query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
A basic test example.
public function testExample() { dump("testExample"); $this->assertTrue(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n }", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "public function testBasicExample()\n {\n $this->assertTrue(true);\n }", "public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('TROLOLOLO');\n }", "public function testBasicTest()\n {\n\n }", "public function testExample()\n\t{\n\t\t$this->assertTrue(true);\n\t}", "public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "public function test() {\n\n\t}", "public static function test() {\r\n echo 'this is a test';\r\n }", "public function testExample()\n {\n $this->assertTrue(true);\n \n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n // lets make it risky to destroy the green\n }", "public function testBasicExample()\n\t{\n \t$response = $this->call('GET', '/');\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "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 }", "function test_sample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Login to Airtel Sales Force System');\n });\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('API tester');\n }", "public function testExample()\n {\n $response = $this->get('/api/test/');\n\n $response->assertStatus(200);\n }", "public function testBasicExample()\n\t{\n\t\t$response = $this->call('GET', '/');\n\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('URL Notes');\n }", "public function testBasicTest()\n {\n $response = $this->get('/test');\n\n $response->assertStatus(200);\n\n $response->assertSeeText('小粽子');\n\n }", "function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}", "public function testBasic()\n {\n $this->assertEquals(1, 1);\n }", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/news/create')\n ->type('title', '123')\n ->type('text', 'test123')\n ->press('Добавить новость')\n\n ->assertSee('Мало букв в поле Заголовок');\n });\n }", "public function testBasicTest()\n {\n $response = $this->get('/dangthi');\n $response->assertStatus(200);\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('html');\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visitRoute('subscription', ['id' => '1'])\n ->radio('gender', 'L')\n ->type('fullName', 'GHF')\n ->type('birthdate', '04/24/1999')\n ->type('phone', '088177552')\n ->type('address', 'Bandung')\n ->press('Submit');\n });\n }", "public function testExample(): void\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->browse(function ($browser , $second) {\n $browser->visit('/')\n //->assertVueContains('name','sina','@editor');\n ->assertVue('name','sina','@editor');\n // ->pause(3000)\n // ->click('.test');\n // ->assertSee('Register')\n // ->value('#name' , 'sina')\n // ->value('#email' , Str::random(10).'@gmail.com')\n // ->value('#password' , '123456789')\n // ->value('#password-confirm' , '123456789')\n // ->click('button[type=\"submit\"]')\n // ->assertPathIs('/home')\n // ->refresh()\n // ->script('alert(\"ok\")');\n });\n }", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->with('.special-text', function ($text) {\n $text->assertSee('title1');\n });\n\n // 確認商品數量\n $browser->click('.check_product')\n ->waitForDialog(5)\n ->assertDialogOpened('商品數量充足')\n ->acceptDialog();\n\n // 設定中斷點\n eval(\\Psy\\sh());\n });\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(\"admin123@gilacoding.com\")\n ->visit(\"/home\");\n });\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('React JS examples');\n });\n }", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Laravel');\n });\n }", "public function testBasicExample()\n {\n $response = $this->call('GET', '/');\n\n $this->assertResponseOk();\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->visit('/')\n ->see('WELCOME');\n }" ]
[ "0.7977854", "0.77753335", "0.76435244", "0.7610687", "0.754975", "0.75405073", "0.75393844", "0.74400353", "0.7432722", "0.7412231", "0.73547494", "0.73383486", "0.7337478", "0.7308627", "0.7305436", "0.72681046", "0.7260569", "0.72460294", "0.7215908", "0.71952444", "0.7174572", "0.71719897", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7167066", "0.715222", "0.7132968", "0.7123071", "0.7119535", "0.7109628", "0.70886546", "0.70870566", "0.70733815", "0.7068619", "0.7050562", "0.7045842", "0.7031207", "0.7030824", "0.7030337", "0.70302093", "0.70302093", "0.70302093", "0.70302093", "0.70291555" ]
0.74867696
7
Create a new designation
function erp_hr_create_designation( $args = array() ) { global $wpdb; $defaults = array( 'id' => 0, 'title' => '', 'description' => '', 'status' => 1 ); $fields = wp_parse_args( $args, $defaults ); // validation if ( empty( $fields['title'] ) ) { return new WP_Error( 'no-name', __( 'No department name provided.', 'wp-erp' ) ); } // unset the department id $desig_id = $fields['id']; unset( $fields['id'] ); $designation = new \WeDevs\ERP\HRM\Models\Designation(); if ( ! $desig_id ) { $desig = $designation->create( $fields ); do_action( 'erp_hr_desig_new', $desig->id, $fields ); return $desig->id; } else { $designation->find( $desig_id )->update( $fields ); do_action( 'erp_hr_desig_updated', $desig_id, $fields ); return $desig_id; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view('designation.create');\n }", "public function create()\n {\n return view('admin.designation.create');\n }", "public function create()\n {\n return view('designs.create');\n }", "public function create()\n {\n return view('company.hr_company_designations.create');\n }", "public function create()\n {\n return view('invoices.invoices_designs.create');\n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t{\n\t\t\n\t\t//\n\t}", "public function create()\n\t{\n\n\n\t\t//\n\t}", "public function create() {\n\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}", "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()\r\n\t{\r\n\t\t//\r\n\t}", "public function create() {\n\t \n }", "public function create()\n\t {\n\t //\n\t }", "public function create()\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}" ]
[ "0.68564475", "0.6761439", "0.66923136", "0.6571619", "0.6500169", "0.6497679", "0.64736426", "0.64736426", "0.64325464", "0.6426237", "0.64186394", "0.64145935", "0.64145935", "0.64145935", "0.64145935", "0.64109004", "0.64109004", "0.64109004", "0.64109004", "0.64109004", "0.64109004", "0.64109004", "0.64109004", "0.64109004", "0.64109004", "0.64109004", "0.64109004", "0.639436", "0.63874376", "0.63675773", "0.6360465", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005", "0.63570005" ]
0.7091566
0
Get all the departments of a company
function erp_hr_get_designations( $args = array() ) { $defaults = array( 'number' => 20, 'offset' => 0, 'orderby' => 'title', 'order' => 'ASC', ); $args = wp_parse_args( $args, $defaults ); $cache_key = 'erp-designations'; $designations = wp_cache_get( $cache_key, 'wp-erp' ); $designation = new \WeDevs\ERP\HRM\Models\Designation(); if ( false === $designations ) { $results = $designation ->skip( $args['offset'] ) ->take( $args['number'] ) ->orderBy( $args['orderby'], $args['order'] ) ->get() ->toArray(); $designations = erp_array_to_object( $results ); wp_cache_set( $cache_key, $designations, 'wp-erp' ); } return $designations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllDepartments() {\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllDepartments();\r\n }", "function GetDepartments()\n\t{\n\t\t$result = $this->sendRequest(\"GetDepartments\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getDepartmentList() {\n return $this->_get(2);\n }", "public function ListDepartments(){\n\t\t$query = \"SELECT code, label, division, sortOrder FROM [DEPARTMENTS TABLE] ORDER BY sortOrder ASC\";\n\t\treturn array(\"results\" => $this->SelectQueryHelper($query));\n\t}", "public function getAllDepartmentInfo(){\n $LOG = Logger::getLogger(__CLASS__ . '.' . __FUNCTION__);\n\n $dao = new LabInspectionSummaryReportDAO();\n $min_year = $this->getMinimumReportYear();\n $departments = $dao->getDepartmentDetails(null, $min_year);\n\n return $departments;\n }", "public static function getDepartmentsList(){\n $cont = new RestController();\n\n $result = $cont->getRequest('ProductDepartments');\n\n $departments = [];\n\n if($result instanceof View){\n return $departments;\n }\n\n foreach($result->value as $dep){\n $departments[$dep->Id]=$dep->Name;\n }\n\n return $departments;\n\n }", "public function getDepartments() {\n //but if none, get from db\n if(null==$this->departments){\n $mapper=new Application_Model_DirectoryDepartmentMapper();\n $departments=$mapper->fetchAll();\n $options=array();\n foreach($departments as $department){\n $options[]=$department->getName();\n }\n $this->departments=$options;\n }\n return $this->departments;\n }", "public function departments()\r\n {\r\n return new QueryForDepartments();\r\n }", "private function getDepartments(): array\n {\n try {\n /** @var Departments[] $departments */\n $departments = $this->getDoctrine()\n ->getRepository(Departments::class)\n ->findAll();\n }\n catch(\\Exception $ex) {\n return [];\n }\n\n return $departments;\n }", "function getTicketDepartments()\r\n\t{\r\n\t\treturn $this->call_API('getTicketDepartments');\r\n\t}", "public function GetAllDepartments()\r\n\t{\t\r\n\t\t$WhereCondition = \"\";\r\n\t\t$query = $this->db->query(\" \t\r\n\t\t\t\t\t\t\t\t\tSELECT * FROM `tbl_user_department`\r\n\t\t\t\t\t\t\t\t\");\r\n\t\t$result = $query->result_array();\t\t\t\r\n\t\treturn $result;\r\n\t}", "public function getCompanyEmployees();", "public function getDepartments(){\r\n $sql=\"SELECT * FROM departments\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }", "public static function all() {\n $departments = array();\n \n $rows = DB::query('SELECT * FROM Department');\n \n foreach ($rows as $row) {\n $departments[] = self::create_department($row);\n }\n \n return $departments;\n }", "public function getDepartment() {\n return response()->json([\n 'success' => true,\n 'statusCode' => 200,\n 'message' => 'Successfully retrieved clearances departments',\n 'data' => Department::all()]);\n }", "public function departments() {\n return $this->hasMany('Department')->orderBy('name');\n }", "function getdepartments() {\n\t\t// import department db\n\t\tApp::import('Model','Department');\n\t\t$this->Department = & new Department();\n\t\t# fetch list of active departments \n\t\t$departments_list = $this->Department->find('list',array('conditions'=>array('Department.status'=>'1'),'fields'=>array('id','name'),'limit'=>10,'order'=>array('Department.id')));\n\t\treturn $departments_list;\n\t}", "public function getdepartments(Request $request){\n $departments = Department::where('departmentable_id', intval($request->input('office_id')))->whereNull('deleted_at')->get();\n return response()->json(array('status' => true, 'data' => $departments));\n }", "public function getList(){\n\t\t$listeDepartements = array();\n\t\t$req = $this->db->prepare('SELECT dep_num,dep_nom,vil_num FROM departement ORDER BY dep_nom');\n\t\t$req->execute();\n\n\t\twhile ($departement = $req->fetch(PDO::FETCH_OBJ)) {\n\t\t\t$listeDepartements[]= new Departement($departement);\n\t\t}\n\n\t\treturn $listeDepartements;\n\t\t$req -> closeCursor();\n\t}", "public function getDepartamentosTodos(){\n\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t$consulta=\"SELECT * FROM departamentos\";\n\t\t\t\t\n\n\t\t\t\t$query=$this->db->preparar($consulta);\n\t\t\t\t$query->execute();\n\t\t\t\t\n\t\t\t\t$tClientes = $query->fetchAll();\n\t\t\t\t\n\t\t\t\t//obtiene todas las tuplas de la tabla clientes\n\t\t\t\t//y devuelve el array $tClientes\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\techo \"Se ha producido un errro\";\n\t\t\t\t\n\t\t\t}\n\n\t\t\t$tablaClientes=array(); //inicializamos la tabla de salida\n\t\t\tforeach ($tClientes as $fila) {\n\t\t\t\t$c=new Departamento($fila[0], $fila[1], \n\t\t\t\t\t$fila[2], $fila[3]);\n\t\t\t\tarray_push($tablaClientes, $c);\n\t\t\t}\n\t\t\treturn $tablaClientes;\n\t\t}", "public function getDepartnetsForVacancies(\\Doctrine\\ORM\\EntityManager $em) {\n $qb = $em->createQueryBuilder();\n $qb->select('d')\n ->from('Application\\Entity\\Departments', 'd')\n ->join('d.vacanciesVacancy', 'v')\n ->groupBy('d.departmentId')\n ;\n $query = $qb->getQuery();\n $query->useResultCache(TRUE);\n return $query->getArrayResult();\n }", "public function departments(){\n \t$departments = Department::all();\n\n \treturn view('departments.departments')->with('departments', $departments);\n }", "function get_department(){\n $this->_db2->where(\"DeleteFlag\",\"A\");\n return $this->_db2->get($this->_tblorg);\n }", "public function getDepartments($onlyCostcenters = false) {\n\n $departments = new SplObjectStorage();\n foreach ($this->getTable()->getDepartments() as $dep) {\n try {\n $department = new Yourdelivery_Model_Department($dep['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n\n $departments->attach($department);\n }\n $this->_departments = $departments;\n \n return $this->_departments;\n }", "public function getDepartment()\n {\n $option = Paging::normalizeOption($_GET);\n $result = DepartmentTable::get($option);\n //$result = Paging::genNextPrev($option, $result);\n\n http_response_code(200);\n echo json_encode($result);\n }", "public function departments()\n {\n $departments = Departments::where('status', 'active')->orderBy('idx')->get();\n foreach ($departments as $dept) {\n $subdepartment = Departments::where('department_id', $dept->subdepartment_id)->get();\n $dept['subdepartments'] = $subdepartment;\n }\n\n return view('setup.department.departments', compact('departments', 'subdepartment'));\n }", "function getDepartmentsByUsername(){\n if(Current_User::isDeity()){\n $db = &new PHPWS_DB('sysinventory_department');\n $db->addColumn('description');\n $db->addColumn('id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n return $list;\n // otherwise return a list of departments of which they're an admin \n }else if(Current_User::allow('sysinventory','admin')){\n $db = new PHPWS_DB('sysinventory_admin');\n $db->addWhere('username',Current_User::getUsername(),'ILIKE');\n $db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $db->addColumn('sysinventory_department.description');\n $db->addColumn('sysinventory_department.id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n \n return $list;\n }else{\n return NULL;\n }\n \n }", "function getDepartmentsByUsername(){\n if(Current_User::isDeity()){\n $db = &new PHPWS_DB('sysinventory_department');\n $db->addColumn('description');\n $db->addColumn('id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n return $list;\n // otherwise return a list of departments of which they're an admin \n }else if(Current_User::allow('sysinventory','admin')){\n $db = new PHPWS_DB('sysinventory_admin');\n $db->addWhere('username',Current_User::getUsername(),'ILIKE');\n $db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $db->addColumn('sysinventory_department.description');\n $db->addColumn('sysinventory_department.id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n \n return $list;\n }else{\n return NULL;\n }\n \n }", "public function getAllAvailableDepartments(){\n if( in_array('Admin', $this->getCurrentRoles()) ){\n // User is admin; get all Departments\n return $this->getAllDepartmentInfo();\n }\n else{\n // Non-admin user; just get their primary department\n return array(\n $this->getDepartmentInfo()\n );\n }\n }", "public function getDepartmentsList($accountId)\n {\n $query = $this->createQueryBuilder('p')\n ->select('p,ca.name as accountName')\n ->leftJoin('CorporateBundle:CorpoAccount', 'ca', 'WITH', \"ca.id = p.accountId\");\n if ($accountId) {\n $query->where(\"p.accountId = :accountId\")\n ->setParameter(':accountId', $accountId);\n }\n\n $quer = $query->getQuery();\n $result = $quer->getScalarResult();\n\n if (!empty($result) && isset($result[0])) {\n return $result;\n } else {\n return array();\n }\n }", "public function get()\n {\n return $this->remote->select()->from('departments')->getStatement()->fetchAll();\n }", "public function companies(): Collection\n {\n return Company::all();\n }", "public static function getList()\n {\n return CHtml::listData(Departamentos::model()->findAll(),'id_departamento', 'descripcion');\n }", "public function llenarDepartamentosModel(){\n\t\ttry{\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT iddept, name FROM department\"); //(\"SELECT idzone, zone FROM zones\");\n\t\t\t$stmt->execute();\n\t\t\treturn $stmt->fetchAll();\n\n\t\t\t$stmt = null;\n\n\t\t}catch(PDOException $error){\n\t\t\techo 'error: '.$error->getMessage();\n\t\t}\n\t}", "public function getUsersDepartments()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('u' => 'users'), array('user_id', 'name', 'surname', 'patronymic'))\n\t\t\t->joinLeft(array('ud' => 'users_departments'),\n\t\t\t\t'ud.user_id = u.user_id', array('department_id', 'chief'));\n\t\treturn $db->fetchAll($select);\t\n\t}", "public function get_jamf_departments()\n {\n $obj = new View();\n $jamf = new Jamf_model;\n $obj->view('json', array('msg' => $jamf->get_jamf_departments()));\n }", "public function allDepartment(){\n\n $all_department=$this->settings->all_departmentasc();\n return response()->json([\n 'all_department' => $all_department,\n ], $this->successStatus);\n\n }", "public function index()\n {\n return Departments::all();\n }", "public function departments()\n {\n $this->authCheck();\n\n $departmentData = DB::table('departments')\n ->get();\n \n $departments=view('admin.department_list')\n ->with('departmentData',$departmentData);\n\n return view('admin.master')\n ->with('main_content',$departments);\n }", "public function listofDepartments()\n {\n return view('Admin.ShowallDepartments');\n //.blade\n }", "public function getRelatedDepartments()\n\t{\n if (is_null($this->department)) return [];\n\n $member_department = $this->department()->get();\n\n\t\tif ($this->department()->first()->is_main()){\n\t\t\treturn $member_department->merge($this->department()->first()->descendants()->get());\n\t\t}else{\n\t\t\treturn $member_department->merge($this->department()->first()->ancestor()->get());\n\t\t}\n\t}", "public function index()\n {\n $departments = Department::orderBy('company_department_id','DESC')->get();\n return view('admin.department.index',compact('departments'));\n }", "function get_departments() {\r\n switch_to_blog(1);\r\n $depts = get_terms([\r\n 'taxonomy' => 'dept',\r\n 'hide_empty' => false,\r\n ]);\r\n restore_current_blog();\r\n\r\n if( !is_array( $depts ) || empty( $depts ) ) {\r\n $url = \"https://news.cah.ucf.edu/wp-json/news/depts\";\r\n $response = wp_remote_get( $url, ['timeout' => 20] );\r\n if( is_wp_error( $response ) ) {\r\n $depts = [];\r\n }\r\n else {\r\n $depts = json_decode( $response['body'] );\r\n }\r\n }\r\n return $depts;\r\n}", "function getUserDepartments($user) {\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n\r\n return $data->getUserDepartments($user);\r\n\r\n }", "function getDepartments($conn){\n $codes = array();\n $depts = array();\n\n $cmd = $conn->prepare(\"SELECT code FROM courses GROUP BY code ORDER BY code\");\n $cmd->execute();\n $result = $cmd->get_result();\n while($row = $result->fetch_assoc()){\n array_push($codes, $row[\"code\"]);\n }\n\n foreach($codes as $code){\n //Split along the sace\n $dept = explode(\" \", $code)[0];\n //Add new department to array if not already in\n if(!in_array($dept, $depts)){\n array_push($depts, $dept);\n }\n }\n\n return $depts;\n }", "public function allCompanies()\n {\n return Company::all();\n }", "public function departments()\n {\n return $this->belongsToMany('App\\Models\\Department');\n }", "public function getdep()\n {\n $query = $this->db->get('departments');\n\n return $query->result();\n }", "function getDepartments(){ // Return department codes and names from database.\n\n\tglobal $DB;\n\t\n\tif($DB->query(\"SELECT code, name FROM department ORDER BY code\")){\n\t\treturn $DB->results();\n\t}\n\t\n\telse{\n\t\treturn false;\n\t}\n}", "public function get_dept()\n\t{\n\t\t$division_id = $this->input->post('division_id');\n\t\t$department['dept'] = $this->reports->get_dept($division_id);\n\t\techo json_encode($department);\n\t}", "function erp_hr_get_departments( $args = [] ) {\n\n $defaults = array(\n 'number' => 20,\n 'offset' => 0,\n 'orderby' => 'id',\n 'order' => 'asc',\n 'no_object' => false\n );\n\n $args = wp_parse_args( $args, $defaults );\n\n $cache_key = 'erp-get-departments';\n $results = wp_cache_get( $cache_key, 'wp-erp' );\n\n $department = new \\WeDevs\\ERP\\HRM\\Models\\Department();\n\n if ( isset( $args['s'] ) ) {\n $results = $department\n ->where( 'title', 'LIKE', '%'.$_GET['s'].'%' )\n ->get()\n ->toArray();\n $results = erp_array_to_object( $results );\n }\n\n if ( false === $results ) {\n $results = $department\n ->get()\n ->toArray();\n\n $results = erp_array_to_object( $results );\n wp_cache_set( $cache_key, $results, 'wp-erp' );\n }\n\n $results = erp_parent_sort( $results );\n $departments = [];\n if ( $results ) {\n foreach ($results as $key => $row) {\n\n if ( true === $args['no_object'] ) {\n $departments[] = $row;\n } else {\n\n $departments[] = new WeDevs\\ERP\\HRM\\Department( intval( $row->id ));\n }\n }\n }\n\n return $departments;\n}", "public function index()\n {\n return DepartmentResource::collection(Department::paginate());\n }", "public function getDepartamentos() {\n try {\n $departamento = Departamento::all();\n return $departamento;\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return ['error' => 'Falló al obtener el departamento:' . $e->getMessage()];\n }\n }", "function cargarDepartamentos()\n\t{\n\t\t$consulta = parent::consulta(\"SELECT nombre,id_departamento FROM departamento ORDER BY nombre ASC\");\n\t\t$num_total_registros = parent::num_rows($consulta);\n\t\tif($num_total_registros>0)\n\t\t{\n\t\t\t$departamentos = array();\n\t\t\twhile($departamento = parent::fetch_assoc($consulta))\n\t\t\t{\n\t\t\t\t$code = $departamento[\"id_departamento\"];\n\t\t\t\t$name = $departamento[\"nombre\"];\t\t\t\t\n\t\t\t\t$departamentos[$code]=$name;\n\t\t\t}\n\t\t\treturn $departamentos;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function get_departments()\n {\n $organizationId = $this->uri->segment(4);\n $this->db->select(\"*\")\n ->from(TBL_DEPARTMENTS)\n ->where('organizationId', $organizationId);\n $db = $this->db->get();\n\n $array = array();\n foreach($db->result() as $row):\n $array[] = array(\"value\" => $row->departmentId, \"property\" => $row->departmentName);\n endforeach;\n\n echo json_encode($array);\n exit;\n }", "function getDepartmentList($client_id=null) {\n\t\t $this->layout = false;\n\t\t //$this->autoRender = false;\n\t\t $departments = array();\n\t\t \n\t\t if($client_id != null){\n\t\t\t $client = $this->User->Client->Department->find('all',array('conditions'=>array('Client.id'=>$client_id,'Department.status'=>1)));\n\t\t\t foreach($client as $cli)\n\t\t\t\t {\n\t\t\t\t $departments[$cli['Department']['id']] = $cli['Department']['name'];\t\t\t\t \n\t\t\t\t }\n\t\t }\n\t\t $this->set('departments', $departments);\n\t\t \n\t\t //echo $this->Form->input('department_name', array('options' => $departments));\n\t }", "function getDepartment($abbrev){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n\r\n $dept = $data->getDepartment($abbrev);\r\n $deptId = $dept[0][\"department_id\"];\r\n $programs = $data->getProgramsInDepartment($deptId);\r\n\r\n $output = array(\"deptInfo\"=>$dept, \"programs\"=>$programs);\r\n return $output;\r\n }", "function get_companies_list() {\n return get_view_data('org_list');\n}", "function getAllDept(){\r\n echo\r\n $query = \"SELECT dept_name,dept_id FROM department\";\r\n $result = $this->executeQuery($query); \r\n return $result;\r\n }", "public function departments(Request $request){\n if (!$request->block) {\n $html = '<option value=\"\">Select Department</option>';\n }\n\n else {\n $html = '<option value=\"\">Select Department</option>';\n $departments = LocationInfo::where('block', $request->block)->distinct()->pluck('department');\n foreach ($departments as $department) {\n $html .= '<option value=\"'.$department.'\">'.$department.'</option>';\n }\n }\n\n return response()->json(['html' => $html]);\n }", "public function getDepartements()\n\t{\n\t\t$this->ensureDepartementsLoaded();\n\t\treturn new GmthBridgeIterator(new \\ArrayIterator($this->_departements),\n\t\t\t$this, 'PhpExtended\\Gmth\\GmthBridgeDepartement');\n\t}", "function get_depar_all()\n {\n $results = array();\n\n $list_user_all = array();\n //Define request\n $req = \"SELECT * FROM departement\";\n\n //request\n $query = $this->db->query($req);\n\n //If the query succeed\n if($query !== FALSE)\n {\n foreach ($query->result() as $row)\n {\n $depar = new Depar_model;\n $depar->define_depar($row->dp_name);\n array_push($results, $depar);\n } \n }\n else\n {\n $results = FALSE;\n }\n\n\n /* Libération du jeu de résultats */\n \n\n return $results;\n }", "public function index()\n {\n $departamentos = Department::all();\n return $this->showAll($departamentos);\n }", "public function departments()\n {\n return $this->belongsToMany(\n config('core.acl.department'), \n config('core.acl.departments_roles_table'), \n 'role_id', \n 'department_id'\n );\n }", "public function getCompaniesReport() : CompaniesReport\n\t{\n\t\t$response = $this->execute('Empresa');\n\t\t\n\t\t$companiesByArea = [];\n\t\tforeach($response['e'] as $areaPool){\n\t\t\t$i = $areaPool['a'];\n\t\t\tforeach($areaPool['e'] as $company){\n\t\t\t\t$companiesByArea[$i][]=new Company(\n\t\t\t\t\t$company['a'],\n\t\t\t\t\t$company['c'],\n\t\t\t\t\t$company['n']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn new CompaniesReport($response['hr'],$companiesByArea);\n\t}", "public function getCompanyDepartmentById($companyId, $departmentId)\n {\n $companyDepartment = Department::select('id', 'name')->find($departmentId);\n if ($companyDepartment) {\n $response_message = array('success' => true, 'message' => \"Data fetched\", 'data' => $companyDepartment);\n return response()->json($response_message);\n } else {\n $response_message = array('success' => false, 'message' => \"Department not found\");\n return response()->json($response_message);\n }\n \n \n }", "public static function mostrarDepartamentos() {\n $query = \"SELECT idDepartamento, nombreDepartamento FROM Departamento\";\n\n self::getConexion();\n\n $resultado = self::$conexion->prepare($query);\n $resultado->execute();\n\n return $resultado;\n }", "function get_deleted_companies() {\n return get_view_data('org_list_archived');\n}", "function GetDepartmentList($departmentIds)\n\t{\n\t\t$result = $this->sendRequest(\"GetDepartmentList\", array(\"DepartmentIds\"=>$departmentIds));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function get_dept()\n\t{\n\t\t$division_id = $this->input->post('division_id');\n\t\t$department['dept'] = $this->file_maintenance_model->get_dept($division_id);\n\t\techo json_encode($department);\n\t}", "private function getDepartment() {\n\t\t$return = NULL;\n\t\t$sql = 'SELECT `#__Department`.* FROM `#__Department` LEFT JOIN `#__Department_User` ON `#__Department_User`.`department_id` = `#__Department`.`id` WHERE `#__Department_User`.`user_id` = ?';\n\t\t$result = $this->execute($sql, $this->id);\n\n\t\tif (count($result) > 0) {\n\t\t\t$return[$result[0]['id']] = $result[0];\n\t\t}\n\t\treturn $return;\n\t}", "function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}", "public function departures()\n {\n return $this->hasMany(Departure::class, 'from_port_id');\n }", "public function index()\n {\n $departments = Department::with('office.organisation')\n ->where('status','Active')\n ->orderBy('id','DESC')\n ->paginate(6);\n\n $organisations = Organisation::where('status','Active')\n ->orderBy('organisation','ASC')\n ->get();\n\n return view('admin/department/departments',compact('departments','organisations'));\n }", "public function getDeptItems()\n {\n return $this->hasMany(DeptItem::className(), ['sales_disc_gl_acc_id' => 'account_id']);\n }", "public function getCompaniesForSelect()\n {\n return Company::whereNull('deleted_at')->pluck('name', 'id');\n }", "public function listCities() {\n $result = array();\n $query = 'SELECT `id`,`zipCode`,`city`,`id_ppro_departments` FROM `ppro_cities` ORDER BY `id` ASC';\n $queryResult = $this->db->query($query);\n if (is_object($queryResult)) {\n $result = $queryResult->fetchAll(PDO::FETCH_OBJ);\n }\n return $result;\n }", "public function index()\n {\n $departments = Department::orderBy('created_at', 'asc')->paginate();\n\n return response()->json($departments, 200);\n }", "public function departemen()\n {\n //Query untuk mengambil semua data departemen dan diurutkan berdasarkan nama_dept\n $query = $this->db->query(\"SELECT * FROM departemen ORDER BY nama_dept\");\n return $query;\n }", "public static function all() {\n\n $db = Zend_Registry::get('dbAdapter');\n $result = $db->query('select id from companys')->fetchAll();\n $companys = new SplObjectStorage();\n foreach ($result as $c) {\n try {\n $company = new Yourdelivery_Model_Company($c['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $companys->attach($company);\n }\n return $companys;\n }", "public function getCompany();", "public function listeDepartementByEmployeeId($id_departement){\n\t\t\t\t\t$sql = \"SELECT * FROM departement WHERE departement.id_departement = \".$id_departement.\" \";\n\t\t\t\t\t if($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t return $this->db->query($sql)->fetchAll();\n\t\t\t\t\t }else{\n\t\t\t\t\t return null;\n\t\t\t\t\t }\n\t\t\t\t\t }", "public function ciudades_all()\n {\n $ciudad = Ciudad::with('departamento')->get();\n\n return $this->sendResponse($ciudad->toArray(), 'Ciudades devueltas con éxito');\n }", "public function services()\n {\n $departments=Department::all();\n return view('pages.services',['department'=>$departments]);\n }", "public function department($dept)\n {\n //find by department code\n $personnels = $this->model\n ->where('office_code', '=', $dept)\n ->get();\n\n return $this->response->item($personnels, new PersonnelTransformer());\n }", "public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }", "public function getHospitalDepartment($globalUtil,$condition){\n\t\t$sql = \"SELECT * FROM \".TABLE_HOSPITAL_DEPARTMENT_INFORMATION.\" \".$condition;\n\t\t$HospitalDeptDetails = $globalUtil->sqlFetchRowsAssoc($sql,2);\t\n\t\treturn $HospitalDeptDetails;\n\t\t}", "public function getDepartmentUsers()\n {\n # code...\n $dept_id = auth()->user()->department_id;\n $users = User::where('department_id', $dept_id)->get();\n return response()->json(['users'=>$users]);\n }", "function asu_isearch_fetch_departments($data) {\n // feed endpoint\n $source_urls = array($data['endpoint']);\n\n $migration = _asu_isearch_get_migration();\n $migration->setMigrateSource($source_urls);\n\n if (isset($data['queue']) && $data['queue']) {\n\n $batch_limit = 50;\n if (isset($data['limit']['unit']) && $data['limit']['unit'] == 'items') {\n $batch_limit = intval($data['limit']['value']);\n }\n\n $source_count = $migration->sourceCount();\n $batch_size = ceil($source_count / $batch_limit);\n\n $queue = DrupalQueue::get('isearch_fetch_department');\n // avoid an inifinite loop by resetting queue to false\n unset($data['queue']);\n\n for ($i = 1; $i <= $batch_size; $i++) {\n $data['limit']['value'] = $i * $batch_limit;\n $queue->createItem($data);\n }\n }\n else {\n // begin the migration\n $update = $migration->prepareUpdate();\n $result = $migration->processImport($data);\n }\n}", "public static function fetch_all_in_a_list()\n\t{\n\t return Company::orderBy( 'name' )->lists( 'name' , 'id' );\n\n\t}", "public function getCompany() {}", "public function show_all_department(){\n // Jika yang mengakses bukan ADMIN, redirect ke department miliknya\n if(!Auth::user()->admin) return redirect('/department/'.Auth::user()->department_id);\n\n // Mengakses fungsi eloquent all() pada class model untuk mendapatkan semua data pada database.\n $departments = Department::all();\n\n // Membuat array asosiasi (association array) bernama $data yang digunakan untuk \n // menampung data $departments yang nantinya akan ditampilkan pada view.\n $data = [\n 'departments' => $departments\n ];\n\n // Menampilkan view dari file views/department/list_all_department.blade.php\n // dengan mengirimkan variabel $data yang akan ditampilkan di view tersebut.\n return view('department.list_all_department', $data);\n }", "public function department() {\n\t\treturn $this->has_many_and_belongs_to('Department', 'department_members');\n\t}", "public function index()\n {\n $designations=Designation::where('company_id',session('companyId'))->paginate(15);\n $departments=departments();\n return view('manage.designation.index')->with('designations', $designations)->with('departments',$departments);\n }", "public function showCities(Request $request)\n {\n $cities = City::where('department', $request->id)->get();\n return json_encode($cities);\n }", "public static function getEnterpriseCompanies(){\n $result = db::get(\"SELECT uid_empresa FROM \". TABLE_EMPRESA .\" WHERE is_enterprise = 1 ORDER BY nombre\", \"*\", 0, \"empresa\");\n return new ArrayObjectList($result);\n }", "public function get_customers_for_dropdown($company){\r\n\t\theader(\"Access-Control-Allow-Origin: \". base_url());\r\n\t\terror_log(\"get_customers_for_dropdown($company)\");\r\n\r\n\t\t$cid = intval($company);\r\n\t\tif($cid>0){\r\n\t\t\t$cs = $this->customer_model->get_companys_customers($cid);\r\n\t\t}\r\n\t\telse if($cid == 0){\r\n\t\t\t$cs = $this->customer_model->get_customers();\r\n\t\t}\r\n\t\telse{\r\n\t\t\techo \"0\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$data = array();\r\n\t\tforeach($cs as $c){\r\n\t\t\t$id = $c[\"id\"];\r\n\t\t\t$name = $c[\"namn\"];\r\n\t\t\t$data[] = array($id => $name);\r\n\t\t}\r\n\t\terror_log(print_r($data, true));\r\n\t\techo json_encode($data);\r\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SuperAdminBundle:Departamento')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getDepartamento(){\n\n if (!empty($this->iCodigoDepartamento)) {\n $this->oDepartamento = DBDepartamentoRepository::getDBDepartamentoByCodigo($this->iCodigoDepartamento);\n }\n return $this->oDepartamento;\n }", "public function findCompanies(){\n $data = SCompany::select('id_company', 'name')\n ->get();\n return response()->json($data);\n }", "public function departments() : BelongsToMany\n {\n return $this->belongsToMany(Department::class);\n }" ]
[ "0.778371", "0.72574794", "0.6894472", "0.688755", "0.68341213", "0.67911035", "0.67826", "0.6724747", "0.6591738", "0.65243286", "0.65227556", "0.63979685", "0.6372682", "0.6359754", "0.63554955", "0.6346507", "0.6346441", "0.63430375", "0.6294696", "0.62629175", "0.6213317", "0.6186259", "0.61806095", "0.6169539", "0.6111452", "0.6107794", "0.60971314", "0.60971314", "0.6092576", "0.6087066", "0.6081168", "0.60667664", "0.6061748", "0.60503185", "0.60329646", "0.60188955", "0.6017523", "0.6014595", "0.59752965", "0.59669316", "0.59484166", "0.5931475", "0.5915751", "0.590718", "0.5894548", "0.5878014", "0.58528155", "0.58518976", "0.5846315", "0.58446765", "0.584308", "0.58351076", "0.58126545", "0.57954466", "0.5785774", "0.5779924", "0.57791525", "0.5777633", "0.57663256", "0.5760699", "0.5740797", "0.57314193", "0.57279503", "0.57273287", "0.5724833", "0.571715", "0.57094675", "0.5691946", "0.5685947", "0.5685008", "0.5684623", "0.5681695", "0.5677996", "0.567716", "0.5670841", "0.5669197", "0.56641006", "0.56629956", "0.56527084", "0.5625119", "0.5624652", "0.56195533", "0.5616658", "0.55936307", "0.5591472", "0.55880827", "0.5586399", "0.5583255", "0.55567", "0.55510885", "0.55506057", "0.5531148", "0.55242807", "0.55165786", "0.5515791", "0.55027574", "0.5481598", "0.54777247", "0.54736584", "0.54690915", "0.5454832" ]
0.0
-1
Get the raw designations dropdown
function erp_hr_get_designation_dropdown_raw() { $designations = erp_hr_get_designations(); $dropdown = array( 0 => __( '- Select Designation -', 'wp-erp' ) ); if ( $designations ) { foreach ($designations as $key => $designation) { $dropdown[$designation->id] = stripslashes( $designation->title ); } } return $dropdown; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function erp_hr_get_designation_dropdown( $selected = '' ) {\n $designations = erp_hr_get_designation_dropdown_raw();\n $dropdown = '';\n\n if ( $designations ) {\n foreach ($designations as $key => $title) {\n $dropdown .= sprintf( \"<option value='%s'%s>%s</option>\\n\", $key, selected( $selected, $key, false ), $title );\n }\n }\n\n return $dropdown;\n}", "public function getDropDown() {}", "public function getDropDown() {}", "function getDropDown() ;", "public function dropdown()\n {\n $building_id = \\Request::get('building_id');\n return \\App\\Floor::where('building_id', $building_id)->lists('name','id');\n }", "private function getSpec() {\n\t\t$html = '<div id=\"tal_ecoles\">';\n\t\t$html .= '<select id=\"tal_listEcoles\" onchange=\"tal_display(this)\">';\n\t\t$html .= '<option value=\"0\" selected=\"\" disabled=\"\">Choose...</option>';\n\t\tforeach ($this->_xml->ecole as $branch) {\n\t\t\t$html .= '<option value=\"'.$branch['id'].'\">'.$branch['name'].'</option>';\n\t\t}\n\t\t$html .= '</select>';\n\t\t$html .= '</div>';\n\n\t\treturn $html;\n\t}", "public function getDesignsList() {\n return $this->_get(1);\n }", "public function getSelect();", "public function getSelect();", "public function getOtherDesignList() {\n return $this->_get(2);\n }", "function build_selection_dropdown() {\n\t$output = array();\n\t$output[] = array('id' => '', 'text' => TEXT_SELECT);\n\t$output[] = array('id' => 'wo_journal_main.id', 'text' => 'Record ID');\n\t$output[] = array('id' => 'wo_journal_main.wo_id', 'text' => 'Work Order Num');\n\t$output[] = array('id' => 'wo_journal_main.wo_title', 'text' => 'Work Order Title');\n\t$output[] = array('id' => 'wo_journal_main.priority', 'text' => 'Priority');\n\t$output[] = array('id' => 'wo_journal_main.sku', 'text' => 'SKU');\n\t$output[] = array('id' => 'wo_journal_main.qty', 'text' => 'Quantity');\n\t$output[] = array('id' => 'wo_journal_main.post_date', 'text' => 'Post Date');\n\t$output[] = array('id' => 'wo_journal_main.closed', 'text' => 'Closed');\n\t$output[] = array('id' => 'wo_journal_main.closed_date', 'text' => 'Closed Date');\n\t$output[] = array('id' => 'wo_journal_main.notes', 'text' => 'Notes');\n\t$output[] = array('id' => 'wo_journal_main.bom_list', 'text' => 'BOM List');\n\t$output[] = array('id' => 'wo_journal_main.ref_specs', 'text' => 'Reference Specs');\n\t$output[] = array('id' => 'wo_journal_main.ref_docs', 'text' => 'Reference Docs');\n\t$output[] = array('id' => 'bar_code', 'text' => 'SKU Bar Code');\n\t$output[] = array('id' => 'image_with_path', 'text' => 'SKU Image');\n\treturn $output;\n }", "public function getDesignation(Request $request) {\n $dep_id = $request->dep_id;\n if ($dep_id) {\n echo '<option value=\"0\">' . language_data('Select Designation') . '</option>';\n $designation = Designation::where('did', $dep_id)->get();\n foreach ($designation as $d) {\n echo '<option value=\"' . $d->id . '\">' . $d->designation . '</option>';\n }\n }\n }", "public function getDesignsList() {\n return $this->_get(5);\n }", "private function generate_filter_dropdowns() {\n $html = '';//no html\n \n //instance filter dropdown\n $instance_config = $this->get_settings_config_data();//get instance config\n if(isset($instance_config) && isset($instance_config->data)//if config exists, and data has been saved\n && count($instance_config->data) > 0) {//there is actually a filter saved\n \n $text = get_string('instance_filters', 'block_dd_content');//get label text\n $html .= $this->generate_filter_dropdown($text, $instance_config->data);//generate dropdown\n }\n\n //global filter dropdown\n $global_config_data = dd_content_get_admin_config();//grab global block config DATA (not the config itself)\n if(count($global_config_data) > 0) {//if a filter exists\n \n $text = get_string('global_filters', 'block_dd_content');//get global filter label\n $html .= $this->generate_filter_dropdown($text, $global_config_data);//create dropdown\n }\n \n \n return $html;\n }", "function get_name_select_list()\n\t{\n\t\treturn $this->get_name_select_edit();\n\t}", "function get_designers() {\n return $this->mysqli->query(\"SELECT `product_variations`.*, `products`.*, `designers`.`name` AS 'des_name' FROM `product_variations` JOIN `products` ON `products`.`product_id` = `product_variations`.`product_id` JOIN `designers` ON `designers`.`designer_id` = `products`.`designer_id` ORDER BY `designers`.`name` ASC, `product_variations`.`price` ASC\");\n }", "function rdisplay()\r\n\t{\r\n\t\t$select = $this->open_select().\"\\n\";\r\n\t\tforeach ($this->m_array_options as $options )\r\n\t\t{\r\n\t\t\t\t$selected = ($options['selected'] == true ) ? \"selected\" : \"\";\r\n\t\t\t\t\r\n\t\t\t\t$select .= \"<option value=\\\"\".$options['value'].\"\\\" $selected >\".$options['text'].\"</option> \\n\";\r\n\t\t}\r\n\t\t$select .= $this->close_select().\"\\n\";\r\n\t\treturn $select;\r\n\t}", "function getListDiagrammer() {\n\n global $idAnalyst;\n $idProject = $_SESSION[\"permisosDeMenu\"];\n global $diagramerASMController;\n\n //obtenemos con el controlador del diagramador los elementos del select\n //id array para los valores de las opciones\n //array los valores a mostrar\n //action funcion que se desea ejercer en dicho elemento select\n $diagramerASMController = new asmsController;\n $ASMs = $diagramerASMController->getASMstexto($idProject);\n $id = array();\n $array = array();\n for ($i = 0; $i < count($ASMs); $i++) {\n $asm = $ASMs[$i];\n $idASM = $asm->getIdASM();\n $name = $asm->getName();\n $id[] = $idASM;\n $array[] = $name;\n }\n $action = \"lookDiagram(value)\";\n $select = select($id, $array, $action, \"...\");\n return $select;\n}", "public function populateDesignSelect($field) {\n\n //Fetch data from host\n $data = wp_remote_get($this->apiUrl, ['cacheBust' => $this->uniqid]); \n \n if(wp_remote_retrieve_response_code($data) == 200) {\n \n //Decode\n $choices = json_decode($data['body']); \n\n //Reset select\n $field['choices'] = []; \n\n //Populate select\n if( is_array($choices) && !empty($choices) ) {\n foreach( $choices as $choice ) {\n $field['choices'][ $choice->id ] = $choice->name; \n }\n }\n\n } else {\n $field['choices']['error'] = __(\"Error loading options\", 'muncipio'); \n } \n \n return $field;\n }", "function drawDropDownCustom($options)\n\t{\n\t\t$controlName=$options['controlName'];\n\t\t$orgValue=$options['orgValue'];\n\t\t$items=$options['items']; \n\t\t$valueColumnName=$options['valueColumnName'];\n\t\t$titleColumnName=$options['titleColumnName'];\n\t\t$levelColumnName=$options['levelColumnName'];\n\t\t$hasChildColumnName=$options['hasChildColumnName'];\n\t\t$groupNameColumnName=$options['groupNameColumnName'];\n\t\t$groupIdColumnName=$options['groupIdColumnName'];\n\t\t$defaultValue=$options['defaultValue'];\n\t\t$defaultTitle=$options['defaultTitle'];\n\t\t$moreAttributes=$options['attributes'];\n\t\t$useKeyAsKeyAndValueAsValue=$options['useKeyAsKeyAndValueAsValue'];\n\t\t\n\t\tif (is_string($items))\n\t\t\t$items=cmfcMySql::getRowsCustom($items);\n\n\t\t\t\n\t\tif ($options['selectType']=='multiSelect') {\n\t\t\t$moreAttributes['multiple']='multiple';\n\t\t\t$controlName.='[]';\n\t\t}\n\t\t\n\t\t/*\n\t\techo '<pre style=\"direction:ltr\">';\n\t\tprint_r($items);\n\t\techo \"</pre>\";\n\t\t*/\n\t\t$moreAttributesStr=cmfcHtml::attributesToHtml($moreAttributes);\n\t\t\n\t\t$lastGroupName='';\n\t\t$firstRow=true;\n\n\t\t$html=sprintf('<select name=\"%s\" %s >'.\"\\n\", $controlName, $moreAttributesStr);\n\t\tif (!is_null($defaultValue)) {\n\t\t\tif ($options['disabledDefaultValue']==true) {\n\t\t\t\t$disabledHtml='disabled=\"disabled\"';\n\t\t\t} else {\n\t\t\t\t$disabledHtml='';\n\t\t\t}\n\t\t\t$html.=sprintf('<option value=\"%s\" %s>%s</option>'.\"\\n\",$defaultValue,$disabledHtml, $defaultTitle);\n\t\t}\n\t\t//$i = 0; //count the number of selected orgValues\n\t\t\n\t\tif (!is_array($orgValue))\n\t\t\t$orgValues[] = $orgValue;\n\t\telse\n\t\t\t$orgValues = $orgValue;\n\t\t\t\n\t\tif(is_array($items)) // added by babak\n\t\tforeach ($items as $key=>$item) {\n\t\t\tif (is_array($item)) {\n\t\t\t\t$title=$item[$titleColumnName];\n\t\t\t\t$value=$item[$valueColumnName];\n\t\t\t} elseif (is_integer($key) and !$useKeyAsKeyAndValueAsValue) {\n\t\t\t\t$title=$item;\n\t\t\t\t$value=$item;\n\t\t\t} else {\n\t\t\t\t$title=$item;\n\t\t\t\t$value=$key;\n\t\t\t}\n\n\t\t\tif (!empty($groupNameColumnName) && ($options['interface']['group'] or !isset($options['interface']['group']))) {\n\t\t\t\t$groupName=$item[$groupNameColumnName];\n\t\t\t\t$groupId=$item[$groupIdColumnName];\n\t\t\t\t\n\t\t\t\tif ($lastGroupName==$groupName) {$groupChanged=false;} else {$groupChanged=true;}\n\t\t\t\t//echo \"[$lastGroupName:$groupName]\";\n\t\t\t\tif ($groupChanged==true) {\n\t\t\t\t\tif (!$firstRow) { $html.=\"</optgroup>\\n\"; }\n\t\t\t\t\t$html.=sprintf('<optgroup label=\"%s\" title=\"%s\">'.\"\\n\",$groupName, $groupId);\n\t\t\t\t\t$lastGroupName=$groupName;\n\t\t\t\t}\n\t\t\t\t$groupChanged=false;\n\t\t\t}\n\t\t\t$selected='';\n\t\t\tif (in_array($value,$orgValues)) {\n\t\t\t\t$selected='selected=\"selected\"';\n\t\t\t\t//$i++;\n\t\t\t} else {\n\t\t\t\t$selected = '';\n\t\t\t}\n\t\t\t\n\t\t\t$itemAttributes=array();\n\t\t\t#--(Begin)-->indent items to show them as a tree (hierarchical items)\n\t\t\tif (!empty($levelColumnName)) {\n\t\t\t\tif (empty($firstLevelNumber))\n\t\t\t\t\t$firstLevelNumber=$item[$levelColumnName];\n\t\t\t\t\t\n\t\t\t\t$depth=$item[$levelColumnName]-$firstLevelNumber;\n\t\t\t\tif (!isset($options['interface']['itemIndent'])) $options['interface']['itemIndent']=20;\n\t\t\t\t$itemIndent=intval($options['interface']['itemIndent']);\n\t\t\t\tif (!$options['interface']['isIe'])\t {\n\t\t\t\t\t$itemIndent=intval($options['interface']['itemIndent']);\n\t\t\t\t\tif ($options['interface']['direction']=='rightToLeft')\n\t\t\t\t\t\t$itemAttributes['style'].=';padding-right:'.($itemIndent*$depth).'px;';\n\t\t\t\t\telse\n\t\t\t\t\t\t$itemAttributes['style'].=';padding-left:'.($itemIndent*$depth).'px;';\n\t\t\t\t} else {\n\t\t\t\t\t$itemIndent=round($itemIndent/2)*$depth;\n\t\t\t\t\t$title=str_repeat('&nbsp;',$itemIndent).$title;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isset($options['isParentsSelectable'])) {\n\t\t\t\t\t$item['isParentsSelectable'] = $options['isParentsSelectable'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($item[$hasChildColumnName]) {\n\t\t\t\t\t$itemAttributes['style'].=';font-weight:bold';\n\t\t\t\t\tif ($options['isParentsSelectable']!=true)\n\t\t\t\t\t\t$itemAttributes['disabled']=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t#--(End)-->indent items to show them as a tree (hierarchical items)\n\t\t\t$itemAttributes=cmfcHtml::attributesToHtml($itemAttributes);\n\t\t\t\n\t\t\t$html.=sprintf('<option value=\"%s\" %s %s>%s</option>'.\"\\n\",\n\t\t\t\t\t\t\t$value, $selected, $itemAttributes,$title);\n\t\t\t$firstRow=false;\n\t\t}\n\t\tif (isset($groupName)) $html.=\"</optgroup>\\n\";\n\t\t$html.=\"</select>\\n\";\n\t\treturn $html;\n\t}", "function getClientDropdown()\n\t {\n\t\t $data = array();\n\t\t $this->db->from('companies');\n\t\t $this->db->join('synonym','companies.compid=synonym.s_id');\n\t\t $this->db->where('is_client','334');\n\t\t $this->db->order_by('parentname','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->compid]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "public static function renderSelect();", "public function dropdown_kondisi()\n {\n //Query untuk mengambil data kondisi dan diurutkan berdasarkan nama kondisi\n $sql = \"SELECT * FROM kondisi ORDER BY waktu_respon\";\n $query = $this->db->query($sql);\n\n //Value default pada dropdown\n $value[''] = '-- CHOOSE --';\n //Menaruh data kondisi ke dalam dropdown, value yang akan diambil adalah value id_kondisi\n foreach ($query->result() as $row) {\n $value[$row->id_kondisi] = $row->nama_kondisi . \" - (Process Target \" . $row->waktu_respon . \" \" . \"Day)\";\n }\n return $value;\n }", "function get_form_list_select($instance) {\n\t\t$forms = get_option('cc_form_design');\n\n\t\t$output = '';\n\t\t$output .= '<select name=\"'.$this->get_field_name('formid').'\" id=\"'.$this->get_field_id('formid').'\">';\n\t\t$output .= '<option value=\"\">'.__('Select a Form Design', 'consatnt-contact-api').'</option>';\n\n\t\tif(!empty($forms)) {\n\t\t\t$previous_names = array();\n\t\t\tforeach($forms as $form) {\n\n\t\t\t\t$name = isset($form['form-name']) ? $form['form-name'] : 'Form '+$key;\n\n\t\t\t\t$form['truncated_name'] = stripcslashes(trim( wp_html_excerpt( $name, 50 ) ));\n\t\t\t\tif ( isset($form['form-name']) && $form['truncated_name'] != $form['form-name'])\n\t\t\t\t\t$form['truncated_name'] .= '&hellip;';\n\n\t\t\t\tif(!in_array(sanitize_key( $name ), $previous_names)) {\n\t\t\t\t\t$previous_names[] = sanitize_key( $name );\n\t\t\t\t} else {\n\t\t\t\t\t$namekey = sanitize_key( $name );\n\t\t\t\t\t$previous_names[$namekey] = isset($previous_names[$namekey]) ? ($previous_names[$namekey] + 1) : 1;\n\t\t\t\t\t$form['truncated_name'] .= ' ('.$previous_names[$namekey].')';\n\t\t\t\t}\n\n\t\t\t\tif(!empty($form)) {\n\t\t\t\t\t$output .= \"<option value=\\\"{$form['cc-form-id']}\\\"\".selected($this->get_value('formid', $instance), $form['cc-form-id'], false).\">{$form['truncated_name']}</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$output .= '</select>';\n\n\t\treturn $output;\n\t}", "function\tdropdown_list($dbconn) {\n\t$sqlcom=\"select distinct spec_id,name from info;\";\n\t$dbres = pg_exec($dbconn, $sqlcom );\n\tif ( ! $dbres ) {echo \"Error : \" + pg_errormessage( $dbconn ); exit();} \n\t$row=0;\n\t$rowmax=pg_NumRows($dbres);\n\tprint \"<form method=\\\"post\\\" action=\\\"libSpec.php\\\"><select name=\\\"organism\\\" onchange=\\\"this.form.submit();\\\">\\n<option value=\\\"select\\\">Select an organism...</option>\\n\"; \n\twhile ($row<$rowmax) {\n\t $do = pg_Fetch_Object($dbres, $row);\n\t $name=$do->name;\n\t print \"<option value=\\\"$name\\\">$name</option>\\n\";\n\t $row++;\n\t}\n\tprint(\"</select></form>\\n\\n\");\n}", "function draw_optiontype_pulldown($name, $default = '') {\n $values = array();\n $values[] = array('id' => 0, 'text' => 'Select');\n $values[] = array('id' => 1, 'text' => 'Text');\n $values[] = array('id' => 2, 'text' => 'Radio');\n $values[] = array('id' => 3, 'text' => 'Checkbox');\n $values[] = array('id' => 4, 'text' => 'Text Area');\n \n return tep_draw_pull_down_menu($name, $values, $default);\n }", "public function render()\n {\n return view('filament::components.dropdown');\n }", "function outputOptionsList()\n {\n $cc_types = modApiFunc(\"Configuration\", \"getCreditCardSettings\", false);\n\n $OptionsList = '';\n foreach ($cc_types as $type)\n {\n $_id = $type['id'];\n $_name = $type['name'];\n $OptionsList.= '<option value='.$_id.'>'.$_name.'</option>';\n }\n return $OptionsList;\n }", "function getNationalityDropdownList($name, $initVal=\"\", $js=\"\") {\n $dList = \"<SELECT id=\\\"$name\\\" name=\\\"$name\\\" $js class=\\\"select\\\"><option value=\\\"\\\">Select from List</option>\";\n $dList.=\"<option value=\\\"British\\\">British</option>\";\n $nationalities = $this->getDBRecords(\"select label as name,value as id from nationality order by label\");\n for ($i = 0; $i < count($nationalities); $i++) {\n\n if (rtrim($initVal) == rtrim($nationalities[$i][\"id\"])) {\n $sel = \"selected\";\n }\n else\n $sel=null;\n $dList.= \"<option $sel value=\\\"\" . rtrim($nationalities[$i][\"id\"]) . \"\\\">\" . $nationalities[$i][\"name\"] . \"</option>\";\n }\n $dList.= \"</SELECT>\";\n\n return $dList;\n }", "function get_faculty_selections($con) {\n\t$facs = get_faculties($con);\n\t$sel = '<option value=\"\"></option>';\n\tforeach ($facs as $id => $name) {\n\t\t$sel .= '<option value=\"'.$id.'\">'.$name.'</option>';\n\t}\n\treturn $sel;\n}", "function creditcard_type_pulldown($selected = '', $fieldname = 'form[type]')\n {\n $html = '<select name=\"' . $fieldname . '\" style=\"font-family: Verdana\">';\n $html .= '<option value=\"visa\"';\n if ($selected == 'visa')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Visa</option>';\n $html .= '<option value=\"mc\"';\n if ($selected == 'mc')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Mastercard</option>';\n $html .= '<option value=\"amex\"';\n if ($selected == 'amex')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>American Express</option>';\n $html .= '<option value=\"disc\"';\n if ($selected == 'disc')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Discover</option>';\n $html .= '</select>';\n return $html;\n }", "function getClientDropdown2()\n\t {\n\t\t $data = array();\n\t\t $this->db->from('companies');\n\t\t $this->db->join('synonym','companies.compid=synonym.s_id');\n\t\t $this->db->where('is_client','334');\n\t\t $this->db->order_by('parentname','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->parentname]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "public function getAccess_DropDown() {\r\n $option_selected = '';\r\n if (!$this->access) {\r\n $option_selected = ' selected=\"selected\"';\r\n }\r\n \r\n // Get the categories\r\n $items = array('Registered', 'Admin');\r\n\r\n $html = array();\r\n \r\n $html[] = '<label for=\"access\">Choose Access</label><br />';\r\n $html[] = '<select name=\"access\" id=\"access\">';\r\n \r\n foreach ($items as $i=>$item) { \r\n // If the selected parameter equals the current category id then flag as selected\r\n if ($this->access == $item) {\r\n $option_selected = ' selected=\"selected\"';\r\n }\r\n // set up the option line\r\n $html[] = '<option value=\"' . $item . '\"' . $option_selected . '>' . $item . '</option>';\r\n // clear out the selected option flag\r\n $option_selected = '';\r\n }\r\n \r\n $html[] = '</select>';\r\n return implode(\"\\n\", $html); \r\n \r\n }", "public function dropdown()\n\t{\n\t\t$fId = Input::get('facility_id');\n\t\t$checkId = Input::get('check_id');\n $facility = Facility::find($fId);\n return $facility->points($checkId);\n }", "private function renderSelection() {\n\t\t$selection = $this->getSelection();\n\t\tif ($selection === false) {\n\t\t\treturn '';\n\t\t}\n\t\t$itemList = '';\n\t\tforeach ($selection as $item) {\n\t\t\t$itemList .= '\n\t\t\t\t<div class=\"catelem\" id=\"y_'.$item['SKU'].'\">\n\t\t\t\t\t<span class=\"toggle leaf\" id=\"y_toggle_'.$item['SKU'].'\">&nbsp;</span>\n\t\t\t\t\t<div class=\"catname\" id=\"y_select_'.$item['SKU'].'\">\n\t\t\t\t\t\t<span class=\"catname\">'.fixHTMLUTF8Entities($item['products_name'].' ('.$item['SKU'].')').'</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>';\n\t\t}\n\t\treturn $itemList;\n\n\t}", "public static function getSelect()\n {\n return Hash::combine(self::getConstants(), '{s}.value', '{s}.name');\n }", "private function renderSelect($def)\n {\n $def[] = 'options = '.(json_encode($this->options));\n\n $def = implode(' ', $def);\n\n //die($def);\n $tpl = \"<sing-form-select $def/></sing-form-select>\";\n\n return $tpl;\n }", "public static function dropdownCategory()\n {\n return self::pluck('name', 'id');\n }", "function vcn_get_career_names_select_list () {\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry()), 'json');\r\n\t$select_list_array = array('' => 'Select a Career');\r\n\r\n\tif (count($data) > 0) {\r\n\t\tforeach ($data as $value) {\r\n\t\t\t$select_list_array[$value->onetcode] = $value->title;\r\n\t\t}\r\n\t}\r\n\treturn $select_list_array;\r\n}", "function build_table_drop_down() {\n\t$output = array();\n\t$output[] = array('id' => '', 'text' => TEXT_SELECT);\n\t$output[] = array('id' => 'step', 'text' => 'Step');\n\t$output[] = array('id' => 'task_name', 'text' => 'Task Name');\n\t$output[] = array('id' => 'description', 'text' => 'Task Description');\n\t$output[] = array('id' => 'mfg', 'text' => 'Mfg');\n\t$output[] = array('id' => 'qa', 'text' => 'QA');\n\t$output[] = array('id' => 'complete', 'text' => 'Complete');\n\t$output[] = array('id' => 'data_entry', 'text' => 'Data Entry Req');\n\treturn $output;\n }", "public function get_all_designation()\n\t {\n\t \t$userId=$this->checklogin();\n\t \t$query=$this->ApiModel->get_all_designation($userId);\n\t \techo json_encode($query);\n\t }", "function draw_optiontype_pulldown($name, $default = '') {\n global $products_options_types_list;\n $values = array();\n foreach ($products_options_types_list as $id => $text) {\n $values[] = array('id' => $id, 'text' => $text);\n }\n return zen_draw_pull_down_menu($name, $values, $default);\n}", "public function getDesign()\n {\n return \\Cloud::app()->getFrontController()->getDesign();\n }", "public function reportsDropdown(){\n $input = Input::get('option');\n $testCategory = TestCategory::find($input);\n $testTypes = $testCategory->testTypes();\n return Response::make($testTypes->get(['id','name']));\n }", "function ajax_name_dropdown_callback($form, $form_state) {\n $form['JD_fieldset']['plot']['#markup'] = get_plot_code_polar($form, $form_state);\n return $form['JD_fieldset'];\n}", "public function ambil_dropdown(){\n\t\treturn $this->db->get('daftar_akun')->result();\n\t}", "function bls_sf_selectForTypes() {\n\tbls_ut_backTrace(\"bls_sf_selectForTypes\");\n\tglobal $bls_sf_location;\n\n\techo \"<select name=\\\"s_pkg_srctype\\\">\";\n\tforeach ($bls_sf_location as $key => $val) {\n\t\techo \"<option value=\\\"$key\\\">$val</option>\";\n\t}\n\techo \"</select>\";\n}", "public static function getDecisionDropdown() {\n\n $decisions = Decision::orderBy('decision', 'ASC')->get();\n\n $decisions_for_dropdown = [];\n foreach($decisions as $decision) {\n $decisions_for_dropdown[$decision->id] = $decision->decision;\n }\n\n return $decisions_for_dropdown;\n }", "function get_string() {\n\t$_strReturn = '';\n\t\t$attribs = $this->get_attribs();\n\t\t$_strReturn = \"\\n<select$attribs>\\n\";\n\t\t$_strReturn .= $this->get_options();\n\t\t$_strReturn .= \"</select>\\n\";\n\treturn $_strReturn;\n\t}", "function selection() {\r\n return array('id' => $this->code,\r\n 'module' => $this->title);\r\n }", "function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {\n $field = '<select id=\"select-'.zen_output_string($name).'\" name=\"' . zen_output_string($name) . '\"';\n\n if (zen_not_null($parameters)) $field .= ' ' . $parameters;\n\n $field .= '>' . \"\\n\";\n\n if (empty($default) && isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) ) $default = stripslashes($GLOBALS[$name]);\n\n for ($i=0, $n=sizeof($values); $i<$n; $i++) {\n $field .= ' <option value=\"' . zen_output_string($values[$i]['id']) . '\"';\n if ($default == $values[$i]['id']) {\n $field .= ' selected=\"selected\"';\n }\n\n $field .= '>' . zen_output_string($values[$i]['text'], array('\"' => '&quot;', '\\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>' . \"\\n\";\n }\n $field .= '</select>' . \"\\n\";\n\n if ($required == true) $field .= TEXT_FIELD_REQUIRED;\n\n return $field;\n }", "public static function get_font_subset_option_elements() {\n\n\t\treturn '<option value=\"unknown\">' . esc_html__( 'Unknown', 'publisher' ) . '</option>';\n\t}", "protected function _getRenderedContent()\n {\n $result = '';\n $objectName = $this->getName();\n\n /**\n * Adding auto submit Code\n */\n if ($this->autoSubmit)\n {\n $this->onChange = 'javascript: document.getElementById(\\''.$objectName.'_event\\').value=\\'on\\'; this.form.submit();';\n $result .= '<input type=\"hidden\" name=\"'.$objectName.'_event\" id=\"'.$objectName.'_event\" />'.\"\\n\";\n }\n\n $result .= '<select name=\"'.$objectName.'\" '.$this->_getAttributesString().'>';\n foreach ($this->_options as $itemUID => $itemLabel)\n {\n if ((strval($itemUID) != strval($this->_selectedIndex)))\n {\n $result .= '<option value=\"'.$itemUID.'\">'.$itemLabel.'</option>';\n }\n else\n {\n $result .= '<option value=\"'.$itemUID.'\" selected>'.$itemLabel.'</option>';\n }\n }\n $result .= '</select>';\n\n return $result;\n }", "function pdl_selector($uid,$current=\"\") {\n\n\t$o = '';\n\n\t// You can use anybody's Comanche layouts on this site that haven't been protected in some way\n\n\t$sql_extra = item_permissions_sql($uid);\n\n\t// By default order by title (therefore at this time pdl's need a unique title across this system), \n\t// though future work may allow categorisation\n\t// based on taxonomy terms\n\n\t$r = q(\"select title, mid from item where (item_restrict & %d) $sql_extra order by title\",\n\t\tintval(ITEM_PDL)\n\t);\n\n\t$arr = array('channel_id' => $uid, 'current' => $current, 'entries' => $r);\n\tcall_hooks('pdl_selector',$arr);\n\n\t$entries = $arr['entries'];\n\t$current = $arr['current'];\t\t\n \n\t$o .= \"<select name=\\\"pdl_select\\\" id=\\\"pdl_select\\\" size=\\\"1\\\" >\";\n\t$entries[] = array('title' => t('Default'), 'mid' => '');\n\tforeach($entries as $selection) {\n\t\t$selected = (($selection == $current) ? ' selected=\"selected\" ' : '');\n\t\t$o .= \"<option value=\\\"{$selection['mid']}\\\" $selected >{$selection['title']}</option>\";\n\t}\n\n\t$o .= '</select>';\n\treturn $o;\n}", "public function get_select() {\r\n\t\t$html = '';\r\n\t\tforeach ( $this->taxonomies as $tax ) {\r\n\t\t\t$options = sprintf( '<option value=\"\">%s %s</option>', __('View All', 'themify-portfolio-posts'),\r\n\t\t\tget_taxonomy($tax)->label );\r\n\t\t\t$class = is_taxonomy_hierarchical( $tax ) ? ' class=\"level-0\"' : '';\r\n\t\t\tforeach ( get_terms( $tax ) as $taxon ) {\r\n\t\t\t\t$options .= sprintf( '<option %s%s value=\"%s\">%s%s</option>', isset( $_GET[$tax] ) ? selected( $taxon->slug, $_GET[$tax], false ) : '', '0' !== $taxon->parent ? ' class=\"level-1\"' : $class, $taxon->slug, '0' !== $taxon->parent ? str_repeat( '&nbsp;', 3 ) : '', \"{$taxon->name} ({$taxon->count})\" );\r\n\t\t\t}\r\n\t\t\t$html .= sprintf( '<select name=\"%s\" id=\"%s\" class=\"postform\">%s</select>', esc_attr( $tax ), esc_attr( $tax ), $options );\r\n\t\t}\r\n\t\techo $html;\r\n\t}", "public function getSeasonSelect()\n\t{\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n \n\t\t$options = array(JHTML::_('select.option', 0, JText::_($this->getParam('seasons_text'))));\n \n $query->select('s.id AS value, s.name AS text');\n $query->from('#__sportsmanagement_season AS s');\n $query->where('s.published = 1');\n $query->order('s.name DESC');\n\n \n\t\t$db->setQuery($query);\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' <br><pre>'.print_r($query->dump(),true).'</pre>'),'Notice');\n \n\t\t$res = $db->loadObjectList();\n\t\tif ($res) {\n\t\t\t$options = array_merge($options, $res);\n\t\t}\n\t\t//return JHTML::_('select.genericlist', $options, 's', 'class=\"jlajaxmenu-select\" onchange=\"jlamnewproject('.$module->id.');\"', 'value', 'text', $this->getSeasonId());\n\t\treturn $options;\n\t}", "function erp_hr_get_departments_dropdown_raw($select_label = null ) {\n $departments = erp_hr_get_departments();\n $dropdown = array( 0 => __( '- Select Department -', 'wp-erp' ) );\n\n if ( $select_label ) {\n $dropdown = array( 0 => $select_label );\n }\n\n if ( $departments ) {\n foreach ($departments as $key => $department) {\n $dropdown[$department->id] = stripslashes( $department->title );\n }\n }\n\n return $dropdown;\n}", "public function getForSelect()\n {\n return $this->all()->lists('full_name', 'id')->all();\n }", "function get_predefined_item_dropdown($args = '') {\r\n global $wpi_settings;\r\n\r\n if (empty($wpi_settings['predefined_services'])) {\r\n return;\r\n }\r\n\r\n\r\n //** Extract passed args and load defaults */\r\n extract(wp_parse_args($args, array(\r\n 'input_name' => 'wpi[itemized_item][]',\r\n 'input_class' => 'wpi_itemized_item',\r\n 'input_id' => 'wpi_itemized_item',\r\n 'input_style' => ''\r\n )), EXTR_SKIP);\r\n\r\n\r\n $return[] = \"<select name='{$input_name}' class='{$input_class}' id='{$input_id}' style='{$input_style}' >\";\r\n $return[] = '<option value=\"\"></option>';\r\n\r\n foreach ($wpi_settings['predefined_services'] as $itemized_item) {\r\n\r\n\r\n if (empty($itemized_item['name'])) {\r\n $empty_rows[] = true;\r\n continue;\r\n }\r\n\r\n $return[] = \"<option value='\" . esc_attr($itemized_item['name']) . \"' tax='{$itemized_item['tax']}' price='{$itemized_item['price']}'>{$itemized_item['name']}</option>\";\r\n }\r\n $return[] = '</select>';\r\n\r\n\r\n if (count($empty_rows) == count($wpi_settings['predefined_services'])) {\r\n return false;\r\n }\r\n\r\n return implode('', $return);\r\n }", "public function _get_picker_dropdown_choices() {\n\t\t$this->load_data();\n\t\t$result = array();\n\t\tforeach ( $this->data as $unique_key => $item ) {\n\t\t\t$result[ $unique_key ] = $item['label'];\n\t\t}\n\n\t\treturn $result;\n\t}", "function _vaxia_dice_roller_get_dropdown($option_set) {\n $options = array('-1' => '<none>');\n foreach ($option_set as $option_key => $option_value) {\n $options[$option_key] = $option_value;\n }\n return $options;\n}", "function fsf_cms_getStatsPages_dropDown()\n {\n $fsfcms_api_options = array();\n $fsfcms_api_options['apiFile'] = \"fsf.cms.getStatsPages.php\";\n\n $fsfcms_stats_pages_json = fsf_cms_accessAPI($fsfcms_api_options);\n $fsfcms_stats_pages = json_decode($fsfcms_stats_pages_json,TRUE);\n \n if(array_pop($fsfcms_stats_pages) == 200)\n {\n $fsfcms_statsPages_select .= \"<select name=\\\"statsPages\\\" onchange=\\\"self.location.href=this.options[this.selectedIndex].value;\\\">\";\n $fsfcms_statsPages_select .= \"<option value=\\\"\\\">SELECT AN OPTION...</option>\";\n\n foreach($fsfcms_stats_pages as $fsfcms_page_name => $fsfcms_page_slug)\n {\n $fsfcms_statsPages_select .= \"<option value=\\\"/statistics/\" . $fsfcms_page_slug . \"\\\">\" . strtoupper($fsfcms_page_name) . \"</option>\"; \n }\n $fsfcms_statsPages_select .= \"</select>\";\n }\n \n return $fsfcms_statsPages_select; \n }", "public function allDesignation(){\n\n $all_designation=$this->settings->all_designation();\n return response()->json([\n 'all_designation' => $all_designation,\n ], $this->successStatus);\n\n }", "static function getSelect($con,$val=false) {\n\t\t\tglobal $contents,$parts;\n\t\t\t$g = $parts[\"bills\"][\"settings\"];\n\t\t\t$out = \"<select name='$con'><option value=''>-</option>\";\n\t\t\t$val = @$g[$con];\n\t\t\tif ($con==\"minutes\")\n\t\t\t\treturn \"<input name='$con' type='number' value='$val'>\";\n\t\t\tif ($con==\"dropable\")\n\t\t\t\treturn \"<input name='$con' type='radio' value='0' \".($val?\"\":\"checked\").\"> Kapalı\n\t\t\t\t\t\t<input name='$con' type='radio' value='1' \".($val?\"checked\":\"\").\"> Açık\";\n\t\t\tswitch ($con) {\n\t\t\t\tcase \"connect\":\n\t\t\t\t\tforeach($contents as $k => $d)\n\t\t\t\t\t\t$out .= \"<option \".($val==$k?\"selected\":\"\").\" value='$k'>$d[name]</option>\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: \n\t\t\t\t\t$db = $g[\"connect\"];\n\t\t\t\t\tif (isset($contents[$db][\"parts\"])) \n\t\t\t\t\tforeach($contents[$db][\"parts\"] as $k => $d)\n\t\t\t\t\t\t$out .= \"<option \".($val==$k?\"selected\":\"\").\" value='$k'>\n\t\t\t\t\t\t\t\t\".@array_shift(explode(\"||\",$d[\"name\"])).\"</option>\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$out .= \"</select>\";\n\t\t\treturn $out;\n\t\t}", "public function dropDownMediaAccess($selected = \"\")\n{\n $name = 'media_access';\n\n $media_access = array('public' => 'Public', 'private' => 'Private');\n\n if($selected != '') {\n \n $selected = $selected;\n\n }\n\n return dropdown($name, $media_access, $selected);\n\n}", "function getFenzuCombo_html($viewid='',$is_relate=false)\n\t{\n\t\tglobal $adb;\n\t\tglobal $app_strings;\n\t\tglobal $current_user;\n\t\t\n\t\t$public_condition = \" 1 \";\n\n\t\t$tabid = getTabid($this->Fenzumodule);\n\t\t$ssql = \"select ec_fenzu.cvid,ec_fenzu.viewname from ec_fenzu inner join ec_tab on ec_tab.name = ec_fenzu.entitytype\";\n\t\t$ssql .= \" where ec_tab.tabid=\".$tabid.\" and \".$public_condition;\n\t\t$result = $adb->getList($ssql);\n\t\t$shtml = array();\n\t\tforeach($result as $cvrow)\n\t\t{\n\t\t\t//all should be gotten via app_strings by dingjianting on 2007-04-24 for Fenzu problem\n\n\t\t\tif($cvrow['viewname'] == $app_strings['All'])\n\t\t\t{\n\t\t\t\t$cvrow['viewname'] = $app_strings['COMBO_ALL'];\n\t\t\t}\n\n\n\t\t\tif(!$is_relate) {\n\t\t\t\tif($cvrow['setdefault'] == 1 && $viewid =='')\n\t\t\t\t{\n\t\t\t\t\t\t\t $shtml .= \"<option selected value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t\t\t\t $this->setdefaultviewid = $cvrow['cvid'];\n\t\t\t\t}\n\t\t\t\telseif($cvrow['cvid'] == $viewid)\n\t\t\t\t{\n\t\t\t\t\t$shtml .= \"<option selected value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t\t$this->setdefaultviewid = $cvrow['cvid'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$shtml .= \"<option value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$shtml .= \"<option value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t}\n\t\t\t//$shtml[$cvrow['cvid']] = $cvrow['viewname'];\n\t\t}\n\t\treturn $shtml;\n\t}", "public function getInfoDropDownList()\n {\n \n try{\n if(!$this->pdo)throw new PDOException();\n $collection = [];\n $sth = $this->pdo->query(\"SELECT id, name FROM brands\"); \n $collection ['brands'] = $this->getFetchAccoss($sth);\n $sth = $this->pdo->query(\"SELECT id, name FROM models\"); \n $collection ['models'] = $this->getFetchAccoss($sth);\n $sth = $this->pdo->query(\"SELECT id, name FROM colors\"); \n $collection ['colors'] = $this->getFetchAccoss($sth);\n $collection ['sucess'] = 1;\n return json_encode($collection);\n }catch(PDOException $err){\n file_put_contents('errors.txt', $err->getMessage(), FILE_APPEND); \n $err_arr = ['sucess'=>0];\n return json_encode($err_arr);\n }\n }", "public function getSelectDataFields();", "function pulli($name,$options,$qname) { //Function zum erstellen eines Pulldowns\n\t\t$pulldown = '<select name=\"' . $qname . '\">';\n\t\t$anzahl = count ($options);\n\t\t\n\t\t\tfor ($i=0; $i < $anzahl; $i++) { //Schleife fuer Pulldown\n\t\t\t\t$pulldown = $pulldown . '<option>';\n\t\t\t\t$pulldown = $pulldown . $options[$i];\n\t\t\t\t$pulldown = $pulldown . '</option>';\n\t\t\t}\n\t\n\t\t$pulldown = $pulldown . '</select>';\n\t\treturn $pulldown;\n\t}", "public function refDropDown()\n\t{\n\t\t$conn = $this->inv_conn();\n\t\t$qry_all = \"SELECT `ref_name` FROM `inventory`\";\n\t\t$result = mysqli_query($conn, $qry_all);\n\t\tmysqli_close($conn);\n\t\treturn $result;\n\t}", "function _getMediaTypeMenu($name, $selectedType, $attrs)\r\n {\r\n global $_ARRAYLANG, $_CORELANG;\r\n\r\n $menu = \"<select name=\\\"\".$name.\"\\\" \".$attrs.\">\";\r\n foreach ($this->_arrMediaTypes as $type => $text) {\r\n if (!$this->_checkForModule($type)) {\r\n continue;\r\n }\r\n $text = $_ARRAYLANG[$text];\r\n if (empty($text)) {\r\n $text = $_CORELANG[$text];\r\n }\r\n $menu .= \"<option value=\\\"\".$type.\"\\\"\".($selectedType == $type ? \" selected=\\\"selected\\\"\" : \"\").\">\".$text.\"</option>\\n\";\r\n }\r\n $menu .= \"</select>\";\r\n return $menu;\r\n }", "public function getSelect2()\n {\n return SelectResource::collection(ProductType::select('id', 'name')->get());\n }", "public function render()\n {\n return view('components.admin.form-fields.select');\n }", "function buildClassificationList($classifications)\n{\n $classificationList = '<select name=\"classificationId\" id=\"classificationList\">';\n $classificationList .= \"<option>Choose a Classification</option>\";\n foreach ($classifications as $classification) {\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\";\n }\n $classificationList .= '</select>';\n return $classificationList;\n}", "function surfaces_dropdown($ids, $lang) {\n\n require_once('config/config.db.php');\n $connection = new mysqli($db_server, $db_username, $db_password, $DB_DATA, $db_port);\n \n if (!$connection) {\n $answer_from_server['result'] = 'error';\n $answer_from_server['info'] = 'connection fail: ' . mysql_error();\n }\n \n //first to get lang id\n //i assume it will be given as language_en_short_name\n $sql_q_lang = \"SELECT language_id\n FROM languages\n WHERE language_en_short_name = '$lang'\";\n \n $res_lang = $connection->query($sql_q_lang);\n if($res_lang->num_rows ==1) {\n while($row = $res_lang->fetch_assoc()) {\n $lang_id = $row[\"language_id\"];\n }\n }\n \n // now to get all the options for pavement surface and making\n // dropdown list with nothing selected\n $sql_q_all = \"SELECT pavement_id, pavement_name\n FROM pavement_translation \n WHERE language_id = $lang_id\";\n \n $dropdown = '<select id=\"surface_drop\"><option value=\"-1\">...</option>';\n\n $res_all = $connection->query($sql_q_all);\n if($res_all->num_rows >0) {\n while($row = $res_all->fetch_assoc()) {\n $pavement_id = $row[\"pavement_id\"];\n $pavement_name = $row[\"pavement_name\"];\n $dropdown .= '<option value=\"' . $pavement_id . '\">' . $pavement_name . '</option>';\n }\n }\n $dropdown .= '</select>';\n \n //now to find if it's the only surface in all selection\n $sql_q_surfaces = \"SELECT DISTINCT pavement_type_id\n FROM qlines\n WHERE qline_id in ($ids)\";\n\n $res_surfaces = $connection->query($sql_q_surfaces);\n if(($ids != null) && ($res_surfaces->num_rows == 1)) {\n while($row = $res_surfaces->fetch_assoc()) {\n $selected_pavement_type_id = $row[\"pavement_type_id\"];\n\t\t\t$answer_from_server['info'] = 'only one quality value is present';\n }\n } else {\n $answer_from_server['info'] = 'several quality values are present';\n $selected_pavement_type_id = -1;\n }\n\t$answer_from_server['result'] = 'success';\n \n $str_to_replace = '\"' . $selected_pavement_type_id . '\">';\n $replacement = '\"' . $selected_pavement_type_id . '\" selected>';\n \n //TODO: fix quotes\n $dropdown = str_replace($str_to_replace, $replacement, $dropdown);\n return $dropdown;\n}", "public function actionGetCodeDropdowns()\n\t{\t\t\n\t\ttry\n\t\t{\n\t\t\t//set db target\n\t\t\tStateCode::setClient(BaseActiveController::urlPrefix());\n\t\t\t\n\t\t\t// RBAC permission check\n\t\t\tPermissionsController::requirePermission('stateCodeGetDropdown');\n\t\t\n\t\t\t$codes = StateCode::find()\n\t\t\t\t->all();\n\t\t\t$namePairs = [null => \"None\"];\n\t\t\t$tempPairs = [];\n\t\t\t$codesSize = count($codes);\n\t\t\t\n\t\t\tfor($i=0; $i < $codesSize; $i++)\n\t\t\t{\n\t\t\t\t$namePairs[$codes[$i]->StateNames]= $codes[$i]->StateNumber . \": \" . $codes[$i]->StateNames ;\n\t\t\t}\n\t\t\t$namePairs = $namePairs + $tempPairs;\t\t\t\t\n\t\t\t\n\t\t\t$response = Yii::$app ->response;\n\t\t\t$response -> format = Response::FORMAT_JSON;\n\t\t\t$response -> data = $namePairs;\n\t\t\t\n\t\t\treturn $response;\n\t\t}\n\t\tcatch(\\Exception $e) \n\t\t{\n\t\t\tthrow new \\yii\\web\\HttpException(400);\n\t\t}\n\t}", "public function consumablesDropdown()\n {\n $sql = \"SELECT `materials`.`material_id`,`materials`.`material_name`,`materials`.`material_grade`\n FROM `materials`\n\t\t\t\tWHERE `injection` = 1 AND `consumables` = 1\n ORDER BY `materials`.`material_name`;\";\n if($stmt = $this->_db->prepare($sql))\n {\n $stmt->execute();\n while($row = $stmt->fetch())\n {\n $ID = $row['material_id'];\n $NAME = $row['material_name'];\n $GRADE = $row['material_grade'];\n echo '<li><a id=\"'. $NAME .'\" onclick=\"selectConsumable(\\''. $ID .'\\',\\''. $NAME .'\\')\">'. $NAME .'</a></li>'; \n }\n $stmt->closeCursor();\n }\n else\n {\n echo '<li>Something went wrong.'. $db->errorInfo .'</li>'; \n }\n }", "function getClientsDropdown(){\n\t\t $data = array();\n\t\t $this->db->from('company');\n\t\t $this->db->where('client',1);\n\t\t $this->db->order_by('comp','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->comp]=$row->comp;\n\t\t }\n\t\t return $data;\n\t }", "public function render()\n {\n return view('components.meta.card.select');\n }", "protected function get_qual_options()\n {\n $qualSearch = optional_param('qualsearch', '', PARAM_TEXT);\n $out = '<div>';\n $out .= '<h3>'.get_string('qualification','block_bcgt').'</h3>';\n $out .= '<select class=\"qual\" multiple name=\"qualID[]\">';\n $out .= '<option value=\"-1\"></option>';\n $quals = search_qualification(-1, -1, -1, $qualSearch, -1, null, -1, null, true); \n if($quals)\n {\n foreach($quals AS $qual)\n {\n $out .= '<option value=\"'.$qual->id.'\">'. bcgt_get_qualification_display_name($qual).'</option>';\n }\n } \n $out .= '</select>';\n $out .= '<input type=\"text\" name=\"qualsearch\" value=\"'.$qualSearch.'\"/>';\n $out.= '</div>';\n \n return $out;\n }", "function buildClassificationList($classifications){ \r\n $classificationList = '<select name=\"classificationId\" id=\"classificationList\">'; \r\n $classificationList .= \"<option>Choose a Classification</option>\"; \r\n foreach ($classifications as $classification) { \r\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\"; \r\n } \r\n $classificationList .= '</select>'; \r\n return $classificationList; \r\n }", "public function getWorkflowSelect();", "function get_dropdown_list() {\n\t\t$this->db->from('tag');\n\t\t$this->db->order_by('tag_id');\n\t\t$result = $this->db->get();\n\t\t$return = array();\n\t\tif($result->num_rows() > 0) {\n\t\t\tforeach($result->result_array() as $row) {\n\t\t\t\t$return[$row['tag_id']] = $row['tag_title'];\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "public static function selectOptions()\n {\n $options = (new static())->withQuery(function ($model){\n return $model->where('channel', self::$channel);\n })->buildSelectOptions();\n\n return collect($options)->prepend('请选择分类', 0)->all();\n }", "public function render()\n {\n $fromList = array();\n $this->getFromList($fromList);\n $value = $this->getValue()!==null?$this->getValue():$this->getDefaultValue();\n $valueArray = explode(',', $value);\n \n $disabledStr = ($this->getEnabled() == \"N\") ? \"DISABLED=\\\"true\\\"\" : \"\";\n $style = $this->getStyle();\n $func = $this->getFunction();\n\n //$sHTML = \"<SELECT NAME=\\\"\" . $this->objectName . \"[]\\\" ID=\\\"\" . $this->objectName .\"\\\" $disabledStr $this->htmlAttr $style $func>\";\n $sHTML = \"<SELECT NAME=\\\"\" . $this->objectName . \"\\\" ID=\\\"\" . $this->objectName .\"\\\" $disabledStr $this->htmlAttr $style $func>\";\n\n if ($this->blankOption) // ADD a blank option\n {\n $entry = explode(\",\",$this->blankOption);\n $text = $entry[0];\n $value = ($entry[1]!= \"\") ? $entry[1] : null;\n $entryList = array(array(\"val\" => $value, \"txt\" => $text ));\n $fromList = array_merge($entryList, $fromList);\n }\n\n $defaultValue = null;\n foreach ($fromList as $option)\n {\n $test = array_search($option['val'], $valueArray);\n if ($test === false)\n {\n $selectedStr = '';\n }\n else\n {\n $selectedStr = \"SELECTED\";\n $defaultValue = $option['val']; \n }\n $sHTML .= \"<OPTION VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr>\" . $option['txt'] . \"</OPTION>\";\n }\n if($defaultValue == null){\n \t$defaultOpt = array_shift($fromList);\n \t$defaultValue = $defaultOpt['val'];\n \tarray_unshift($fromList,$defaultOpt);\n }\n \n \n $this->setValue($defaultValue);\n $sHTML .= \"</SELECT>\";\n return $sHTML;\n }", "function listTech($con, $def_techID)\n\t{\n\t\t# Default value for the tech dropdown\n\t\t$sql_tech = \"SELECT techID, techName FROM technologies\";\n\t\t$result_tech = $con->query($sql_tech) or die(mysqli_error($con));\n\t\n\t\t$list_tech = \"\";\n\t\twhile($rowh = mysqli_fetch_array($result_tech))\n\t\t{\n\t\t\t$techID = htmlspecialchars($rowh['techID']);\n\t\t\t$techName = htmlspecialchars($rowh['techName']);\n\t\n\t\t\tif($techID == $def_techID) { $selected = \"selected='true'\"; } else { $selected = \"\"; }\n\t\n\t\t\t$list_tech .= \"<option value='$techID' $selected>$techName</option>\";\n\t\t}\n\n\t\treturn $list_tech;\n\t}", "public function getValuesHtml()\n {\n $product = $this->getProduct();\n\n\n $selectHtml = '<div class=\"options-list nested\" id=\"options-shipment-' . $product->getId() . '-list\">';\n\n $options = explode(',', $product->getMdlShipments());\n $i = 0;\n foreach ($options as $option) {\n $optionInfo = $optionLabel = $this->shipmentRepository\n ->getByCode($option, $this->_storeManager->getStore()->getId());\n $optionLabel = $optionInfo->getName();\n $selectHtml .= '<div class=\"field choice admin__field admin__field-option required\">' .\n '<input type=\"radio\" id=\"shipment_' .\n $product->getId() . '_' . $i .\n '\" class=\"'\n\n . 'radio admin__control-radio required product-custom-option\" name=\"shipment_' .\n $product->getId()\n .\n '\" data-selector=\"shipment_' . $product->getId() . '\"' .\n ' value=\"' \n . $optionLabel \n . '--'\n . $option \n . '--'\n . $optionInfo->getBillingAddressTopLabel()\n . '--'\n . $optionInfo->getShippingAddressTopLabel()\n . '--'\n . $optionInfo->getIsSameAsBilling()\n . '\" /><label class=\"label admin__field-label\" for=\"shipment_' .\n $product->getId() . '_' . $i .\n '\">\n '\n . $optionLabel . '</span></label></div>';\n\n $i++;\n }\n $selectHtml .= '</div>';\n return $selectHtml;\n\n }", "static function get_dropdown_options()\n {\n $rows = ORM::factory('actor')->where('parent_id=0')->orderby('actor')->find_all();\n \n foreach ($rows as $row){\n $hijos = array();\n $_t = ORM::factory('actor')->where('parent_id',$row->id)->orderby('actor')->select_list('id','actor');\n\n foreach($_t as $_id => $_n) {\n\n $_hijos = ORM::factory('actor')->where('parent_id',$_id)->orderby('actor')->select_list('id','actor');\n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_hijos);\n \n /* \n foreach($_hijos as $_idn => $_nn) {\n $_h[] = array('id' => $_idn, 'n' => $_nn, 'h' => ORM::factory('actor')->where('parent_id',$_idn)->select_list('id','actor'));\n }\n \n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_h);\n */\n }\n \n $opts[] = array('id' => $row->id, 'n' => $row->actor, 'h' => $hijos);\n }\n return $opts;\n }", "public function dropdownOption(): array\n {\n return [\n 'icon' => 'image',\n 'text' => $this->model->filename(),\n ] + parent::dropdownOption();\n }", "public function getOptions()\n\t{\n\t\t// Set the options\n\t\t$options = array(\n\t\t\tJHtml::_('select.option', '', JText::_('JNONE')),\n\t\t\tJHtml::_('select.option', 'Arts > Design', 'Arts &gt; Design'),\n\t\t\tJHtml::_('select.option', 'Arts > Fashion & Beauty', 'Arts &gt; Fashion &amp; Beauty'),\n\t\t\tJHtml::_('select.option', 'Arts > Food', 'Arts &gt; Food'),\n\t\t\tJHtml::_('select.option', 'Arts > Literature', 'Arts &gt; Literature'),\n\t\t\tJHtml::_('select.option', 'Arts > Performing Arts', 'Arts &gt; Performing Arts'),\n\t\t\tJHtml::_('select.option', 'Arts > Visual Arts', 'Arts &gt; Visual Arts'),\n\t\t\tJHtml::_('select.option', 'Business', 'Business'),\n\t\t\tJHtml::_('select.option', 'Business > Business News', 'Business &gt; Business News'),\n\t\t\tJHtml::_('select.option', 'Business > Careers', 'Business &gt; Careers'),\n\t\t\tJHtml::_('select.option', 'Business > Investing', 'Business &gt; Investing'),\n\t\t\tJHtml::_('select.option', 'Business > Management & Marketing', 'Business &gt; Management &amp; Marketing'),\n\t\t\tJHtml::_('select.option', 'Business > Shopping', 'Business &gt; Shopping'),\n\t\t\tJHtml::_('select.option', 'Comedy', 'Comedy'),\n\t\t\tJHtml::_('select.option', 'Education', 'Education'),\n\t\t\tJHtml::_('select.option', 'Education > Education Technology', 'Education &gt; Education Technology'),\n\t\t\tJHtml::_('select.option', 'Education > Higher Education', 'Education &gt; Higher Education'),\n\t\t\tJHtml::_('select.option', 'Education > K-12', 'Education &gt; K-12'),\n\t\t\tJHtml::_('select.option', 'Education > Language Courses', 'Education &gt; Language Courses'),\n\t\t\tJHtml::_('select.option', 'Education > Training', 'Education &gt; Training'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies', 'Games &amp; Hobbies'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Automotive', 'Games &amp; Hobbies &gt; Automotive'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Aviation', 'Games &amp; Hobbies &gt; Aviation'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Hobbies', 'Games &amp; Hobbies &gt; Hobbies'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Other Games', 'Games &amp; Hobbies &gt; Other Games'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Video Games', 'Games &amp; Hobbies &gt; Video Games'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations', 'Government &amp; Organizations'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations > Local', 'Government &amp; Organizations &gt; Local'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations > National', 'Government &amp; Organizations &gt; National'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations > Non-Profit', 'Government &amp; Organizations &gt; Non-Profit'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations > Regional', 'Government &amp; Organizations &gt; Regional'),\n\t\t\tJHtml::_('select.option', 'Health', 'Health'),\n\t\t\tJHtml::_('select.option', 'Health > Alternative Health', 'Health &gt; Alternative Health'),\n\t\t\tJHtml::_('select.option', 'Health > Fitness & Nutrition', 'Health &gt; Fitness &amp; Nutrition'),\n\t\t\tJHtml::_('select.option', 'Health > Self-Help', 'Health &gt; Self-Help'),\n\t\t\tJHtml::_('select.option', 'Health > Sexuality', 'Health &gt; Sexuality'),\n\t\t\tJHtml::_('select.option', 'Kids & Family', 'Kids &amp; Family'),\n\t\t\tJHtml::_('select.option', 'Music', 'Music'),\n\t\t\tJHtml::_('select.option', 'News & Politics', 'News &amp; Politics'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality', 'Religion &amp; Spirituality'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Buddhism', 'Religion &amp; Spirituality &gt; Buddhism'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Christianity', 'Religion &amp; Spirituality &gt; Christianity'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Hinduism', 'Religion &amp; Spirituality &gt; Hinduism'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Islam', 'Religion &amp; Spirituality &gt; Islam'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Judaism', 'Religion &amp; Spirituality &gt; Judaism'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Other', 'Religion &amp; Spirituality &gt; Other'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Spirituality', 'Religion &amp; Spirituality &gt; Spirituality'),\n\t\t\tJHtml::_('select.option', 'Science & Medicine', 'Science &amp; Medicine'),\n\t\t\tJHtml::_('select.option', 'Science & Medicine > Medicine', 'Science &amp; Medicine &gt; Medicine'),\n\t\t\tJHtml::_('select.option', 'Science & Medicine > Natural Sciences', 'Science &amp; Medicine &gt; Natural Sciences'),\n\t\t\tJHtml::_('select.option', 'Science & Medicine > Social Sciences', 'Science &amp; Medicine &gt; Social Sciences'),\n\t\t\tJHtml::_('select.option', 'Society & Culture', 'Society &amp; Culture'),\n\t\t\tJHtml::_('select.option', 'Society & Culture > History', 'Society &amp; Culture &gt; History'),\n\t\t\tJHtml::_('select.option', 'Society & Culture > Personal Journals', 'Society &amp; Culture &gt; Personal Journals'),\n\t\t\tJHtml::_('select.option', 'Society & Culture > Philosophy', 'Society &amp; Culture &gt; Philosophy'),\n\t\t\tJHtml::_('select.option', 'Society & Culture > Places & Travel', 'Society &amp; Culture &gt; Places &amp; Travel'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation', 'Sports &amp; Recreation'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation > Amateur', 'Sports &amp; Recreation &gt; Amateur'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation > College & High School', 'Sports &amp; Recreation &gt; College &amp; High School'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation > Outdoor', 'Sports &amp; Recreation &gt; Outdoor'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation > Professional', 'Sports &amp; Recreation &gt; Professional'),\n\t\t\tJHtml::_('select.option', 'Technology', 'Technology'),\n\t\t\tJHtml::_('select.option', 'Technology > Gadgets', 'Technology &gt; Gadgets'),\n\t\t\tJHtml::_('select.option', 'Technology > Tech News', 'Technology &gt; Tech News'),\n\t\t\tJHtml::_('select.option', 'Technology > Podcasting', 'Technology &gt; Podcasting'),\n\t\t\tJHtml::_('select.option', 'Technology > Software How-To', 'Technology &gt; Software How-To'),\n\t\t\tJHtml::_('select.option', 'TV & Film', 'TV &amp; Film')\n\t\t);\n\n\t\treturn $options;\n\t}", "function erp_hr_get_departments_dropdown( $selected = '' ) {\n $departments = erp_hr_get_departments_dropdown_raw();\n $dropdown = '';\n if ( $departments ) {\n foreach ($departments as $key => $title) {\n $dropdown .= sprintf( \"<option value='%s'%s>%s</option>\\n\", $key, selected( $selected, $key, false ), $title );\n }\n }\n\n return $dropdown;\n}", "function select_dropdown_options($name)\n{\n $conn = db_connect();\n\n // Generate the salespeople from the database as select options if that is the name passed in to the element\n if ($name == \"salesperson\") {\n\n // Prepared statement for selecting salesperson dropdown options\n $salesperson_dropdown_select_stmt = pg_prepare(\n $conn,\n \"salesperson_dropdown_select_stmt\",\n \"SELECT id, first_name, last_name FROM salespeople;\"\n );\n\n $result = pg_execute($conn, \"salesperson_dropdown_select_stmt\", array());\n\n // Generate the clients from the database as select options if salesperson is logged in \n // by filtering only their clients\n } else if ($name == \"client\" && $_SESSION['type'] == \"a\") {\n\n // Prepared statement for selecting client dropdown options\n $salesperson_id = $_SESSION['id'];\n $clients_dropdown_select_stmt = pg_prepare(\n $conn,\n \"clients_dropdown_select_stmt\",\n \"SELECT id, first_name, last_name FROM clients WHERE salesperson_id = $salesperson_id;\"\n );\n\n $result = pg_execute($conn, \"clients_dropdown_select_stmt\", array());\n }\n\n // Return the data required to populate dropdown menu options\n return $result;\n}", "function hundope_select_field_render() { \n\t\n}", "protected function get_model_kenaikan_select(){\n $name = $this->get_model_name();\n $default = array( \"class\" => \"selectpicker col-md-12\" , \"name\" => $name , \"id\" => $name , 'selected' => $this->get_value($name) );\n $items = array(\"Persen\" , \"Peringkat\");\n return $this->get_select( $items , $default);\n }", "public function render()\n {\n return view('adminhub::components.dropdown.button');\n }", "function getCompleteDesign()\n {\n $designId = $_POST['designId'];\n $result = getCompleteDesignDB($designId);\n\n if($result['message'] == 'OK')\n {\n # All the info of the design\n echo json_encode($result);\n }\n else\n {\n if($result['message'] == 'NONE')\n {\n # No designs with that designId\n echo json_encode($result);\n }\n else\n {\n # Error\n die(json_encode($result));\n }\n }\n }", "private function renderSelect(): string\n {\n $str = '<select'.($this->id ? ' id=\"'.$this->getId().'\"' : '').($this->name ? ' name=\"'.$this->name.'\"' : '');\n if ($this->multiple) {\n $str .= ' multiple=\"multiple\"';\n }\n if ($this->size > 1) {\n $str .= ' size=\"'.$this->size.'\"';\n }\n if ($this->disabled) {\n $str .= ' disabled=\"disabled\"';\n }\n if ($this->tabIndex) {\n $str .= ' tabindex=\"'.$this->tabIndex.'\"';\n }\n $str .= $this->renderCssClass();\n if ($this->required) {\n $str .= ' required=\"required\"';\n }\n $str .= '>';\n\n return $str;\n }", "function get_data_request_options()\r\n{\r\n\t//kijk wat het abstractie niveau is van de huidige opties\r\n\t$current_abstraction_level_query = 'select option_type from Requestable_data where option_name == \":current_selected_option\"';\r\n\t$current_abstraction_level = execute_sql_extract_data($current_abstraction_level_query);\r\n\t\r\n\t//haal de opties maar op uit de DB\r\n\t$requestable_data_descriptions = 'select option_name from Requestable_data where option_type = ' . $current_abstraction_level;\r\n\texecute_sql_extract_data($requestable_data_descriptions);\r\n}", "public function getOptions()\n {\n return $this->where(array('is_del' => array('neq', 1)))->getField('id, name');\n }", "function getHomeCategoriesSelect()\n {\n return $this->getCategoryDropDown('frmDoSearch_Keyword_Category', 0, true);\n }" ]
[ "0.7500952", "0.7249784", "0.7249784", "0.720924", "0.6806662", "0.65877426", "0.64892787", "0.64123344", "0.64123344", "0.6354741", "0.6348697", "0.6343385", "0.633502", "0.63242024", "0.6224537", "0.6169921", "0.611704", "0.6108064", "0.6094584", "0.609113", "0.6085239", "0.6062392", "0.59977716", "0.59971404", "0.5968821", "0.5963065", "0.59579533", "0.59381014", "0.5933105", "0.59136504", "0.5910306", "0.59003186", "0.5862573", "0.58602345", "0.5828938", "0.5825972", "0.5817644", "0.581441", "0.5812261", "0.58116233", "0.5806648", "0.57979983", "0.57808393", "0.577161", "0.57706046", "0.57664406", "0.57648796", "0.5762777", "0.5755433", "0.57505214", "0.5750099", "0.57220596", "0.5720434", "0.57179415", "0.57090056", "0.57065916", "0.570472", "0.569364", "0.568943", "0.5684771", "0.5676629", "0.5675823", "0.5663609", "0.566237", "0.565783", "0.5657827", "0.5650572", "0.56288016", "0.5625086", "0.56229633", "0.56212264", "0.5614163", "0.56139016", "0.5607011", "0.5601709", "0.559784", "0.5592365", "0.55921113", "0.55902064", "0.55841595", "0.5571641", "0.55545145", "0.55518335", "0.55426854", "0.55362344", "0.55329806", "0.55261713", "0.5521253", "0.5519796", "0.55196655", "0.5515714", "0.5510015", "0.55010575", "0.5499196", "0.54955566", "0.5494889", "0.5490277", "0.54897517", "0.54881763", "0.54837304" ]
0.83475983
0
Get company designations dropdown
function erp_hr_get_designation_dropdown( $selected = '' ) { $designations = erp_hr_get_designation_dropdown_raw(); $dropdown = ''; if ( $designations ) { foreach ($designations as $key => $title) { $dropdown .= sprintf( "<option value='%s'%s>%s</option>\n", $key, selected( $selected, $key, false ), $title ); } } return $dropdown; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function erp_hr_get_designation_dropdown_raw() {\n $designations = erp_hr_get_designations();\n $dropdown = array( 0 => __( '- Select Designation -', 'wp-erp' ) );\n\n if ( $designations ) {\n foreach ($designations as $key => $designation) {\n $dropdown[$designation->id] = stripslashes( $designation->title );\n }\n }\n\n return $dropdown;\n}", "public function getDropDown() {}", "public function getDropDown() {}", "function getDropDown() ;", "public function dropdown()\n {\n $building_id = \\Request::get('building_id');\n return \\App\\Floor::where('building_id', $building_id)->lists('name','id');\n }", "function getClientDropdown()\n\t {\n\t\t $data = array();\n\t\t $this->db->from('companies');\n\t\t $this->db->join('synonym','companies.compid=synonym.s_id');\n\t\t $this->db->where('is_client','334');\n\t\t $this->db->order_by('parentname','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->compid]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "public function getDesignation(Request $request) {\n $dep_id = $request->dep_id;\n if ($dep_id) {\n echo '<option value=\"0\">' . language_data('Select Designation') . '</option>';\n $designation = Designation::where('did', $dep_id)->get();\n foreach ($designation as $d) {\n echo '<option value=\"' . $d->id . '\">' . $d->designation . '</option>';\n }\n }\n }", "private function _getCompanySelector()\n {\n $sSearch = getValue('q');\n if(empty($sSearch))\n return json_encode(array());\n\n $oDB = CDependency::getComponentByName('database');\n\n $sQuery = 'SELECT * FROM company WHERE status = 1 AND lower(company_name) LIKE '.$oDB->dbEscapeString('%'.strtolower($sSearch).'%').' ORDER BY company_name desc';\n $oDbResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oDbResult->readFirst();\n if(!$bRead)\n return json_encode(array());\n\n $asJsonData = array();\n while($bRead)\n {\n $asData['name'] = $oDbResult->getFieldValue('company_name');\n $asJsonData[] = json_encode($asData);\n $bRead = $oDbResult->readNext();\n }\n echo '['.implode(',', $asJsonData).']';\n }", "function getClientDropdown2()\n\t {\n\t\t $data = array();\n\t\t $this->db->from('companies');\n\t\t $this->db->join('synonym','companies.compid=synonym.s_id');\n\t\t $this->db->where('is_client','334');\n\t\t $this->db->order_by('parentname','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->parentname]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "public function get_customers_for_dropdown($company){\r\n\t\theader(\"Access-Control-Allow-Origin: \". base_url());\r\n\t\terror_log(\"get_customers_for_dropdown($company)\");\r\n\r\n\t\t$cid = intval($company);\r\n\t\tif($cid>0){\r\n\t\t\t$cs = $this->customer_model->get_companys_customers($cid);\r\n\t\t}\r\n\t\telse if($cid == 0){\r\n\t\t\t$cs = $this->customer_model->get_customers();\r\n\t\t}\r\n\t\telse{\r\n\t\t\techo \"0\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$data = array();\r\n\t\tforeach($cs as $c){\r\n\t\t\t$id = $c[\"id\"];\r\n\t\t\t$name = $c[\"namn\"];\r\n\t\t\t$data[] = array($id => $name);\r\n\t\t}\r\n\t\terror_log(print_r($data, true));\r\n\t\techo json_encode($data);\r\n\t}", "function getClientsDropdown(){\n\t\t $data = array();\n\t\t $this->db->from('company');\n\t\t $this->db->where('client',1);\n\t\t $this->db->order_by('comp','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->comp]=$row->comp;\n\t\t }\n\t\t return $data;\n\t }", "function get_companies_list() {\n return get_view_data('org_list');\n}", "public function getCpnyToCombobox() {\n return $this->db->selectObjList('SELECT company_id, shortname, longname FROM company ORDER BY shortname;', $array = array(), \"Company\");\n }", "function getHomeCategoriesSelect()\n {\n return $this->getCategoryDropDown('frmDoSearch_Keyword_Category', 0, true);\n }", "function industryList($fieldname=\"industry\", $classes=\"form-control\", $important=false, $ind=\"Aerospace Industry\")\n\t{\n\t\tif($important)\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Industry' required>\";\n\t\telse\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Industry'>\";\n\t\t$con = dbConnect(\"localhost\", \"root\", \"\", \"jobPortal\");\n\t\tif($con)\n\t\t{\n\t\t\t$rsIndustry = mysqli_query($con, \"SELECT * FROM industries\");\n\t\t\tif($rsIndustry)\n\t\t\t{\n\t\t\t\twhile($row = mysqli_fetch_array($rsIndustry))\n\t\t\t\t{\n\t\t\t\t\tif($row[\"indName\"]==$ind)\n\t\t\t\t\techo \"<option value='\".$row['indId'].\"' selected>\".$row['indName'].\"</option>\";\n\t\t\t\t\telse\n\t\t\t\t\techo \"<option value='\".$row['indId'].\"'>\".$row['indName'].\"</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<option value='0'>Unable To Fetch.</option>\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<option value='0'>Unable To Fetch.</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t}", "public function getDesignsList() {\n return $this->_get(1);\n }", "function\tdropdown_list($dbconn) {\n\t$sqlcom=\"select distinct spec_id,name from info;\";\n\t$dbres = pg_exec($dbconn, $sqlcom );\n\tif ( ! $dbres ) {echo \"Error : \" + pg_errormessage( $dbconn ); exit();} \n\t$row=0;\n\t$rowmax=pg_NumRows($dbres);\n\tprint \"<form method=\\\"post\\\" action=\\\"libSpec.php\\\"><select name=\\\"organism\\\" onchange=\\\"this.form.submit();\\\">\\n<option value=\\\"select\\\">Select an organism...</option>\\n\"; \n\twhile ($row<$rowmax) {\n\t $do = pg_Fetch_Object($dbres, $row);\n\t $name=$do->name;\n\t print \"<option value=\\\"$name\\\">$name</option>\\n\";\n\t $row++;\n\t}\n\tprint(\"</select></form>\\n\\n\");\n}", "function get_designers() {\n return $this->mysqli->query(\"SELECT `product_variations`.*, `products`.*, `designers`.`name` AS 'des_name' FROM `product_variations` JOIN `products` ON `products`.`product_id` = `product_variations`.`product_id` JOIN `designers` ON `designers`.`designer_id` = `products`.`designer_id` ORDER BY `designers`.`name` ASC, `product_variations`.`price` ASC\");\n }", "function vcn_get_career_names_select_list () {\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry()), 'json');\r\n\t$select_list_array = array('' => 'Select a Career');\r\n\r\n\tif (count($data) > 0) {\r\n\t\tforeach ($data as $value) {\r\n\t\t\t$select_list_array[$value->onetcode] = $value->title;\r\n\t\t}\r\n\t}\r\n\treturn $select_list_array;\r\n}", "function select_dropdown_options($name)\n{\n $conn = db_connect();\n\n // Generate the salespeople from the database as select options if that is the name passed in to the element\n if ($name == \"salesperson\") {\n\n // Prepared statement for selecting salesperson dropdown options\n $salesperson_dropdown_select_stmt = pg_prepare(\n $conn,\n \"salesperson_dropdown_select_stmt\",\n \"SELECT id, first_name, last_name FROM salespeople;\"\n );\n\n $result = pg_execute($conn, \"salesperson_dropdown_select_stmt\", array());\n\n // Generate the clients from the database as select options if salesperson is logged in \n // by filtering only their clients\n } else if ($name == \"client\" && $_SESSION['type'] == \"a\") {\n\n // Prepared statement for selecting client dropdown options\n $salesperson_id = $_SESSION['id'];\n $clients_dropdown_select_stmt = pg_prepare(\n $conn,\n \"clients_dropdown_select_stmt\",\n \"SELECT id, first_name, last_name FROM clients WHERE salesperson_id = $salesperson_id;\"\n );\n\n $result = pg_execute($conn, \"clients_dropdown_select_stmt\", array());\n }\n\n // Return the data required to populate dropdown menu options\n return $result;\n}", "public function populateDesignSelect($field) {\n\n //Fetch data from host\n $data = wp_remote_get($this->apiUrl, ['cacheBust' => $this->uniqid]); \n \n if(wp_remote_retrieve_response_code($data) == 200) {\n \n //Decode\n $choices = json_decode($data['body']); \n\n //Reset select\n $field['choices'] = []; \n\n //Populate select\n if( is_array($choices) && !empty($choices) ) {\n foreach( $choices as $choice ) {\n $field['choices'][ $choice->id ] = $choice->name; \n }\n }\n\n } else {\n $field['choices']['error'] = __(\"Error loading options\", 'muncipio'); \n } \n \n return $field;\n }", "private function getSpec() {\n\t\t$html = '<div id=\"tal_ecoles\">';\n\t\t$html .= '<select id=\"tal_listEcoles\" onchange=\"tal_display(this)\">';\n\t\t$html .= '<option value=\"0\" selected=\"\" disabled=\"\">Choose...</option>';\n\t\tforeach ($this->_xml->ecole as $branch) {\n\t\t\t$html .= '<option value=\"'.$branch['id'].'\">'.$branch['name'].'</option>';\n\t\t}\n\t\t$html .= '</select>';\n\t\t$html .= '</div>';\n\n\t\treturn $html;\n\t}", "public function getCompany();", "function getFieldIndustryofEmployment($val = null){\n\t\tinclude('axcelerate_link_array_list.php');\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_ANZSICCode');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_ANZSICCode');\n\t\t$tooltip = setToolTipNotification(\"ANZSICCode\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"<div id='ANZSICCodecon'></br><label>\".$dataTitle.(get_axl_req_fields('employment') === 'employment' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><select name='ANZSICCode' id='ANZSICCode' class='srms-field \".(get_axl_req_fields('employment') === 'employment' ? 'input-select-required' : '').\"'><option value='' > -- Select an Option -- </option>\";\n\t\t\tforeach ($employerANZSIC_lists as $key => $value) {\n\t\t\t\t$form_ret .= \"<option value='\".$key.\"' \".($val == $key ? 'selected' : '').\">\".$value.\"</option>\";\n\t\t\t}\n\t\t\t$form_ret .= \"</select></br></div>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public static function dropdownCategory()\n {\n return self::pluck('name', 'id');\n }", "function get_form_list_select($instance) {\n\t\t$forms = get_option('cc_form_design');\n\n\t\t$output = '';\n\t\t$output .= '<select name=\"'.$this->get_field_name('formid').'\" id=\"'.$this->get_field_id('formid').'\">';\n\t\t$output .= '<option value=\"\">'.__('Select a Form Design', 'consatnt-contact-api').'</option>';\n\n\t\tif(!empty($forms)) {\n\t\t\t$previous_names = array();\n\t\t\tforeach($forms as $form) {\n\n\t\t\t\t$name = isset($form['form-name']) ? $form['form-name'] : 'Form '+$key;\n\n\t\t\t\t$form['truncated_name'] = stripcslashes(trim( wp_html_excerpt( $name, 50 ) ));\n\t\t\t\tif ( isset($form['form-name']) && $form['truncated_name'] != $form['form-name'])\n\t\t\t\t\t$form['truncated_name'] .= '&hellip;';\n\n\t\t\t\tif(!in_array(sanitize_key( $name ), $previous_names)) {\n\t\t\t\t\t$previous_names[] = sanitize_key( $name );\n\t\t\t\t} else {\n\t\t\t\t\t$namekey = sanitize_key( $name );\n\t\t\t\t\t$previous_names[$namekey] = isset($previous_names[$namekey]) ? ($previous_names[$namekey] + 1) : 1;\n\t\t\t\t\t$form['truncated_name'] .= ' ('.$previous_names[$namekey].')';\n\t\t\t\t}\n\n\t\t\t\tif(!empty($form)) {\n\t\t\t\t\t$output .= \"<option value=\\\"{$form['cc-form-id']}\\\"\".selected($this->get_value('formid', $instance), $form['cc-form-id'], false).\">{$form['truncated_name']}</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$output .= '</select>';\n\n\t\treturn $output;\n\t}", "public function getDesignsList() {\n return $this->_get(5);\n }", "public function getCompany() {}", "public function getOtherDesignList() {\n return $this->_get(2);\n }", "function get_name_select_list()\n\t{\n\t\treturn $this->get_name_select_edit();\n\t}", "function sub_company_user_list() {\n\t$result=mysql_query(\"SELECT `username`,`name` FROM `users`,`company` WHERE NOT `type`=1 AND NOT `name`='Liberty International' AND users.company = company.company_id ORDER BY `name` ASC\"); \n\t\n\t$options=\"\"; \n\twhile ($row=mysql_fetch_array($result)) { \n\t\t$username=$row['username']; \n\t\t$company=$row['name']; \n\t\t$options.=\"<OPTION VALUE=\".$username.\">\".$company.\" - \". $username; \n\t} \n\treturn $options;\n}", "function form_dropdown_dept($name = '', $selected = array(), $extra = '', $type = 'all', $display = 'y', $exclude = '', $blank_option = false)\n {\n $ci =& get_instance();\n\n /* load the resources */\n $ci->load->model('depts_model', 'dept');\n\n /* set and load the language file needed */\n $ci->lang->load('app', $ci->session->userdata('language'));\n\n switch ($type) {\n case 'all':\n $depts = $ci->dept->get_all_depts('asc', $display);\n\n if ($depts->num_rows() > 0) {\n if ($blank_option === true) {\n $options[0] = ucfirst($ci->lang->line('labels_none'));\n }\n\n foreach ($depts->result() as $dept) {\n if (!empty($exclude) && $exclude == $dept->dept_id) {\n /* don't do anything */\n } else {\n $manifestname = $ci->dept->get_manifest($dept->dept_manifest, 'manifest_name');\n $manifest = ($manifestname == '') ? false : ' ('.$manifestname.')';\n\n $options[$dept->dept_id] = $dept->dept_name.$manifest;\n }\n\n $subd = $ci->dept->get_sub_depts($dept->dept_id, 'asc', $display);\n\n if ($subd->num_rows() > 0) {\n foreach ($subd->result() as $sub) {\n if (!empty($exclude) && $exclude == $sub->dept_id) {\n /* don't do anything */\n } else {\n $options[$sub->dept_id] = $sub->dept_name;\n }\n }\n }\n }\n }\n break;\n\n case 'main':\n $depts = $ci->dept->get_all_depts('asc', $display);\n\n if ($depts->num_rows() > 0) {\n if ($blank_option === true) {\n $options[0] = ucfirst($ci->lang->line('labels_none'));\n }\n\n foreach ($depts->result() as $dept) {\n if (!empty($exclude) && $exclude == $dept->dept_id) {\n /* don't do anything */\n } else {\n $manifestname = $ci->dept->get_manifest($dept->dept_manifest, 'manifest_name');\n $manifest = ($manifestname == '') ? false : ' ('.$manifestname.')';\n\n $options[$dept->dept_id] = $dept->dept_name.$manifest;\n }\n }\n }\n break;\n }\n\n if (! is_array($selected)) {\n $selected = array($selected);\n }\n\n // If no selected state was submitted we will attempt to set it automatically\n if (count($selected) === 0) {\n // If the form name appears in the $_POST array we have a winner!\n if (isset($_POST[$name])) {\n $selected = array($_POST[$name]);\n }\n }\n\n if ($extra != '') {\n $extra = ' '.$extra;\n }\n\n $multiple = (count($selected) > 1 && strpos($extra, 'multiple') === false) ? ' multiple=\"multiple\"' : '';\n\n $form = '<select name=\"'.$name.'\"'.$extra.$multiple.\">\\n\";\n\n foreach ($options as $key => $val) {\n $key = (string) $key;\n\n if (is_array($val)) {\n $form .= '<optgroup label=\"'.$key.'\">'.\"\\n\";\n\n foreach ($val as $optgroup_key => $optgroup_val) {\n $sel = (in_array($optgroup_key, $selected)) ? ' selected=\"selected\"' : '';\n\n $form .= '<option value=\"'.$optgroup_key.'\"'.$sel.'>'.(string) $optgroup_val.\"</option>\\n\";\n }\n\n $form .= '</optgroup>'.\"\\n\";\n } else {\n $sel = (in_array($key, $selected)) ? ' selected=\"selected\"' : '';\n\n $form .= '<option value=\"'.$key.'\"'.$sel.'>'.(string) $val.\"</option>\\n\";\n }\n }\n\n $form .= '</select>';\n\n return $form;\n }", "function outputOptionsList()\n {\n $cc_types = modApiFunc(\"Configuration\", \"getCreditCardSettings\", false);\n\n $OptionsList = '';\n foreach ($cc_types as $type)\n {\n $_id = $type['id'];\n $_name = $type['name'];\n $OptionsList.= '<option value='.$_id.'>'.$_name.'</option>';\n }\n return $OptionsList;\n }", "public function leadDesignerList()\n {\n if(Input::get('clientID') != \"\") {\n \t\t\t$adiDesigners = DB::table('aditional_designers')\n \t\t\t\t\t\t\t\t\t->select('id','designer_name')\n\t\t\t\t\t\t\t\t\t->where('firm_id', Input::get('clientID'))\n\t\t\t\t\t\t\t\t\t->orderBy('designer_name', 'asc')\n\t\t\t\t\t\t\t\t\t->get();\n\t\t\t\t\t\t\t\t\t\n\t\t\t$view = View::make('adminTemplate.adminjob.aditionalDesignerList') \n\t\t\t->with('adiDesigners', $adiDesigners);\n\t\t\treturn $view;\n }\n }", "public function getDropdownEmployeeGroup()\n {\n /*\n * define variable\n */\n $return[''] = '-- Select Employee Group --';\n $employeeGroup = $this->getEmployeeGroup();\n\n if ($employeeGroup->isNotEmpty())\n {\n foreach ($employeeGroup as $val){\n $return[$val->guid] = $val->name;\n }\n }\n\n return $return;\n }", "function getNationalityDropdownList($name, $initVal=\"\", $js=\"\") {\n $dList = \"<SELECT id=\\\"$name\\\" name=\\\"$name\\\" $js class=\\\"select\\\"><option value=\\\"\\\">Select from List</option>\";\n $dList.=\"<option value=\\\"British\\\">British</option>\";\n $nationalities = $this->getDBRecords(\"select label as name,value as id from nationality order by label\");\n for ($i = 0; $i < count($nationalities); $i++) {\n\n if (rtrim($initVal) == rtrim($nationalities[$i][\"id\"])) {\n $sel = \"selected\";\n }\n else\n $sel=null;\n $dList.= \"<option $sel value=\\\"\" . rtrim($nationalities[$i][\"id\"]) . \"\\\">\" . $nationalities[$i][\"name\"] . \"</option>\";\n }\n $dList.= \"</SELECT>\";\n\n return $dList;\n }", "public function showSelectOrganiser()\n {\n return view('ManageOrganiser.SelectOrganiser');\n }", "public function empty_city_dropdown_select()\n {\n $empty_select = '<select name=\"deptID\" class=\"chosen-select\" data-placeholder=\"Select Departement\" style=\"width: 300px; display: none;\">';\n $empty_select_closed = '</select>';\n //GET THE ID OF THE LISTING USING URI\n $listingID = $this->uri->segment(5);\n \n //LOAD GCRUD AND GET THE STATE\n $crud = new grocery_CRUD();\n $state = $crud->getState();\n \n //CHECK FOR A URI VALUE AND MAKE SURE ITS ON THE EDIT STATE\n if(isset($listingID) && $state == \"edit\") {\n //GET THE STORED STATE ID\n $this->db->select('companyID, divisionID, deptID, iGroupApprovalId')\n ->from('tbl_apv_group_approval')\n ->where('iGroupApprovalId', $listingID);\n $db = $this->db->get();\n $row = $db->row(0);\n $divisionID = $row->divisionID;\n $deptID = $row->deptID;\n \n //GET THE CITIES PER STATE ID\n $this->db->select('*')\n ->from('tbl_dept')\n ->where('iDeptDivID', $divisionID);\n $db = $this->db->get();\n \n //APPEND THE OPTION FIELDS WITH VALUES FROM THE STATES PER THE COUNTRY ID\n foreach($db->result() as $row):\n if($row->iDeptID == $deptID) {\n $empty_select .= '<option value=\"'.$row->iDeptID.'\" selected=\"selected\">'.$row->cDeptName.'</option>';\n } else {\n $empty_select .= '<option value=\"'.$row->iDeptID.'\">'.$row->cDeptName.'</option>';\n }\n endforeach;\n \n //RETURN SELECTION COMBO\n return $empty_select.$empty_select_closed;\n } else {\n //RETURN SELECTION COMBO\n return $empty_select.$empty_select_closed; \n }\n }", "function showCompany() {\n\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\n\t\t\t\t\t$editForm = new h2o('views/editCompany.html');\n\t\t\t\t\techo $editForm->render(compact('company'));\n\t\t\t\t}", "function buildClassificationList($classifications)\n{\n $classificationList = '<select name=\"classificationId\" id=\"classificationList\">';\n $classificationList .= \"<option>Choose a Classification</option>\";\n foreach ($classifications as $classification) {\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\";\n }\n $classificationList .= '</select>';\n return $classificationList;\n}", "function drawDropDownCustom($options)\n\t{\n\t\t$controlName=$options['controlName'];\n\t\t$orgValue=$options['orgValue'];\n\t\t$items=$options['items']; \n\t\t$valueColumnName=$options['valueColumnName'];\n\t\t$titleColumnName=$options['titleColumnName'];\n\t\t$levelColumnName=$options['levelColumnName'];\n\t\t$hasChildColumnName=$options['hasChildColumnName'];\n\t\t$groupNameColumnName=$options['groupNameColumnName'];\n\t\t$groupIdColumnName=$options['groupIdColumnName'];\n\t\t$defaultValue=$options['defaultValue'];\n\t\t$defaultTitle=$options['defaultTitle'];\n\t\t$moreAttributes=$options['attributes'];\n\t\t$useKeyAsKeyAndValueAsValue=$options['useKeyAsKeyAndValueAsValue'];\n\t\t\n\t\tif (is_string($items))\n\t\t\t$items=cmfcMySql::getRowsCustom($items);\n\n\t\t\t\n\t\tif ($options['selectType']=='multiSelect') {\n\t\t\t$moreAttributes['multiple']='multiple';\n\t\t\t$controlName.='[]';\n\t\t}\n\t\t\n\t\t/*\n\t\techo '<pre style=\"direction:ltr\">';\n\t\tprint_r($items);\n\t\techo \"</pre>\";\n\t\t*/\n\t\t$moreAttributesStr=cmfcHtml::attributesToHtml($moreAttributes);\n\t\t\n\t\t$lastGroupName='';\n\t\t$firstRow=true;\n\n\t\t$html=sprintf('<select name=\"%s\" %s >'.\"\\n\", $controlName, $moreAttributesStr);\n\t\tif (!is_null($defaultValue)) {\n\t\t\tif ($options['disabledDefaultValue']==true) {\n\t\t\t\t$disabledHtml='disabled=\"disabled\"';\n\t\t\t} else {\n\t\t\t\t$disabledHtml='';\n\t\t\t}\n\t\t\t$html.=sprintf('<option value=\"%s\" %s>%s</option>'.\"\\n\",$defaultValue,$disabledHtml, $defaultTitle);\n\t\t}\n\t\t//$i = 0; //count the number of selected orgValues\n\t\t\n\t\tif (!is_array($orgValue))\n\t\t\t$orgValues[] = $orgValue;\n\t\telse\n\t\t\t$orgValues = $orgValue;\n\t\t\t\n\t\tif(is_array($items)) // added by babak\n\t\tforeach ($items as $key=>$item) {\n\t\t\tif (is_array($item)) {\n\t\t\t\t$title=$item[$titleColumnName];\n\t\t\t\t$value=$item[$valueColumnName];\n\t\t\t} elseif (is_integer($key) and !$useKeyAsKeyAndValueAsValue) {\n\t\t\t\t$title=$item;\n\t\t\t\t$value=$item;\n\t\t\t} else {\n\t\t\t\t$title=$item;\n\t\t\t\t$value=$key;\n\t\t\t}\n\n\t\t\tif (!empty($groupNameColumnName) && ($options['interface']['group'] or !isset($options['interface']['group']))) {\n\t\t\t\t$groupName=$item[$groupNameColumnName];\n\t\t\t\t$groupId=$item[$groupIdColumnName];\n\t\t\t\t\n\t\t\t\tif ($lastGroupName==$groupName) {$groupChanged=false;} else {$groupChanged=true;}\n\t\t\t\t//echo \"[$lastGroupName:$groupName]\";\n\t\t\t\tif ($groupChanged==true) {\n\t\t\t\t\tif (!$firstRow) { $html.=\"</optgroup>\\n\"; }\n\t\t\t\t\t$html.=sprintf('<optgroup label=\"%s\" title=\"%s\">'.\"\\n\",$groupName, $groupId);\n\t\t\t\t\t$lastGroupName=$groupName;\n\t\t\t\t}\n\t\t\t\t$groupChanged=false;\n\t\t\t}\n\t\t\t$selected='';\n\t\t\tif (in_array($value,$orgValues)) {\n\t\t\t\t$selected='selected=\"selected\"';\n\t\t\t\t//$i++;\n\t\t\t} else {\n\t\t\t\t$selected = '';\n\t\t\t}\n\t\t\t\n\t\t\t$itemAttributes=array();\n\t\t\t#--(Begin)-->indent items to show them as a tree (hierarchical items)\n\t\t\tif (!empty($levelColumnName)) {\n\t\t\t\tif (empty($firstLevelNumber))\n\t\t\t\t\t$firstLevelNumber=$item[$levelColumnName];\n\t\t\t\t\t\n\t\t\t\t$depth=$item[$levelColumnName]-$firstLevelNumber;\n\t\t\t\tif (!isset($options['interface']['itemIndent'])) $options['interface']['itemIndent']=20;\n\t\t\t\t$itemIndent=intval($options['interface']['itemIndent']);\n\t\t\t\tif (!$options['interface']['isIe'])\t {\n\t\t\t\t\t$itemIndent=intval($options['interface']['itemIndent']);\n\t\t\t\t\tif ($options['interface']['direction']=='rightToLeft')\n\t\t\t\t\t\t$itemAttributes['style'].=';padding-right:'.($itemIndent*$depth).'px;';\n\t\t\t\t\telse\n\t\t\t\t\t\t$itemAttributes['style'].=';padding-left:'.($itemIndent*$depth).'px;';\n\t\t\t\t} else {\n\t\t\t\t\t$itemIndent=round($itemIndent/2)*$depth;\n\t\t\t\t\t$title=str_repeat('&nbsp;',$itemIndent).$title;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isset($options['isParentsSelectable'])) {\n\t\t\t\t\t$item['isParentsSelectable'] = $options['isParentsSelectable'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($item[$hasChildColumnName]) {\n\t\t\t\t\t$itemAttributes['style'].=';font-weight:bold';\n\t\t\t\t\tif ($options['isParentsSelectable']!=true)\n\t\t\t\t\t\t$itemAttributes['disabled']=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t#--(End)-->indent items to show them as a tree (hierarchical items)\n\t\t\t$itemAttributes=cmfcHtml::attributesToHtml($itemAttributes);\n\t\t\t\n\t\t\t$html.=sprintf('<option value=\"%s\" %s %s>%s</option>'.\"\\n\",\n\t\t\t\t\t\t\t$value, $selected, $itemAttributes,$title);\n\t\t\t$firstRow=false;\n\t\t}\n\t\tif (isset($groupName)) $html.=\"</optgroup>\\n\";\n\t\t$html.=\"</select>\\n\";\n\t\treturn $html;\n\t}", "private function generate_filter_dropdowns() {\n $html = '';//no html\n \n //instance filter dropdown\n $instance_config = $this->get_settings_config_data();//get instance config\n if(isset($instance_config) && isset($instance_config->data)//if config exists, and data has been saved\n && count($instance_config->data) > 0) {//there is actually a filter saved\n \n $text = get_string('instance_filters', 'block_dd_content');//get label text\n $html .= $this->generate_filter_dropdown($text, $instance_config->data);//generate dropdown\n }\n\n //global filter dropdown\n $global_config_data = dd_content_get_admin_config();//grab global block config DATA (not the config itself)\n if(count($global_config_data) > 0) {//if a filter exists\n \n $text = get_string('global_filters', 'block_dd_content');//get global filter label\n $html .= $this->generate_filter_dropdown($text, $global_config_data);//create dropdown\n }\n \n \n return $html;\n }", "function get_college_programs() {\n $list = \"\";\n $list.=\"<select id='programs' style='width:155px;' required>\";\n $list.=\"<option value='0' selected>Program</option>\";\n $query = \"select * from mdl_course where category=5 and cost>0 and visible=1\";\n $result = $this->db->query($query);\n foreach ($result->result() as $row) {\n $list.=\"<option value='$row->id'>$row->fullname</option>\";\n }\n $list.=\"</select>\";\n\n return $list;\n }", "function listTech($con, $def_techID)\n\t{\n\t\t# Default value for the tech dropdown\n\t\t$sql_tech = \"SELECT techID, techName FROM technologies\";\n\t\t$result_tech = $con->query($sql_tech) or die(mysqli_error($con));\n\t\n\t\t$list_tech = \"\";\n\t\twhile($rowh = mysqli_fetch_array($result_tech))\n\t\t{\n\t\t\t$techID = htmlspecialchars($rowh['techID']);\n\t\t\t$techName = htmlspecialchars($rowh['techName']);\n\t\n\t\t\tif($techID == $def_techID) { $selected = \"selected='true'\"; } else { $selected = \"\"; }\n\t\n\t\t\t$list_tech .= \"<option value='$techID' $selected>$techName</option>\";\n\t\t}\n\n\t\treturn $list_tech;\n\t}", "function generateHTMLcboCompanies($selected=\"\", $class=\"\"){\n\t\t\t\treturn arraySelect($this->Companies(), \"idcompany_todo\", \"class=\\\"$class\\\" tabindex=\\\"8\\\" onchange=\\\"javascript:changeProject_todo();\\\" \", $selected, true, false);\n\t\t\t\t\n\t\t\t}", "function showDropdown(){\n echo '<select name=\"portfolioSelection\">';\n echo '<option value=\"remove\"><strong>..</strong></option>';\n global $mysqli;\n $result = $mysqli->query('SELECT id, name FROM portfolio');\n if($mysqli->error) return 404;\n while($row = $result->fetch_object()){\n echo '<option value=\"'.$row->id.'\">'.$row->name.'</option>';\n }\n echo '</select>';\n }", "function DependantDropdown(){\r\n }", "function cmdCustType($name, $caption) {\n $optcust_type = array\n (\n array(\"\", \"\"),\n array(\"End User\", \"1\"),\n array(\"Dealer / Reseller\", \"2\"),\n array(\"Goverment / BUMN\", \"3\"),\n );\n ?>\n <tr>\n <td><?php getCaption($caption); ?> :</td>\n <td>\n <select class=\"easyui-combobox\"\n id=\"<?php echo $name; ?>\"\n name=\"<?php echo $name; ?>\"\n style=\"width:120px;\"\n data-options=\"panelHeight:100,editable:false,width:200\"\n disabled=true\n >\n <?php\n foreach ($optcust_type as $val) {\n echo '<option value=\"' . $val[1] . '\">' . $val[0] . '</option>';\n }\n ?>\n </select>\n </td>\n </tr>\n <?php\n}", "function build_selection_dropdown() {\n\t$output = array();\n\t$output[] = array('id' => '', 'text' => TEXT_SELECT);\n\t$output[] = array('id' => 'wo_journal_main.id', 'text' => 'Record ID');\n\t$output[] = array('id' => 'wo_journal_main.wo_id', 'text' => 'Work Order Num');\n\t$output[] = array('id' => 'wo_journal_main.wo_title', 'text' => 'Work Order Title');\n\t$output[] = array('id' => 'wo_journal_main.priority', 'text' => 'Priority');\n\t$output[] = array('id' => 'wo_journal_main.sku', 'text' => 'SKU');\n\t$output[] = array('id' => 'wo_journal_main.qty', 'text' => 'Quantity');\n\t$output[] = array('id' => 'wo_journal_main.post_date', 'text' => 'Post Date');\n\t$output[] = array('id' => 'wo_journal_main.closed', 'text' => 'Closed');\n\t$output[] = array('id' => 'wo_journal_main.closed_date', 'text' => 'Closed Date');\n\t$output[] = array('id' => 'wo_journal_main.notes', 'text' => 'Notes');\n\t$output[] = array('id' => 'wo_journal_main.bom_list', 'text' => 'BOM List');\n\t$output[] = array('id' => 'wo_journal_main.ref_specs', 'text' => 'Reference Specs');\n\t$output[] = array('id' => 'wo_journal_main.ref_docs', 'text' => 'Reference Docs');\n\t$output[] = array('id' => 'bar_code', 'text' => 'SKU Bar Code');\n\t$output[] = array('id' => 'image_with_path', 'text' => 'SKU Image');\n\treturn $output;\n }", "public function getAccess_DropDown() {\r\n $option_selected = '';\r\n if (!$this->access) {\r\n $option_selected = ' selected=\"selected\"';\r\n }\r\n \r\n // Get the categories\r\n $items = array('Registered', 'Admin');\r\n\r\n $html = array();\r\n \r\n $html[] = '<label for=\"access\">Choose Access</label><br />';\r\n $html[] = '<select name=\"access\" id=\"access\">';\r\n \r\n foreach ($items as $i=>$item) { \r\n // If the selected parameter equals the current category id then flag as selected\r\n if ($this->access == $item) {\r\n $option_selected = ' selected=\"selected\"';\r\n }\r\n // set up the option line\r\n $html[] = '<option value=\"' . $item . '\"' . $option_selected . '>' . $item . '</option>';\r\n // clear out the selected option flag\r\n $option_selected = '';\r\n }\r\n \r\n $html[] = '</select>';\r\n return implode(\"\\n\", $html); \r\n \r\n }", "function buildClassificationList($classifications){ \r\n $classificationList = '<select name=\"classificationId\" id=\"classificationList\">'; \r\n $classificationList .= \"<option>Choose a Classification</option>\"; \r\n foreach ($classifications as $classification) { \r\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\"; \r\n } \r\n $classificationList .= '</select>'; \r\n return $classificationList; \r\n }", "public function getSelect();", "public function getSelect();", "public function get_all_designation()\n\t {\n\t \t$userId=$this->checklogin();\n\t \t$query=$this->ApiModel->get_all_designation($userId);\n\t \techo json_encode($query);\n\t }", "function creditcard_type_pulldown($selected = '', $fieldname = 'form[type]')\n {\n $html = '<select name=\"' . $fieldname . '\" style=\"font-family: Verdana\">';\n $html .= '<option value=\"visa\"';\n if ($selected == 'visa')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Visa</option>';\n $html .= '<option value=\"mc\"';\n if ($selected == 'mc')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Mastercard</option>';\n $html .= '<option value=\"amex\"';\n if ($selected == 'amex')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>American Express</option>';\n $html .= '<option value=\"disc\"';\n if ($selected == 'disc')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Discover</option>';\n $html .= '</select>';\n return $html;\n }", "function get_faculty_selections($con) {\n\t$facs = get_faculties($con);\n\t$sel = '<option value=\"\"></option>';\n\tforeach ($facs as $id => $name) {\n\t\t$sel .= '<option value=\"'.$id.'\">'.$name.'</option>';\n\t}\n\treturn $sel;\n}", "public function getDesignList(SearchCriteria $searchCriteria);", "function pdl_selector($uid,$current=\"\") {\n\n\t$o = '';\n\n\t// You can use anybody's Comanche layouts on this site that haven't been protected in some way\n\n\t$sql_extra = item_permissions_sql($uid);\n\n\t// By default order by title (therefore at this time pdl's need a unique title across this system), \n\t// though future work may allow categorisation\n\t// based on taxonomy terms\n\n\t$r = q(\"select title, mid from item where (item_restrict & %d) $sql_extra order by title\",\n\t\tintval(ITEM_PDL)\n\t);\n\n\t$arr = array('channel_id' => $uid, 'current' => $current, 'entries' => $r);\n\tcall_hooks('pdl_selector',$arr);\n\n\t$entries = $arr['entries'];\n\t$current = $arr['current'];\t\t\n \n\t$o .= \"<select name=\\\"pdl_select\\\" id=\\\"pdl_select\\\" size=\\\"1\\\" >\";\n\t$entries[] = array('title' => t('Default'), 'mid' => '');\n\tforeach($entries as $selection) {\n\t\t$selected = (($selection == $current) ? ' selected=\"selected\" ' : '');\n\t\t$o .= \"<option value=\\\"{$selection['mid']}\\\" $selected >{$selection['title']}</option>\";\n\t}\n\n\t$o .= '</select>';\n\treturn $o;\n}", "function fsf_cms_getStatsPages_dropDown()\n {\n $fsfcms_api_options = array();\n $fsfcms_api_options['apiFile'] = \"fsf.cms.getStatsPages.php\";\n\n $fsfcms_stats_pages_json = fsf_cms_accessAPI($fsfcms_api_options);\n $fsfcms_stats_pages = json_decode($fsfcms_stats_pages_json,TRUE);\n \n if(array_pop($fsfcms_stats_pages) == 200)\n {\n $fsfcms_statsPages_select .= \"<select name=\\\"statsPages\\\" onchange=\\\"self.location.href=this.options[this.selectedIndex].value;\\\">\";\n $fsfcms_statsPages_select .= \"<option value=\\\"\\\">SELECT AN OPTION...</option>\";\n\n foreach($fsfcms_stats_pages as $fsfcms_page_name => $fsfcms_page_slug)\n {\n $fsfcms_statsPages_select .= \"<option value=\\\"/statistics/\" . $fsfcms_page_slug . \"\\\">\" . strtoupper($fsfcms_page_name) . \"</option>\"; \n }\n $fsfcms_statsPages_select .= \"</select>\";\n }\n \n return $fsfcms_statsPages_select; \n }", "public function reportsDropdown(){\n $input = Input::get('option');\n $testCategory = TestCategory::find($input);\n $testTypes = $testCategory->testTypes();\n return Response::make($testTypes->get(['id','name']));\n }", "public function getSeasonSelect()\n\t{\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n \n\t\t$options = array(JHTML::_('select.option', 0, JText::_($this->getParam('seasons_text'))));\n \n $query->select('s.id AS value, s.name AS text');\n $query->from('#__sportsmanagement_season AS s');\n $query->where('s.published = 1');\n $query->order('s.name DESC');\n\n \n\t\t$db->setQuery($query);\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' <br><pre>'.print_r($query->dump(),true).'</pre>'),'Notice');\n \n\t\t$res = $db->loadObjectList();\n\t\tif ($res) {\n\t\t\t$options = array_merge($options, $res);\n\t\t}\n\t\t//return JHTML::_('select.genericlist', $options, 's', 'class=\"jlajaxmenu-select\" onchange=\"jlamnewproject('.$module->id.');\"', 'value', 'text', $this->getSeasonId());\n\t\treturn $options;\n\t}", "function getFenzuCombo_html($viewid='',$is_relate=false)\n\t{\n\t\tglobal $adb;\n\t\tglobal $app_strings;\n\t\tglobal $current_user;\n\t\t\n\t\t$public_condition = \" 1 \";\n\n\t\t$tabid = getTabid($this->Fenzumodule);\n\t\t$ssql = \"select ec_fenzu.cvid,ec_fenzu.viewname from ec_fenzu inner join ec_tab on ec_tab.name = ec_fenzu.entitytype\";\n\t\t$ssql .= \" where ec_tab.tabid=\".$tabid.\" and \".$public_condition;\n\t\t$result = $adb->getList($ssql);\n\t\t$shtml = array();\n\t\tforeach($result as $cvrow)\n\t\t{\n\t\t\t//all should be gotten via app_strings by dingjianting on 2007-04-24 for Fenzu problem\n\n\t\t\tif($cvrow['viewname'] == $app_strings['All'])\n\t\t\t{\n\t\t\t\t$cvrow['viewname'] = $app_strings['COMBO_ALL'];\n\t\t\t}\n\n\n\t\t\tif(!$is_relate) {\n\t\t\t\tif($cvrow['setdefault'] == 1 && $viewid =='')\n\t\t\t\t{\n\t\t\t\t\t\t\t $shtml .= \"<option selected value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t\t\t\t $this->setdefaultviewid = $cvrow['cvid'];\n\t\t\t\t}\n\t\t\t\telseif($cvrow['cvid'] == $viewid)\n\t\t\t\t{\n\t\t\t\t\t$shtml .= \"<option selected value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t\t$this->setdefaultviewid = $cvrow['cvid'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$shtml .= \"<option value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$shtml .= \"<option value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t}\n\t\t\t//$shtml[$cvrow['cvid']] = $cvrow['viewname'];\n\t\t}\n\t\treturn $shtml;\n\t}", "function getEmployeesListCtrl() {\n $accounts = getEmployeesList();\n echo \"<select class='form-control' required name='id_comptes'>\";\n foreach ($accounts as $a) {\n if ($id === $a['id_compte']) {\n echo \"<option value='\".$a[\"id_compte\"].\"' selected>\".$a[\"nom\"].\" \".$a[\"prenom\"].\"</option>\";\n } else {\n echo \"<option value='\".$a[\"id_compte\"].\"'>\".$a[\"nom\"].\" \".$a[\"prenom\"].\"</option>\";\n }\n }\n echo \"</select>\";\n}", "function display_domain_dropdown ($varname = \"domain_name\") {\n\n\tprint \"<SELECT name=\" . $varname . \">\n\t<option value=NONE>Please pick one</option>\\n\";\n\n\t$domains = &get_domain_array( $GLOBALS['dsn'] );\n\t\n\tfor ( $i = 0 ; $i < sizeof($domains) ; $i++ ) {\n\t\tprint \"<OPTION>\" . $domains[$i] . \"</OPTION>\\n\";\n\t}\n\n\tprint \"\t\n\t</SELECT>\";\n}", "function getCity()\n\t\t{\n\t\t\t$cities = $this->manage_content->getValue('city','city_name');\n\t\t\tforeach($cities as $city)\n\t\t\t{\n\t\t\t\techo '<option value=\"'.$city['city_name'].'\">'.$city['city_name'].'</option>';\n\t\t\t}\n\t\t}", "function get_predefined_item_dropdown($args = '') {\r\n global $wpi_settings;\r\n\r\n if (empty($wpi_settings['predefined_services'])) {\r\n return;\r\n }\r\n\r\n\r\n //** Extract passed args and load defaults */\r\n extract(wp_parse_args($args, array(\r\n 'input_name' => 'wpi[itemized_item][]',\r\n 'input_class' => 'wpi_itemized_item',\r\n 'input_id' => 'wpi_itemized_item',\r\n 'input_style' => ''\r\n )), EXTR_SKIP);\r\n\r\n\r\n $return[] = \"<select name='{$input_name}' class='{$input_class}' id='{$input_id}' style='{$input_style}' >\";\r\n $return[] = '<option value=\"\"></option>';\r\n\r\n foreach ($wpi_settings['predefined_services'] as $itemized_item) {\r\n\r\n\r\n if (empty($itemized_item['name'])) {\r\n $empty_rows[] = true;\r\n continue;\r\n }\r\n\r\n $return[] = \"<option value='\" . esc_attr($itemized_item['name']) . \"' tax='{$itemized_item['tax']}' price='{$itemized_item['price']}'>{$itemized_item['name']}</option>\";\r\n }\r\n $return[] = '</select>';\r\n\r\n\r\n if (count($empty_rows) == count($wpi_settings['predefined_services'])) {\r\n return false;\r\n }\r\n\r\n return implode('', $return);\r\n }", "function DepartmentDropDown($link){\r\n \r\n $query = \"SELECT * FROM Department\";\r\n $result = mysqli_query($link, $query);\r\n \r\n if (mysqli_num_rows($result)){\r\n while($row = mysqli_fetch_assoc($result)) {\r\n echo ' <option value=' . $row[\"DepartmentID\"] . '>' . $row[\"Department\"] . '</option>';\r\n \r\n }\r\n } else {\r\n echo \"No results.\";\r\n }\r\n}", "public function getInfoDropDownList()\n {\n \n try{\n if(!$this->pdo)throw new PDOException();\n $collection = [];\n $sth = $this->pdo->query(\"SELECT id, name FROM brands\"); \n $collection ['brands'] = $this->getFetchAccoss($sth);\n $sth = $this->pdo->query(\"SELECT id, name FROM models\"); \n $collection ['models'] = $this->getFetchAccoss($sth);\n $sth = $this->pdo->query(\"SELECT id, name FROM colors\"); \n $collection ['colors'] = $this->getFetchAccoss($sth);\n $collection ['sucess'] = 1;\n return json_encode($collection);\n }catch(PDOException $err){\n file_put_contents('errors.txt', $err->getMessage(), FILE_APPEND); \n $err_arr = ['sucess'=>0];\n return json_encode($err_arr);\n }\n }", "public function buildSelect()\n {\n $this->query->select(\"DISTINCT(p.id),p.*,\n u.first_name as owner_first_name,u.last_name as owner_last_name,\n c.id as company_id,c.name as company_name,IF(p.id=d2.primary_contact_id, 1, 0) AS is_primary_contact\");\n\n $this->query->from(\"#__people AS p\");\n $this->query->leftJoin(\"#__people_cf as cf ON cf.person_id = p.id\");\n $this->query->leftJoin(\"#__users AS u ON u.id = p.owner_id\");\n $this->query->leftJoin(\"#__companies AS c ON c.id = p.company_id\");\n $this->query->leftJoin(\"#__deals AS d ON d.id = cf.association_id AND cf.association_type = 'deal'\");\n $this->query->leftJoin(\"#__deals AS d2 ON d2.primary_contact_id = p.id\");\n\n }", "function outputCitiesList() {\r\n\t$cities = new CityCollection();\r\n\t$cities->loadCollection();\r\n \r\n\t$result = $cities->getArray();\r\n \r\n\tfor($i=0;$i<$cities->getCount();$i++){\r\n\t\techo '<option value=\"'. $result[$i]->getCityCode(). '\">' . $result[$i]->getAsciiName() . '</option>';\r\n\t}\r\n}", "function erp_hr_get_departments_dropdown( $selected = '' ) {\n $departments = erp_hr_get_departments_dropdown_raw();\n $dropdown = '';\n if ( $departments ) {\n foreach ($departments as $key => $title) {\n $dropdown .= sprintf( \"<option value='%s'%s>%s</option>\\n\", $key, selected( $selected, $key, false ), $title );\n }\n }\n\n return $dropdown;\n}", "public function render()\n {\n return view('filament::components.dropdown');\n }", "function getFieldCountryOfCitizenship($val = null){\n\t\tinclude('axcelerate_link_array_list.php');\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_CountryofCitizenID');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_CountryofCitizenID');\n\t\t$tooltip = setToolTipNotification(\"CountryofCitizenID\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('cit_country') === 'cit_country' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><select name='CountryofCitizenID' id='CountryofCitizenID' class='srms-field \".(get_axl_req_fields('cit_country') === 'cit_country' ? 'input-select-required' : '').\"'><option value=''>-- Select Country --</option>\";\n\t\t\tforeach ($sacc_countries as $key => $value) {\n\t\t\t\tif(isCountryDisabled($key, 'Demographics')){\n\t\t\t\t\t$form_ret .= \"<option value='\".$key.\"' \".($val == $key ? 'selected' : '').\">\".$value.\"</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$form_ret .= \"</select></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function getcboauditor() {\n \n $procedure = \"call usp_at_audi_getcboauditor()\";\n\t\t$query = $this->db-> query($procedure);\n \n if ($query->num_rows() > 0) {\n\n $listas = '<option value=\"\" selected=\"selected\">::Elegir</option>';\n \n foreach ($query->result() as $row)\n {\n $listas .= '<option value=\"'.$row->IDAUDI.'\">'.$row->DESCRIPAUDI.'</option>'; \n }\n return $listas;\n }{\n return false;\n }\t\n }", "public function csstoolkit_options_callback($dc)\r\n\t{\r\n\t\t$objCssToolkits = CssToolkitModel::findByPid($dc->id);\r\n\t\twhile($objCssToolkits && $objCssToolkits->next()){\r\n\t\t\t$output[$objCssToolkits->id] = $objCssToolkits->name;\r\n\t\t}\r\n\t\treturn $output;\r\n\t}", "public function companylist() {\r\n $companies = $this->model->getCompanies();\r\n return $this->view('company/companylist', $companies);\r\n }", "function getBrandSelect()\n\t{\n\t\tglobal $con;\n\t\t\t\n\t\t$get_brands = \"select * from brands\";\n\t\t$run_brands = mysqli_query($con, $get_brands);\n\t\twhile ($row = mysqli_fetch_array($run_brands)){\n\t\t\t$id = $row['brand_id'];\n\t\t\t$title = $row['brand_title'];\n\n\t\t\techo \"<option value='$id'>$title</option>\";\n\t\t}\n\t}", "public function coconutComboBoxStart_long($name) {\necho \"<select name='$name' class='comboBox'>\";\n}", "private function getMenuCombobox($active_category = 'x',$forparent = 0){\n $markup = '\n <select name=\"id_menucategory\" id=\"id_menucategory\" class=\"ui-autocomplete-input ui-widget-content ui-corner-all\">';\n if($forparent == '0'){\n $markup .= '<option value=\"0\">'.$this->text('without_category').'</option>';\n }\n $markup .= $this->getMenucategories($active_category,$forparent);\n $markup .= '</select>';\n return $markup;\n }", "public function dropdown()\n\t{\n\t\t$fId = Input::get('facility_id');\n\t\t$checkId = Input::get('check_id');\n $facility = Facility::find($fId);\n return $facility->points($checkId);\n }", "function dropDownto()\r\n {\r\n $queryArray = array();\r\n $html = \"\";\r\n\r\n $mysqli = $this->conn;\r\n $query = \"SELECT ID,lakeHostGroupName FROM lakehostgroup ORDER BY lakeHostGroupName ASC\";\r\n $stmt = $mysqli->query($query);\r\n\r\n /*\r\n // Prepared statement, stage 1: prepare\r\n if (!($stmt = $mysqli->prepare(\"SELECT ?, ? FROM ? ORDER BY ?))) {\r\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\r\n }\r\n\r\n // Prepared statement, stage 2: bind and execute\r\n if (!($stmt->bind_param('ssss', , , ,))) {\r\n echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n }\r\n if (!$stmt->execute()) {\r\n echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n }\r\n */\r\n\r\n if ($stmt->num_rows > 0) {\r\n while ($row = $stmt->fetch_assoc()) {\r\n $queryArrayID = $row['ID'];\r\n $queryArrayField = $row['lakeHostGroupName'];\r\n $queryArray[$queryArrayID] = $queryArrayField;\r\n }\r\n }\r\n $html .= \"<select id= groupID required>\";\r\n foreach ($queryArray as $key => $value) {\r\n $html .= \"<option value=$key>$value</option>\\n\";\r\n }\r\n return $html;\r\n }", "function getServiceTypesTree_selectBox($select_name, $current_servicetype_id)\n {\n //echo '$current_category_id = '.$current_category_id;\n $service_type_array = $this->getServiceTypeTree_array(0, 0);\n $level = 1;\n $rs = '';\n $rs .= '<div id=\"parent_id_div\">';\n $rs .= '<select name=\"' . $select_name . '\">';\n $rs .= '<option value=\"0\">..</option>';\n\n $rs .= $this->getServiceTypesTree_optionItems($service_type_array, $current_servicetype_id);\n $rs .= '</select>';\n $rs .= '</div>';\n return $rs;\n }", "function getLodDropDown($PROJECT, $FORM_ITEM_NAME, $MULTIPLE_SELECT) {\n $SCM_SCRIPTS_DIR = \"/opt/build/scm/scripts/buildServer/groovy\";\n\t//echo $SCM_SCRIPTS_DIR;\n $SOURCE_INFO = \"source /opt/cvbuild/.bash_profile 2>&1\";\n // get an array for each branch\n $lods = array();\n// $getLodCmd = $SOURCE_INFO . ' 2>&1 && cd ' .$SCM_SCRIPTS_DIR . ' 2>&1 && bin/eval.sh groovy scm.groovy -c GetLodsForProject --log_level=' . $LOG_LEVEL . ' --project=' . $PROJECT . ' --path_to_project=' . $PATH_TO_PROJECT; \n $getLodCmd = 'bash -c \"'. $SOURCE_INFO . ' 2>&1 && cd ' .$SCM_SCRIPTS_DIR . ' 2>&1 && bin/eval.sh groovy scm.groovy -c GetLodsForProject --log_level=INFO --project=' . $PROJECT . ' --path_to_project=/opt/checkouts\"'; \n// $getLodCmd = 'bash -c \"'. $SOURCE_INFO . ' 2>&1 && cd ' .$SCM_SCRIPTS_DIR . ' 2>&1 && bin/eval.sh groovy scm.groovy -c GetTagsForProject --log_level=INFO --project=' . $PROJECT . ' --path_to_project=/opt/checkouts\"';\n exec($getLodCmd . ' | egrep -e \"^br_*\"', $lods);\n// exec($getLodCmd . ' | egrep -e \"^r_*\"', $lods);\n usort($lods, 'lodWLevelCompare');\n $lods = array_reverse($lods);\n\n if($MULTIPLE_SELECT == 'true') {\n $output = '<select name=\"' . $FORM_ITEM_NAME . '\" ' . 'multiple=\"multiple\" size=\"5\">';\n }\n else {\n $output = '<select name=\"' . $FORM_ITEM_NAME . '\">';\n }\n foreach ($lods as $lod) {\n $lod = str_replace('/','',$lod);\n $output = $output . '<option value=\"' . $lod . '\">' . $lod . '</option>';\n }\n $output = $output. '</select>';\n return $output;\n}", "public function brandForm(){\n $table = \"brands\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $brand){\n echo('<option value=\"'.$brand[\"brand_id\"].'\">'.$brand[\"brand_name\"].'</option>');\n }\n\n\n }", "public function company()\n {\n return $this->business();\n }", "public function getComponente()\n {\n $retorno = '<div class=\"input-group\">\n<span class=\"input-group-addon\">' . $this->getLabel() . '</span>\n\n<div class=\"list-group\">\n<select name=\"'. $this->getNome() .'\">\n<option value=\"\">Selecione</option>\n';\n\n if (is_array($this->getArrValores()))\n {\n foreach ($this->getArrValores() as $key => $value) \n {\n $retorno .= '<option value=\"'. $key .'\" '. ( $this->getValor() == $key ? 'selected=\"selected\"' : '' ) .'>';\n $retorno .= $value;\n $retorno .= '</option>';\n }\n }\n\n $retorno .= '</select></div>';\n $retorno .= '</div>';\n\n return $retorno;\n }", "public function bitorondropdown(){\n\t\tif(!empty($_REQUEST['id'])){\n\t\t\t$this->layout='ajax';\n\t\t\t//$this->loadModel('Maincategory');\n\t\t\t$childCatIds = $this->Childcategory->find('list',array('fields'=>array('id','name'),\n\t\t\t\t'conditions' =>array('maincategory_id' =>$_REQUEST['id'])));\n\n\t\t\t$this->set(compact('childCatIds'));\n\t\t}\n\n\t}", "public function getCompaniesForSelect()\n {\n return Company::whereNull('deleted_at')->pluck('name', 'id');\n }", "static function getSelect($con,$val=false) {\n\t\t\tglobal $contents,$parts;\n\t\t\t$g = $parts[\"bills\"][\"settings\"];\n\t\t\t$out = \"<select name='$con'><option value=''>-</option>\";\n\t\t\t$val = @$g[$con];\n\t\t\tif ($con==\"minutes\")\n\t\t\t\treturn \"<input name='$con' type='number' value='$val'>\";\n\t\t\tif ($con==\"dropable\")\n\t\t\t\treturn \"<input name='$con' type='radio' value='0' \".($val?\"\":\"checked\").\"> Kapalı\n\t\t\t\t\t\t<input name='$con' type='radio' value='1' \".($val?\"checked\":\"\").\"> Açık\";\n\t\t\tswitch ($con) {\n\t\t\t\tcase \"connect\":\n\t\t\t\t\tforeach($contents as $k => $d)\n\t\t\t\t\t\t$out .= \"<option \".($val==$k?\"selected\":\"\").\" value='$k'>$d[name]</option>\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: \n\t\t\t\t\t$db = $g[\"connect\"];\n\t\t\t\t\tif (isset($contents[$db][\"parts\"])) \n\t\t\t\t\tforeach($contents[$db][\"parts\"] as $k => $d)\n\t\t\t\t\t\t$out .= \"<option \".($val==$k?\"selected\":\"\").\" value='$k'>\n\t\t\t\t\t\t\t\t\".@array_shift(explode(\"||\",$d[\"name\"])).\"</option>\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$out .= \"</select>\";\n\t\t\treturn $out;\n\t\t}", "public function dropdown_departemen()\n {\n //Query untuk mengambil data departemen dan diurutkan berdasarkan nama departemen\n $sql = \"SELECT * FROM departemen ORDER BY nama_dept\";\n $query = $this->db->query($sql);\n\n //Value default pada dropdown\n $value[''] = '-- CHOOSE --';\n //Menaruh data departemen ke dalam dropdown, value yang akan diambil adalah value id_dept\n foreach ($query->result() as $row) {\n $value[$row->id_dept] = $row->nama_dept;\n }\n return $value;\n }", "public static function getMealCompanyNames()\n {\n\n $search_names_query = \"SELECT DISTINCT companyName FROM TiffinHouseDb.Dealer\";\n\n try {\n $menu = new Menu();\n self::$db->query($search_names_query);\n self::$db->execute();\n $menu = self::$db->resultSetByArr();\n return $menu;\n } catch (PDOException $err) {\n echo \"Error : \" . $err->getMessage();\n }\n }", "public function allDesignation(){\n\n $all_designation=$this->settings->all_designation();\n return response()->json([\n 'all_designation' => $all_designation,\n ], $this->successStatus);\n\n }", "public function getWorkflowSelect();", "private function returnCampaignSelector($campaigns, $current_campaign, $name)\n\t{\n\t\tif ( !empty($campaigns))\n\t\t{\n\t\t\t?>\n\t\t\t<select name=\"<?php echo $name;?>\" id=\"<?php echo $name;?>\" class=\"GR_select\">\n\t\t\t\t<?php\n\t\t\t\tforeach ($campaigns as $campaign)\n\t\t\t\t{\n\t\t\t\t\techo '<option value=\"' . $campaign->campaignId . '\" id=\"' . $campaign->campaignId . '\"', $current_campaign == $campaign->campaignId ? ' selected=\"selected\"' : '', '>', $campaign->name, '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t<?php }\n\t\telse\n\t\t{\n\t\t\t_e('No Campaigns.', 'Gr_Integration');\n\t\t}\n\t}", "public function getMajorCategory(){\n\n //get all the education where parent is equal to 0 (parent education major)\n $education_major_cateogries = Education::where('parent',0)->get();\n $return_html = \"<option value='0'>None</option>\";\n\n //loop through each of the major category to render the required html\n foreach($education_major_cateogries as $education_major_category){\n $return_html .= '<option value=\"'.$education_major_category->id .'\">'.ucwords($education_major_category->name).'</option>';\n }\n\n //return response back to the browser\n return response()->json(array('status'=>'success','result'=>$return_html),200);\n }", "public function getOptions()\n\t{\n\t\t// Set the options\n\t\t$options = array(\n\t\t\tJHtml::_('select.option', '', JText::_('JNONE')),\n\t\t\tJHtml::_('select.option', 'Arts > Design', 'Arts &gt; Design'),\n\t\t\tJHtml::_('select.option', 'Arts > Fashion & Beauty', 'Arts &gt; Fashion &amp; Beauty'),\n\t\t\tJHtml::_('select.option', 'Arts > Food', 'Arts &gt; Food'),\n\t\t\tJHtml::_('select.option', 'Arts > Literature', 'Arts &gt; Literature'),\n\t\t\tJHtml::_('select.option', 'Arts > Performing Arts', 'Arts &gt; Performing Arts'),\n\t\t\tJHtml::_('select.option', 'Arts > Visual Arts', 'Arts &gt; Visual Arts'),\n\t\t\tJHtml::_('select.option', 'Business', 'Business'),\n\t\t\tJHtml::_('select.option', 'Business > Business News', 'Business &gt; Business News'),\n\t\t\tJHtml::_('select.option', 'Business > Careers', 'Business &gt; Careers'),\n\t\t\tJHtml::_('select.option', 'Business > Investing', 'Business &gt; Investing'),\n\t\t\tJHtml::_('select.option', 'Business > Management & Marketing', 'Business &gt; Management &amp; Marketing'),\n\t\t\tJHtml::_('select.option', 'Business > Shopping', 'Business &gt; Shopping'),\n\t\t\tJHtml::_('select.option', 'Comedy', 'Comedy'),\n\t\t\tJHtml::_('select.option', 'Education', 'Education'),\n\t\t\tJHtml::_('select.option', 'Education > Education Technology', 'Education &gt; Education Technology'),\n\t\t\tJHtml::_('select.option', 'Education > Higher Education', 'Education &gt; Higher Education'),\n\t\t\tJHtml::_('select.option', 'Education > K-12', 'Education &gt; K-12'),\n\t\t\tJHtml::_('select.option', 'Education > Language Courses', 'Education &gt; Language Courses'),\n\t\t\tJHtml::_('select.option', 'Education > Training', 'Education &gt; Training'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies', 'Games &amp; Hobbies'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Automotive', 'Games &amp; Hobbies &gt; Automotive'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Aviation', 'Games &amp; Hobbies &gt; Aviation'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Hobbies', 'Games &amp; Hobbies &gt; Hobbies'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Other Games', 'Games &amp; Hobbies &gt; Other Games'),\n\t\t\tJHtml::_('select.option', 'Games & Hobbies > Video Games', 'Games &amp; Hobbies &gt; Video Games'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations', 'Government &amp; Organizations'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations > Local', 'Government &amp; Organizations &gt; Local'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations > National', 'Government &amp; Organizations &gt; National'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations > Non-Profit', 'Government &amp; Organizations &gt; Non-Profit'),\n\t\t\tJHtml::_('select.option', 'Government & Organizations > Regional', 'Government &amp; Organizations &gt; Regional'),\n\t\t\tJHtml::_('select.option', 'Health', 'Health'),\n\t\t\tJHtml::_('select.option', 'Health > Alternative Health', 'Health &gt; Alternative Health'),\n\t\t\tJHtml::_('select.option', 'Health > Fitness & Nutrition', 'Health &gt; Fitness &amp; Nutrition'),\n\t\t\tJHtml::_('select.option', 'Health > Self-Help', 'Health &gt; Self-Help'),\n\t\t\tJHtml::_('select.option', 'Health > Sexuality', 'Health &gt; Sexuality'),\n\t\t\tJHtml::_('select.option', 'Kids & Family', 'Kids &amp; Family'),\n\t\t\tJHtml::_('select.option', 'Music', 'Music'),\n\t\t\tJHtml::_('select.option', 'News & Politics', 'News &amp; Politics'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality', 'Religion &amp; Spirituality'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Buddhism', 'Religion &amp; Spirituality &gt; Buddhism'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Christianity', 'Religion &amp; Spirituality &gt; Christianity'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Hinduism', 'Religion &amp; Spirituality &gt; Hinduism'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Islam', 'Religion &amp; Spirituality &gt; Islam'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Judaism', 'Religion &amp; Spirituality &gt; Judaism'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Other', 'Religion &amp; Spirituality &gt; Other'),\n\t\t\tJHtml::_('select.option', 'Religion & Spirituality > Spirituality', 'Religion &amp; Spirituality &gt; Spirituality'),\n\t\t\tJHtml::_('select.option', 'Science & Medicine', 'Science &amp; Medicine'),\n\t\t\tJHtml::_('select.option', 'Science & Medicine > Medicine', 'Science &amp; Medicine &gt; Medicine'),\n\t\t\tJHtml::_('select.option', 'Science & Medicine > Natural Sciences', 'Science &amp; Medicine &gt; Natural Sciences'),\n\t\t\tJHtml::_('select.option', 'Science & Medicine > Social Sciences', 'Science &amp; Medicine &gt; Social Sciences'),\n\t\t\tJHtml::_('select.option', 'Society & Culture', 'Society &amp; Culture'),\n\t\t\tJHtml::_('select.option', 'Society & Culture > History', 'Society &amp; Culture &gt; History'),\n\t\t\tJHtml::_('select.option', 'Society & Culture > Personal Journals', 'Society &amp; Culture &gt; Personal Journals'),\n\t\t\tJHtml::_('select.option', 'Society & Culture > Philosophy', 'Society &amp; Culture &gt; Philosophy'),\n\t\t\tJHtml::_('select.option', 'Society & Culture > Places & Travel', 'Society &amp; Culture &gt; Places &amp; Travel'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation', 'Sports &amp; Recreation'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation > Amateur', 'Sports &amp; Recreation &gt; Amateur'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation > College & High School', 'Sports &amp; Recreation &gt; College &amp; High School'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation > Outdoor', 'Sports &amp; Recreation &gt; Outdoor'),\n\t\t\tJHtml::_('select.option', 'Sports & Recreation > Professional', 'Sports &amp; Recreation &gt; Professional'),\n\t\t\tJHtml::_('select.option', 'Technology', 'Technology'),\n\t\t\tJHtml::_('select.option', 'Technology > Gadgets', 'Technology &gt; Gadgets'),\n\t\t\tJHtml::_('select.option', 'Technology > Tech News', 'Technology &gt; Tech News'),\n\t\t\tJHtml::_('select.option', 'Technology > Podcasting', 'Technology &gt; Podcasting'),\n\t\t\tJHtml::_('select.option', 'Technology > Software How-To', 'Technology &gt; Software How-To'),\n\t\t\tJHtml::_('select.option', 'TV & Film', 'TV &amp; Film')\n\t\t);\n\n\t\treturn $options;\n\t}", "function cah_news_get_dept_option() {\r\n return get_option('cah_news_display_dept2');\r\n}", "public function client_option()\n {\n $this->load->model('m_contacts');\n $resultat = $this->m_contacts->liste_option();\n $results = json_decode(json_encode($resultat), true);\n\n echo \"<option value='' selected='selected'>(choisissez)</option>\";\n foreach ($results as $row) {\n echo \"<option value='\" . $row['id'] . \"'>\" . $row['value'] . \"</option>\";\n }\n }", "function part139339_c_facilitycombobox_limitedtomu($suppliedid, $archived, $nameofinput, $showcombobox, $default) {\r\n\t// $archived\t\t, do you want to list all menu items, or just the archived ones;\r\n\t// $nameofinout\t\t, what is the name of the select box that 'could' be ceated by this function;\r\n\t// $showcombobox\t, Do you want to show the combo box select input style or just the text without the input box;\r\n\t// $default\t\t\t, What is the default group to display in the combobox when it is displayed;\r\n\r\n\t// Examples\r\n\t\r\n\t//\t$adataselect[$i]($objarray[$adatafieldid[$i]], \"all\", $adatafield[$i], \"hide\", \"\");\r\n\t// This example will only show one record, and it will not be in a combobox input box, but rather be displayed as text.\r\n\t\r\n\t\r\n\t$sql\t= \"\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Define the sql variable, just in case\r\n\t$nsql \t= \"\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Define the nsql variable, just in case\r\n\t\r\n\t$sql = \"SELECT * FROM tbl_139_339_sub_c_f \r\n\t\t\tWHERE 139339_f_rwy_yn != 2 AND 139339_f_rwy_yn != 3 \";\r\n\t\t\t\t\t\t\t\t\t// start the SQL Statement with the common syntax\r\n\r\n\t\r\n\t$objconn_support = mysqli_connect($GLOBALS['hostdomain'], $GLOBALS['hostusername'], $GLOBALS['passwordofdatabase'], $GLOBALS['nameofdatabase']);\r\n\t\r\n\tif (mysqli_connect_errno()) {\r\n\t\t\tprintf(\"connect failed: %s\\n\", mysqli_connect_error());\r\n\t\t\texit();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$objrs_support = mysqli_query($objconn_support, $sql);\r\n\t\t\tif ($objrs_support) {\r\n\t\t\t\t\t$number_of_rows = mysqli_num_rows($objrs_support);\r\n\t\t\t\t\t//printf(\"result set has %d rows. \\n\", $number_of_rows);\r\n\t\t\t\t\tif ($showcombobox==\"show\") {\r\n\t\t\t\t\t\t\t?>\r\n\t<SELECT class=\"Commonfieldbox\" name=\"<?php echo $nameofinput?>\" ID=\"<?php echo $nameofinput?>\">\r\n\t\t<option value=\"all\">All Surfaces</option>\r\n\t\t\t\t\t<?php \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\twhile ($objfields = mysqli_fetch_array($objrs_support, MYSQLI_ASSOC)) {\r\n\t\t\t\t\t\t\t$tmpsuppliedid \t\t= $objfields['139339_f_id'];\r\n\t\t\t\t\t\t\t$tmpsuppliedname \t= $objfields['139339_f_name'];\r\n\t\t\t\t\t\t\t$tmpsuppliedarch\t= $objfields['139339_f_archived_yn'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($showcombobox==\"show\") {\r\n\t\t\t\t\t\t\t\t?>\r\n\t\t<option \r\n\t\t\t\t\t\t\t\t<?php \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif ($suppliedid = \"all\") {\r\n\t\t\t\t\t\t\t\t\t$intsuppliedid\t= (double) $default;\r\n\t\t\t\t\t\t\t\t\tif ($tmpsuppliedid == $intsuppliedid) {\r\n\t\t\t\t\t\t\t\t\t\t\tif ($showcombobox==\"show\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\tSELECTED\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php \r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t// There is no user specified so we dont need to set a defualt value\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif ($showcombobox==\"show\") {\r\n\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\tvalue=\"<?php echo $tmpsuppliedid;?>\"><?php echo $tmpsuppliedname;?></option>\r\n\t\t\t\t\t\t\t\t\t\t<?php \r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t<?php echo $tmpsuppliedname?>\r\n\t\t\t\t\t\t\t\t\t\t<?php \r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\t// End of while loop\r\n\t\t\t\t\t\t\t\tmysqli_free_result($objrs_support);\r\n\t\t\t\t\t\t\t\tmysqli_close($objconn_support);\r\n\t\t\t\t\t\t\t\tif ($showcombobox==\"show\") {\r\n\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t</SELECT>\r\n\t\t\t\t\t\t\t\t\t\t<?php \r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t// end of Res Record Object\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\treturn \t$tmpsuppliedname;\t\r\n\t\t\t\t\r\n\t}", "function ve_get_header_navigation() {\n?>\n<ul class=\"nav navbar-nav\">\n\t<li><a href=\"<?php echo home_url() ?>\">Front page <span class=\"sr-only\">(current)</span></a></li>\n\t<li class=\"dropdown\">\n\t\t<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Companies <span class=\"caret\"></span></a>\n\t\t<ul class=\"dropdown-menu purple\">\n\t\t\t<?php ve_get_company_navigation() ?>\n\t\t</ul>\n\t<li class=\"dropdown\">\n\t <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Partnership <span class=\"caret\"></span></a>\n\t <ul class=\"dropdown-menu turquoise\">\n\t\t<?php ve_get_group_of_companies_navigation() ?>\n\t </ul>\n\t</li>\n</ul>\n<?php\n}" ]
[ "0.70443285", "0.69775075", "0.69775075", "0.6830307", "0.6693424", "0.6561858", "0.6519874", "0.65164685", "0.62691575", "0.62632024", "0.6256109", "0.6213755", "0.6210435", "0.61857384", "0.61231995", "0.61097354", "0.6105037", "0.6052006", "0.60503477", "0.5964083", "0.5946406", "0.5941338", "0.59343463", "0.59288484", "0.59264445", "0.5925606", "0.59184706", "0.59079355", "0.5861485", "0.58373505", "0.58213013", "0.58166784", "0.5802418", "0.5778978", "0.5769885", "0.5757812", "0.57262206", "0.5721885", "0.57200354", "0.57073146", "0.57064384", "0.5687362", "0.5686905", "0.56781304", "0.56751776", "0.56734633", "0.5659083", "0.5651848", "0.56511796", "0.5646449", "0.5642627", "0.56347424", "0.56347424", "0.56336963", "0.5632643", "0.5626171", "0.56251216", "0.5612724", "0.5609254", "0.5608636", "0.56054074", "0.5604541", "0.55986273", "0.55858517", "0.55757684", "0.5569137", "0.5568934", "0.55630076", "0.55445826", "0.5534393", "0.55325544", "0.5532196", "0.55198246", "0.55168974", "0.5511378", "0.5509244", "0.5501146", "0.5500744", "0.54938716", "0.54750454", "0.5472837", "0.5471109", "0.5468088", "0.5467174", "0.54571575", "0.5456007", "0.5454197", "0.544581", "0.54362905", "0.541604", "0.54151815", "0.541126", "0.53963", "0.53960323", "0.538817", "0.53814703", "0.53790975", "0.5374994", "0.5374198", "0.53710276" ]
0.6937162
3
Run the database seeds.
public function run() { /** @var \Illuminate\Database\Eloquent\Collection $users */ $users = User::all(); $faker = \Faker\Factory::create(); $posts = Post::all(); $posts->each( function (Post $post) use($faker, $users) { for($i = 0; $i < 5; $i++) { $post->comments()->save(new Comment([ 'user_id' => $users->random()->id, 'comment' => $faker->sentence, ])); } }); }
{ "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\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 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 // $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' => 'simpleadressemail@mail.com', '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'=> \"admin@admin.com\"\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' => 'admin@petstore.com',\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 // 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 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 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' => 'prosales@researchmobile.co',\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' => 'movil@researchmobile.co',\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'=>'test@yandex.ru'\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' => 'admin@yahoo.com',\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' => 'programmerlemar@gmail.com',\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' => 'qwerty@gmail.com',\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=> 'admin@example.com',\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' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\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' => 'admin@admin.com',\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 // \\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(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 $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' => 'ignacio@dh.com',\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' => 'admin@gmail.com',\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\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\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 = your.email@domain.com\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 // 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([\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 // $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 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 // $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 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\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 $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 {\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' => 'admin@gmail.com',\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 //\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(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\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 // $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\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' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\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 \\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 $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' => 'sovon.kucse@gmail.com']);\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'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->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' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\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 \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 //$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 $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 // $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 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 // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\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\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\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 $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 /*$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' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\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 $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 // $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' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\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'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\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 // $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'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', '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 }", "public function run()\n {\n \t$roles = DB::table('roles')->pluck('id');\n \t$sexes = DB::table('sexes')->pluck('id');\n \t$faker = \\Faker\\Factory::create();\n\n \tforeach (range(1,20) as $item) {\n \t\tDB::table('users')->insert([\n \t\t\t'role_id' => $faker->randomElement($roles),\n \t\t\t'sex_id' => $faker->randomElement($sexes),\n \t\t\t'name' => $faker->firstName . ' ' . $faker->lastName,\n \t\t\t'dob' => $faker->date,\n \t\t\t'bio' => $faker->text,\n \t\t\t'created_at' => now(),\n \t\t\t'updated_at' => now()\n \t\t]);\n \t} \n }" ]
[ "0.80130625", "0.79795986", "0.79764974", "0.79524934", "0.7950615", "0.79505694", "0.7944086", "0.7941758", "0.7938509", "0.79364634", "0.79335415", "0.7891555", "0.78802574", "0.78790486", "0.7878107", "0.7875447", "0.78703815", "0.7869534", "0.7851931", "0.7850407", "0.7840015", "0.78331256", "0.7826906", "0.78172284", "0.7807776", "0.78024083", "0.78023773", "0.7799859", "0.77994525", "0.77955437", "0.7790015", "0.77884936", "0.7786196", "0.77790534", "0.7776279", "0.7765613", "0.7761798", "0.7760838", "0.7760613", "0.7760611", "0.7759328", "0.7757682", "0.775591", "0.7752759", "0.774942", "0.7748997", "0.7745014", "0.7728245", "0.7727775", "0.77277344", "0.7716621", "0.77139914", "0.7713781", "0.77135956", "0.7713254", "0.7711222", "0.7710622", "0.7710614", "0.77104497", "0.77100515", "0.770471", "0.77039754", "0.7703702", "0.770327", "0.7702392", "0.7700962", "0.7700507", "0.7698413", "0.76974845", "0.7697178", "0.7696662", "0.76933604", "0.76916313", "0.76898587", "0.7689098", "0.76864886", "0.76862013", "0.76860833", "0.7685714", "0.7683389", "0.76831365", "0.7679125", "0.76774627", "0.767677", "0.7676274", "0.76719916", "0.76704824", "0.76679665", "0.7667335", "0.7667264", "0.76645994", "0.7662546", "0.76618296", "0.7660438", "0.76583356", "0.76564723", "0.76530147", "0.7651929", "0.7651548", "0.7651444", "0.76511025" ]
0.0
-1
if string contains nonalphanumeric characters, returns true
function containsBadCharacters($string) { if(preg_match('/[^a-z_\A-Z\0-9]/', $string)) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAlphanumeric()\n {\n return $this->matchesPattern('^[[:alnum:]]*$');\n }", "public static function is_alphanumeric(string $str): bool\n {\n if (self::$SUPPORT['mbstring'] === true) {\n return \\mb_ereg_match('^[[:alnum:]]*$', $str);\n }\n\n return self::str_matches_pattern($str, '^[[:alnum:]]*$');\n }", "function hasSpecialCharacters( $string ) {\n return preg_match('/[^a-zA-Z\\d]/', $string);\n}", "private function check_If_Alphanumeric($word){\r\n return ctype_alnum($word) ? true : false;\r\n }", "public function string_validation($string){\n\t\tif(!preg_match('/^[a-zA-Z ]*$/',$string)){ \n\t\t\treturn true;\n \t}\n }", "function onlyAlpha( $myString )\n{\n $myReturn = eregi('[^a-zA-Z]', $myString ) ;\n if ( $myReturn )\n { return FALSE ; }\n else\n { return TRUE ; }\n}", "public static function validate_string($text){\r\n if(!preg_match('/^[_a-zA-Z- ]*$/', $text)) return FALSE;\r\n return TRUE;\r\n \r\n }", "function alphaOnly($str){\n\tif(preg_match(\"/[^a-zA-Z]/\",$str))\n\t{return false;}else{return true;} //opposite logic from email?\n}", "function onlyAlphaNum( $myString )\n{\n $myReturn = eregi( '[^a-zA-Z0-9]', $myString ) ;\n if ( $myReturn )\n { return FALSE ; }\n else\n { return TRUE ; }\n}", "function mycheck_alphadash($str)\n{\n if (preg_match('/^[a-z0-9_-]+$/i', $str)) {\n return true;\n } else {\n return false;\n }\n}", "public static function validateMixedalphanumeric($str) \r\n\t{\r\n\t\treturn preg_match('/^[a-zA-Z0-9]+$/',$str);\r\n\t}", "function non_karakter($a){\n if(preg_match(\"/^[A-Za-z0-9 -]*$/\",$a)){\n return false;\n }\n return true;\n}", "function hasSpecial($str){\nreturn preg_match('/[\\'\\^\\.\\£\\$\\%\\&\\*\\(\\)\\}\\{\\@\\#\\~\\?\\>\\<\\>\\,\\|\\=\\_\\+\\¬\\-]/', $string);\n}", "static public function is_alphanum($value) {\n\t\treturn !preg_match(\"/[^a-zA-Z_-\\s0-9]/\",$value);\n\t}", "function verifyAlphaNum($testString) {\r\n return (preg_match (\"/^([[:alnum:]]|-|\\.| |\\'|&|;|#)+$/\", $testString));\r\n}", "public function isValidUsername($username)\n {\n return ctype_alnum($username);\n }", "function verifyAlphaNum ($testString) {\n\t// Check for letters, numbers and dash, period, space and single quote only. \n\treturn (preg_match (\"/^([[:alnum:]]|-|\\.| |')+$/\", $testString));\n}", "function isValidCharacter ($string)\n{\n return (preg_match ('/[^a-z0-9\\-_:\\.=;]/i', $string) ? 0 : 1);\n}", "public static function StringAlphaNumeric($string){\n\t\tif(empty($string)){\n\t\t\treturn false;\n\t\t}\n\t\t$chars = str_split($string);\n\t\tforeach($chars as $char){\n\t\t\tif(!self::StringAlpha($char) && !self::StringNumeric($char)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static function IsAlpha($str){\r\n\t\tif(strlen($str) == 0){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$strArray = str_split($str);\r\n\t\tforeach($strArray as $char){\r\n\t\t\t$isAlpha = ((ord($char) > 64) && (ord($char) < 91)) || ((ord($char) > 96) && (ord($char) < 123));\r\n\t\t\t$isEspecialChar = (ord($char) == 193) || (ord($char) == 201) ||\r\n\t\t\t\t(ord($char) == 205) || (ord($char) == 209) || (ord($char) == 211) ||\r\n\t\t\t\t(ord($char) == 218) || (ord($char) == 220) || (ord($char) == 225) ||\r\n\t\t\t\t(ord($char) == 233) || (ord($char) == 237) || (ord($char) == 241) ||\r\n\t\t\t\t(ord($char) == 243) || (ord($char) == 250) || (ord($char) == 252);\r\n\t\t\tif(!$isAlpha && !$isEspecialChar){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static function StringAlpha($string){\n\t\tif(empty($string)){\n\t\t\treturn false;\n\t\t}\n\t\t$chars = str_split($string);\n\t\tforeach($chars as $char){\n\t\t\tif(ord($char) < 64 || (ord($char) > 90 && ord($char) < 97) || ord($char) > 122){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private function process_alphanum($value)\n {\n return ! preg_match('/[^a-zA-Z0-9]/', $value);\n }", "function vAlphanumeric( $string )\r\n\t\t{\r\n\t\t\treturn ctype_alnum ( $string );\r\n\t\t\t\t\r\n\t\t}", "function isAlpha($string){\n\tif(preg_match(\"/\\d/\", $string)){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function alpha_space_only($str)\n {\n if (!preg_match(\"/^[a-zA-Z- ]+$/\",$str))\n {\n $this->form_validation->set_message('alpha_space_only', 'Le champs %s ne doit contenir que des lettres, tiret (-) et espace.');\n return FALSE;\n }\n else\n {\n return TRUE;\n }\n }", "function verifyAlphaNum ($testString)\n\t{\n return (preg_match(\"/^([[:alnum:]]|-|\\.| |')+$/\", $testString));\n }", "function isNaam($text){\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$text)){\n return \"Only letters and white space allowed\"; \n } else {\n return true;\n }\n}", "function check_string ($var) {\n \n if (preg_match ('/^([A-Za-z0-9 ]+)+$/', $var)) {\n return true;\n } else {\n return false;\n }\n}", "public function testInvalidAlphanumString()\n {\n $string = 'fda543*&^%$gfs';\n $this->assertFalse($this->alphanum->execute($string));\n }", "function is_alphanumeric($string, $min_length = 0, $max_length = 0){\r\n //$ret = _is_valid($string, $min_length, $max_length, \"[[:alnum:],.°&!%()'?¿=ÀÁÂÃÄÅÆÇÈÉ\\\\ÊËÌÍÎÏÐÑÒÓÔÕÖ\\'ØÙÚÛÜÝÞßàáâãäæçèéêëìíîïðñòóôõöø;:ùúûüýþ:@#*-///$[:space:]]+\");\r\n //return($ret);\r\n $string=clean($string);\r\n if($min_length!=0)\r\n {\r\n if(strlen($string)<$min_length)\r\n return (false);\r\n }\r\n if($max_length!=0)\r\n {\r\n if(strlen($string)>$max_length)\r\n return (false);\r\n }\r\n return(true);\r\n}", "function alphanumeric_space($str)\n\t{\t\t\n\t\t$this->CI->form_validation->set_message('alphanumeric_space', \"El campo %s debe contener una combinaci&oacute;n de caracteres alfanum&eacute;ricos y espacios.\");\n\t\treturn (bool) preg_match(\"/(^[a-zA-Z0-9\\xF1\\xD1\\sñÑ]+$)|^$/\", $str);\n\t}", "private function isAlphanumeric($field)\n {\n return preg_match('/^([a-zA-Z0-9\\-])+$/', $field) ? true : false;\n\n }", "function check_string ($var)\n{\n if (preg_match ('/^([A-Za-z0-9 ]+)+$/', $var))\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function isStringValidLogin($str) {\n if (preg_match(\"/^[a-zA-Z0-9]*$/\", $str)) {\n return true;\n }\n else {\n return false;\n }\n}", "function OnlyLatin($string) {\n return (empty($string) || preg_replace(\"/[\\d\\w]+/i\", '', $string) != '') ? FALSE : $string;\n}", "public function CharacterCheck($string=\"\"){\n\t\t if (preg_match('/[\\'^£$%&*0-9()}{@#~?><>,|=_+¬-]/', $string))\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}", "public function validate_name($str){\n $allowed = array(\".\", \"-\", \"_\", \" \"); // you can add here more value, you want to allow.\n if(ctype_alnum(str_replace($allowed, '', $str ))) {\n return true;\n }\n else{\n return false;\n }\n }", "static public function is_alpha($value) {\n\t\treturn !preg_match(\"/[^a-zA-Z_-\\s]/\",$value);\n\t}", "public static function isSafe($str): bool\n {\n return self::matchesPattern($str, \"/^[A-Za-z0-9_-\\s]/u\");\n }", "function alpha_space_only($str){\n\t\tif (!preg_match(\"/^[a-zA-Z ]+$/\",$str)){\n\t\t\t$this->form_validation->set_message('alpha_space_only', 'The %s field must contain only alphabets and space');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "function specialChar($password)\n{\n $specialChars = array('!', '@', '#', '$', '%', '^', '&', '*', '(', ')');\n foreach ($specialChars as $char) {\n if (strpos($password, $char) != 0) {\n return true;\n }\n }\n return false;\n}", "public function alpha_space_only($str)\n\t{\n\t\tif (!preg_match(\"/^[a-zA-Z ]+$/\",$str))\n\t\t{\n\t\t\t$this->form_validation->set_message('alpha_space_only', 'The %s field must contain only alphabets and space');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "function alpha_space_only($str) {\n if (!preg_match(\"/^[a-zA-Z ]+$/\",$str)) {\n $this->form_validation->set_message('alpha_space_only', 'The %s field must contain only alphabets and space');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function alpha_underscore($str)\n\t{\n\t\treturn ( ! preg_match(\"/^([a-z0-9_])+$/i\", $str)) ? FALSE : TRUE;\n\t}", "function validateAlphanum($value) {\n\tif(ereg(\"^[a-zA-Z0-9]+$\", $value, $regs)) {\n\t\techo \"true\";\n\t} else {\n\t\techo \"false\";\n\t}\n}", "function alpha_space_only($str)\n {\n if (!preg_match(\"/^[a-zA-Z ]+$/\",$str))\n {\n $this->form_validation->set_message('alpha_space_only', 'The %s field must contain only alphabets and space');\n return FALSE;\n }\n else\n {\n return TRUE;\n }\n }", "function alpha_space_only($str)\r\n {\r\n if (!preg_match(\"/^[a-zA-Z ]+$/\",$str))\r\n {\r\n $this->form_validation->set_message('alpha_space_only', 'The %s field must contain only alphabets and space');\r\n return FALSE;\r\n }\r\n else\r\n {\r\n return TRUE;\r\n }\r\n }", "function alpha_extra($str) {\n $this->CI->form_validation->set_message('alpha_extra', 'The %s may only contain alpha-numeric characters, spaces, periods, underscores & dashes.');\n return ( ! preg_match(\"/^([\\.\\s-a-z0-9_-])+$/i\", $str)) ? FALSE : TRUE;\n }", "function alpha_only_space($str)\r\n\t{\r\n\t\tif (!preg_match(\"/^([-a-z ])+$/i\", $str))\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('alpha_only_space', 'The %s field must contain only alphabets or spaces');\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t}", "function invalidGebruikersnaam($gebruikersnaam){\n $result = true;\n if (!preg_match(\"/^[a-zA-Z0-9]*$/\" ,$gebruikersnaam )){\n $result = true;\n }\n else{\n $result = false;\n }\n return $result;\n}", "static function isAlnum($str) {\n return ctype_alnum($str);\n }", "function isValid($username) {\n\treturn !preg_match('/[^a-z0-9.\\-_]/i', $username);\n}", "public static function alphanumeric($value)\n {\n $locale = setlocale(LC_CTYPE, 0);\n setlocale(LC_CTYPE, 'C');\n $valid = !ctype_alnum($value);\n setlocale(LC_CTYPE, $locale);\n\n return (!$valid) ? true : false;\n }", "function validateSpecial($string)\n\t\t{\n\t\t\t$specials=\tarray(\"!\",\"@\",\"#\",\"$\",\"%\",\"^\",\"&\",\"*\",\"(\",\")\",\"_\",\"-\",\"=\",\"+\",\"'\",\"\\\"\",\".\",\",\",\":\",\";\");\n\t\t\t$string\t=\ttrim($string);\n\t\t\t$count\t=\t0;\n\t\t\tfor($i=0;$i<strlen($string);$i++){\n\t\t\t\tif(in_array($string[$i],$specials)){\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($count>0){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function password_check($str)\n\t\t\t{\n\t\t\t\tif(preg_match('/[0-9]/', $str) && preg_match('/[a-zA-Z]/', $str))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t}", "private function hasSpecialChar(): bool\n {\n if (1 == preg_match('/[^\\p{Lu}\\p{Ll}\\d]/', $this->password)) {\n return true;\n }\n array_push($this->errorMessages, \"Special character missing.\");\n return false;\n }", "public function alpha_only_space($str)\n {\n if (!preg_match(\"/^([-a-z ])+$/i\", $str)) {\n $this->form_validation->set_message('alpha_only_space', 'The %s field must contain only alphabets or spaces');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "public function isAlpha()\n {\n return $this->matchesPattern('^[[:alpha:]]*$');\n }", "public static function is_alpha(string $str): bool\n {\n if (self::$SUPPORT['mbstring'] === true) {\n return \\mb_ereg_match('^[[:alpha:]]*$', $str);\n }\n\n return self::str_matches_pattern($str, '^[[:alpha:]]*$');\n }", "static function isAlpha($str) {\n return ctype_alpha($str);\n }", "public static function isVerySafe($str): bool\n {\n return self::matchesPattern($str, \"/^[A-Za-z0-9_-]/u\");\n }", "static public function checkString($s){\n if (ctype_lower($s) || ctype_upper($s) || ctype_alpha($s)){\n return false;\n }\n return true;\n }", "function isNoScript($text)\n{\n $allowed = array('.','=','-','+', '_',' ','\"',\"'\",'[','(',']',')','$',':','%','!','/','?','*','&','@','|'); // you can add here more value, you want to allow.\n if(ctype_alnum(str_replace($allowed, '', $text ))) {\n return TRUE;\n } else {\n return FALSE;\n }\n}", "function name_validation($str)\n{\n return preg_match(\"/^[a-zA-Z ]+$/\", $str);\n}", "function sAlphanumeric( $string )\r\n\t\t{\r\n\t\t\t\treturn preg_replace( '/[^a-zA-Z0-9]/', '', $string );\r\n\t\t\t\t\r\n\t\t}", "protected static function validate_alphanumeric( $value ){\n\t\treturn true;\n\t}", "function allLegalLetters($pass)\n{\n\n\tif(preg_match('/[iol]/', $pass)) return false;\n\treturn true;\n\n}", "public function alpha_dash($str): bool\n\t{\n return (bool)preg_match('#^[a-z0-9_-]+$#i', $str);\n }", "public function alpha_dash_space( $str ){\n\t\t\n\t\t$this->CI->form_validation->set_message( 'alpha_dash_space', lang( 'validation_rule_alpha_dash_spaces' ) );\n\t\t\n\t\treturn ( ! preg_match( '/^[a-z0-9 ._\\-]+$/i', $str ) ) ? FALSE : TRUE;\n\t\t\n\t}", "private function process_alphanumhyphen($value)\n {\n return ! preg_match('/[^a-zA-Z0-9-]/', $value);\n }", "function validStringAndSpace($string)\n{\n return preg_match('/^[A-Za-z\\s ]+$/', $string);\n}", "function removeNonAlphabets($character){\n return (ctype_alpha($character));\n}", "public static function isShorted(string $text): bool{\n return preg_match('/^[a-zA-Z0-9]+$/',$text);\n }", "function validateCharsDie(&$text)\n{\n\t$matches = preg_match('/[^-a-z0-9]/', $text);\n\n\tif($matches)\n\t\tdie('Invalid characters specified in input. This could be caused by invalid cookie data, thus it is recommended to clear your cookies.');\n}", "public function alphaNumeric($str)\n {\n if ( !preg_match('/^[a-zA-Z0-9\\s]+$/i',$str) )\n {\n $this->form_validation->set_message('alphaNumeric', 'Please enter only alpha numeric characters.');\n return FALSE;\n }\n else\n {\n return TRUE;\n }\n }", "function is_simple_string($string){\n\t\treturn $string == remove_special_chars($string);\n\t}", "public function alphaNum($alphanum)\n {\n return (bool) preg_match($this->regExpPatterns['alphanum'], $alphanum);\n }", "public static function validUsername($username) {\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $username)) {\n return false;\n }\n return true;\n }", "function ctypeAlpha($text){ \n $response = preg_match(\"/[A-Za-z]/\",$text);\n return $response;\n}", "function validateLatin($string)\n {\n $result = false;\n\n if (preg_match(\"/^[\\w\\d\\s.,-]*$/\", $string)) {\n $result = true;\n }\n\n return $result;\n }", "function filter_alphanum($input) {\n return preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $input);\n}", "function filter_chars($str) {\n\treturn preg_replace(\"/[^A-Za-z0-9_]*/\", \"\", $str);\n}", "public function is_ascii($str)\n {\n return (preg_match('/[^\\x00-\\x7F]/S', $str) == 0);\n }", "public static function standard_text($str)\r\n {\r\n // pL matches letters\r\n // pN matches numbers\r\n // pZ matches whitespace\r\n // pPc matches underscores\r\n // pPd matches dashes\r\n // pPo matches normal puncuation\r\n return (bool) preg_match('/^[\\pL\\pN\\pZ\\p{Pc}\\p{Pd}\\p{Po}]++$/uD', (string) $str);\r\n }", "public static function is_ascii($str)\n\t{\n\t\tif (is_array($str)) {\n\t\t\t$str = implode($str);\n\t\t}\n\n\t\treturn ! preg_match('/[^\\x00-\\x7F]/S', $str);\n\t}", "protected function checkSpecialChar($str, $fieldName) {\n\t\tif (preg_match('/[^A-Za-z0-9ÄÖÜäöüßéàè\\s]+/', $str)) {\n\t\t\t$this->errors[] = sprintf('Field \"%s\" must not contain special chars', $fieldName);\n\t\t\t$this->isValid = false;\n\t\t}\n\t}", "function valid_words ( $str )\n\t{\n\t\t$bReturn = TRUE;\n\t\tif ( $this->forbidden_words === '') return FALSE;\n\t\t$aWords = explode( ',', $this->forbidden_words );\n\t\tforeach( $aWords as $sWord )\n\t\t{\n\t\t\t$sWord = trim( $sWord );\n\t\t\t$uPos = stripos( $str, $sWord );\n\t\t\tif (ereg(\"([0-9])\", $uPos)) // Avoid using boolean because the word can be in 0 (first) position\n\t\t\t{\n\t\t\t\t$bReturn = FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $bReturn;\n\t}", "function lower_alpha_numeric( $str )\n\t{\n\t\treturn ( preg_match(\"([^a-z0-9])\", $str)) ? FALSE : TRUE;\n\t}", "public function is_alpha_extra($str) {\r\n\t\t\r\n\t $this->CI->form_validation->set_message('is_alpha_extra', 'The %s may only contain alpha-numeric characters, spaces, periods, underscores & dashes.');\r\n\t \r\n\t if($this->CI->validation->isAlphaExtra($str))\r\n\t return true;\r\n\r\n\t return false;\r\n }", "function valid_username($username)\n{\n\t$filter = preg_replace(\"/[^a-z\\d\\-=\\?!@:\\.]/i\", \"\", $username);\n\t\n\tif($filter == $username){\n\t\treturn $username; //preg_match('#^[a-z]{1,2}[a-z0-9-_.-]+$#i', $username);\n\t}\n}", "public function letter_num_validation($input){\n\t\tif(!preg_match('/^[a-zA-Z0-9]*$/',$input)){ \n\t\t\treturn true;\n \t}\n }", "function justAlphanumeric($var)\n{\n return preg_replace('/[^0-9A-Za-z]/', '', $var);\n}", "function alphanumeric_dot($str)\n\t{\n\t\t$this->CI->form_validation->set_message('alphanumeric_dot', \"El campo %s solo puede contener caracteres alfanum&eacute;ricos y puntos.\");\n\t\treturn (bool) preg_match(\"/^([a-z0-9.])+$/i\", $str);\n\t}", "static function ExtractAlphanumeric($string) {\n return @eregi_replace('[^0-9A-Za-z]', '', $string);\n }", "public function testValidateSpecialChars(): void\n {\n $this->assertFalse($this->validate('some-text-123'));\n }", "function april_sanitize_alphanumeric ( $s ) {\n\treturn preg_replace(\"/[^a-zA-Z0-9\\\\-]+/\", \"\", $s);\n}", "function onlyNum( $myString )\n{\n $myReturn = eregi('[^0-9]', $myString ) ;\n if ( $myReturn )\n { return FALSE ; }\n else\n { return TRUE ; }\n}", "function is_clean_text($string, $min_length = 0, $max_length = 0)\r\n{\r\n $ret = _is_valid($string, $min_length, $max_length, \"[a-zA-Z[:space:]!()=?¿ÀÁÂÃÄŰ\\\\\\\"/ÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ`´']+\");\r\n\r\n return($ret);\r\n}", "function regexcheckusername($username){\n\t$regex_pattern=\"/^\\s*([a-zA-Z0-9]+[a-zA-Z0-9_-]*)+[a-zA-Z0-9]\\s*$/\"; //the displayname must begin and end with alphanumeric\n\treturn preg_match($regex_pattern,$username);//returns 1 if the username was valid\n}", "function isValidName($name)\n{\n if (! preg_match(\"/^[a-zA-Z ]*$/\", $name)) {\n return false;\n }\n return true;\n}" ]
[ "0.8147333", "0.7928963", "0.7856146", "0.78359306", "0.7823197", "0.78103304", "0.7780917", "0.77340454", "0.76942", "0.766314", "0.7656567", "0.76016766", "0.75424314", "0.74788517", "0.743622", "0.7386543", "0.7347393", "0.7336011", "0.72732735", "0.7255068", "0.7235879", "0.7232978", "0.72301495", "0.7216929", "0.7194044", "0.7192704", "0.7146721", "0.7141063", "0.71313024", "0.71121716", "0.7108665", "0.7104112", "0.7073677", "0.7066369", "0.7041383", "0.7040722", "0.70030314", "0.6997049", "0.6990226", "0.6990137", "0.69770205", "0.6963729", "0.6959223", "0.6954366", "0.6951617", "0.69437635", "0.6924661", "0.6922419", "0.69213873", "0.6918704", "0.69147867", "0.69115835", "0.68665534", "0.6860634", "0.685751", "0.68569374", "0.6845026", "0.68212426", "0.6802097", "0.67996275", "0.6789246", "0.67647696", "0.6751991", "0.67510116", "0.67432195", "0.6741431", "0.6722687", "0.67122406", "0.67030114", "0.6671881", "0.667166", "0.6642162", "0.66306716", "0.66103953", "0.66096556", "0.6603544", "0.65930605", "0.6568683", "0.6560559", "0.65504783", "0.654342", "0.6535234", "0.65216136", "0.65076715", "0.65008885", "0.6491592", "0.64715165", "0.64681256", "0.64624155", "0.6459707", "0.64567214", "0.64531004", "0.6442772", "0.6415595", "0.6412625", "0.63678354", "0.6362754", "0.6361884", "0.63556105", "0.6355489" ]
0.79543155
1
initialize dbtable 'eventlog' if it does not exist yet
function init_queries($tableslc) { $tablename1 = qa_db_add_table_prefix('quizx_moderate'); // create table qa_quizx_moderate which stores the questions to be moderated if(!in_array($tablename1, $tableslc)) { qa_db_query_sub( 'CREATE TABLE IF NOT EXISTS `^quizx_moderate` ( `questionid` int(10) unsigned NOT NULL, `userid` int(10) unsigned DEFAULT NULL, `status` tinyint(1) unsigned DEFAULT "0" COMMENT "0-open 1-editdone 2-published", `tags` varchar(800) DEFAULT NULL, PRIMARY KEY (`questionid`), UNIQUE KEY `questionid` (`questionid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;' ); } $tablename2 = qa_db_add_table_prefix('quizx_gameplay'); // create table qa_quizx_gameplay which stores the game results if(!in_array($tablename2, $tableslc)) { qa_db_query_sub( 'CREATE TABLE IF NOT EXISTS `^quizx_gameplay` ( `userid` int(10) unsigned DEFAULT NULL, `timestamp` datetime NOT NULL, `questionid` int(10) unsigned NOT NULL, `answerid` int(10) unsigned NOT NULL, `correct` tinyint(1) unsigned NOT NULL, `elapsed` int(10) unsigned DEFAULT NULL, `cookieid` bigint(20) unsigned DEFAULT NULL, `ipaddress` int(10) unsigned DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;' ); } $tablename3 = qa_db_add_table_prefix('quizx_stamps'); // create table qa_quizx_stamps which stores the reset times of each player (to play questions again) if(!in_array($tablename3, $tableslc)) { qa_db_query_sub( 'CREATE TABLE IF NOT EXISTS `^quizx_stamps` ( `userid` int(10) unsigned DEFAULT NULL, `timestamp` datetime NOT NULL, `cookieid` bigint(20) unsigned DEFAULT NULL, `actiontype` varchar(255) CHARACTER SET utf8 DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;' ); } $tablename4 = qa_db_add_table_prefix('quizx_highscores'); // create table qa_quizx_highscore which stores the monthly scores of all players if(!in_array($tablename4, $tableslc)) { qa_db_query_sub( 'CREATE TABLE IF NOT EXISTS `^quizx_highscores` ( `date` date NOT NULL, `userid` int(10) unsigned NOT NULL, `rating` decimal(10,3) unsigned NOT NULL, `qcorrect` int(10) unsigned NOT NULL, `qincorrect` int(10) unsigned NOT NULL, PRIMARY KEY (`date`,`userid`), KEY `date` (`date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initialize()\n {\n $this->pdo->exec(\n 'CREATE TABLE IF NOT EXISTS ' . $this->table . '\n(\n id VARCHAR(30) PRIMARY KEY NOT NULL,\n channel VARCHAR(60) NOT NULL,\n level INT NOT NULL,\n level_name VARCHAR(10) NOT NULL,\n message VARCHAR(250) NOT NULL,\n trace TEXT,\n payload TEXT,\n time DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,\n INDEX logs_channel_index (channel) USING HASH,\n INDEX logs_level_index (level) USING HASH,\n INDEX logs_time_index (time) USING HASH\n);'\n );\n\n $this->initialized = true;\n }", "private function create_event_log_table($db) {\n\t\t$this->company_forge = $this->load->dbforge($db, TRUE);\n\t\t// Load fields to create the Event Log table\n\t\t$fields = array(\n\t\t\t'id' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> FALSE,\n\t\t\t\t'auto_increment'\t=> TRUE\n\t\t\t),\n\t\t\t'user' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'event' => array(\n\t\t\t\t'type'\t\t\t\t=> 'VARCHAR',\n\t\t\t\t'constraint'\t\t=> 100,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'event_type' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> TRUE\n\t\t\t),\n\t\t);\n\t\t// Add the fields before creating the Forms table\n\t\t$this->company_forge->add_field($fields);\n\t\t// Array format doesn't work for default DateTimes, so we add them by string\n\t\t$this->company_forge->add_field(\"date DATETIME NOT NULL\");\n\t\t$this->company_forge->add_field(\"signature BLOB NOT NULL\");\n\t\t// Make the id the primary key of the Event Log table\n\t\t$this->company_forge->add_key('id', TRUE);\n\t\t// Attempt to create the Event Log table and return success or failure\n\t\tif ($this->company_forge->create_table('event_log'))\n\t\t\treturn TRUE;\n\t\telse\n\t\t\treturn FALSE;\n\t}", "private function createDBTable() {\n\t\tglobal $wpdb;\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '\" . $this->debug_table . \"'\" ) !== $this->debug_table ) {\n\t\t\t$sql = 'CREATE TABLE `' . $this->debug_table . '` (\n\t\t\t\t`id` INT(9) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t`timestamp` TIMESTAMP NOT NULL,\n\t\t\t\t`blog` INT(9) NOT NULL,\n\t\t\t\t`message` text NOT NULL\n\t\t\t);';\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\tdbDelta( $sql );\n\t\t}\n\t}", "function on_activate() {\n\t\t\tglobal $wpdb;\n\t\t\t$wpdb->query(\"CREATE TABLE IF NOT EXISTS {$this->table_name} (\n\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t`time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\t`category` varchar(50) DEFAULT NULL,\n\t\t\t\t`log_type` varchar(10) DEFAULT NULL,\n\t\t\t\t`message` varchar(255) DEFAULT NULL,\n\t\t\t\tPRIMARY KEY (`id`),\n\t\t\t\tKEY `time_stamp` (`time_stamp`),\n\t\t\t\tKEY `category` (`category`)\n\t\t\t)\");\n\t\t}", "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}", "function ensure_log()\r\n\t{\r\n\t\tglobal $wpdb;\r\n\t\t// Create table if it doesn't exist, log the hit, delete outdated hits\r\n\t\t$sql = \"create table if not exists `$wpdb->three_strikes` (\" .\r\n\t\t\t\t\"`strike_id` bigint(20) not null auto_increment, \" .\r\n\t\t\t\t\"`strike_ip` varchar(50) not null default '', \" .\r\n\t\t\t\t\"`strike_time` datetime not null default '0000-00-00 00:00:00', \" .\r\n\t\t\t\t\"`source` varchar(100) not null default '', \" .\r\n\t\t\t\t\"`message` varchar(100) not null default '', \" .\r\n\t\t\t\t\"PRIMARY KEY(`strike_id`))\";\r\n\t\t$wpdb->query($sql);\r\n\t}", "protected function initDatabaseRecord() {}", "private static function setupDB() {\n\t\t$tbl = self::$table;\n\t\t$dbw = wfGetDB( DB_MASTER );\n\t\twfDebugLog( __METHOD__, \"\\tCreating tables\\n\" );\n\t\t$dbw->query(\n\t\t\t\"CREATE TABLE IF NOT EXISTS $tbl ( pathway varchar(255), day varchar(50) )\", DB_MASTER\n\t\t);\n\t\twfDebugLog( __METHOD__, \"\\tDone!\\n\" );\n\t}", "public function initialize()\n {\n $this->setSchema($this->config->database->dbname);\n $this->setSource(\"timestamps\");\n }", "function init_tables(){\n $db = new PDO('sqlite:history.pyramid.sqlite');\n $db->exec(\"PRAGMA foreign_keys = ON\");\n $db->exec(\"drop table if exists areas\");\n $db->exec(\"drop table if exists codigos\");\n $db->exec(\"drop table if exists outs\");\n $db->exec(\"CREATE TABLE Areas (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n $db->exec(\"CREATE TABLE codigos (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n $db->exec(\"CREATE TABLE outs (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n}", "public function initialize()\n {\n $schema = new Schema();\n\n $snapshotsTable = $schema->createTable(self::SNAPSHOTS_TABLE);\n $snapshotsTable->addColumn('id', 'integer', ['autoincrement' => true]);\n $snapshotsTable->addColumn('aggregate_type', 'string');\n $snapshotsTable->addColumn('aggregate_id', 'string');\n $snapshotsTable->addColumn('type', 'string');\n $snapshotsTable->addColumn('version', 'integer');\n $snapshotsTable->addColumn('snapshot', 'text');\n $snapshotsTable->setPrimaryKey(['id']);\n\n $queries = $schema->toSql($this->connection->getDatabasePlatform());\n $this->connection->transactional(function(Connection $connection) use ($queries) {\n foreach ($queries as $query) {\n $connection->exec($query);\n }\n });\n }", "private function initDatabase() {\n \n \n \n }", "public function initDatabaseStructure( );", "private static function init() {\n\t\tif (self::get_db()) {\n\t\t\t# Auto load modules when called\n\t\t\tspl_autoload_register(function ($module_name) {\n\t\t\t\trequire_once 'modules/' . $module_name . '.php';\n\t\t\t});\n\n\t\t\t# Init modules\n\t\t\tif ($handle = opendir('modules')) {\n\t\t\t\twhile (false !== ($module = readdir($handle))) {\n\t\t\t\t\tif (!in_array($module, array('.','..'))) {\n\t\t\t\t\t\t$module = rtrim($module, '.php');\n\t\t\t\t\t\tself::$modules[] = $module;\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\t$sth = self::$db->prepare(\"CREATE TABLE IF NOT EXISTS `input_log` (\n\t\t\t `input_id` int(10) NOT NULL AUTO_INCREMENT,\n\t\t\t `input` varchar(200) CHARACTER SET latin1 NOT NULL,\n\t\t\t `ip` varchar(19) CHARACTER SET latin1 NOT NULL,\n\t\t\t `date_added` datetime NOT NULL,\n\t\t\t PRIMARY KEY (`input_id`)\n\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\");\n\t\t\t$sth->execute();\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function initialize() {\n\n switch ($this->type) {\n case 'sqlite':\n $query[0] = 'CREATE TABLE `enrolled` (\n `sid` INTEGER PRIMARY KEY,\n `first` TEXT ,\n `last` TEXT);';\n\n $query[1] = 'CREATE TABLE `paid` (\n `sid` INTEGER PRIMARY KEY);';\n\n $query[2] = 'CREATE TABLE `admin` (\n `sid` INTEGER PRIMARY KEY);';\n\n $query[3] = 'CREATE TABLE `log` (\n `id` INTEGER PRIMARY KEY AUTOINCREMENT,\n `sid` TEXT,\n `event` TEXT,\n `status` TEXT,\n `timestamp` TEXT);';\n \n $query[4] = 'CREATE TABLE `stage` (\n `id` INTEGER PRIMARY KEY AUTOINCREMENT,\n `sid` TEXT,\n `last` TEXT,\n `first` TEXT,\n `dest` TEXT);';\n\t\t\t\t \n\t\t\t\t$query[5] = 'CREATE TABLE `guest` (\n `sid` INTEGER PRIMARY KEY);';\n\n\t\t\t\t \n break;\n\n case 'mysql':\n\n $query[0] = 'CREATE TABLE IF NOT EXISTS `enrolled` (\n `sid` INT NOT NULL ,\n `first` VARCHAR(45) NULL ,\n `last` VARCHAR(45) NULL ,\n PRIMARY KEY (`sid`) );\n ENGINE = InnoDB;';\n\n $query[1] = 'CREATE TABLE IF NOT EXISTS `paid` (\n `sid` INT NOT NULL ,\n PRIMARY KEY (`sid`) )\n ENGINE = InnoDB;';\n\n $query[2] = 'CREATE TABLE IF NOT EXISTS `admin` (\n `sid` INT NOT NULL ,\n PRIMARY KEY (`sid`) )\n ENGINE = InnoDB;';\n\n $query[3] = 'CREATE TABLE IF NOT EXISTS `log` (\n `id` INT NOT NULL ,\n `sid` VARCHAR(45) NULL ,\n `status` VARCHAR(45) NULL,\n `event` VARCHAR(45) NULL ,\n `timestamp` DATETIME NULL ,\n PRIMARY KEY (`id`) )\n ENGINE = InnoDB;';\n\n break;\n\n default:\n throw new Exception($this->type . \" is not a valid database type.\");\n break;\n\n }\n\n foreach ($query as $insert) {\n $this->query($insert);\n }\n \n /**\n * Integrity Checking goes here\n */\n \n }", "public function init()\n {\n $this->logger->info('DBService : init');\n\n $this->connect();\n $this->createTable( $this->pdo );\n }", "public function createEventTable()\n {\n $table = $this->getEventTable();\n $recurr = $this->getRecurrenceTable();\n if (empty($table) || empty($recurr)) {\n return PHPWS_Error::get(CAL_CANNOT_MAKE_EVENT_TABLE, 'calendar',\n 'Calendar_Schedule::createEventTable');\n }\n\n $template['TABLE'] = $table;\n $template['RECURR_TABLE'] = $recurr;\n $template['INDEX_NAME'] = str_replace('_', '', $table) . '_idx';\n $template['RECURR_INDEX_NAME'] = str_replace('_', '', $recurr) . '_idx';\n\n $file = PHPWS_SOURCE_DIR . 'mod/calendar/inc/event_table.sql';\n\n if (!is_file($file)) {\n return PHPWS_Error::get(PHPWS_FILE_NOT_FOUND, 'calendar',\n 'Calendar_Schedule::createEventTable', $file);\n }\n\n $query = PHPWS_Template::process($template, 'calendar', $file, true);\n return PHPWS_DB::import($query);\n }", "public function initialize()\n {\n $this->setSchema(\"smsgw_engine_db\");\n }", "public function create_table_config(){\n $sql = \" CREATE TABLE IF NOT EXISTS {$this->table_config} (\n `id` varchar(100),\n `day` varchar(50) DEFAULT NULL,\n `range` varchar(50) DEFAULT NULL,\n `qty` smallint DEFAULT 0,\n `type` varchar(50) DEFAULT NULL,\n `order` smallint DEFAULT 0,\n PRIMARY KEY (`id`)\n )\";\n\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n }", "public function setup(): void\n {\n if (DbalService::tableExists($this->internalTable)) {\n throw new DbJournalConfigException(\"Internal table was already created (setup)\");\n }\n\n $schema = new Schema();\n\n $table = $schema->createTable($this->internalTable);\n $table->setComment('Each table being monitored will have an entry on this table');\n\n $table->addColumn(\"table_name\", \"string\", [\"length\" => 256]);\n $table->setPrimaryKey(array(\"table_name\"));\n\n $table->addColumn(\"last_journal\", \"datetime\", [\"default\" => 'CURRENT_TIMESTAMP']);\n\n $table->addColumn(\"last_execution_time_milliseconds\", \"float\", [\"notnull\" => false]);\n\n // generate DDL for the table\n $queries = $schema->toSql($this->getPlatform());\n\n // and run it\n foreach ($queries as $query) {\n $this->output($query, OutputInterface::VERBOSITY_VERBOSE);\n $this->conn->exec($query);\n }\n\n $this->output(\"<success>Table {$this->internalTable} created</success>\");\n }", "public static function setupDatabase( Event $event )\n\t{\n\t\t$options = $env = array();\n\n\t\tif( $event->isDevMode() ) {\n\t\t\t$options[] = '--option=setup/default/demo:1';\n\t\t} else {\n\t\t\t$env[] = '--env=prod';\n\t\t}\n\n\t\tself::executeCommand( $event, 'aimeos:setup', $options + $env );\n\t\tself::executeCommand( $event, 'aimeos:clear', $env );\n\t}", "private function newTrackingTable () {\n\t\t//set timezone for timestamps\n\t\tdate_default_timezone_set('America/Toronto');\n\t\t$query = \n\t\t\t\"CREATE TABLE IF NOT EXISTS a2_tracking (id INTEGER AUTO_INCREMENT, hostname VARCHAR(100), url VARCHAR(100), timestamp VARCHAR(20), sequence INTEGER, increment INTEGER, count INTEGER, PRIMARY KEY (id))\";\n\t\t$this->sendQuery($query);\n\t}", "public function setTableDefinition()\n {\n $this->addListener(new Doctrine_Template_Listener_Loggable($this->_options), 'loggable');\n }", "function initDB(PDO $db) {\n $db->exec('drop table if exists \"caching\"');\n $db->exec('CREATE TABLE \"caching\" (\"id\" INTEGER PRIMARY KEY AUTOINCREMENT, \"keyword\" VARCHAR UNIQUE, \"object\" BLOB, \"exp\" INTEGER)');\n $db->exec('CREATE UNIQUE INDEX \"cleaup\" ON \"caching\" (\"keyword\",\"exp\")');\n $db->exec('CREATE INDEX \"exp\" ON \"caching\" (\"exp\")');\n $db->exec('CREATE UNIQUE INDEX \"keyword\" ON \"caching\" (\"keyword\")');\n }", "public function initTable()\n\t{\n\t\t$this->db->exec(\"\n\t\t\tCREATE TABLE `cache` (\n\t\t\t `id` varbinary(255) NOT NULL,\n\t\t\t `data` longblob NOT NULL,\n\t\t\t `date_expire` datetime DEFAULT NULL,\n\t\t\t INDEX date_expire_idx (date_expire),\n\t\t\t PRIMARY KEY (`id`)\n\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\t\t\");\n\t}", "protected function _initialize() {\n $this->tableName = 'user_product';\n }", "function initialize()\n {\n $sql = \"\n CREATE TABLE IF NOT EXISTS `config` (`key` varchar(255) NOT NULL, `value` text NOT NULL, PRIMARY KEY (`key`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n CREATE TABLE IF NOT EXISTS `secureconfig` (`key` varchar(255) NOT NULL, `value` text NOT NULL, PRIMARY KEY (`key`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n \";\n try {\n $db = Base_Database::getConnection();\n $db->exec($sql);\n } catch (PDOException $e) {\n error_log('Initialize Base_Config failed: ' . $e->getMessage());\n die(\"An error occurred creating the configuration tables\");\n }\n }", "private function createMainDatabaseRecords()\n {\n // get the .sql file\n $sql = (string) @file_get_contents( $this->plugin->getPath() . \"/Setup/install.sql\" );\n\n // insert it\n $this->db->exec( $sql );\n }", "protected function _initLog()\n {\n // make sure the db bootstrap is done\n $this->bootstrap('db');\n \n // add the logger\n $writer = new SG_Log_Writer_Db();\n $logger = new Zend_Log($writer);\n $logger->registerErrorHandler();\n Zend_Registry::set('SG_Logger', $logger);\n }", "protected function createDatabaseStructure() {}", "abstract protected function initDB();", "function CreateTableEvent(){\r\n\t\t$qry = \"CREATE TABLE IF NOT EXISTS $this->tablename2 (\". \r\n\t\t\t\t\"Eid INT AUTO_INCREMENT,\".\r\n\t\t\t\t\"UuserName CHAR(255) NOT NULL,\".\r\n\t\t\t\t\"Evename VARCHAR(255) NOT NULL,\".\r\n\t\t\t\t\"EstartDate VARCHAR(20) NOT NULL,\".\r\n\t\t\t\t\"EendDate VARCHAR(20) NOT NULL,\".\r\n\t\t\t\t\"Eaddress VARCHAR(255) NOT NULL,\".\r\n\t\t\t\t\"Ecity VARCHAR(50) NOT NULL,\".\r\n\t\t\t\t\"Estate CHAR(10) NOT NULL,\".\r\n\t\t\t\t\"Ezip INT(5) NOT NULL,\".\r\n\t\t\t\t\"EphoneNumber VARCHAR(50),\".\r\n\t\t\t\t\"Edescription VARCHAR(500) NOT NULL,\".\r\n\t\t\t\t\"Etype VARCHAR(26) NOT NULL,\".\r\n\t\t\t\t\"Ewebsite VARCHAR(500) NOT NULL,\".\r\n\t\t\t\t\"Ehashtag CHAR(255),\".\r\n\t\t\t\t\"Efacebook CHAR(255),\".\r\n\t\t\t\t\"Etwitter CHAR(255),\".\r\n\t\t\t\t\"Egoogle CHAR(255),\".\r\n\t\t\t\t\"Eflyer CHAR(255),\".\r\n\t\t\t\t\"Ebanner CHAR(255),\".\r\n\t\t\t\t\"Eother CHAR(255),\".\r\n\t\t\t\t\"EtimeStart CHAR(255),\".\r\n\t\t\t\t\"EtimeEnd CHAR(255),\".\r\n\t\t\t\t\"Elat DECIMAL(10,6),\".\r\n\t\t\t\t\"Elong DECIMAL(10,6),\".\r\n\t\t\t\t\"Erank CHAR(255),\".\r\n\t\t\t\t\"Edisplay INT(1),\".\r\n\t\t\t\t\"PRIMARY KEY(Eid, UuserName)\".\r\n\t\t\t\");\";\r\n\r\n\t\tif(!mysql_query($qry, $this->connection)){\r\n\t\t\t$this->HandleDBError(\"Error creating the table \\nquery was\\n $qry\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "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 init() {\n $this->table = 'depenses';\n }", "public function run()\n {\n DB::insert(\n \"INSERT INTO `logs` (`event`, `occurred_at`) VALUES ('event1', '2020-01-01 00:00:00')\"\n );\n }", "protected function _initsTable() {}", "public function setUp()\n {\n if ($this->_plugin->getOption('auditLog')) {\n $this->_plugin->initialize($this->_table);\n }\n\n $version = $this->_options['version'];\n $name = $version['name'] . (isset($version['alias']) ? ' as ' . $version['alias'] : '');\n $this->hasColumn($name, $version['type'], $version['length'], $version['options']);\n\n $this->addListener(new dmDoctrineAuditLogListener($this->_plugin));\n }", "private final function _createDbStructure()\n {\n if ($conn = $this->_getConnection()) {\n $installer = new lib_Install('install');\n try {\n $installer->install();\n } catch (Exception $e) {\n app::log($e->getMessage(), app::LOG_LEVEL_ERROR);\n }\n }\n }", "public function __construct() {\n\n $this->tableName = \"re_event_type\";\n $this->setColumnsInfo(\"id\", \"int(11)\", 0);\n $this->setColumnsInfo(\"name\", \"varchar(250)\", \"\");\n $this->setColumnsInfo(\"id_space\", \"int(11)\", 0);\n $this->primaryKey = \"id\";\n }", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(USER_RSS); \n }", "protected function setUpTable()\n {\n if (!Schema::hasTable($this->TABLE)){\n Schema::create($this->TABLE, function (Blueprint $table) {\n $table->string(self::ID)->primary();\n $table->string(self::TEXT);\n $table->integer(self::DATE);\n $table->string(self::SENDER_ID);\n $table->string(self::RECIPIENT_ID);\n });\n }\n }", "public function __construct(){\n \n $this->create_tables();\n \n }", "public function acfedu_create_fill_db() {\n\t\t\t\t$this->acfedu_check_table();\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\tob_start();\n\t\t\t\tglobal $wpdb;\n //require_once( 'lib/import_nl.php' );\n //require_once( 'lib/import_be.php' );\n //require_once( 'lib/import_lux.php' );\n require_once( 'lib/import_id.php' );\n\t\t\t\t$sql = ob_get_clean();\n\t\t\t\tdbDelta( $sql );\n\t\t\t}", "public function __construct()\n {\n $this->connection = $connection = null;\n $createLogsTableInstruction = \"CREATE TABLE IF NOT EXISTS logs(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n level VARCHAR(10) NOT NULL,\n message TEXT NOT NULL\n );\";\n $this->connection = new \\PDO('sqlite:syslog.sqlite3');\n $this->connection->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n $this->connection->exec($createLogsTableInstruction);\n }", "public function alter_table()\n {\n $CI =& get_instance();\n $CI->load->model('config_model');\n\n $CI->config_model->create_tb_login_log();\n\n return true;\n }", "public function init()\n\t{\n\t\tif (isset($_SERVER['DB_TABLE_PREFIX'])) {\n\t\t\t$this->setPrefix($_SERVER['DB_TABLE_PREFIX']);\n\t\t}\n\t}", "function configureFirstRun() {\n if(!$this->createDBTables())\n {\n echo \"First run configuration error. \"\n . \"Unable to create database tables!\";\n }\n }", "function postCreateTable(){\n\t}", "function lti_maybe_create_db() {\n\tglobal $wpdb;\n\n\tget_lti_hash(); // initialise the remote login hash\n\n\t$wpdb->ltitable = $wpdb->base_prefix . 'lti';\n\tif ( lti_site_admin() ) {\n\t\t$created = 0;\n\t\tif ( $wpdb->get_var(\"SHOW TABLES LIKE '{$wpdb->ltitable}'\") != $wpdb->ltitable ) {\n\t\t\t$wpdb->query( \"CREATE TABLE IF NOT EXISTS `{$wpdb->ltitable}` (\n\t\t\t\t`id` bigint(20) NOT NULL auto_increment,\n\t\t\t\t`consumer_key` varchar(255) NOT NULL,\n\t\t\t\t`secret` varchar(255) NOT NULL,\n\t\t\t\t`active` tinyint(4) default '1',\n\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t);\" );\n\t\t\t$created = 1;\n\t\t}\n\t\tif ( $created ) {\n\t\t\t?> <div id=\"message\" class=\"updated fade\"><p><strong><?php _e( 'LTI database table created.', 'wordpress-mu-lti' ) ?></strong></p></div> <?php\n\t\t}\n\t}\n\n}", "public function logInit($event)\n {\n $this->setNewVersion();\n }", "public static function table () {\n\t\tglobal $pdo_handler;\n\t\t$pdo_handler->query( \"\n\t\t\tCREATE TABLE IF NOT EXISTS `etc_texts_history` (\n\t\t\t `text_id` int(11) NOT NULL,\n\t\t\t `user_id` int(11) NOT NULL,\n\t\t\t `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t `text` mediumtext COLLATE utf8_unicode_ci NOT NULL,\n\t\t\t PRIMARY KEY (`text_id`,`user_id`,`timestamp`)\n\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\t\t\" );\n\t}", "function build_event_tbl() {\n global $wpdb;\n\n $charset_collate = $wpdb->get_charset_collate();\n\n $table_name = $wpdb->prefix . \"events\";\n\n $sql = \"CREATE TABLE $table_name (\n id mediumint(9) NOT NULL,\n time datetime DEFAULT '0000-00-00 00:00:00',\n venue mediumint(9),\n performer mediumint(9),\n city text,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n \n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta( $sql );\n\n $performer_name = $wpdb->prefix . \"performers\";\n $performerSql = \"CREATE TABLE $performer_name (\n id mediumint(9) NOT NULL,\n name text,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $performerSql );\n\n $category_name = $wpdb->prefix . \"categories\";\n $categorySql = \"CREATE TABLE $category_name (\n id mediumint(9) NOT NULL,\n name text,\n wp_id mediumint(9),\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $categorySql );\n\n $searched_terms_name = $wpdb->prefix . \"searched_terms\";\n $searchedSql = \"CREATE TABLE $searched_terms_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n term text,\n num_searched mediumint(9) DEFAULT 1,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $searchedSql );\n\n $cached_results_name = $wpdb->prefix . \"cached_results\";\n $cachedSql = \"CREATE TABLE $cached_results_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n term text,\n result blob,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $cachedSql );\n\n $predictive_name = $wpdb->prefix . \"predictive_terms\";\n $predictiveSql = \"CREATE TABLE $predictive_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n term text,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $predictiveSql );\n}", "public function __construct(){\r\n //get pdo connection\r\n $db=$this->conn();\r\n $qr = \"CREATE TABLE IF NOT EXISTS manager (username varchar(200),password varchar(200));\";\r\n $qq = \"CREATE TABLE IF NOT EXISTS user (username varchar(200),password varchar(200));\";\r\n $evt= \"CREATE TABLE IF NOT EXISTS event (eid varchar(200),ename varchar(200),name varchar(200),des varchar(2000),img varchar(200));\";\r\n //query occur\r\n $r = $db->query($qr);\r\n $q = $db->query($qq);\r\n $w = $db->query($evt);\r\n // if($r){echo \"Created\";}\r\n }", "function __construct() \n {\n // Creation de la table\n self::createTableIfNeeded();\n }", "function setupDatabase($db){\n\t\tif($db == null) throw new Exception(\"Database is not given\");\n\t\t\n $sqlBirthdays = \"\n CREATE TABLE IF NOT EXISTS `birthdays` (\n `key` int(11) NOT NULL AUTO_INCREMENT,\n `date` date NOT NULL,\n `name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,\n PRIMARY KEY (`key`)\n\t\t);\";\n\t\t\n\t\t$sqlEvents =\"\n\t\tCREATE TABLE IF NOT EXISTS `events` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `title` text NOT NULL,\n `date` date NOT NULL,\n `time` time NOT NULL,\n `descr` mediumtext CHARACTER SET latin1 COLLATE latin1_german1_ci NOT NULL,\n `startdate` date NOT NULL,\n `enddate` date NOT NULL,\n PRIMARY KEY (`id`)\n );\";\n\n $sqlTicker = \"\n\t\tCREATE TABLE IF NOT EXISTS `tickermsg` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `startdate` date NOT NULL,\n `enddate` date NOT NULL,\n `message` text NOT NULL,\n PRIMARY KEY (`id`)\n );\";\n\n // Execute the create querys\n $db->query($sqlBirthdays);\n $db->query($sqlEvents);\n $db->query($sqlTicker);\n }", "private function setup_db_variables() {\n\t\tglobal $wpdb;\n\t\t$this::$dbtable = $wpdb->prefix . self::DBTABLE;\n\t\t$this::$dbtable_contexts = $wpdb->prefix . self::DBTABLE_CONTEXTS;\n\n\t\t/**\n\t\t * Filter db table used for simple history events\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table\n\t\t */\n\t\t$this::$dbtable = apply_filters( 'simple_history/db_table', $this::$dbtable );\n\n\t\t/**\n\t\t * Filter table name for contexts.\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table_contexts\n\t\t */\n\t\t$this::$dbtable_contexts = apply_filters(\n\t\t\t'simple_history/logger_db_table_contexts',\n\t\t\t$this::$dbtable_contexts\n\t\t);\n\t}", "public function init() {\n\n\t\t$table_maker = new ActionScheduler_LoggerSchema();\n\t\t$table_maker->register_tables();\n\n\t\tparent::init();\n\n\t\tadd_action( 'action_scheduler_deleted_action', [ $this, 'clear_deleted_action_logs' ], 10, 1 );\n\t}", "function db_startup(){\n\t\n\t}", "function createTable() {\n print \"\\nCreate table: \".$dbtable.\"\\n\";\n if (createDB()) {\n print \"OK\\n\";\n }\n interceptExit();\n }", "private function dbinit() {\n\t\tCheck::identifier( $this->table_sessions );\n\t\tCheck::identifier( $this->table_tokens );\n\n\t\t$change = 0;\n\t\tif ( ! gad( db_get_tables_meta( $this->db ), $this->table_tokens ) )\n\t\t{\n\t\t\t$this->trace( \"creating $this->table_tokens\" );\n\t\t\t$this->db->exec( \"\n\t\t\t\tCREATE TABLE IF NOT EXISTS $this->table_tokens(\n\t\t\t\t\trealm\t\tvarchar(32) not null,\n\t\t\t\t\ttoken\t\tvarchar(128) not null,\n\t\t\t\t\tkey\t\t\tvarchar(64) not null,\n\t\t\t\t\tsecret\tvarchar(64) not null,\n\t\t\t\t\tcreated\ttimestamptz not null default NOW(),\n\t\t\t\t\tPRIMARY KEY ( realm, token, key )\n\t\t\t\t)\n\t\t\t\" );\n\t\t\t$change++;\n\t\t}\n\n\t\tif ( ! gad( db_get_tables_meta( $this->db ), $this->table_sessions ) )\n\t\t{\n\t\t\t$this->db->exec( \"\n\t\t\t\tCREATE TABLE IF NOT EXISTS $this->table_sessions(\n\t\t\t\t\tnonce\t\tchar(40),\n\t\t\t\t\tsite\t\tvarchar(255),\n\t\t\t\t\tdata\t\tvarchar(255),\n\t\t\t\t\thost\t\tvarchar(255),\n\t\t\t\t\tip\t\t\tvarchar(16),\n\t\t\t\t\t\".$this->db->identifier('when').\" timestamp not null default NOW()\n\t\t\t\t)\n\t\t\t\");\n\t\t\t$change++;\n\t\t}\n\n\t\tif ( $change ) {\n\t\t\tdb_clear_meta( $this->db );\n\t\t\tdb_get_tables_meta( $this->db );\n\t\t}\n\n\t\treturn $this->db;\n\t}", "private function createIfNotExists()\n {\n $table = new Table('schema_migration');\n if ($this->info->isTableExists($table)) {\n return;\n }\n $primaryKey = new PrimaryKey(array('version'));\n $primaryKey->disableAutoIncrement();\n\n $table->addConstraint($primaryKey);\n $table\n ->addColumn(new BigIntegerColumn('version'))\n ->addColumn(new DateTimeColumn('created_at', array('nullable' => false, 'default' => 'now()')));\n $this->manipulation->create($table);\n }", "protected function _initLog()\n {\n }", "function check_db(){\n if( ! $this->database_exists() ){\n $this->create_table();\n }\n }", "public function __construct()\n {\n parent::__construct('Log', 'gems__log_activity', 'gla', true);\n $this->addTable('gems__log_setup', array('gla_action' => 'gls_id_action'))\n ->addLeftTable('gems__respondents', array('gla_respondent_id' => 'grs_id_user'))\n ->addLeftTable('gems__staff', array('gla_by' => 'gsf_id_user'));\n\n $this->setKeys(array(\\Gems_Model::LOG_ITEM_ID => 'gla_id'));\n }", "function heartbeat_install() {\n global $wpdb;\n global $heartbeat_db_version;\n $table_name = $wpdb->prefix . 'heartbeattimelogger';\n $table_name_logs = $wpdb->prefix . 'heartbeattimelogger_logs';\n \n $charset_collate = $wpdb->get_charset_collate();\n\n $sql_log = \"CREATE TABLE $table_name_logs (\n id int NOT NULL AUTO_INCREMENT,\n userid int NOT NULL,\n ip_add VARCHAR(64) default '0.0.0.0',\n datetime DATETIME,\n PRIMARY KEY (id),\n KEY SEC (userid, datetime)\n ) $charset_collate;\";\n\n $sql = \"CREATE TABLE $table_name (\n id int NOT NULL AUTO_INCREMENT,\n userid int NOT NULL,\n minutes int default 0,\n pageid int NOT NULL,\n PRIMARY KEY (id),\n KEY SEC (userid, pageid)\n ) $charset_collate;\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta( $sql );\n dbDelta( $sql_log );\n\n add_option( 'heartbeattimelogger_db_version', $heartbeat_db_version );\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "function edithistory_install()\n{\n\tglobal $db;\n\t$db->write_query(\"CREATE TABLE \".TABLE_PREFIX.\"edithistory (\n\t\t\t\teid int(10) unsigned NOT NULL auto_increment,\n\t\t\t\tpid int(10) unsigned NOT NULL default '0',\n\t\t\t\ttid int(10) unsigned NOT NULL default '0',\n\t\t\t\tuid int(10) unsigned NOT NULL default '0',\n\t\t\t\tdateline bigint(30) NOT NULL default '0',\n\t\t\t\toriginaltext text NOT NULL,\n\t\t\t\tsubject varchar(200) NOT NULL default '',\n\t\t\t\tipaddress varchar(30) NOT NULL default '',\n\t\t\t\treason varchar(200) NOT NULL default '',\n\t\t\t\tKEY pid (pid),\n\t\t\t\tPRIMARY KEY(eid)\n\t\t\t) ENGINE=MyISAM;\");\n\n\t$db->add_column(\"posts\", \"reason\", \"varchar(200) NOT NULL default ''\");\n}", "public function createTable()\n\t{\n\t\t$app = Factory::getApplication();\n\n\t\tif ($app->isSite())\n\t\t{\n\t\t\techo 'Error creating DB table - Need to run this in admin area';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Factory::getUser();\n\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\techo 'Error creating DB table - You need to be superadmin user to exeacute this task';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$jinput = $app->input;\n\t\t$context = $jinput->get->get('context', '', 'cmd');\n\n\t\tif (empty($context))\n\t\t{\n\t\t\techo 'Error creating DB table - No context is passed';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$model = $this->getModel('indexer');\n\t\t$model->createTable($context);\n\t}", "function submitted_events_install() {\n\tglobal $submitted_events_db_version;\n\t\n\t// Only update database on version update\n\tif ($submitted_events_db_version != get_option ( 'submitted_events_version' )) {\n\t\t\n\t\tglobal $wpdb;\n\t\t\n\t\t$table_name = $wpdb->prefix . \"submitted_events\";\n\t\t\n\t\terror_log ( 'Submitted Events Plugin activated', 0 );\n\t\t\n\t\t// This is a harsh way of changing the database - all previous data will be lost!\n\t\t// But dbDelta wasn't doing the updates as intended\n\t\t$wpdb->query( \"DROP TABLE IF EXISTS \" . $table_name );\n\t\t\n\t\t$charset_collate = $wpdb->get_charset_collate ();\n\t\t\n\t\t// Max field lengths assumed, e.g.\n\t\t// date will be YYYY-MM-DD\n\t\t// packedlunch should be Yes or No but could be blank\n\t\t// altmeetpttime could be : or HH:MM\n\t\t$sql = \"CREATE TABLE \" . $table_name . \"(\n \tid mediumint(9) NOT NULL AUTO_INCREMENT,\n \tname VARCHAR(50) NOT NULL,\n\tdate VARCHAR(10) NOT NULL, \n\ttitle VARCHAR(150) NOT NULL,\n\tbrunelgroup VARCHAR(30) NOT NULL,\n\tlevel VARCHAR(30) NOT NULL,\n\tlength VARCHAR(30) NOT NULL,\n\tstarttime VARCHAR(20) NOT NULL,\n\tmeetpt VARCHAR(30) NOT NULL,\n\taltmeetpt VARCHAR(150) NOT NULL,\n\taltmeetgridref VARCHAR(20) NOT NULL,\n\taltmeetpttime VARCHAR(8) NOT NULL,\n\taltmeetcontactleader VARCHAR(4) NOT NULL,\t\t\n\tmapurl VARCHAR(200) NOT NULL,\n\temail VARCHAR(50) NOT NULL,\n\tphone VARCHAR(30) NOT NULL,\n\tpackedlunch VARCHAR(4) NOT NULL,\n\tpostwalk VARCHAR(20) NOT NULL,\n\tdescription text NOT NULL,\n\tcoleader VARCHAR(50) NOT NULL,\n\tcoleaderphone VARCHAR(30) NOT NULL,\t\t\n\tcarshareorganiser VARCHAR(4) NOT NULL,\t\n\teventgenerated boolean NOT NULL DEFAULT FALSE,\n \tPRIMARY KEY (id)\t\n\t) \" . $charset_collate . \";\";\n\t\t\n\t\trequire_once (ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\t\n\t\t// This isn't allowing updates to the table - error table exists\n\t\t// see http://wordpress.stackexchange.com/questions/41293/dbdelta-failing-with-error-wordpress-database-error-table-wp-2-myplugin-alre\n\t\tdbDelta ( $sql );\n\t\t\n\t\t// WordPress Options Hooks\n\t\tupdate_option ( 'submitted_events_db_version', $submitted_events_db_version );\n\t}\n}", "public function setUp()\n {\n parent::setUp();\n \n $this->db = Ediary_Db::getInstance();\n $this->object = new Ediary_Database_Schema($this->db);\n \n // DEBUG: THIS WILL DROP TABLES AND RECREATE THEM\n //Ediary_Db::getInstance()->upgrade();\n }", "public function initialize()\n {\n $this->setSource('tblEntry');\n\n $this->hasOne('userId', '\\Soul\\Model\\User', 'userId', ['alias' => 'user']);\n $this->belongsTo('eventId', '\\Soul\\Model\\Event', 'eventId', ['alias' => 'event']);\n $this->hasOne('paymentId', '\\Soul\\Model\\Payment', 'paymentId', ['alias' => 'payment']);\n }", "public function create_or_upgrade_tables() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t$this->create_table( $this->table );\n\t}", "public static function on_activate() {\n self::create_tables();\n }", "function generateCreateTableSQL($targetDB = 'MySQL', $makeLogTable = true)\n{\n if (!$makeLogTable){\n //create the main table statement\n $SQL = $this->_generateBasicCreateTable(\n $targetDB,\n $this->ModuleID,\n $this->ModuleFields,\n $this->PKFields,\n $this->Indexes\n );\n\n } else { //make changes from basic structure for audit trail table\n //table name for the log table is Module ID + \"_l\"\n $logTableName = $this->ModuleID . '_l';\n\n //copy module table fields to a local array\n $logTableFields = $this->ModuleFields;\n\n //copy primary key fields to a local array\n $logPKfields = $this->PKFields;\n\n //copy indexes to a local array\n $logIndexes = $this->Indexes;\n\n //remove 'auto_increment' from any primary key field\n foreach($logPKfields as $value){\n $logTableFields[$value]->dbFlags =\n str_replace('auto_increment', '',\n $logTableFields[$value]->dbFlags\n );\n }\n\n //prepend a special recordID to the beginning of the array\n $logPKfield = MakeObject(\n $this->ModuleID,\n '_RecordID',\n 'TableField',\n array(\n 'name' => '_RecordID',\n 'type' => 'int',\n 'dbFlags' => 'unsigned not null auto_increment',\n 'phrase' => 'LogID'\n )\n );\n\n array_unshift($logTableFields, $logPKfield);\n\n //also prepend it to the primary key list\n array_unshift($logPKfields, '_RecordID');\n\n //build the CREATE TABLE statement\n $SQL = $this->_generateBasicCreateTable(\n $targetDB,\n $logTableName,\n $logTableFields,\n $logPKfields,\n $logIndexes\n );\n\n //dispose of the log table array\n unset($logTableFields);\n }\n return $SQL;\n}", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}", "private function _createTable() {\n $query = \"\n CREATE TABLE `seo_metadata` (\n `metadata_id` int(11) NOT NULL auto_increment,\n `seo_id` char(60) NOT NULL,\n `seo_title` varchar(255) NOT NULL,\n `seo_description` varchar(255) NOT NULL,\n `seo_keyword` varchar(255) NOT NULL,\n PRIMARY KEY (`metadata_id`),\n KEY `id_idx` (`id`)\n )\";\n $this->getAdapter()->query( $query );\n }", "public function initTable(){\n\t\t\t\n\t\t}", "public function initializeTable($table)\n {\n DB::table($table)->truncate();\n DB::table($table)->insert([\n ['category_name' => 'Lent', 'category_type' => 'Expense', 'created_by' => 1],\n ['category_name' => 'Loan Return', 'category_type' => 'Expense', 'created_by' => 1],\n ['category_name' => 'Salary', 'category_type' => 'Income', 'created_by' => 1],\n ['category_name' => 'Loan', 'category_type' => 'Income', 'created_by' => 1],\n ['category_name' => 'Lent Return', 'category_type' => 'Income', 'created_by' => 1]\n ]);\n }", "private function initializeStorage(): void\n\t{\n\t\t$this->connection->query('\n\t\t\tCREATE TABLE IF NOT EXISTS ticket (\n\t\t\t\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\tclient_id TEXT NOT NULL,\n\t\t\t\tcreated TEXT,\n\t\t\t\tdeposit TEXT,\n\t\t\t\trate TEXT\t\t\t\t\n\t\t\t);\n\t\t');\n\n\t\t$this->connection->query('\n\t\t\tCREATE TABLE IF NOT EXISTS ticket_item (\n\t\t\t\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\tticket_id INTEGER NOT NULL,\n\t\t\t\tname TEXT,\n\t\t\t\ttip TEXT,\n\t\t\t\tstatus TEXT,\n\t\t\t\trate TEXT,\t\t\n\t\t\t\tdate_time TEXT\t\t\t\t\n\t\t\t);\n\t\t');\n\t}", "private function __construct() {\n\t\t$this->verifyBasicDatabaseTableSetup();\n\t}", "public function initialize()\r\n {\r\n $this->setSchema(\"test\");\r\n $this->setSource(\"event\");\r\n }", "private static function initialize_db() {\n\t\tif ( ! defined( 'WP_CLI_SNAPSHOT_DB' ) ) {\n\t\t\tdefine( 'WP_CLI_SNAPSHOT_DB', Utils\\trailingslashit( WP_CLI_SNAPSHOT_DIR ) . 'wp_snapshot.db' );\n\t\t}\n\n\t\tif ( ! ( file_exists( WP_CLI_SNAPSHOT_DB ) ) ) {\n\t\t\tself::create_tables();\n\n\t\t\treturn;\n\t\t}\n\n\t\t// phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.sqliteRemoved -- False positive.\n\t\tself::$dbo = new \\SQLite3( WP_CLI_SNAPSHOT_DB );\n\t}", "private function createDummyTable() {}", "protected function setupConfig()\n\t{\n\t\tparent::setupConfig();\n\t\t\n\t\tunset($this->config->event_log);\n\t\t$this->config->event_log = new EventLogTemp(\n\t\t\t$this->config->olp_db,\n\t\t\t$this->config->olp_db->db_info['db'],\n\t\t\t$this->config_data->application_id,\n\t\t\t'event_log_new_bbx'\n\t\t);\n\t}", "protected function createMigrationTable()\n {\n $migration_table = $this->config_file->getMigrationTable();\n\n $resource = $this->db_adapter->query(\"\n CREATE TABLE $this->migration_table (\n file VARCHAR PRIMARY KEY,\n ran_at TIMESTAMP DEFAULT NOW()\n );\n \");\n }", "public function ensureTableExists()\n {\n $_tableName = DB_PREFIX . \"wr360product\";\n $sqlCreateTable = <<<SQL\nCREATE TABLE IF NOT EXISTS `$_tableName` (\n `product_id` INT NOT NULL ,\n `root_path` VARCHAR(255) NULL DEFAULT NULL ,\n `config_file_url` VARCHAR(255) NULL DEFAULT NULL ,\n `wr360_enabled` TINYINT(1) NOT NULL DEFAULT '1' ,\n PRIMARY KEY (`product_id`) )\nENGINE = MyISAM\nDEFAULT CHARACTER SET = utf8;\nSQL;\n\n $this->db->query($sqlCreateTable);\n }", "private function populateDummyTable() {}", "function augmentDatabase() {\r\n\t}", "function create_table(){\n global $wpdb;\n\n require_once(ABSPATH . \"wp-admin\" . '/includes/upgrade.php');\n\n $table_name = $wpdb->base_prefix . $this->table;\n\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n post_id bigint(20) unsigned,\n blog_id mediumint(9) NOT NULL,\n post_author bigint(20) unsigned,\n post_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_date_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_content longtext,\n post_title text,\n post_excerpt text,\n post_status varchar(20) DEFAULT 'post_status',\n post_type varchar(20) DEFAULT 'post',\n post_modified_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_modified datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n guid varchar(255),\n UNIQUE KEY id (id)\n );\";\n\n dbDelta( $sql );\n }", "private function initialiseDatabaseStructure(){\r\n $this->exec($this->userTableSQL);\r\n $query = \"INSERT INTO `user` (`userName`,`userEmail`,`userFirstName`,`userSurname`,`userPassword`,`userIsActive`,`userIsAdmin`) VALUES(?,?,?,?,?,?,?);\";\r\n $statement = $this->prepare($query);\r\n $password = md5('Halipenek3');\r\n $statement->execute(array('admin','admin@glynntucker.com.au','Super','Admin',$password,1,1));\r\n\r\n //Create the knowledge Table\r\n $this->exec($this->knowledgeTableSQL);\r\n $this->exec($this->tagTableSQL);\r\n $this->exec($this->tagsTableSQL);\r\n }", "public function getLogTable() {}", "public function initialize()\n {\n $this->setSchema(\"animedb\");\n $this->setSource(\"episodes\");\n $this->hasMany('id', 'Videos', 'episode_id', ['alias' => 'Videos']);\n $this->belongsTo('anime_id', '\\Anime', 'id', ['alias' => 'Anime', 'reusable' => true]);\n $this->allowEmptyStringValues(['title', 'description']);\n $this->skipAttributes(['date']);\n }", "public function handleRunOnce()\n {\n // Wait for the tables to be created (see #5061)\n if (!$this->hasTable('tl_log')) {\n return;\n }\n\n Backend::handleRunOnce();\n }", "public function createLogTable($checkExistence = true)\n {\n if ($checkExistence && $this->isTableExists()) {\n throw new \\RuntimeException(\"Table `{$this->tableName}` already exists.\");\n }\n\n $sql = <<<SQL\nCREATE TABLE `{$this->tableName}` (\n `id` INT UNSIGNED NOT NULL AUTO_INCREMENT\n COMMENT 'Id',\n `request_data` JSON NOT NULL\n COMMENT 'Jivochat Webhook API request data (JSON string)',\n `response_data` JSON NULL DEFAULT NULL \n COMMENT 'Jivochat Webhook API response data (JSON string)',\n `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP\n COMMENT 'Log creation datetime',\n `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\n COMMENT 'Update datetime',\n PRIMARY KEY (id)\n)\n ENGINE = InnoDB\n COMMENT 'Stores Jivochat Webhooks API requests.';\nSQL;\n $result = $this->pdo->exec($sql);\n if (!$result) {\n $errorInfo = print_r($this->pdo->errorInfo(), true);\n throw new \\RuntimeException(\"Couldn't create Log table. Query string: `{$sql}`, table name: `{$this->tableName}`, error info: `{$errorInfo}`.\");\n }\n }", "private function initDB(){\n $sql = \"\n CREATE SCHEMA IF NOT EXISTS `\".$this->_database.\"` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;\n USE `\".$this->_database.\"` ;\n \";\n try {\n $dbh = new PDO(\"mysql:host=$this->_host\", $this->_username, $this->_password,array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));\n $dbh->exec($sql)\n or die(print_r($dbh->errorInfo(), true));\n } catch (PDOException $e) {\n $err_data = array('stmt'=>'on init');\n Helper_Error::setError( Helper_Error::ERROR_TYPE_DB , $e->getMessage() , $err_data , $e->getCode() );\n die(\"DB init ERROR: \". $e->getMessage());\n }\n }", "protected function createOldTable()\n {\n $this->setUpNewTable();\n $this->getSchemaManager()->createTable($this->getOldTable());\n }", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(EmailManagerHistoryTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(EmailManagerHistoryTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new EmailManagerHistoryTableMap());\n }\n }", "public function setUpDatabaseTables()\n {\n $table = new DModuleTable();\n $table -> setName(\"currencies\");\n $table -> addBigIncrements( \"id\" , true );\n $table -> addString( \"base\" , true);\n $table -> addLongText( 'rates' , true);\n $table -> addDateTime( 'added' , true );\n $table -> addBoolean( 'status' , true);\n $table -> addString( \"extra\" , false);\n $table -> addString( \"extra2\" , false);\n $this -> addTable( $table );\n }", "protected function createMigrationHistoryTable()\n {\n $tableName = $this->db->schema->getRawTableName($this->migrationTable);\n $this->stdout(\"Creating migration history table \\\"$tableName\\\"...\", Console::FG_YELLOW);\n\n $this->db->createCommand()->createTable($this->migrationTable, [\n 'version' => 'String',\n 'apply_time' => 'DateTime',\n ], 'ENGINE = MergeTree() PRIMARY KEY (version) ORDER BY (version)')->execute();\n\n $this->addMigrationHistory(self::BASE_MIGRATION);\n\n $this->stdout(\"Done.\\n\", Console::FG_GREEN);\n }", "private function createTables()\n {\n $this->createConfigsTable();\n $this->createServersTable();\n $this->createSearchesTable();\n }", "function create()\r\n{\r\n\t$query = \"CREATE TABLE IF NOT EXISTS `#__flexicontact_log` (\r\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t `datetime` datetime NOT NULL,\r\n\t\t\t\t `name` varchar(60) NOT NULL DEFAULT '',\r\n\t\t\t\t `email` varchar(60) NOT NULL DEFAULT '',\r\n\t\t\t\t `admin_email` varchar(60) NOT NULL DEFAULT '',\r\n\t\t\t\t `subject` varchar(100) NOT NULL DEFAULT '',\r\n\t\t\t\t `message` text NOT NULL,\r\n\t\t\t\t `status_main` varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t\t `status_copy` varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t\t `ip` varchar(40) NOT NULL DEFAULT '',\r\n\t\t\t\t `browser_id` tinyint(4) NOT NULL DEFAULT '0',\r\n\t\t\t\t `browser_string` varchar(20) NOT NULL DEFAULT '',\r\n\t\t\t\t `list_choice` varchar(60) DEFAULT NULL,\r\n\t\t\t\t `field1` varchar(100) DEFAULT NULL,\r\n\t\t\t\t `field2` varchar(100) DEFAULT NULL,\r\n\t\t\t\t `field3` varchar(100) DEFAULT NULL,\r\n\t\t\t\t `field4` varchar(100) DEFAULT NULL,\r\n\t\t\t\t `field5` varchar(100) DEFAULT NULL,\r\n\t\t\t\t PRIMARY KEY (`id`),\r\n\t\t\t\t KEY `DATETIME` (`datetime`)\r\n\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\";\r\n\t\t\t\t\r\n\t$result = $this->ladb_execute($query);\r\n\t\r\n\tif ($result === false)\r\n\t\t{\r\n\t\t$this->_app->enqueueMessage($this->ladb_error_text, 'error');\r\n\t\treturn false;\r\n\t\t}\r\n\r\n\treturn true;\r\n}" ]
[ "0.7161281", "0.65283597", "0.6396993", "0.6389922", "0.6337952", "0.6094936", "0.6082936", "0.60522753", "0.60501117", "0.60190827", "0.5922508", "0.591922", "0.59157014", "0.5887158", "0.583535", "0.5819186", "0.5784603", "0.57832897", "0.5779371", "0.5758786", "0.5731722", "0.5726381", "0.5726308", "0.5716075", "0.5692989", "0.56835395", "0.5678669", "0.5666292", "0.5659928", "0.56580824", "0.56452304", "0.56316084", "0.55804175", "0.5575248", "0.5574885", "0.555939", "0.55576396", "0.55394137", "0.5536597", "0.55342746", "0.5529981", "0.55256987", "0.5524745", "0.5520952", "0.55206543", "0.5520021", "0.5515438", "0.55094546", "0.5503631", "0.5499696", "0.5497316", "0.5490018", "0.5472047", "0.54700875", "0.54574424", "0.5456859", "0.54504657", "0.54444414", "0.5442332", "0.54384726", "0.5436944", "0.54363215", "0.54168177", "0.54142165", "0.5407479", "0.5397051", "0.53968126", "0.53843963", "0.5380584", "0.537492", "0.53723305", "0.53630716", "0.5358677", "0.53404117", "0.53350747", "0.53306484", "0.5327598", "0.53172714", "0.5311734", "0.5311643", "0.53045505", "0.52985966", "0.52942497", "0.52855104", "0.52813315", "0.52722967", "0.52707654", "0.52681124", "0.52650726", "0.5263533", "0.5257414", "0.52548635", "0.5246587", "0.52341646", "0.52314353", "0.5229959", "0.5229925", "0.5227059", "0.5217237", "0.52097887", "0.5206117" ]
0.0
-1
end init_queries option's value is requested but the option has not yet been set
function option_default($option) { switch($option) { case 'quizx_enabled': return 1; // true case 'quizx_timeformat': return 'd.m.Y'; case 'quizx_servertimezone': return 'Europe/Berlin'; case 'quizx_localization': return 'en_US'; case 'quizx_lastqutoshow': return 3; case 'quizx_permission': return QA_PERMIT_ADMINS; // default level to access editor page default: return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initQuery()\n {\n // reset\n $this->result = false;\n \n $this->errorCode = 0;\n $this->errorMessage = '';\n }", "protected function init()\r\n {\r\n parent::init();\r\n\r\n foreach ($this->options as $name => $value) {\r\n switch ($name) {\r\n case 'query':\r\n if (!is_array($value)) {\r\n $value = array(array('query' => $value));\r\n }\r\n $this->addQueries($value);\r\n break;\r\n }\r\n }\r\n }", "public function init_save_queries()\n {\n }", "abstract protected function initQuery(): void;", "private function _setDefaults(): void {\n\t\t// default query options\n\t\t$options['limit'] = 50;\n\t\t$options['offset'] = false;\n\t\t$options['sort'] = false;\n\t\t$options['sortDirection'] = false;\n\t\t$this->setQueryOptions($options);\n\t}", "function init() {\n if (!$this->options['persistant']) $this->options['value'] = null;\n }", "function init()\n {\n $this->options = get_option('bundesliga_table_options');\n\n \n if ( $this->options->last_scraped)\n {\n\t\t\t$diff = time() - $this->options->last_scraped;\n\t\t\tif ($diff > (60)) //every minute\n\t\t\t{\n\t\t\t\t//do a call since it has been more than an hour since you last checked for data\n\t \t$this->options->last_scraped = time();\n\t \t$this->options->bundesliga_table_data = $this->get_data_from_url();\n \t\t\tupdate_option('bundesliga_table_options', $this->options); \t\t\t\n\t\t\t}\n }\n else\n {\n \t//do the first time call\n \t$this->options->last_scraped = time();\n \t$this->options->bundesliga_table_data = $this->get_data_from_url();\n \t$this->options->showlink = 0;\n \t\tupdate_option('bundesliga_table_options', $this->options);\n }\n \n }", "private function initQuery()\n {\n $this->_lastSql = null;\n $this->_limit = null;\n $this->_offset = null;\n $this->_order = array();\n $this->_group = array();\n $this->_table = null;\n $this->_stmt = null;\n\n $this->fromStates = array();\n $this->selectFields = array();\n $this->whereStates = array();\n $this->havingStates = array();\n $this->values = array();\n $this->joinStates = array();\n }", "private function resetShowQueries(): void\n {\n if ($this->showQueries === self::SHOW_QUERIES_RESET) {\n return;\n }\n if ($this->showQueries) {\n $_REQUEST['showqueries'] = $this->showQueries;\n } else {\n unset($_REQUEST['showqueries']);\n }\n $this->showQueries = self::SHOW_QUERIES_RESET;\n }", "protected function initOptions()\n {\n }", "public function set_default_query($query){\n $this->default_query = $query;\n }", "public function _testInitQuery() {\n $view = Views::getView('test_view');\n $view->setDisplay();\n\n $view->initQuery();\n $this->assertInstanceOf(QueryTestPlugin::class, $view->query);\n }", "private function setQueryParams()\n {\n if (empty($this->generator->types[CustomsInterface::CUSTOM_TYPES_QUERY_PARAMS][ApiInterface::RAML_PROPS]) === false) {\n $queryParams = $this->generator->types[CustomsInterface::CUSTOM_TYPES_QUERY_PARAMS][ApiInterface::RAML_PROPS];\n $this->openEntity(ConfigInterface::QUERY_PARAMS);\n foreach ($this->queryParams as $param) {\n if (empty($queryParams[$param][ApiInterface::RAML_KEY_DEFAULT]) === false) {\n $this->setParam($param, $queryParams[$param][ApiInterface::RAML_TYPE], $queryParams[$param][ApiInterface::RAML_KEY_DEFAULT], 2);\n }\n }\n $this->closeEntities();\n }\n }", "public function resetQuery(): void\n\t{\n\t\t$this->state = new State();\n\t\t$this->explain = FALSE;\n\t}", "function init() {\n $this->options['selected'] = isset($this->options['value']) ?\n true : @(bool)$this->options['default'];\n }", "public function initializeObject()\n {\n $this->defaultQuerySettings = $this->objectManager->get(Typo3QuerySettings::class);\n $this->defaultQuerySettings->setRespectStoragePage(false);\n }", "public function initDBQuery($dbQuery)\n {\n $this->dbQuery = $dbQuery;\n return;\n }", "public function getQuerySettings() {}", "function getQuerySettings() ;", "private function initializeStatement( $clear = false )\r\n {\r\n if ( isset( $this->stmt ) && $this->stmt instanceof PDOStatement && !$clear ) {\r\n return;\r\n }\r\n $sql = $this->sql . \" LIMIT ? OFFSET ?\";\r\n $this->logger->log ( $sql );\r\n $this->stmt = $this->conn->prepare( $sql );\r\n $nextIndex = 1;\r\n if ( $this->mode == self::MODE_PARAMETERIZED ) {\r\n for ( $i = 0; $i < count( $this->values); $i++) {\r\n if ( is_bool( $this->values[$i] ) ) {\r\n $this->stmt->bindValue( $i+1, $this->values[$i], PDO::PARAM_BOOL );\r\n } else {\r\n $this->stmt->bindValue( $i+1, $this->values[$i] );\r\n }\r\n }\r\n $nextIndex = ++$i;\r\n }\r\n $this->index['max'] = $nextIndex++;\r\n $this->index['start'] = $nextIndex++;\r\n }", "protected function resetLastQuery(): void\n {\n $this->lastQuery = null;\n }", "public function init()\n {\n global $kong_helpdesk_options;\n $this->options = $kong_helpdesk_options;\n }", "public function query() {\n if (!empty($this->value)) {\n parent::query();\n }\n }", "public static function resetQueryCount() {\n \tself::$queryCount = 0;\n }", "private function startCountingSelectQueries(): void\n {\n if ($this->showQueries !== self::SHOW_QUERIES_RESET) {\n throw new LogicException('showQueries wasnt reset, you did something wrong');\n }\n $this->showQueries = $_REQUEST['showqueries'] ?? null;\n // force showqueries on to count the number of SELECT statements via output-buffering\n // if this approach turns out to be too brittle later on, switch to what debugbar\n // does and use tractorcow/proxy-db which should be installed as a dev-dependency\n // https://github.com/lekoala/silverstripe-debugbar/blob/master/code/Collector/DatabaseCollector.php#L79\n $_REQUEST['showqueries'] = 1;\n ob_start();\n echo '__START_ITERATE__';\n }", "public function init()\n\t{\n\t\tif ($this->db->get_sql_layer() != 'mysql' && $this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli' && $this->db->get_sql_layer() != 'postgres')\n\t\t{\n\t\t\treturn $this->user->lang['FULLTEXT_SPHINX_WRONG_DATABASE'];\n\t\t}\n\n\t\t// Move delta to main index each hour\n\t\tset_config('search_gc', 3600);\n\n\t\treturn false;\n\t}", "public function is_main_query()\n {\n }", "function addQuery() {}", "public static function init()\r\n {\r\n self::$Data = get_option(self::OPT_SETTINGS);\r\n //when the plugin updated, this will be true\r\n if (empty(self::$Data) || empty(self::$Data['version']) || version_compare(DUPLICATOR_VERSION, self::$Data['version'], '>')) {\r\n self::SetDefaults();\r\n }\r\n }", "private function initOptions()\n {\n $this->optionsResolver->setDefaults([\n 'collection' => [],\n ]);\n\n $this->optionsResolver->setAllowedTypes('collection', 'array');\n }", "public function options_init() {\n\t\t\tglobal $allowedtags;\n\t\t\t$allowedtags['p'] = array();\n\t\t\t$this->allowedtags = $allowedtags;\n\n\t\t // set options equal to defaults\n\t\t $this->_options = get_option( $this->options_group[0]['options_name'] );\n\t\t if ( false === $this->_options ) {\n\t\t\t\t$this->_options = $this->get_defaults();\n\t\t }\n\t\t if ( isset( $_GET['undo'] ) && !isset( $_GET['settings-updated'] ) && is_array( $this->get_option('previous') ) ) {\n\t\t \t$this->_options = $this->get_option('previous');\n\t\t }\n\t\t update_option( $this->options_group[0]['options_name'], $this->_options );\t\t\n\t\t \n\t\t}", "public function clearQueries(): void\n {\n $this->queries = [];\n }", "protected function resetQuery()\n {\n $this->bindings = [];\n $this->types = [];\n }", "function getOptionValuesFromQuery() {\t\t\n\t\t# get the query to execute\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t$query = $conn->fetchRow(\"SELECT querystring FROM lookupquery WHERE name = '\".$this->getName().\"'\");\n\t\t# debugMessage($query); \n\t\tif (isEmptyString($query['querystring'])) {\n\t\t\treturn array(); \n\t\t} else {\n\t\t\treturn getOptionValuesFromDatabaseQuery($query['querystring']);\n\t\t}\n\t}", "public function initializeObject()\n {\n /** @var $defaultQuerySettings \\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface */\n $defaultQuerySettings = $this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface::class);\n $defaultQuerySettings->setRespectStoragePage(false);\n $this->setDefaultQuerySettings($defaultQuerySettings);\n }", "function query() {\n // Do nothing: fake field.\n }", "function _setDefaults()\n {\n $this->options['dsn'] = null;\n $this->options['table'] = 'sessiondata';\n $this->options['autooptimize'] = false;\n }", "public function initializeObject() {\n\t\t$this->defaultQuerySettings = $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Typo3QuerySettings');\n\t\t$this->defaultQuerySettings->setRespectStoragePage(FALSE);\n\t}", "public function init()\n {\n $this->loadDefaultWhere();\n }", "function queries_run(){\n\t\tglobal $database_sql_queries;\n\t\treturn($database_sql_queries);\n\t}", "function register_block_core_query_no_results()\n {\n }", "public function selective_refresh_init()\n {\n }", "public function init()\n {\n $this->logger = GeneralUtility::makeInstance(Logger::class);\n\n $sqlQuerySettings = $this->filterConfig->getSettings('optionsSqlQuery');\n\n foreach ($sqlQuerySettings as $type => $part) {\n if (!is_array($part)) {\n $sqlQuerySettings[$type] = trim($part);\n }\n }\n\n $fromPart = trim(RenderValue::stdWrapIfPlainArray($sqlQuerySettings['from']));\n $items = GeneralUtility::trimExplode(' ', $fromPart);\n\n Assert::isInRange(count($items), 1 ,2 , ['message' => 'baseFromClause of Backend in TS has not the correct values! This should be table name and optional alias added by space! 1280234420']);\n\n $fromTable= trim($items[0]);\n $fromAlias = $items[1] ?? null;\n\n /** @var Connection $connection */\n $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($fromTable);\n $this->queryBuilder = $connection->createQueryBuilder();\n\n if ($sqlQuerySettings['select']) {\n $this->queryBuilder->selectLiteral(RenderValue::stdWrapIfPlainArray($sqlQuerySettings['select']));\n }\n $this->queryBuilder->from($fromTable, $fromAlias);\n\n if ($sqlQuerySettings['join']) {\n foreach ($sqlQuerySettings['join'] as $joinPart) {\n $joinFromAlias = trim($joinPart['fromAlias']);\n $joinTable = trim($joinPart['table']);\n $joinAlias = trim($joinPart['alias']) ?: trim($joinPart['table']);\n $joinOn = trim($joinPart['on']);\n $joinMethod = (strtolower(trim($joinPart['type'])) ?: 'inner') . 'Join';\n $this->queryBuilder->$joinMethod($joinFromAlias, $joinTable, $joinAlias, $joinOn);\n }\n }\n\n\n if ($sqlQuerySettings['where']) {\n $this->queryBuilder->where(RenderValue::stdWrapIfPlainArray($sqlQuerySettings['where']));\n }\n\n if ($sqlQuerySettings['orderBy']) {\n $items = GeneralUtility::trimExplode(' ', $sqlQuerySettings['orderBy']);\n $this->queryBuilder->orderBy($items[0], $items[1] ?? '');\n\n }\n if ($sqlQuerySettings['groupBy']) {\n $this->queryBuilder->groupBy(RenderValue::stdWrapIfPlainArray($sqlQuerySettings['groupBy']));\n }\n if ($sqlQuerySettings['limit']) {\n $items = GeneralUtility::trimExplode(',', RenderValue::stdWrapIfPlainArray($sqlQuerySettings['limit']));\n if ($items > 1) {\n $this->queryBuilder->setFirstResult($items[0]);\n $this->queryBuilder->setMaxResults($items[1]);\n } else {\n $this->queryBuilder->setMaxResults($items[0]);\n }\n }\n\n $this->filterField = trim($this->filterConfig->getSettings('filterField'));\n $this->displayFields = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::trimExplode(',', $this->filterConfig->getSettings('displayFields'));\n\n Assert::isNotEmptyString($this->filterField, ['info' => 'No filter field is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221957']);\n Assert::isNotEmptyString($sqlQuerySettings['select'], ['info' => 'No Select part is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221958']);\n Assert::isNotEmptyString($sqlQuerySettings['from'], ['info' => 'No from part is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221959']);\n }", "function initialize_options()\n\t\t{\n\t\t\tglobal $config;\n\n\t\t\t$defaults = array(\n\t\t\t\t'minimum_age' => 4,\n\t\t\t\t'maximum_age' => 0,\n\t\t\t);\n\t\t\tforeach ($defaults as $option => $default)\n\t\t\t{\n\t\t\t\tif (!isset($config[$option]))\n\t\t\t\t{\n\t\t\t\t\tset_config($option, $default);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function initDefaultOptions(){\n\n\t\t\t$defaults = $this->defaultOptions();\n\t\t\treturn update_option( $this->optionsKey, $defaults );\n\t\t}", "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}", "protected function _initDefaultOptions()\n {\n $this->_options[self::OPT_STOP_PROMPTING_ON_DTMF] = self::STOP_PROMPTING_ON_DTMF_DEFAULT;\n $this->_options[self::OPT_NO_INPUT_PROMPT_PLAYLIST] = array();\n $this->_options[self::OPT_END_READING_KEY] = Streamwide_Engine_Dtmf_Handler::KEY_POUND;\n $this->_options[self::OPT_RETURN_ALL_INPUT] = self::RETURN_ALL_INPUT_DEFAULT;\n $this->_options[self::OPT_TRIES] = self::DEFAULT_NUMBER_OF_TRIES;\n }", "function initialiserId()\n {\n if(empty($this->m_idOption))\n {\n $requete = 'SELECT idOption FROM optionHotel WHERE libelleOption=? AND prixOption=?';\n $tabParametres = array($this->m_libelleOption, $this->m_prixOption);\n $tabResultat = $this->m_bdd->selection($requete, $tabParametres);\n $this->m_idOption = $tabResultat[0]['idOption']; \n }\n }", "public function setQueryOptions(array $options): void {\n\t\tif(!isset($options['limit'])) $options['limit'] = 20;\n\t\tif(!isset($options['offset'])) $options['offset'] = false;\n\t\tif(!isset($options['sort'])) $options['sort'] = false;\n\t\tif(!isset($options['sortDirection'])) $options['sortDirection'] = false;\n\t\tif(!isset($options['groupby'])) $options['groupby'] = '';\n\n\t\t$this->_queryOptions = $options;\n\t}", "function get_num_queries()\n {\n }", "function wassupoptions() {\n\t\t//# initialize class variables with current options \n\t\t//# or with defaults if none\n\t\t$this->loadSettings();\n\t}", "public static function useDefaultQueryGrammar()\n {\n }", "public function initOptions()\n {\n $this->setOption('className', '%CLASS%' . $this->getRelationName());\n }", "abstract protected function initQuery(Query $query): Query;", "public function check_queries() {\r\n\t\tQueryManager::check_queries();\r\n\t}", "protected function dbReset() {\r\n $this->query_result = '';\r\n }", "public function setQuery($q)\n {\n if (is_string($q)) {\n $this->options['Query'] = $q;\n } else {\n return false;\n }\n }", "protected function initConnection()\n {\n parent::initConnection();\n $this->enableSlaves = false;\n\n if($this->isISeries === null){\n try {\n $stmt = $this->pdo->query('SELECT * FROM QSYS2.SYSTABLES FETCH FIRST 1 ROW ONLY');\n $this->isISeries = boolval($stmt);\n } catch (\\Exception $ex) {\n $this->isISeries = false;\n }\n }\n if($this->defaultSchema && !$this->isISeries){\n $this->pdo->exec('SET CURRENT SCHEMA ' . $this->defaultSchema);\n }\n\n }", "protected function _getDefaultOptions()\n {\n }", "public function init()\n\t{\n\t\t$this->_init = true;\n\t\t$db = $this->getDbConnection();\n\t\t$this->preload = $this->preprocessParams($this->preload);\n\t\tif (!empty($this->preload) || $this->autoLoad)\n\t\t{\n\t\t\t$sql = 'SELECT option_name, option_value FROM '.$this->paramsTableName;\n\t\t\tif (sizeof($this->preload))\n\t\t\t\t$sql .= ' WHERE option_name IN (\\''.implode('\\',\\'', $this->preload).'\\')';\n\t\t\t$cmd = $db->createCommand($sql);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$reader = $cmd->query();\n\t\t\t\tforeach ($reader as $row)\n\t\t\t\t{\n\t\t\t\t\t$this->add($row['option_name'], $row['option_value']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (CException $e)\n\t\t\t{\n\t\t\t\t//table is not present\n\t\t\t\t$createTable = true;\n\t\t\t\t//if there is no table, then attributes are empty.\n\t\t\t\tfor ($i = 0, $s = sizeof($this->preload); $i < $s; $i++)\n\t\t\t\t{\n\t\t\t\t\t$this->add($this->preload[$i], null);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//check if table exist\n\t\t\tif ($db->createCommand('SHOW TABLES LIKE \\''.$this->paramsTableName.'\\'')->query()->rowCount <= 0)\n\t\t\t\t$createTable = true;\n\t\t}\n\t\tif ($createTable === true)\n\t\t{\n\t\t\tif($this->autoCreateParamsTable)\n\t\t\t\t$this->createParamsTable($db,$this->paramsTableName);\n\t\t\telse\n\t\t\t\tthrow new CException(Yii::t('xparam','Params table \"{tableName}\" does not exist.',\n\t\t\t\t\tarray('{tableName}'=>$this->paramsTableName)));\n\t\t}\n\t}", "public function stopQuery()\n {\n }", "function init($options='')\n\t{\n\t\tglobal $conf;\n\n\t\t// Permissions\n\t\t$this->remove($options);\n\n\t\t$sql = array();\n\n\t\t$result=$this->load_tables();\n\n\t\treturn $this->_init($sql,$options);\n\t}", "public function initURLQueryStringName($value) \n {\n $this->urlQueryStringName = $value;\n return;\n }", "public function init()\n {\n // Default user search for all users\n if ($this->userSearchUrl == \"\") {\n // provide the space id if the widget is calling from a space\n if (Yii::$app->controller->id == 'space') {\n $spaceId = Yii::$app->controller->getSpace()->id;\n $this->userSearchUrl = Url::toRoute(['/teams/search/json', 'keyword' => '-keywordPlaceholder-', 'space_id' => $spaceId]);\n } else {\n $this->userSearchUrl = Url::toRoute(['/teams/search/json', 'keyword' => '-keywordPlaceholder-']);\n }\n }\n }", "protected function get_options()\n\t{}", "function pre_query() { \r\n // Unset invalid date values before the query runs.\r\n if (!empty($this->view->args) && count($this->view->args) > $this->position) {\r\n $argument = $this->view->args[$this->position];\r\n $parts = $this->date_handler->arg_parts($argument);\r\n if (empty($parts[0]['date']) && empty($parts[0]['period'])) {\r\n unset($this->view->args[$this->position]); \r\n }\r\n }\r\n \r\n $this->get_query_fields();\r\n if (!empty($this->query_fields)) {\r\n foreach ($this->query_fields as $query_field) {\r\n $field = $query_field['field'];\r\n // Explicitly add this table using add_table so Views does not\r\n // remove it if it is a duplicate, since that will break the query.\r\n $this->query->add_table($field['table_name'], NULL, NULL, $field['table_name']);\r\n }\r\n }\r\n }", "protected function _reset_select()\r\n\t{\r\n\t\t$this->_reset_run(array(\r\n\t\t\t'qb_select'\t\t=> array(),\r\n\t\t\t'qb_from'\t\t=> array(),\r\n\t\t\t'qb_join'\t\t=> array(),\r\n\t\t\t'qb_where'\t\t=> array(),\r\n\t\t\t'qb_groupby'\t\t=> array(),\r\n\t\t\t'qb_having'\t\t=> array(),\r\n\t\t\t'qb_orderby'\t\t=> array(),\r\n\t\t\t'qb_aliased_tables'\t=> array(),\r\n\t\t\t'qb_no_escape'\t\t=> array(),\r\n\t\t\t'qb_distinct'\t\t=> FALSE,\r\n\t\t\t'qb_limit'\t\t=> FALSE,\r\n\t\t\t'qb_offset'\t\t=> FALSE,\r\n 'qb_lock_in_share_mode' => FALSE,\r\n 'qb_for_update' => FALSE\r\n\t\t));\r\n\t}", "public function init()\n\t\t{\n\t\t\t$this->fields['squadra']['writeParms']['optArray'] = array('' => '' ,'Serie C' => 'Serie C', '1° Division' => '1° Divisione', 'Giovanile' => 'Giovanile', 'Staff Tecnico - Dirigenza' => 'Staff Tecnico - Dirigenza'); // Example Drop-down array. \t\t\n\n//\t\t\t$this->fields['ruolo']['writeParms']['optArray'] = array('' => '' , 'Palleggiatore' => 'Palleggiatore','Schiacciatore' => 'Schiacciatore', 'Opposto' => 'Opposto', 'Centrale' => 'Centrale', 'Libero' => 'Libero', 'Allenatore' => 'Allenatore', '2* Allenatore' => '2* Allenatore', 'Direttore Sportivo' => 'Direttore Sportivo', 'Direttore Tecnico' => 'Direttore Tecnico', 'Presidente' => 'Presidente', 'Vice Presidente' => 'Vice Presidente', 'Preparatore Atletico' => 'Preparatore Atletico', 'Massaggiatore' => 'Massaggiatore', 'Medico' => 'Medico', 'Massaggiatore' => 'Massaggiatore', 'Dirigente' => 'Dirigente', ''); // Example Drop-down array. \n\t\t\t$this->fields['ruolo']['writeParms']['optArray'] = array('' => '' , 'Palleggiatore' => 'Palleggiatore','Schiacciatore' => 'Schiacciatore', 'Opposto' => 'Opposto', 'Centrale' => 'Centrale', 'Libero' => 'Libero', 'Allenatore' => 'Allenatore', '2* Allenatore' => '2* Allenatore', 'Direttore Sportivo' => 'Direttore Sportivo', 'Direttore Tecnico' => 'Direttore Tecnico', 'Presidente' => 'Presidente', 'Vice Presidente' => 'Vice Presidente', 'Preparatore Atletico' => 'Preparatore Atletico', 'Massaggiatore' => 'Massaggiatore', 'Medico' => 'Medico', 'Massaggiatore' => 'Massaggiatore', 'Dirigente' => 'Dirigente'); // Example Drop-down array. \n\t\t\n\t\t\t$this->fields['incarico']['writeParms']['optArray'] = array('' => '', 'Capitano' => 'Capitano','Vice Capitano'=> 'Vice Capitano', 'Player' => 'Player'); // Example Drop-down array. \n\n\t\t}", "public function clearQueries();", "private function synch_options_from_loaded_quba() {\n $this->options->behaviour = $this->quba->get_preferred_behaviour();\n $this->options->maxmark = $this->quba->get_question_max_mark($this->slot);\n }", "public function useDefaultQueryGrammar()\n {\n $this->queryGrammar = $this->getDefaultQueryGrammar ();\n }", "public function useQueryCLI() {\n parent::useQueryCLI();\n }", "public function init(Builder $queryBuilder);", "function graphql_init()\n {\n }", "private function init() {\n \t// $input->key = 'magazine';\n \t// $input->subkey = array('1','2');\n \t// $magazinetype = getSetList($input);\n \t// $this->output->subkey_options = $magazinetype;\n \t// $this->output->homepage_options = getYesOrNoOptions();\n \t// $this->output->homepage_choose = '0';\n }", "function ajax_query_init($request, $query)\n {\n }", "public function __construct()\n {\n $this->options = [];\n }", "function setQuery($ezSQL='') {\n global $_ezQuery, $_ezMysqli;// $_ezCubrid, $_ezOracle8_9, $_ezOracleTNS; 'recordset' ,'oracle8_9', 'oracletns',\n global $_ezPdo, $_ezPostgresql, $_ezRecordset, $_ezSqlite3, $_ezSqlsrv;\n if (in_array(strtolower($ezSQL), array( 'cubrid', 'mysqli', 'pdo', 'postgresql', 'sqlite3', 'sqlsrv' ))) {\n switch(strtolower($ezSQL)) {\n // case 'cubrid':\n // $_ezQuery = $_ezCubrid;\n // break;\n case 'mysqli':\n $_ezQuery = $_ezMysqli;\n break;\n // case 'oracle8_9':\n // $_ezQuery = $_ezOracle8_9;\n // break;\n // case 'oracletns':\n // $_ezQuery = $_ezOracleTNS;\n // break;\n case 'pdo':\n $_ezQuery = $_ezPdo;\n break;\n case 'postgresql':\n $_ezQuery = $_ezPostgresql;\n break;\n case 'recordset':\n $_ezQuery = $_ezRecordset;\n break;\n case 'sqlite3':\n $_ezQuery = $_ezSqlite3;\n break;\n case 'sqlsrv':\n $_ezQuery = $_ezSqlsrv;\n break; \n }\n return (!empty($_ezQuery)) ? true: false; \n } else {\n\t\t\t$_ezQuery = null;\n unset($_ezQuery);\n return false; \n }\n }", "function setQuery($ezSQL='') {\n global $_ezQuery, $_ezMysqli;// $_ezCubrid, $_ezOracle8_9, $_ezOracleTNS; 'recordset' ,'oracle8_9', 'oracletns',\n global $_ezPdo, $_ezPostgresql, $_ezRecordset, $_ezSqlite3, $_ezSqlsrv;\n if (in_array(strtolower($ezSQL), array( 'cubrid', 'mysqli', 'pdo', 'postgresql', 'sqlite3', 'sqlsrv' ))) {\n switch(strtolower($ezSQL)) {\n // case 'cubrid':\n // $_ezQuery = $_ezCubrid;\n // break;\n case 'mysqli':\n $_ezQuery = $_ezMysqli;\n break;\n // case 'oracle8_9':\n // $_ezQuery = $_ezOracle8_9;\n // break;\n // case 'oracletns':\n // $_ezQuery = $_ezOracleTNS;\n // break;\n case 'pdo':\n $_ezQuery = $_ezPdo;\n break;\n case 'postgresql':\n $_ezQuery = $_ezPostgresql;\n break;\n case 'recordset':\n $_ezQuery = $_ezRecordset;\n break;\n case 'sqlite3':\n $_ezQuery = $_ezSqlite3;\n break;\n case 'sqlsrv':\n $_ezQuery = $_ezSqlsrv;\n break; \n }\n return (!empty($_ezQuery)) ? true: false; \n } else {\n\t\t\t$_ezQuery = null;\n unset($_ezQuery);\n return false; \n }\n }", "function clearQuery($inparms){\n unset($this->_query);\n $this->_query = new booleanQuery();\n $this->selectedNode = -1;\n $this->selectedOperator = -1;\n\n return $this->output(NULL);\n }", "public static function enableQueryLog()\n {\n }", "public function it_can_populate_options_from_database_dynamically()\n {\n $this->configureInputs([\n [\n 'name' => 'app_migrations',\n 'label' => 'App Migration',\n 'type' => 'select',\n 'options' => function () {\n return DB::table('migrations')->pluck('migration', 'id')->toArray();\n }\n ]\n ]);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('select')\n ->assertSee('2014_10_00_000000_create_settings_table');\n }", "protected function initializeAction()\n {\n parent::initializeAction();\n\n $query = GeneralUtility::_GET('q');\n if ($query !== null) {\n $this->request->setArgument('q', $query);\n }\n }", "protected function setDefaults()\n {\n $this->options['dsn'] = null;\n $this->options['table'] = 'sessiondata';\n $this->options['autooptimize'] = false;\n }", "protected function _reset_select()\n\t{\n\t\t$this->_reset_run(array(\n\t\t\t'qb_select'\t\t=> array(),\n\t\t\t'qb_from'\t\t=> array(),\n\t\t\t'qb_join'\t\t=> array(),\n\t\t\t'qb_where'\t\t=> array(),\n\t\t\t'qb_groupby'\t\t=> array(),\n\t\t\t'qb_having'\t\t=> array(),\n\t\t\t'qb_orderby'\t\t=> array(),\n\t\t\t'qb_aliased_tables'\t=> array(),\n\t\t\t'qb_no_escape'\t\t=> array(),\n\t\t\t'qb_distinct'\t\t=> FALSE,\n\t\t\t'qb_limit'\t\t=> FALSE,\n\t\t\t'qb_offset'\t\t=> FALSE\n\t\t));\n\t}", "public function _query()\n {\n }", "public static function queryStop()\n\t{\n\t\tif (static::isEnabled(static::DB_BENCHMARK))\n\t\t{\n\t\t\tstatic::$_query['time'] = microtime(true) - static::$_query['time'];\n\t\t\tstatic::$_queries[] = static::$_query;\n\t\t}\n\t}", "public function init() {\n\n\t\t// Determine whether the admin pages should show or not.\n\t\t// Default is enabled.\n\t\t$this->admin_enabled = apply_filters( 'graphql_show_admin', true );\n\t\t$this->graphiql_enabled = apply_filters( 'graphql_enable_graphiql', get_graphql_setting( 'graphiql_enabled', true ) );\n\n\t\t// This removes the menu page for WPGraphiQL as it's now built into WPGraphQL\n\t\tif ( $this->graphiql_enabled ) {\n\t\t\tadd_action( 'admin_menu', function() {\n\t\t\t\tremove_menu_page( 'wp-graphiql/wp-graphiql.php' );\n\t\t\t} );\n\t\t}\n\n\t\t// If the admin is disabled, prevent admin from being scaffolded.\n\t\tif ( false === $this->admin_enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->settings = new Settings();\n\t\t$this->settings->init();\n\n\t\tif ( 'on' === $this->graphiql_enabled || true === $this->graphiql_enabled ) {\n\t\t\t$graphiql = new GraphiQL();\n\t\t\t$graphiql->init();\n\t\t}\n\n\t}", "public static function setQueryString(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$queryString = substr(static::$fullUrl, strpos(static::$fullUrl, '?') + 1, strlen(static::$fullUrl));\n\t\t} else {\n\t\t\tstatic::$queryString = '';\n\t\t}\n\n\t}", "function existingQueryForm () { return \"\"; }", "public function resetQuery(): ?Builder;", "function ajb_options_init(){\n\tregister_setting( 'ajb_option_group', 'ajb_options', 'ajb_options_validate' );\n}", "protected function resetQuery()\n {\n array_forget($this->query, ['start', 'end']);\n }", "public static function disableQueryLog()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }" ]
[ "0.7048591", "0.7013029", "0.6812968", "0.6717942", "0.64564204", "0.625116", "0.61727285", "0.6070001", "0.6027071", "0.59224415", "0.59102863", "0.573481", "0.571854", "0.5661594", "0.56419814", "0.5611634", "0.5553667", "0.55115825", "0.54712003", "0.5468943", "0.5467366", "0.5467106", "0.5441046", "0.5437436", "0.5436249", "0.54254496", "0.54137045", "0.5404957", "0.5393658", "0.53842914", "0.53714263", "0.5361372", "0.53587294", "0.5308136", "0.5301486", "0.5299834", "0.5287137", "0.5274328", "0.5273643", "0.52719706", "0.527164", "0.5269586", "0.5261", "0.5253391", "0.52499896", "0.5247228", "0.52444905", "0.5243841", "0.52389216", "0.52235025", "0.5201184", "0.5185777", "0.518445", "0.518172", "0.51783687", "0.5159123", "0.5158909", "0.5146246", "0.51368445", "0.5133488", "0.51218885", "0.5111282", "0.50952524", "0.50933886", "0.5089917", "0.508054", "0.5077854", "0.5077394", "0.50636876", "0.50620353", "0.5053283", "0.5051649", "0.50493884", "0.5044919", "0.50447696", "0.50402004", "0.5037372", "0.5034343", "0.5034343", "0.503281", "0.5029422", "0.50181794", "0.501817", "0.50124913", "0.50058556", "0.5004304", "0.5000666", "0.49968952", "0.49935305", "0.498819", "0.49876627", "0.4984444", "0.4980268", "0.4979995", "0.49798524", "0.49798524", "0.49798524", "0.49798524", "0.49798524", "0.49798524", "0.49798524" ]
0.0
-1
process the admin form if admin hit SaveChangesbutton
function admin_form(&$qa_content){ $ok = null; if (qa_clicked('quizx_save')) { qa_opt('quizx_enabled', (bool)qa_post_text('quizx_enabled')); // empty or 1 qa_opt('quizx_timeformat', (String)qa_post_text('quizx_timeformat')); qa_opt('quizx_servertimezone', (String)qa_post_text('quizx_servertimezone')); qa_opt('quizx_localization', (String)qa_post_text('quizx_localization')); qa_opt('quizx_lastqutoshow', (int)qa_post_text('quizx_lastqutoshow')); qa_opt('quizx_permission', (int)qa_post_text('quizx_permission')); // level $ok = qa_lang('admin/options_saved'); } // form fields to display frontend for admin $fields = array(); $fields[] = array( 'type' => 'checkbox', 'label' => qa_lang('quizx_lang/enable_plugin'), 'tags' => 'name="quizx_enabled"', 'value' => qa_opt('quizx_enabled'), ); $fields[] = array( 'type' => 'input', 'label' => qa_lang('quizx_lang/admin_timeformat'), 'tags' => 'name="quizx_timeformat"', 'value' => qa_opt('quizx_timeformat'), ); $fields[] = array( 'type' => 'input', 'label' => strtr( qa_lang('quizx_lang/admin_servertimezone'), array( '^1' => '<a target="_blank" href="http://php.net/manual/en/timezones.php">', '^2' => '</a>' )), 'tags' => 'name="quizx_servertimezone"', 'value' => qa_opt('quizx_servertimezone'), ); $fields[] = array( 'type' => 'input', 'label' => strtr( qa_lang('quizx_lang/admin_localization'), array( '^1' => '<a target="_blank" href="http://stackoverflow.com/q/3191664/1066234">', '^2' => '</a>' )), 'tags' => 'name="quizx_localization"', 'value' => qa_opt('quizx_localization'), ); $fields[] = array( 'type' => 'input', 'label' => qa_lang('quizx_lang/admin_lastqutoshow'), 'tags' => 'name="quizx_lastqutoshow"', 'value' => qa_opt('quizx_lastqutoshow'), ); $view_permission = (int)qa_opt('quizx_permission'); $permitoptions = qa_admin_permit_options(QA_PERMIT_ALL, QA_PERMIT_SUPERS, false, false); $pluginpageURL = qa_path('desk'); $fields[] = array( 'type' => 'select', 'label' => qa_lang('quizx_lang/minimum_level'), 'tags' => 'name="quizx_permission"', 'options' => $permitoptions, 'value' => $permitoptions[$view_permission], ); $avwidgstring = qa_lang('admin/widgets_explanation'); // remove hyphen in end of default string $avwidgstring = substr($avwidgstring, 0, strlen($avwidgstring)-1); $fields[] = array( 'type' => 'static', 'note' => qa_lang('quizx_lang/plugin_page_url').' <a target="_blank" href="'.$pluginpageURL.'">'.$pluginpageURL.'</a>', ); $fields[] = array( 'type' => 'static', 'note' => '<span style="color:#00F;">'.qa_lang('quizx_lang/admin_checkwidgets').' <a target="_blank" href="'.qa_path('admin/layout').'#home_description" style="text-decoration:underline;">'.$avwidgstring.'</a></span>', ); // link to q2apro.com $fields[] = array( 'type' => 'static', 'note' => '<span style="color:#789;">'.strtr( qa_lang('quizx_lang/q2apro_contact'), array( '^1' => '<a target="_blank" href="http://www.q2apro.com/contact">', '^2' => '</a>' )).'</span>', ); return array( 'ok' => ($ok && !isset($error)) ? $ok : null, 'fields' => $fields, 'buttons' => array( array( 'label' => qa_lang('main/save_button'), 'tags' => 'name="quizx_save"', ), ), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function afterSave()\n\t{\n\t\t//annoying on every edit, move to a checkbox on form and handle in controller\n\t}", "public function admin_save()\r\n\t{\r\n\t\tif ($this->Coupon->saveAll($this->data))\r\n\t\t{\r\n\t\t\t$id = (empty($this->data['Coupon']['id'])) ? $this->Coupon->getInsertID() : $this->data['Coupon']['id'];\r\n\r\n\t\t\t$this->Session->setFlash('Record saved.', 'default', array('class' => 'success'));\r\n\t\t\t$this->redirect('/admin/coupons/edit/' . $id);\t\r\n\t\t}\r\n\t\t\r\n\t\t$this->Session->setFlash('Record could not be saved. Please check the form for errors.', 'default', array('class' => 'failure'));\r\n\t\treturn $this->setAction('admin_edit');\t\r\n\r\n\t}", "function processForm(){\n /*Admin page content goes here */\n if( isset($_POST['rssMultiUpdate']) ){\n require \"classes/RssUpdateSingle.php\";\n \n $RssUpdateSingle = new RssUpdateSingle;\n $RssUpdateSingle->updateBlog();\n }\n }", "public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function admin_add() {\r\n if(isset($this->data[$this->modelClass])) {\r\n\t\t\t$this->_message($this->{$this->modelClass}->bsSave($this->data, 'add'));\r\n }\r\n\t\t$this->render('admin_edit');\r\n }", "public function postProcess()\n {\n $pageId = Tools::getValue('id_page');\n if (Tools::isSubmit('submitEditCustomHTMLPage') || Tools::isSubmit('submitEditCustomHTMLPageAndStay')) {\n if ($pageId == 'new')\n $this->processAdd();\n else\n $this->processUpdate();\n }\n else if (Tools::isSubmit('status'.$this->table)) {\n $this->toggleStatus();\n }\n else if (Tools::isSubmit('delete'.$this->table)) {\n $this->processDelete();\n }\n }", "function admin_modify() {\r\n\t\tglobal $wpdb, $current_user;\r\n\r\n\t\tif ( !is_super_admin() ) {\r\n\t\t\techo \"<p>\" . __('Nice Try...', 'psts') . \"</p>\"; //If accessed properly, this message doesn't appear.\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//add manual log entries\r\n\t\tif ( isset($_POST['log_entry']) ) {\r\n\t\t\t$this->log_action( (int)$_GET['bid'], $current_user->display_name . ': \"' . strip_tags(stripslashes($_POST['log_entry'])) . '\"' );\r\n\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Log entry added.', 'psts').'</p></div>';\r\n\t\t}\r\n\t\t\t\t\r\n //extend blog\r\n if ( isset($_POST['psts_extend']) ) {\r\n check_admin_referer('psts_extend'); //check nonce\r\n\r\n if ( isset($_POST['extend_permanent']) ) {\r\n $extend = 9999999999;\r\n } else {\r\n\t\t\t\t$months = $_POST['extend_months'];\r\n\t\t\t\t$days = $_POST['extend_days'];\r\n\t\t\t\t$extend = strtotime(\"+$months Months $days Days\") - time();\r\n\t\t\t}\r\n\t\t\t$this->extend((int)$_POST['bid'], $extend, __('Manual', 'psts'), $_POST['extend_level']);\r\n\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Site Extended.', 'psts').'</p></div>';\r\n\t\t}\t\t\r\n\t\t\t\r\n\t\tif ( isset($_POST['psts_transfer_pro']) ) {\r\n\t\t\t$new_bid = (int)$_POST['new_bid'];\r\n\t\t\t$current_bid = (int)$_GET['bid'];\r\n\t\t\tif ( !$new_bid ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"error\"><p>'.__('Please enter the Blog ID of a site to transfer too.', 'psts').'</p></div>';\r\n\t\t\t} else if ( is_pro_site($new_bid) ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"error\"><p>'.__('Could not transfer Pro Status: The chosen site already is a Pro Site. You must remove Pro status and cancel any existing subscriptions tied to that site.', 'psts').'</p></div>';\r\n\t\t\t} else {\r\n\t\t\t\t$current_level = $wpdb->get_row(\"SELECT * FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$current_bid'\");\r\n\t\t\t\t$new_expire = $current_level->expire - time();\r\n\t\t\t\t$this->extend($new_bid, $new_expire, $current_level->gateway, $current_level->level, $current_level->amount);\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->base_prefix}pro_sites SET term = '{$current_level->term}' WHERE blog_ID = '$new_bid'\");\r\n\t\t\t\t$this->withdraw($current_bid);\r\n\t\t\t\t$this->log_action( $current_bid, sprintf(__('Pro Status transferred by %s to BlogID: %d', 'psts'), $current_user->display_name, $new_bid) );\r\n\t\t\t\t$this->log_action( $new_bid, sprintf(__('Pro Status transferred by %s from BlogID: %d', 'psts'), $current_user->display_name, $current_bid) );\r\n\t\t\t\tdo_action('psts_transfer_pro', $current_bid, $new_bid); //for gateways to hook into for api calls, etc.\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.sprintf(__('Pro Status transferred to BlogID: %d', 'psts'), (int)$_POST['new_bid']).'</p></div>';\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t//remove blog\r\n if ( isset($_POST['psts_modify']) ) {\r\n check_admin_referer('psts_modify'); //check nonce\r\n\r\n do_action('psts_modify_process', (int)$_POST['bid']);\r\n\r\n if ( isset($_POST['psts_remove']) ) {\r\n $this->withdraw((int)$_POST['bid']);\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Pro Site Status Removed.', 'psts').'</p></div>';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( isset($_POST['psts_receipt']) ) {\r\n $this->email_notification((int)$_POST['bid'], 'receipt', $_POST['receipt_email']);\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Email receipt sent.', 'psts').'</p></div>';\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\t\r\n\t\t//check blog_id\r\n\t\tif( isset( $_GET['bid'] ) ) {\r\n\t\t\t$blog_count = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}blogs WHERE blog_ID = '\" . (int)$_GET['bid'] . \"'\");\r\n\t\t\tif ( !$blog_count ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Invalid blog ID. Please try again.', 'psts').'</p></div>';\r\n \t\t$blog_id = false;\r\n\t\t\t} else {\r\n\t\t\t\t$blog_id = (int)$_GET['bid'];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$blog_id = false;\r\n\t\t}\r\n\r\n\t\t?>\r\n\t\t<div class=\"wrap\">\r\n\t\t<script type=\"text/javascript\">\r\n \t jQuery(document).ready(function () {\r\n \t\t jQuery('input.psts_confirm').click(function() {\r\n var answer = confirm(\"<?php _e('Are you sure you really want to do this?', 'psts'); ?>\")\r\n if (answer){\r\n return true;\r\n } else {\r\n return false;\r\n };\r\n });\r\n \t\t});\r\n \t</script>\r\n \t<div class=\"icon32\"><img src=\"<?php echo $this->plugin_url . 'images/modify.png'; ?>\" /></div>\r\n <h2><?php _e('Pro Sites Management', 'psts'); ?></h2>\r\n\r\n <?php if ( $blog_id ) { ?>\r\n \t<h3><?php _e('Manage Site', 'psts') ?>\r\n\t\t\t<?php\r\n if ($name = get_blog_option($blog_id, 'blogname'))\r\n echo ': '.$name.' (Blog ID: '.$blog_id.')';\r\n\r\n echo '</h3>';\r\n\r\n \t\t$levels = (array)get_site_option('psts_levels');\r\n \t\t$current_level = $this->get_level($blog_id);\r\n $expire = $this->get_expire($blog_id);\r\n $result = $wpdb->get_row(\"SELECT * FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$blog_id'\");\r\n if ($result) {\r\n\t\t\t\tif ($result->term == 1 || $result->term == 3 || $result->term == 12)\r\n\t $term = sprintf(__('%s Month', 'psts'), $result->term);\r\n\t else\r\n\t $term = $result->term;\r\n\t\t\t} else {\r\n\t\t\t\t$term = 0;\r\n\t\t\t}\r\n\r\n if ($expire && $expire > time()) {\r\n echo '<p><strong>'.__('Current Pro Site', 'psts').'</strong></p>';\r\n\r\n echo '<ul>';\r\n\t\t\t\tif ($expire > 2147483647)\r\n\t\t\t\t\techo '<li>'.__('Pro Site privileges will expire: <strong>Never</strong>', 'psts').'</li>';\r\n\t\t\t\telse\r\n \techo '<li>'.sprintf(__('Pro Site privileges will expire on: <strong>%s</strong>', 'psts'), date_i18n(get_option('date_format'), $expire)).'</li>';\r\n\r\n echo '<li>'.sprintf(__('Level: <strong>%s</strong>', 'psts'), $current_level . ' - ' . @$levels[$current_level]['name']).'</li>';\r\n if ($result->gateway)\r\n\t\t\t\t\techo '<li>'.sprintf(__('Payment Gateway: <strong>%s</strong>', 'psts'), $result->gateway).'</li>';\r\n if ($term)\r\n \techo '<li>'.sprintf(__('Payment Term: <strong>%s</strong>', 'psts'), $term).'</li>';\r\n echo '</ul>';\r\n\r\n } else if ($expire && $expire <= time()) {\r\n echo '<p><strong>'.__('Expired Pro Site', 'psts').'</strong></p>';\r\n\r\n echo '<ul>';\r\n echo '<li>'.sprintf(__('Pro Site privileges expired on: <strong>%s</strong>', 'psts'), date_i18n(get_option('date_format'), $expire)).'</li>';\r\n\r\n echo '<li>'.sprintf(__('Previous Level: <strong>%s</strong>', 'psts'), $current_level . ' - ' . @$levels[$current_level]['name']).'</li>';\r\n if ($result->gateway)\r\n\t\t\t\t\techo '<li>'.sprintf(__('Previous Payment Gateway: <strong>%s</strong>', 'psts'), $result->gateway).'</li>';\r\n if ($term)\r\n\t\t\t\t\techo '<li>'.sprintf(__('Previous Payment Term: <strong>%s</strong>', 'psts'), $term).'</li>';\r\n echo '</ul>';\r\n\r\n } else {\r\n echo '<p><strong>\"'.get_blog_option($blog_id, 'blogname').'\" '.__('has never been a Pro Site.', 'psts').'</strong></p>';\r\n }\r\n\r\n\t\t//meta boxes hooked by gateway plugins\r\n if ( has_action('psts_subscription_info') || has_action('psts_subscriber_info') ) { ?>\r\n <div class=\"metabox-holder\">\r\n <?php if ( has_action('psts_subscription_info') ) { ?>\r\n\t\t\t<div style=\"width: 49%;\" class=\"postbox-container\">\r\n <div class=\"postbox\">\r\n <h3 class='hndle'><span><?php _e('Subscription Information', 'psts'); ?></span></h3>\r\n <div class=\"inside\">\r\n <?php do_action('psts_subscription_info', $blog_id); ?>\r\n </div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<?php } ?>\r\n\r\n <?php if ( has_action('psts_subscriber_info') ) { ?>\r\n <div style=\"width: 49%;margin-left: 2%;\" class=\"postbox-container\">\r\n <div class=\"postbox\">\r\n <h3 class='hndle'><span><?php _e('Subscriber Information', 'psts'); ?></span></h3>\r\n <div class=\"inside\">\r\n \t<?php do_action('psts_subscriber_info', $blog_id); ?>\r\n </div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<?php } ?>\r\n\r\n <div class=\"clear\"></div>\r\n </div>\r\n <?php } ?>\r\n\r\n\t <div id=\"poststuff\" class=\"metabox-holder\">\r\n\t <div class=\"postbox\">\r\n\t <h3 class='hndle'><span><?php _e('Account History', 'psts') ?></span></h3>\r\n\t <div class=\"inside\">\r\n\t <span class=\"description\"><?php _e('This logs basically every action done in the system regarding the site for an audit trail.', 'psts'); ?></span>\r\n\t <div style=\"height:150px;overflow:auto;margin-top:5px;margin-bottom:5px;\">\r\n\t <table class=\"widefat\">\r\n\t <?php\r\n\t $log = get_blog_option($blog_id, 'psts_action_log');\r\n\t if (is_array($log) && count($log)) {\r\n\t $log = array_reverse($log, true);\r\n\t foreach ($log as $timestamp => $memo) {\r\n\t $class = (isset($class) && $class == 'alternate') ? '' : 'alternate';\r\n\t echo '<tr class=\"'.$class.'\"><td><strong>' . date_i18n( __('Y-m-d g:i:s a', 'psts'), $timestamp ) . '</strong></td><td>' . esc_html($memo) . '</td></tr>';\r\n\t\t\t\t\t\t\t\t}\r\n\t } else {\r\n\t echo '<tr><td colspan=\"2\">'.__('No history recorded for this site yet.', 'psts').'</td></tr>';\r\n\t }\r\n\t\t\t\t\t\t\t?>\r\n\t </table>\r\n\t </div>\r\n\t\t\t\t\t<form method=\"post\" action=\"\">\r\n\t\t\t\t\t\t<input type=\"text\" placeholder=\"Add a custom log entry...\" name=\"log_entry\" style=\"width:91%;\" /> <input type=\"submit\" class=\"button-secondary\" name=\"add_log_entry\" value=\"<?php _e('Add &raquo;', 'psts') ?>\" style=\"width:8%;float:right;\" />\r\n\t\t\t\t\t</form>\r\n\t </div>\r\n\t </div>\r\n\t </div>\r\n\r\n\r\n <div id=\"poststuff\" class=\"metabox-holder\">\r\n\r\n <div style=\"width: 49%;\" class=\"postbox-container\">\r\n <div class=\"postbox\">\r\n\t\t <h3 class='hndle'><span><?php _e('Manually Extend Pro Site Status', 'psts') ?></span></h3>\r\n\t\t <div class=\"inside\">\r\n\t\t <span class=\"description\"><?php _e('Please note that these changes will not adjust the payment dates or level for any existing subscription.', 'psts'); ?></span>\r\n\t\t <form method=\"post\" action=\"\">\r\n\t\t <table class=\"form-table\">\r\n\t\t <?php wp_nonce_field('psts_extend') ?>\r\n\t\t <input type=\"hidden\" name=\"bid\" value=\"<?php echo $blog_id; ?>\" />\r\n\t\t <tr valign=\"top\">\r\n\t\t <th scope=\"row\"><?php _e('Period', 'psts') ?></th>\r\n\t\t <td><select name=\"extend_months\">\r\n\t\t \t<?php\r\n\t\t \t\tfor ( $counter = 0; $counter <= 36; $counter += 1) {\r\n\t\t echo '<option value=\"' . $counter . '\">' . $counter . '</option>' . \"\\n\";\r\n\t\t \t\t}\r\n\t\t ?>\r\n\t\t </select><?php _e('Months', 'psts'); ?>\r\n\t\t <select name=\"extend_days\">\r\n\t\t \t<?php\r\n\t\t \t\tfor ( $counter = 0; $counter <= 30; $counter += 1) {\r\n\t\t echo '<option value=\"' . $counter . '\">' . $counter . '</option>' . \"\\n\";\r\n\t\t \t\t}\r\n\t\t ?>\r\n\t\t </select><?php _e('Days', 'psts'); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php _e('or', 'psts'); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t <label><input type=\"checkbox\" name=\"extend_permanent\" value=\"1\" /> <?php _e('Permanent', 'psts'); ?></label>\r\n\t\t <br /><?php _e('Period you wish to extend the site. Leave at zero to only change the level.', 'psts'); ?></td>\r\n\t\t </tr>\r\n\t\t <tr valign=\"top\">\r\n\t\t <th scope=\"row\"><?php _e('Level', 'psts') ?></th>\r\n\t\t <td><select name=\"extend_level\">\r\n\t\t \t<?php\r\n \t\tforeach ($levels as $level => $value) {\r\n\t\t\t\t\t\t\t\t?><option value=\"<?php echo $level; ?>\"<?php selected($current_level, $level) ?>><?php echo $level . ': ' . esc_attr($value['name']); ?></option><?php\r\n\t\t\t\t\t\t\t}\r\n\t\t ?>\r\n\t\t </select>\r\n\t\t <br /><?php _e('Choose what level the site should have access to.', 'psts'); ?></td>\r\n\t\t </tr>\r\n\t\t <tr valign=\"top\">\r\n\t\t\t\t\t\t\t<td colspan=\"2\" style=\"text-align:right;\"><input class=\"button-primary\" type=\"submit\" name=\"psts_extend\" value=\"<?php _e('Extend &raquo;', 'psts') ?>\" /></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t </table>\r\n\t\t\t\t\t<hr />\r\n\t\t <table class=\"form-table\">\r\n\t\t <tr valign=\"top\">\r\n\t\t\t\t\t\t\t<td><label>Transfer Pro status to Blog ID: <input type=\"text\" name=\"new_bid\" size=\"3\" /></label></td>\r\n\t\t\t\t\t\t\t<td style=\"text-align:right;\"><input class=\"button-primary psts_confirm\" type=\"submit\" name=\"psts_transfer_pro\" value=\"<?php _e('Transfer &raquo;', 'psts') ?>\" /></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t </table>\r\n\t\t </form>\r\n\t\t </div>\r\n\t\t\t</div>\r\n\t </div>\r\n\r\n <?php if ( is_pro_site($blog_id) || has_action('psts_modify_form') ) { ?>\r\n\t <div style=\"width: 49%;margin-left: 2%;\" class=\"postbox-container\">\r\n\t <div class=\"postbox\">\r\n\t <h3 class='hndle'><span><?php _e('Modify Pro Site Status', 'psts') ?></span></h3>\r\n\t <div class=\"inside\">\r\n\t <form method=\"post\" action=\"\">\r\n\t <?php wp_nonce_field('psts_modify') ?>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"bid\" value=\"<?php echo $blog_id; ?>\" />\r\n\r\n <?php do_action('psts_modify_form', $blog_id); ?>\r\n\r\n\t\t\t\t\t<?php if ( is_pro_site($blog_id) ) { ?>\r\n <p><label><input type=\"checkbox\" name=\"psts_remove\" value=\"1\" /> <?php _e('Remove Pro status from this site.', 'psts'); ?></label></p>\r\n\t \t\t<?php } ?>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<?php if ($last_payment = $this->last_transaction($blog_id)) { ?>\r\n\t\t\t\t\t<p><label><input type=\"checkbox\" name=\"psts_receipt\" value=\"1\" /> <?php _e('Email a receipt copy for last payment to:', 'psts'); ?> <input type=\"text\" name=\"receipt_email\" value=\"<?php echo get_blog_option($blog_id, 'admin_email'); ?>\" /></label></p>\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<p class=\"submit\">\r\n\t <input type=\"submit\" name=\"psts_modify\" class=\"button-primary psts_confirm\" value=\"<?php _e('Modify &raquo;', 'psts') ?>\" />\r\n\t </p>\r\n\t </form>\r\n\t </div>\r\n\t </div>\r\n\t </div>\r\n <?php } ?>\r\n </div>\r\n <?php\r\n\r\n\t\t//show blog_id form\r\n } else {\r\n ?>\r\n <div class=\"metabox-holder\">\r\n\t <div class=\"postbox\">\r\n\t <h3 class='hndle'><span><?php _e('Manage a Site', 'psts') ?></span></h3>\r\n\t <div class=\"inside\">\r\n\t <form method=\"get\" action=\"\">\r\n\t <table class=\"form-table\">\r\n\t <input type=\"hidden\" name=\"page\" value=\"psts\" />\r\n\t <tr valign=\"top\">\r\n\t <th scope=\"row\"><?php _e('Blog ID:', 'psts') ?></th>\r\n\t <td><input type=\"text\" size=\"17\" name=\"bid\" value=\"\" /> <input type=\"submit\" value=\"<?php _e('Continue &raquo;', 'psts') ?>\" /></td></tr>\r\n\t </table>\r\n\t </form>\r\n\t\t\t\t\t<hr />\r\n\t\t\t\t\t<form method=\"get\" action=\"sites.php\" name=\"searchform\">\r\n\t <table class=\"form-table\">\r\n\t <tr valign=\"top\">\r\n\t <th scope=\"row\"><?php _e('Or search for a site:', 'psts') ?></th>\r\n\t <td><input type=\"text\" size=\"17\" value=\"\" name=\"s\"/> <input type=\"submit\" value=\"<?php _e('Search Sites &raquo;', 'psts') ?>\" id=\"submit_sites\" name=\"submit\"/></td></tr>\r\n\t </table>\r\n\t </form>\r\n\t </div>\r\n\t </div>\r\n </div>\r\n <?php\r\n }\r\n echo '</div>';\r\n\t}", "protected function callAfterSuccessfulSave()\n\t{\n\t\tforeach($this->editFields as $f)\n\t\t{\n\t\t\t$this->getControl($f, $this->id)->afterSuccessfulSave();\n\t\t}\n\t}", "function action_update()\n {\n $record = $this->m_node->updateRecord();\n\n if ($this->m_postvars['atkcancel']==\"\")\n { \n\n // just before we validate the record we call the preUpdate() to check if the record needs to be modified\n $this->m_node->preUpdate($record);\n\n $this->m_node->validate($record, \"update\");\n\n $error = count($record['atkerror']) > 0;\n foreach (array_keys($record) as $key)\n $error = $error || (is_array($record[$key]) && count($record[$key]['atkerror']) > 0);\n\n if ($error)\n {\n $this->m_node->m_action=\"edit\";\n $page = &$this->getPage();\n $edithandler = $this->m_node->getHandler(\"edit\");\n $page->addContent($edithandler->invoke(\"editPage\", $record));\n }\n else\n {\n if(!$this->m_node->updateDb($record))\n {\n $this->m_node->m_db->rollback();\n if($this->m_node->m_db->getErrorType()==\"user\")\n {\n triggerError($record, 'Error', $this->m_node->m_db->getErrorMsg(), '', '');\n $this->m_node->m_action=\"edit\";\n $page = &$this->getPage();\n $edithandler = $this->m_node->getHandler(\"edit\");\n $page->addContent($edithandler->invoke(\"editPage\", $record));\n }\n else\n {\n $location = $this->m_node->feedbackUrl(\"update\",ACTION_FAILED, $record, $this->m_node->m_db->getErrorMsg());\n $this->m_node->redirect($location);\n }\n }\n else\n {\n $this->m_node->m_db->commit(); \n \n if ($this->m_postvars['atknoclose']==\"\")\n {\n // 'save and close' was clicked\n $location = $this->m_node->feedbackUrl(\"update\", ACTION_SUCCESS, $record, \"\");\n $this->m_node->redirect($location);\n }\n else\n {\n // 'save' was clicked\n $page = &$this->getPage();\n // $this->m_action=\"edit\";\n //update succesful, pk value might be changed so update m_orgkey\n $record[\"atkprimkey\"] = $this->m_node->primaryKey($record);\n \n if ($this->m_node->hasFlag(NF_LOCK))\n { \n $locked = true;\n }\n \n //$this->setOrgKeyValue($record);\n $this->m_node->m_action = \"edit\"; \n $edithandler = $this->m_node->getHandler(\"edit\");\n $editpage = $edithandler->invoke(\"editPage\", $record, $locked);\n $screen = $this->m_node->renderActionPage(\"edit\", $editpage);\n $page->addContent($screen);\n }\n\n }\n }\n }\n else\n {\n // Cancel was pressed\n $location = $this->m_node->feedbackUrl(\"update\", ACTION_CANCELLED, $record);\n $this->m_node->redirect($location);\n }\n }", "function editAdminHandler() {\n global $inputs;\n\n updateDb('admin',[\n 'name' => $inputs['admin_username'],\n 'password' => $inputs['admin_password'],\n ], [\n 'id' => $inputs['id']\n ]);\n\n updateDb('admin_building',[\n 'building_id' => $inputs['admin_building'],\n ], [\n 'admin_id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success');\n}", "function okra_form_single_save() {\n\n\tif ($_POST[\"action\"] === \"okra_form_single_save\") {\n\n\t\tglobal $wpdb;\n\t\t$id = $_POST[\"id\"];\n\t\t//echo $id;\n\t\t$name = sanitize_text_field($_POST[\"name\"]);\n\t\t$page = sanitize_text_field($_POST[\"page\"]);\n\t\t$btn_text = sanitize_text_field($_POST[\"btn_text\"]);\n\t\t$short_code = sanitize_text_field($_POST[\"short_code\"]);\n\n\t\t$array = array(\n\t\t\t\"name\" => $name,\n\t\t\t\"page\" => $page,\n\t\t\t\"btn_text\"=>$btn_text,\n\t\t\t\"short_code\" => $short_code\n\t\t);\n\n\t\t$wpdb->update($wpdb->prefix . \"okra_all_forms\", $array, array(\"id\" => $id));\n\t\twp_redirect(admin_url() . \"?page=okra_wordpress_plugin&&update=true\");\n\n\t}\n}", "public function actionEdit(){\n\t\t$form = $_POST;\n\t\t$id = $form['id'];\n\t\tunset($form['id']);\n\t\tunset($form['submit_']);\n\t\tif($form['active'] == 'on'){\n\t\t\t$form['active'] = 1;\n\t\t}\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('UPDATE core_pages SET ? WHERE id = ?', $form, $id);\n\t\t$this->redirect('pages:');\n\t}", "protected function _postSave()\r\n\t{\r\n\t}", "public function saveAction() {\n parent::saveAction();\n }", "public function saveForm()\n\t{\n\t\tparent::saveForm();\n\t\t$this->setNeedReinitRulesFlag();\n\t}", "protected function onAfterSave()\n {\n \t$this->saveSuccessful = true;\n\t\t\n\t\tif( $this->isNewStatusUpdate ){ \n \t$this->_sendNewStatusUpdateEmailToAdministrators();\n \t$this->_sendNewStatusUpdateEmailToUser();\n\t\t}\n }", "protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}", "protected function processAdminCommand()\n {\n if(isset($_POST['command'], $_POST['id']) && $_POST['command']==='delete')\n {\n $this->loadPost($_POST['id'])->delete();\n // reload the current page to avoid duplicated delete actions\n $this->refresh();\n }\n }", "public function updateForm(){\n $new = $this->model->getNew();\n $this->view->updateForm($new);\n }", "protected function processAdminCommand()\n\t{\n\t\tif(isset($_POST['command'], $_POST['id']) && $_POST['command']==='delete')\n\t\t{\n\t\t\t$this->loadarticles($_POST['id'])->delete();\n\t\t\t// reload the current page to avoid duplicated delete actions\n\t\t\t$this->refresh();\n\t\t}\n\t}", "public function admin_submit(){\n if($this->input->post('source') === 'insert'){\n $this->usm->insert();\n }else if(is_numeric($this->input->post('source'))){\n $this->usm->update();\n }else{\n echo Modules::run(\"template/load_admin\",\"Somthing Went Wrong!\", \"Server Didn't Understand Your Request! Please Try Again from controller\");\n }\n }", "public function controlActions(){\n // Check if the tables are created.\n $this->mode = 'admin';\n $this->object = new $this->type();\n $this->titlePage = __((string)$this->object->info->info->form->title);\n $this->layout = (string)$this->object->info->info->form->layout;\n $this->menuInside = $this->menuInside();\n $ui = new NavigationAdmin_Ui($this);\n switch ($this->action) {\n default:\n header('Location: '.url($this->type.'/listAdmin', true));\n exit();\n break;\n case 'listAdmin':\n /**\n * This is the main action for the BackEnd. If we are in DEBUG mode\n * it will create the table automatically.\n */\n $this->checkLoginAdmin();\n $this->content = $this->listAdmin();\n return $ui->render();\n break;\n case 'insertView':\n /**\n * This is the action that shows the form to insert a record in the BackEnd.\n */\n $this->checkLoginAdmin();\n $this->content = $this->insertView();\n return $ui->render();\n break;\n case 'insert':\n /**\n * This is the action that inserts a record in the BackEnd.\n * If the insertion is successful it shows a form to check the record,\n * if not it creates a form with the errors to correct.\n */\n $this->checkLoginAdmin();\n $insert = $this->insert();\n if ($insert['success']=='1') {\n header('Location: '.url($this->type.'/insertCheck/'.$insert['id'], true));\n exit();\n } else {\n $this->messageError = __('errorsForm');\n $this->content = $insert['html'];\n return $ui->render();\n }\n break;\n case 'modifyView':\n case 'modifyViewCheck':\n case 'insertCheck':\n /**\n * This is the action that shows the form to check a record insertion.\n */\n $this->checkLoginAdmin();\n $this->message = ($this->action=='insertCheck' || $this->action=='modifyViewCheck') ? __('savedForm') : '';\n $this->content = $this->modifyView();\n return $ui->render();\n break;\n case 'modifyViewNested':\n /**\n * This is the action that shows the form to modify a record.\n */\n $this->checkLoginAdmin();\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n $this->content = $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modifyNested', true),\n 'class'=>'formAdmin formAdminModify',\n 'nested'=>true),\n array()));\n return $ui->render();\n break;\n case 'modify':\n case 'modifyNested':\n /**\n * This is the action that updates a record when updating it.\n */\n $this->checkLoginAdmin();\n $nested = ($this->action == 'modifyNested') ? true : false;\n $modify = $this->modify($nested);\n if ($modify['success']=='1') {\n if (isset($this->values['submit-saveCheck'])) {\n header('Location: '.url($this->type.'/modifyViewCheck/'.$modify['id'], true));\n } else {\n header('Location: '.url($this->type.'/listAdmin', true));\n }\n exit();\n } else {\n $this->messageError = __('errorsForm');\n $this->content = $modify['html'];\n return $ui->render();\n }\n break;\n case 'delete':\n /**\n * This is the action that deletes a record.\n */\n $this->checkLoginAdmin();\n if ($this->id != '') {\n $type = new $this->type();\n $object = $type->readObject($this->id);\n $object->delete();\n }\n header('Location: '.url($this->type.'/listAdmin', true));\n exit();\n break;\n case 'sortSave':\n /**\n * This is the action that saves the order of a list of records.\n * It is used when sorting using the BackEnd.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n $object = new $this->type();\n $newOrder = (isset($this->values['newOrder'])) ? $this->values['newOrder'] : array();\n $object->updateOrder($newOrder);\n break;\n case 'sortList':\n /**\n * This is the action that changes the order of the list.\n */\n $this->checkLoginAdmin();\n $object = new $this->type();\n $info = explode('_', $this->id);\n if (isset($info[1]) && $object->attributeInfo($info[1])!='') {\n $orderType = ($info[0]=='asc') ? 'asc' : 'des';\n Session::set('ord_'.$this->type, $orderType.'_'.$info[1]);\n }\n header('Location: '.url($this->type, true));\n exit();\n break;\n case 'addSimple':\n /**\n * This is the action that adds a simple record.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n $formObject = $this->type.'_Form';\n $form = new $formObject();\n return $form->createFormFieldMultiple();\n break;\n case 'multiple-delete':\n /**\n * This is the action that deletes multiple records at once.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n if (isset($this->values['list-ids'])) {\n $type = new $this->type();\n foreach ($this->values['list-ids'] as $id) {\n $object = $type->readObject($id);\n $object->delete();\n }\n }\n break;\n case 'multiple-activate':\n case 'multiple-deactivate':\n /**\n * This is the action that activates or deactivates multiple records at once.\n * It just works on records that have an attribute named \"active\",\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n if (isset($this->values['list-ids'])) {\n $primary = (string)$this->object->info->info->sql->primary;\n $where = '';\n foreach ($this->values['list-ids'] as $id) {\n $where .= $primary.'=\"'.$id.'\" OR ';\n }\n $where = substr($where, 0, -4);\n $active = ($this->action == 'multiple-activate') ? '1' : '0';\n $query = 'UPDATE '.Db::prefixTable($this->type).' SET active=\"'.$active.'\" WHERE '.$where;\n Db::execute($query);\n }\n break;\n case 'autocomplete':\n /**\n * This is the action that returns a json string with the records that match a search string.\n * It is used for the autocomplete text input.\n */\n $this->mode = 'json';\n $autocomplete = (isset($_GET['term'])) ? $_GET['term'] : '';\n if ($autocomplete!='') {\n $where = '';\n $concat = '';\n $items = explode('_', $this->id);\n foreach ($items as $itemIns) {\n $item = $this->object->attributeInfo($itemIns);\n $name = (string)$item->name;\n if (is_object($item) && $name!='') {\n $concat .= $name.',\" \",';\n $where .= $name.' LIKE \"%'.$autocomplete.'%\" OR ';\n }\n }\n $where = substr($where, 0, -4);\n $concat = 'CONCAT('.substr($concat, 0, -5).')';\n if ($where!='') {\n $query = 'SELECT '.(string)$this->object->info->info->sql->primary.' as idItem, \n '.$concat.' as infoItem\n FROM '.Db::prefixTable($this->type).'\n WHERE '.$where.'\n ORDER BY '.$name.' LIMIT 20';\n $results = array();\n $resultsAll = Db::returnAll($query);\n foreach ($resultsAll as $result) {\n $resultsIns = array();\n $resultsIns['id'] = $result['idItem'];\n $resultsIns['value'] = $result['infoItem'];\n $resultsIns['label'] = $result['infoItem'];\n array_push($results, $resultsIns);\n }\n return json_encode($results); \n }\n }\n break;\n case 'search':\n /**\n * This is the action that does the default \"search\" on a content object.\n */\n $this->checkLoginAdmin();\n if ($this->id != '') {\n $this->content = $this->listAdmin();\n return $ui->render();\n } else {\n if (isset($this->values['search']) && $this->values['search']!='') {\n $searchString = urlencode(html_entity_decode($this->values['search']));\n header('Location: '.url($this->type.'/search/'.$searchString, true));\n } else {\n header('Location: '.url($this->type.'/listAdmin', true));\n } \n }\n break;\n case 'export-json':\n /**\n * This is the action that exports the complete list of objects in JSON format.\n */\n $this->mode = 'ajax';\n $query = 'SELECT * FROM '.Db::prefixTable($this->type);\n $items = Db::returnAll($query);\n $file = $this->type.'.json';\n $options = array('content'=>json_encode($items), 'contentType'=>'application/json');\n File::download($file, $options);\n return '';\n break;\n }\n }", "protected function processForm(){\n if(Tools::isSubmit('saveBtn')){ // save data\n $settings = array(\n 'user' => Tools::getValue('user'),\n 'widget_id' => Tools::getValue('widget_id'),\n 'tweets_limit' => Tools::getValue('tweets_limit'),\n 'follow_btn' => Tools::getValue('follow_btn')\n );\n Configuration::updateValue($this->name.'_settings', serialize($settings));\n \n // display success message\n return $this->displayConfirmation($this->l('The settings have been successfully saved!'));\n }\n \n return '';\n }", "protected function processAdminCommand()\n\t{\n\t\tif(isset($_POST['command'], $_POST['id']) && $_POST['command']==='delete')\n\t\t{\n\t\t\t$this->loadfiles($_POST['id'])->delete();\n\t\t\t// reload the current page to avoid duplicated delete actions\n\t\t\t$this->refresh();\n\t\t}\n\t}", "public function actionSave()\n\t{\n\t\t$ajax = new \\AjaxHelper();\n\t\t$ajax->success = Menu::model()->updateTree(\\Yii::app()->request->getPost('items'));\n\t\t$ajax->errorDefaultMessage = 'Произошла ошибка на сервере, порядок не был сохранен';\n\t\t$ajax->endFlush();\n\t}", "public function save_trash_delete_form() {\n\t\t// Handled in the process_bulk_actions() function in includes/class-forms-list.php\n\t}", "protected function saveUpdate()\n {\n }", "function fm_process_admin_settings($entry) {\r\n\t// Deals with all processing from the files section of admin\r\n\tif (!$exist_record = get_record('fmanager_admin', 'usertype', $entry->usertype)) {\r\n\t\t$tmp = NULL;\r\n\t\t$tmp->usertype = $entry->usertype;\r\n\t\tif (!insert_record('fmanager_admin', $tmp)) {\r\n\t\t\t$err = NULL;\r\n\t\t\t$err->errtype = \"insert\";\r\n\t\t\t$err->forhwho =\"user\";\r\n\t\t\terror(get_string('errrecordmod', 'block_file_manager', $err), $_SERVER['HTTP_REFERER']);\r\n\t\t}\r\n\t}\r\n\tif ($exist_record = get_record('fmanager_admin', 'usertype', $entry->usertype)) {\r\n\t\t$entry->id = $exist_record->id;\r\n\t\tif (!update_record('fmanager_admin', $entry)) {\r\n\t\t\t$err = NULL;\r\n\t\t\t$err->errtype = 'update';\r\n\t\t\t$err->forwho = 'user';\r\n\t\t\terror(get_string('errrecordmod', 'block_file_manager', $err), $_SERVER['HTTP_REFERER']);\r\n\t\t}\r\n\t}\r\n}", "public function saveAction() :void\n {\n $data = $this->request->getPost();\n $record = ModuleTemplate::findFirst();\n if ($record === null) {\n $record = new ModuleTemplate();\n }\n $this->db->begin();\n foreach ($record as $key => $value) {\n switch ($key) {\n case 'id':\n break;\n case 'checkbox_field':\n case 'toggle_field':\n if (array_key_exists($key, $data)) {\n $record->$key = ($data[$key] === 'on') ? '1' : '0';\n } else {\n $record->$key = '0';\n }\n break;\n default:\n if (array_key_exists($key, $data)) {\n $record->$key = $data[$key];\n } else {\n $record->$key = '';\n }\n }\n }\n\n if ($record->save() === FALSE) {\n $errors = $record->getMessages();\n $this->flash->error(implode('<br>', $errors));\n $this->view->success = false;\n $this->db->rollback();\n return;\n }\n\n $this->flash->success($this->translation->_('ms_SuccessfulSaved'));\n $this->view->success = true;\n $this->db->commit();\n }", "protected function hook_afterSave(){}", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "public function afterSave(){\n\t\t$Log = Logger::getLogger(\"accessLog\");\n\n\t\tif($this->oldAttributes==NULL)\n \t\t$action=\"create\";\n \telse \t\n \t\t$action=\"update\";\n \t\n\t\t$uid=Yii::app()->user->getState(\"uid\");\n\t \t$Log->info($uid.\"\\t\".Yii::app()->user->name.\"\\t\".$this->getModelName().\"\\t\".$action.\"\\t\".$this->orgId);\t\n\t \n\t \tif($this->orgName != $this->oldAttributes['orgName'])\n\t \t\t{$Log->info(\"orgName \".$this->oldAttributes['orgName'].\" \".$this->orgName);}\n\t \tif($this->noEmp != $this->oldAttributes['noEmp'])\n\t \t\t{$Log->info(\"noEmp \".$this->oldAttributes['noEmp'].\" \".$this->noEmp);}\n\t\tif($this->phone != $this->oldAttributes['phone'])\n\t \t\t{$Log->info(\"phone \".$this->oldAttributes['phone'].\" \".$this->phone);}\n\t\tif($this->email != $this->oldAttributes['email'])\n\t \t\t{$Log->info(\"email \".$this->oldAttributes['email'].\" \".$this->email);}\n\t\tif($this->addr1 != $this->oldAttributes['addr1'])\n\t \t\t{$Log->info(\"addr1 \".$this->oldAttributes['addr1'].\" \".$this->addr1);}\n\t\tif($this->addr2 != $this->oldAttributes['addr2'])\n\t \t\t{$Log->info(\"addr2 \".$this->oldAttributes['addr2'].\" \".$this->addr2);}\n\t\tif($this->state != $this->oldAttributes['state'])\n\t \t\t{$Log->info(\"state \".$this->oldAttributes['state'].\" \".$this->state);}\n\t\tif($this->country != $this->oldAttributes['country'])\n\t \t\t{$Log->info(\"country \".$this->oldAttributes['country'].\" \".$this->country);}\n\t\tif($this->orgType != $this->oldAttributes['orgType'])\n\t \t\t{$Log->info(\"orgType \".$this->oldAttributes['orgType'].\" \".$this->orgType);}\n\t\tif($this->description != $this->oldAttributes['description'])\n\t \t\t{$Log->info(\"description \".$this->oldAttributes['description'].\" \".$this->description);}\n\t\tif($this->fax != $this->oldAttributes['fax'])\n\t \t\t{$Log->info(\"fax \".$this->oldAttributes['fax'].\" \".$this->fax);}\n\t\tif($this->validity != $this->oldAttributes['validity'])\n\t \t\t{$Log->info(\"validity \".$this->oldAttributes['validity'].\" \".$this->validity);}\t\t\t\t\t\t\t\t\n\treturn parent::afterSave();\t\n\t}", "function checkSaveButtons() {\n if ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n $tce = GeneralUtility::makeInstance('t3lib_TCEmain');\n $tce->stripslashes_values=0;\n if (count($this->arrTableParameters['grps'])) {\n\t $arrSave['grps'] = $this->arrTableParameters['grps'];\n\t $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = serialize($arrSave);\n } else {\n \t$arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = '';\n }\n $tce->start($arrData,array());\n\t $tce->process_datamap();\n if ($this->arrTableParameters['saveandclosedok']) {\n header('Location: ' . GeneralUtility::locationHeaderUrl($this->arrWizardParameters['returnUrl']));\n\t\t\t\texit;\n }\n }\n }", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "function thumbwhere_contentcollectionitem_edit_form_submit(&$form, &$form_state) {\n\n $thumbwhere_contentcollectionitem = entity_ui_controller('thumbwhere_contentcollectionitem')->entityFormSubmitBuildEntity($form, $form_state);\n // Save the thumbwhere_contentcollectionitem and go back to the list of thumbwhere_contentcollectionitems\n\n // Add in created and changed times.\n if ($thumbwhere_contentcollectionitem->is_new = isset($thumbwhere_contentcollectionitem->is_new) ? $thumbwhere_contentcollectionitem->is_new : 0) {\n $thumbwhere_contentcollectionitem->created = time();\n }\n\n $thumbwhere_contentcollectionitem->changed = time();\n\n $thumbwhere_contentcollectionitem->save($transaction);\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_contentcollectionitems';\n}", "public function admin_action() {\n\t}", "public function admin_action() {\n\t}", "public function admin() {\n\t\tglobal $wpdb, $current_user;\n\n\t\tget_currentuserinfo();\n\n\t\t// Save current user ID\n\t\t$user_id = $current_user->ID;\n\n\t\t// Get the Form Order type settings, if any\n\t\t$user_form_order_type = get_user_meta( $user_id, 'vfb-form-order-type', true );\n\n\t\t$form_nav_selected_id = ( isset( $_REQUEST['form'] ) ) ? $_REQUEST['form'] : '0';\n\t?>\n\t<div class=\"wrap\">\n\t\t<h2>\n\t\t\t<?php _e( 'Visual Form Builder Pro', 'visual-form-builder-pro' ); ?>\n<?php\n\t\t\t// Add New link\n\t\t\techo sprintf( ' <a href=\"%1$s\" class=\"add-new-h2\">%2$s</a>', esc_url( admin_url( 'admin.php?page=vfb-add-new' ) ), esc_html( __( 'Add New', 'visual-form-builder-pro' ) ) );\n\n\t\t\t// If searched, output the query\n\t\t\tif ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )\n\t\t\t\techo '<span class=\"subtitle\">' . sprintf( __( 'Search results for \"%s\"' , 'visual-form-builder-pro'), $_REQUEST['s'] );\n?>\n\t\t</h2>\n<?php\n\t\t\t// Display form editor or the form list\n\t\t\tif ( isset( $_GET['form'] ) && 'edit' == $_GET['action'] ) :\n\t\t\t\tinclude_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/admin-form-creator.php' );\n\t\t\telse :\n?>\n\t\t\t<div id=\"vfb-form-list\">\n\t\t\t\t<div id=\"vfb-main\" class=\"vfb-order-type-<?php echo ( in_array( $user_form_order_type, array( 'order', '' ) ) ) ? 'order' : 'list'; ?>\">\n\t\t\t\t<?php $this->all_forms(); ?>\n\t\t\t\t</div> <!-- #vfb-main -->\n\t\t\t</div> <!-- #vfb-form-list -->\n<?php\n\t\t\tendif;\n?>\n\t</div>\n\t<?php\n\t}", "public function manageFormAction()\n\t{\n\t\t//vérification du statut d'admin\n\t\t$customersManager = new CustomersManager();\n\t\t$customer = $customersManager -> getLoginInfo();\n\n\t\t// redirection des non-admins\n\t\tif (empty($customer) OR $customer['email'] != ADMIN_EMAIL)\n\t\t{\n\t\t\theader('Location: account');\n\t\t\texit();\n\t\t}\n\n\t\t//récupération des éventuelles données entrées erronées\n\t\tif (isset($_SESSION['forms']['adminAddProduct']['fieldsContent']))\n\t\t{\n\t\t\t$this -> viewData['enteredData'] = $_SESSION['forms']['adminAddProduct']['fieldsContent'];\n\t\t}\n\n\t\t//récupération des infos produits\n\t\t$productsManager = new ProductsManager();\n\t\t$this -> viewData['products'] = $productsManager -> getAll();\n\t\t//récupération des infos de catégories\n\t\t$categoriesManager = new CategoriesManager();\n\t\t$this -> viewData['categories'] = $categoriesManager -> getAll();\n\t\t$this -> viewData['CSRFToken'] = $customer['CSRFToken'];\n\t\t$this -> generateView('products/manage-form.phtml');\n\t}", "function OnAfterEdit(){\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "function thumbwhere_contentcollection_edit_form_submit(&$form, &$form_state) {\n\n $thumbwhere_contentcollection = entity_ui_controller('thumbwhere_contentcollection')->entityFormSubmitBuildEntity($form, $form_state);\n // Save the thumbwhere_contentcollection and go back to the list of thumbwhere_contentcollections\n\n // Add in created and changed times.\n if ($thumbwhere_contentcollection->is_new = isset($thumbwhere_contentcollection->is_new) ? $thumbwhere_contentcollection->is_new : 0) {\n $thumbwhere_contentcollection->created = time();\n }\n\n $thumbwhere_contentcollection->changed = time();\n\n $thumbwhere_contentcollection->save($transaction);\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_contentcollections';\n}", "private function _postProcess()\n {\n if (Tools::isSubmit('btnSubmit')) {\n Configuration::updateValue('MONDIDO_CHECKOUT_MERCHANTID', Tools::getValue('merchant_id'));\n Configuration::updateValue('MONDIDO_CHECKOUT_SECRET', Tools::getValue('secret_code'));\n Configuration::updateValue('MONDIDO_CHECKOUT_PASSWORD', Tools::getValue('password'));\n Configuration::updateValue('MONDIDO_CHECKOUT_TEST_MODE', Tools::getValue('test_mode'));\n Configuration::updateValue('MONDIDO_CHECKOUT_ACTIVE', Tools::getValue('is_active'));\n }\n $this->_html .= '<div class=\"conf confirm\"> ' . $this->l('Settings updated') . '</div>';\n }", "public function editAction() {\n# process the edit form.\n# check the post data and filter it.\n\t\tif(isset($_POST['cancel'])) {\n\t\t\tAPI::Redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t$input_check = $this->_model->check_input($_POST);\n\t\tif(is_array($input_check)) {\n\t\t\tAPI::Error($input_check);\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t// all hooks will stack their errors onto the API::Error stack\n\t\t// but WILL NOT redirect.\n\t\tAPI::callHooks(self::$module, 'validate', 'controller', $_POST);\n\t\tif(API::hasErrors()) {\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\n\t\t$this->_model->set_data($_POST);\n\n\t\t// auto call the hooks for this module/action\n\t\tAPI::callHooks(self::$module, 'save', 'controller');\n\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\n\n\t}", "public function updateAdmin() {\n\t$numRows = $this->db->update();\n\t\tif($numRows===1) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function postProcess()\n {\n if (Tools::isSubmit('saveSettings')) {\n ConfPPM::setConf(\n 'paysto_merchant_id',\n Tools::getValue(ConfPPM::formatConfName('paysto_merchant_id'))\n );\n ConfPPM::setConf(\n 'paysto_secret',\n Tools::getValue(ConfPPM::formatConfName('paysto_secret'))\n );\n ConfPPM::setConf('server_list', Tools::getValue(ConfPPM::formatConfName('server_list')));\n ConfPPM::setConf('ip_only_from_server_list',\n Tools::getValue(ConfPPM::formatConfName('ip_only_from_server_list')));\n ConfPPM::setConf('disable_tax_shop',\n Tools::getValue(ConfPPM::formatConfName('disable_tax_shop')));\n ConfPPM::setConf('tax_delivery', Tools::getValue(ConfPPM::formatConfName('tax_delivery')));\n Tools::redirectAdmin(ToolsModulePPM::getModuleTabAdminLink() . '&conf=6');\n }\n }", "public function admin() {\n global $wpdb;\n $action = filter_input(INPUT_GET, 'action');\n \n echo '<div class=\"wrap\"><h2>';\n BUtils::e('Simple Membership Form Builder');\n echo '</h2>';\n // Save current user ID\n $current_user = wp_get_current_user();\n $user_id = $current_user->ID;\n $current_tab = empty($action) ? '' : $action;\n $tabs = array('' => \"Form List\", 'add' => 'New Form', 'license' => 'Product License');\n echo '<h2 class=\"nav-tab-wrapper\">';\n foreach ($tabs as $tab_key => $tab_caption) {\n $active = $current_tab == $tab_key ? 'nav-tab-active' : '';\n echo '<a class=\"nav-tab ' . $active . '\" href=\"admin.php?page=swpm-form-builder&action=' . $tab_key . '\">' . $tab_caption . '</a>';\n }\n echo '</h2>';\n switch ($action) {\n case 'add':\n $this->admin_add_new();\n break;\n case 'license':\n $this->admin_license_menu();\n break;\n case 'edit':\n default:\n $form_nav_selected_id = filter_input(INPUT_GET, 'form');\n if (empty($form_nav_selected_id) || $form_nav_selected_id == 0) {\n $this->all_forms();\n } else {\n include_once( SWPM_FORM_BUILDER_PATH . 'includes/admin-form-creator.php' );\n }\n break;\n }\n echo '</div>';\n }", "public function modifyView() {\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n return $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modify', true),\n 'class'=>'formAdmin formAdminModify'),\n array('submit'=>array('save'=>__('save'),\n 'saveCheck'=>__('saveCheck')))));\n }", "public function handle_post_action_edit() {\n\t\tif ( empty( $_POST['table'] ) || empty( $_POST['table']['id'] ) ) {\n\t\t\tIggoGrid::redirect( array( 'action' => 'list', 'message' => 'error_save' ) );\n\t\t} else {\n\t\t\t$edit_table = wp_unslash( $_POST['table'] );\n\t\t}\n\n\t\tIggoGrid::check_nonce( 'edit', $edit_table['id'], 'nonce-edit-table' );\n\n\t\tif ( ! current_user_can( 'iggogrid_edit_table', $edit_table['id'] ) ) {\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.', 'default' ) );\n\t\t}\n\n\t\t// Options array must exist, so that checkboxes can be evaluated\n\t\tif ( empty( $edit_table['options'] ) ) {\n\t\t\tIggoGrid::redirect( array( 'action' => 'edit', 'table_id' => $edit_table['id'], 'message' => 'error_save' ) );\n\t\t}\n\n\t\t// Evaluate options that have a checkbox (only necessary in Admin Controller, where they might not be set (if unchecked))\n\t\t$checkbox_options = array(\n\t\t\t'table_head', 'table_foot', 'alternating_row_colors', 'row_hover', 'print_name', 'print_description', // Table Options\n\t\t\t'use_datatables', 'datatables_sort', 'datatables_filter', 'datatables_paginate', 'datatables_lengthchange', 'datatables_info', 'datatables_scrollx', // DataTables JS Features\n\t\t);\n\t\tforeach ( $checkbox_options as $option ) {\n\t\t\t$edit_table['options'][ $option ] = ( isset( $edit_table['options'][ $option ] ) && 'true' === $edit_table['options'][ $option ] );\n\t\t}\n\n\t\t// Load existing table from DB\n\t\t$existing_table = IggoGrid::$model_table->load( $edit_table['id'], false, true ); // Load table, without table data, but with options and visibility settings\n\t\tif ( is_wp_error( $existing_table ) ) { // @TODO: Maybe somehow load a new table here? (IggoGrid::$model_table->get_table_template())?\n\t\t\tIggoGrid::redirect( array( 'action' => 'edit', 'table_id' => $edit_table['id'], 'message' => 'error_save' ) );\n\t\t}\n\t\t\n\t\t// Check consistency of new table, and then merge with existing table\n\t\t$table = IggoGrid::$model_table->prepare_table( $existing_table, $edit_table );\n\t\tif ( is_wp_error( $table ) ) {\n\t\t\tIggoGrid::redirect( array( 'action' => 'edit', 'table_id' => $edit_table['id'], 'message' => 'error_save' ) );\n\t\t}\n\n\t\t// DataTables Custom Commands can only be edit by trusted users\n\t\tif ( ! current_user_can( 'unfiltered_html' ) ) {\n\t\t\t$table['options']['datatables_custom_commands'] = $existing_table['options']['datatables_custom_commands'];\n\t\t}\n\n\t\t// Save updated table\n\t\t$saved = IggoGrid::$model_table->save( $table );\n\t\tif ( is_wp_error( $saved ) ) {\n\t\t\tIggoGrid::redirect( array( 'action' => 'edit', 'table_id' => $table['id'], 'message' => 'error_save' ) );\n\t\t}\n\n\t\t// Check if ID change is desired\n\t\tif ( $table['id'] === $table['new_id'] ) { // if not, we are done\n\t\t\tIggoGrid::redirect( array( 'action' => 'edit', 'table_id' => $table['id'], 'message' => 'success_save' ) );\n\t\t}\n\n\t\t// Change table ID\n\t\tif ( current_user_can( 'iggogrid_edit_table_id', $table['id'] ) ) {\n\t\t\t$id_changed = IggoGrid::$model_table->change_table_id( $table['id'], $table['new_id'] );\n\t\t\tif ( ! is_wp_error( $id_changed ) ) {\n\t\t\t\tIggoGrid::redirect( array( 'action' => 'edit', 'table_id' => $table['new_id'], 'message' => 'success_save_success_id_change' ) );\n\t\t\t} else {\n\t\t\t\tIggoGrid::redirect( array( 'action' => 'edit', 'table_id' => $table['id'], 'message' => 'success_save_error_id_change' ) );\n\t\t\t}\n\t\t} else {\n\t\t\tIggoGrid::redirect( array( 'action' => 'edit', 'table_id' => $table['id'], 'message' => 'success_save_error_id_change' ) );\n\t\t}\n\t}", "protected function _postUpdate()\n\t{\n\t}", "public function action() {\r\n parent::action();\r\n\r\n\r\n switch (SQ_Tools::getValue('action')) {\r\n\r\n case 'sq_settings_update':\r\n if (SQ_Tools::getIsset('sq_post_types')) {\r\n SQ_Tools::$options['sq_post_types'] = array();\r\n foreach (SQ_Tools::getValue('sq_post_types') as $key) {\r\n array_push(SQ_Tools::$options['sq_post_types'], $key);\r\n }\r\n\r\n if (!in_array('product', get_post_types())) {\r\n array_push(SQ_Tools::$options['sq_post_types'], 'product');\r\n }\r\n }\r\n\r\n SQ_Tools::saveOptions('sq_google_country', SQ_Tools::getValue('sq_google_country'));\r\n SQ_Tools::saveOptions('sq_google_country_strict', SQ_Tools::getValue('sq_google_country_strict'));\r\n SQ_Tools::saveOptions('sq_google_ranksperhour', SQ_Tools::getValue('sq_google_ranksperhour'));\r\n\r\n SQ_Tools::saveOptions('sq_keyword_help', (int) SQ_Tools::getValue('sq_keyword_help'));\r\n SQ_Tools::saveOptions('sq_keyword_information', (int) SQ_Tools::getValue('sq_keyword_information'));\r\n SQ_Tools::saveOptions('sq_sla', (int) SQ_Tools::getValue('sq_sla'));\r\n SQ_Tools::saveOptions('sq_keywordtag', (int) SQ_Tools::getValue('sq_keywordtag'));\r\n SQ_Tools::saveOptions('sq_local_images', (int) SQ_Tools::getValue('sq_local_images'));\r\n\r\n\r\n SQ_Tools::saveOptions('sq_google_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkGoogleWTCode(SQ_Tools::getValue('sq_google_wt','',true)));\r\n SQ_Tools::saveOptions('sq_bing_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_bing_wt','',true)));\r\n SQ_Tools::saveOptions('sq_alexa', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_alexa','',true)));\r\n\r\n\r\n SQ_Action::apiCall('sq/user/settings', array('settings' => json_encode(SQ_Tools::getBriefOptions())), 10);\r\n SQ_Tools::emptyCache();\r\n break;\r\n }\r\n }", "function after_validation_on_update() {}", "public function crudSaved()\n {\n $this->fireModelEvent('crudSaved', false);\n }", "private function admin_hooks() {\n\t\t\n\t\t// Actions\n\t\t// Load Nav injection\n\t\t$this->add_action ('admin_menu', $this->nav, 'plugin_menu' );\n\t\t\n\t\t// Load Dashboard widget\n\t\t$this->add_action ('wp_dashboard_setup', $this->admin, 'dashboard');\n\t\t\n\t\t// Load Edit Post additions\n\t\t// $this->add_action ('add_meta_boxes', $this->admin, 'post_edit' );\n\n\t\t// Load social toggles on submitbox, if the setting is available\n\t\t// if (get_option('smmp_view_submitbox'))\n\t\t//\t$this->add_action ('post_submitbox_misc_actions', $this->admin, 'admin_post_submitbox' );\n\t\t\n\t\t// On post update/save\n\t\t// $this->add_action ('save_post', $this->admin, 'admin_post_submitbox_submit');\n\t\t\n\t\t\n\t\t// Load Expired Account notice\n\t\t/*try {$this->admin->validate_accounts (); }\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->add_action ('admin_notices', $this->admin, 'notice_accounts' );\n\t\t}*/\n\t\t\n\t\t// Filters\n\t\t// Prevent inner links for flow-drive images\n\t\t$this->add_action ('image_downsize', $this->admin, 'filter_image_downsize', 10, 3);\n\t}", "function post_handler() {\r\n\r\n if ($this->action == 'new' or $this->action == 'edit') { # handle new-save\r\n # check permission first\r\n if ( ($this->action == 'new' and !$this->allow_new) or ($this->action == 'edit' and !$this->allow_edit) )\r\n die('Permission not given for \"'.$this->action.'\" action.');\r\n\r\n $_REQUEST['num_row'] = intval($_REQUEST['num_row']) > 0? intval($_REQUEST['num_row']): 1; # new row should get the number of row to insert from num_row\r\n # import suggest field into current datasource (param sugg_field[..]). note: suggest field valid for all rows\r\n if ($this->action == 'new')\r\n $this->import_suggest_field_to_ds();\r\n # only do this if post come from edit form. bground: browse mode now can contain <input>, which value got passed to edit/new mode\r\n if ($this->_save == '') { # to accomodate -1 (preview)\r\n\t\t\t\treturn False;\r\n\t\t\t}\r\n\r\n $this->import2ds(); # only do this if post come from edit form. bground: browse mode now can contain <input>, which value got passed to edit/new mode\r\n $this->db_count = $_REQUEST['num_row']; # new row should get the number of row to insert from num_row\r\n # check requirement\r\n\r\n if (!$this->validate_rows()) # don't continue if form does not pass validation\r\n return False;\r\n\r\n if ($this->action == 'new') {\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n if (!$this->check_datatype($i)) { # check duplicate index\r\n return False;\r\n }\r\n\r\n if (!$this->check_duplicate_index($i)) { # check duplicate index\r\n return False;\r\n }\r\n if (!$this->check_insert($i)) { # check insertion\r\n return False;\r\n }\r\n }\r\n\r\n if ($this->preview[$this->action] and $this->_save == -1) { # show preview page instead\r\n $this->_preview = True;\r\n return False;\r\n }\r\n\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $this->insert($i);\r\n }\r\n\r\n if ($this->_go != '') {\r\n while (@ob_end_clean());\r\n header('Location: '.$this->_go);\r\n exit;\r\n }\r\n }\r\n elseif ($this->action == 'edit') {\r\n $this->populate($this->_rowid, True);\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n #~ if (!$this->check_duplicate_index($i)) { # check duplicate index\r\n #~ return False;\r\n #~ }\r\n if (!$this->check_update($i)) { # check insertion\r\n return False;\r\n }\r\n }\r\n\r\n if ($this->preview[$this->action] and $this->_save == -1) { # show preview page instead\r\n $this->_preview = True;\r\n return False;\r\n }\r\n\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $this->update($i);\r\n }\r\n\r\n if ($this->_go != '') {\r\n #~ include('footer.inc.php');\r\n header('Location: '.$this->_go);\r\n exit;\r\n }\r\n }\r\n }\r\n elseif ($this->action == 'csv') {\r\n /* generate CSV representation of loaded datasource\r\n http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm\r\n */\r\n if (AADM_ON_BACKEND!=1)\r\n die('Permission not given for \"'.$this->action.'\" action.');\r\n $this->browse_rows = 0; # show all data\r\n $this->populate();\r\n $rows = array();\r\n $fields = array();\r\n foreach ($this->properties as $colvar=>$col) {\r\n $vtemp = $this->ds->{$colvar}[$i];\r\n $vtemp = str_replace('\"','\"\"',$vtemp);\r\n $vtemp = (strpos($vtemp,',') === false and strpos($vtemp,'\"') === false and strpos($vtemp,\"\\n\") === false)? $vtemp: '\"'.$vtemp.'\"';\r\n $fields[] = (strpos($col->label,',') === false)? $col->label: '\"'.$col->label.'\"';\r\n }\r\n $rows[] = join(',',$fields);\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $fields = array();\r\n foreach ($this->properties as $colvar=>$col) {\r\n $vtemp = $this->ds->{$colvar}[$i];\r\n $vtemp = str_replace('\"','\"\"',$vtemp);\r\n $vtemp = (strpos($vtemp,',') === false and strpos($vtemp,'\"') === false and strpos($vtemp,\"\\n\") === false)? $vtemp: '\"'.$vtemp.'\"';\r\n $fields[] = $vtemp;\r\n }\r\n $rows[] = join(',',$fields);\r\n }\r\n #~ header('Content-type: application/vnd.ms-excel');\r\n header('Content-type: text/comma-separated-values');\r\n header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');\r\n header('Content-Disposition: inline; filename=\"dump.csv\"');\r\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n header('Pragma: public');\r\n header('Expires: 0');\r\n\r\n echo join(\"\\r\\n\",$rows);\r\n exit();\r\n }\r\n else { # no-act handler, call its post function callbacks if available\r\n if (AADM_ON_BACKEND==1) {\r\n $callback = 'act_'.$this->action;\r\n if (method_exists($this, $callback)) {\r\n $this->$callback(True);\r\n }\r\n }\r\n }\r\n }", "public function afterSave(){\n\t}", "protected function handlePageEditing() {}", "function wck_show_update_form(){\r\n\t\tcheck_ajax_referer( \"wck-edit-entry\" );\t\t\r\n\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\t$id = absint($_POST['id']);\r\n\t\t$element_id = absint( $_POST['element_id'] );\r\n\r\n do_action( \"wck_before_adding_form_{$meta}\", $id, $element_id );\r\n\r\n\t\techo self::mb_update_form($this->args['meta_array'], $meta, $id, $element_id);\r\n\t\t\r\n\t\tdo_action( \"wck_after_adding_form\", $meta, $id, $element_id );\r\n do_action( \"wck_after_adding_form_{$meta}\", $id, $element_id );\r\n\r\n\t\texit;\r\n\t}", "public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "function pre_editview(){\n\t\tif (empty($this->bean->id) && !empty($_REQUEST['return_module']) &&$_REQUEST['return_module'] == 'Prospects' ) {\n\t\t\t\n\t\t\t$prospect = BeanFactory::getBean('Prospects', $_REQUEST['return_id']);\n\t\t\tforeach($prospect->field_defs as $key=>$value)\n\t\t\t{\n\t\t\t\tif ($key == 'id' or $key=='deleted' )continue;\n\t\t\t\tif (isset($this->bean->field_defs[$key])) {\n\t\t\t\t\t$this->bean->$key = $prospect->$key;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$_POST['is_converted']=true;\n\t\t}\n\t\treturn true;\n\t}", "public function onRelationManageUpdate()\n {\n $this->forceManageMode = 'form';\n $this->beforeAjax();\n $saveData = $this->manageWidget->getSaveData();\n\n if ($this->viewMode == 'multi') {\n $model = $this->relationModel->find($this->manageId);\n $modelsToSave = $this->prepareModelsToSave($model, $saveData);\n foreach ($modelsToSave as $modelToSave) {\n $modelToSave->save(null, $this->manageWidget->getSessionKey());\n }\n }\n elseif ($this->viewMode == 'single') {\n $this->viewWidget->setFormValues($saveData);\n $this->viewModel->save(null, $this->manageWidget->getSessionKey());\n }\n\n return $this->relationRefresh();\n }", "public function process() {\n $canSave = $this->beforeSet();\n if ($canSave !== true) {\n return $this->failure($canSave);\n }\n\n $this->object->set('menuindex', $this->getProperty('menuindex'));\n $this->object->set('template', $this->getProperty('template'));\n\n /* Run the beforeSave method and allow stoppage */\n $canSave = $this->beforeSave();\n if ($canSave !== true) {\n return $this->failure($canSave);\n }\n\n /* run object validation */\n if (!$this->object->validate()) {\n /** @var modValidator $validator */\n $validator = $this->object->getValidator();\n if ($validator->hasMessages()) {\n foreach ($validator->getMessages() as $message) {\n $this->addFieldError($message['field'],$this->modx->lexicon($message['message']));\n }\n }\n }\n\n /* run the before save event and allow stoppage */\n $preventSave = $this->fireBeforeSaveEvent();\n if (!empty($preventSave)) {\n return $this->failure($preventSave);\n }\n\n if ($this->saveObject() == false) {\n return $this->failure($this->modx->lexicon($this->objectType.'_err_save'));\n }\n $this->afterSave();\n $this->fireAfterSaveEvent();\n $this->logManagerAction();\n return $this->cleanup();\n }", "function save() {\n //save the added fields\n }", "public function updateAction(){\r\n \r\n \r\n \r\n // Rolle überprüfen\r\n $user = $this->getServiceLocator()\r\n ->get('AuthService')\r\n ->getStorage()\r\n ->read();\r\n if ($user['Rolle'] != \"SA\" && ($user['Rolle'] != \"AD\")) {\r\n $this->flashMessenger()->addMessage('Dieser Vorgang ist nur Administratoren vorbehalten!');\r\n // Redirect to list of tasks\r\n return $this->redirect()->toRoute('auth', array(\r\n 'action' => 'index'\r\n ));\r\n }\r\n //Verändert bzw setzt einen neuen Vereinsadmin\r\n $id =$this->params('id');\r\n \r\n $form = new VereinsadminaendernForm();\r\n $vereinsadminaendern = new VereinsadminaendernEntity();\r\n \r\n $form->bind($vereinsadminaendern);\r\n // die Übergabe von Werten funktioniert noch nicht\r\n if(isset($_REQUEST['vereinid'])){\r\n \r\n \r\n $vereinid = $_REQUEST['vereinid'];\r\n $adminemail = $_REQUEST['adminemail'];\r\n $passwort = $_REQUEST['passwort'];\r\n \r\n // Hier fehlen noch die InputFilter Abfragen !!\r\n \r\n \r\n //Überprüfung ob die VereinsID existiert\r\n $check1=$this->getVereinsadminaendernMapper()->checkid($vereinid);\r\n //Überprüfung ob die eingegebene Email bereits existiert\r\n $check2=$this->getVereinsadminaendernMapper()->checkemaillogin($adminemail);\r\n \r\n $check3=is_numeric($vereinid);\r\n \r\n $check4=strlen($passwort);\r\n \r\n \r\n if ( $check1!=NULL && $check2==NULL && $check4<17 && $check4>7){\r\n \r\n \r\n //speichern des neuen Admins\r\n $this->getVereinsadminaendernMapper()->saveLogin($adminemail,$passwort);\r\n \r\n $this->getVereinsadminaendernMapper()->saveVereinsadminaendern($adminemail,$vereinid);\r\n \r\n \r\n $this->flashMessenger()->addMessage('Neuer Vereinsadministrator erfolgreich angelegt');\r\n // Redirect to list of tasks\r\n \r\n return $this->redirect()->toRoute('vereinsadminaendern', array('action' => 'index'));\r\n \r\n \r\n \r\n } else {\r\n \r\n \r\n $this->flashMessenger()->addMessage('Es ist ein Fehler aufgetreten! Eventuell existiert diese Email bereits.\r\n Achten sie zudem darauf, dass das Passwort zwischen 8 und 16 Zeichen lang sein muss!');\r\n // Redirect to list of tasks\r\n return $this->redirect()->toRoute('vereinsadminaendern', array('action' => 'index'));\r\n \r\n } \r\n \r\n \r\n\r\n \r\n \r\n \r\n }\r\n \r\n \r\n \r\n return array('form' => $form,\r\n 'id'=>$id\r\n );\r\n }", "function OnBeforeEdit(){\n }", "public function editAction() {\n if($this->_getParam('id',false)) {\n $form = new ContentForm();\n $form->submit->setLabel('Submit changes');\n $form->author->setValue($this->getIdentityForForms());\n $this->view->form = $form;\n if($this->getRequest()->isPost() \n && $form->isValid($this->_request->getPost())){\n if ($form->isValid($form->getValues())) {\n $updateData = $form->getValues();\n $where = array();\n $where[] = $this->_content->getAdapter()\n ->quoteInto('id = ?', $this->_getParam('id'));\n $oldData = $this->_content->fetchRow($this->_content\n ->select()->where('id= ?' , \n (int)$this->_getParam('id')))->toArray();\n $this->_helper->audit($updateData, $oldData, 'ContentAudit', \n $this->_getParam('id'), $this->_getParam('id'));\n $this->_content->update($updateData, $where);\n $this->_helper->solrUpdater->update('beocontent', \n $this->_getParam('id'), 'content'); \n $this->getFlash()->addMessage('You updated: <em>' \n . $form->getValue('title') \n . '</em> successfully. It is now available for use.');\n $this->getCache()->clean(Zend_Cache::CLEANING_MODE_ALL);\n $this->_redirect('admin/content/');\n } else {\n $form->populate($this->_request->getPost());\n }\n } else {\n // find id is expected in $params['id']\n $id = (int)$this->_request->getParam('id', 0);\n if ($id > 0) {\n $content = $this->_content->fetchRow('id=' . (int)$id)->toArray();\n if($content) {\n $form->populate($content);\n } else {\n throw new Pas_Exception_Param($this->_nothingFound);\n }\n }\n }\n } else {\n throw new Pas_Exception_Param($this->_missingParameter, 500);\n }\n }", "protected function hook_beforeSave(){}", "public function postSave() {}", "function webform2html_edit_form_submit($form, &$form_state) {\n if ($form_state['values']['op'] == t('Save')) {\n $save = $form_state['values'];\n unset($save['nid']);\n unset($save['enabled']);\n unset($save['submit']);\n unset($save['reset']);\n unset($save['form_build_id']);\n unset($save['form_token']);\n unset($save['form_id']);\n unset($save['op']);\n\n // First enabled\n if (isset($form_state['values']['new'])) {\n unset($save['new']);\n\n if ($form_state['values']['enabled']) {\n $w2html_setting['nid'] = $form_state['values']['nid'];\n $w2html_setting['enabled'] = $form_state['values']['enabled'];\n $w2html_setting['data'] = $save;\n drupal_write_record('webform2html', $w2html_setting);\n }\n }\n }\n else {\n // default settings\n $save = variable_get('webform2html_default', '');\n\n }\n\n if (!isset($form_state['values']['new'])) {\n // update settings\n $w2html_setting['nid'] = $form_state['values']['nid'];\n $w2html_setting['enabled'] = $form_state['values']['enabled'];\n $w2html_setting['data'] = $save;\n drupal_write_record('webform2html', $w2html_setting, 'nid');\n }\n}", "protected function postSave() {\n\t\treturn true;\n\t}", "public function updatePost(){\n\t\t\t//goi ham de update du lieu\n\t\t\t$this->modelUpdate();\n\t\t\t//di chuyen den trang read\n\t\t\techo \"<script>location.href='account/detail';</script>\";\n\t\t}", "function company_settingsupdate() {\n $this->auth(COMP_ADM_LEVEL);\n $company_id = $this->uri->segment(3);\n foreach ($_POST as $key=>$value) {\n if($key != 'save'){\n $data[$key] = $this->input->post($key);\n }\n }\n if($this->m_company_settings->update($company_id, $data)){\n $this->companyadmin(7);\n }else{\n echo 'error';\n }\n }", "public function admin_edit($id) {\r\n if(isset($this->data[$this->modelClass])) {\r\n\t\t\t$this->_message($this->{$this->modelClass}->bsSave($this->data, 'edit'));\r\n }\r\n\t\t$this->data = $this->{$this->modelClass}->read(null, $id);\r\n }", "public function afterUpdate()\n {\n //only clean and change custom fields if they have been set\n if (!empty($this->customFields)) {\n $this->deleteAllCustomFields();\n $this->saveCustomFields();\n }\n }", "public function hook_after_edit($id) {\n\t //Your code here \n\n\t }", "public function hook_after_edit($id) {\n\t //Your code here \n\n\t }", "protected function Form_Run() {}", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function pageAdmin()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oExtras = new Oeventextra($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_GENERAL);\r\n\r\n\t\t// Infos generales\r\n\t\t$form = $body->addForm('frmAdmin', BPREF_UPDATE_ADMIN, 'targetDlg');\r\n\t\t$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\t\t$div = $form->addDiv('', 'bn-div-left');\r\n\t\t$edt = $div->addEdit('nameevent', LOC_LABEL_EVENT_NAME, $oEvent->getVal('name'), 255);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_NAME);\r\n\r\n\t\t$edt = $div->addEdit('place', LOC_LABEL_EVENT_PLACE, $oEvent->getVal('place'), 25);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_PLACE);\r\n\r\n\t\t$edt = $div->addEdit('dateevent', LOC_LABEL_EVENT_DATE, $oEvent->getVal('date'), 25);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_DATE);\r\n\r\n\t\t$edt = $div->addEdit('numauto', LOC_LABEL_EVENT_NUMAUTO, $oEvent->getVal('numauto'), 50);\r\n\r\n\t\t$edt = $div->addEdit('organizer', LOC_LABEL_EVENT_ORGANIZER, $oEvent->getVal('organizer'), 75);\r\n\t\t$edt->noMandatory();\r\n\t\t//$edt->tooltip(LOC_TOOLTIP_EVENT_ORGANIZER);\r\n\r\n\t\t/* Region */\r\n\t\t$cbo = $div->addSelect('regionid', LOC_LABEL_EVENT_REGION);\r\n\t\t//$cbo->tooltip(LOC_TOOLTIP_EVENT_REGION);\r\n\t\t$regs = Ogeo::getRegions(-1, LOC_LABEL_SELECT_REGION);\r\n\t\t$cbo->addOptions($regs, $oExtras->getVal('regionid'));\r\n\r\n\t\t/* Departement */\r\n\t\t$cbo = $div->addSelect('deptid', LOC_LABEL_EVENT_DPT);\r\n\t\t//$cbo->tooltip(LOC_TOOLTIP_EVENT_DPT);\r\n\t\t$codeps = Ogeo::getDepts(-1, LOC_LABEL_SELECT_DPT);\r\n\t\t$cbo->addOptions($codeps, $oExtras->getVal('deptid'));\r\n\r\n\t\t$d = $div->addDiv('', 'bn-div-line');\r\n\t\t$edt = $d->addEditDate('firstday', LOC_LABEL_EVENT_FIRSTDAY, Bn::date($oEvent->getVal('firstday'), 'd-m-Y'));\r\n\t\t$edt->addOption('onSelect', 'selectFirstDay');\r\n\t\t$edt->addOption('maxDate', 'new Date(' . Bn::date($oEvent->getVal('lastday'), 'Y,m-1,d') .')');\r\n\t\t$edt = $d->addEditDate('lastday', LOC_LABEL_EVENT_LASTDAY, Bn::date($oEvent->getVal('lastday'), 'd-m-Y'));\r\n\t\t$edt->addOption('onSelect', 'selectLastDay');\r\n\t\t$edt->addOption('minDate', 'new Date(' . Bn::date($oEvent->getVal('firstday'), 'Y,m-1,d') .')');\r\n\r\n\t\t$d->addBreak();\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonValid('', LOC_BTN_UPDATE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$body->display();\r\n\t\treturn false;\r\n\t}", "function adminDefault() {\n\t\t// decide submit modes\n\t\t$GLOBALS['objCms']->initSubmitting(1,2); // save and save and close\n\t\n\t\t// initialize object content\n\t\t$this->content = new ContentFck();\n\t\t\n\t\t// load content corresponding to page\n\t\t$this->content->loadContent($GLOBALS['objPage']->id);\n\t\n\t\t// set script for form\n\t\t$this->content->initAdmin('full', 2);\n\t\t\n\t\t$this->setView('admin_form');\n\t\t\n\t}", "public function preSave() { }", "function admin_page() {\n\t\t$this->maybe_authorize();\n?>\n\t\t<div class=\"wrap ghupdate-admin\">\n\n\t\t\t<div class=\"head-wrap\">\n\t\t\t\t<?php screen_icon( 'plugins' ); ?>\n\t\t\t\t<h2><?php _e( 'Setup GitHub Updates' , 'github_plugin_updater' ); ?></h2>\n\t\t\t</div>\n\n\t\t\t<div class=\"postbox-container primary\">\n\t\t\t\t<form method=\"post\" id=\"ghupdate\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\tsettings_errors();\n\t\tsettings_fields( 'ghupdate' ); // includes nonce\n\t\tdo_settings_sections( 'github-updater' );\n?>\n\t\t\t\t</form>\n\t\t\t</div>\n\n\t\t</div>\n\t\t<?php\n\t}", "public function afterSave() {\n parent::afterSave();\n // remove old athletes\n $this->compileAthletesToNotify();\n foreach ($this->athletes as $athlete) {\n if (!in_array($athlete->primaryKey, $this->formAthletes)) {\n $this->removeAthlete($athlete);\n }\n }\n // add new athletes\n if (!is_array($this->formAthletes)) {\n $this->formAthletes = array($this->formAthletes);\n }\n foreach ($this->formAthletes as $formAthleteID) {\n $formAthlete = User::model()->findByPk($formAthleteID);\n if (!in_array($formAthlete, $this->athletes)) {\n $this->addAthlete($formAthlete);\n }\n }\n $this->notifyRemainingAthletes();\n $this->notifyClubAdmin();\n $this->refresh();\n }", "public function preSave() {}", "function onProcess () {\n \n switch (parent::getAction()) {\n \n case \"save\":\n if (Context::hasRole(\"user.files.edit\")) {\n parent::param(\"mode\", parent::post(\"mode\"));\n parent::redirect();\n }\n break;\n case \"config\":\n break;\n default:\n parent::onProcess();\n break;\n }\n }", "function psc_manage_forms() {\n\tif(isset($_GET['action'])) {\n\t\tswitch($_GET['action']) {\n\t\t\tcase 'save_captcha_info':\n\t\t\t\tif(wp_verify_nonce($_POST['psc_catch_info'], 'psc_nonce_field')) {\n\t\t\t\t\tpsc_save_api_info($_POST);\n\t\t\t\t}\n\t\t\t\tpsc_admin_index();\n\t\t\t\tbreak;\n\t\t\tcase 'edit_form':\n\t\t\t\tif(isset($_GET['id'])) {\n\t\t\t\t\tif(wp_verify_nonce($_POST['psc_save'], 'psc_nonce_field') && $_POST['psc_id']==$_GET['id']) {\n\t\t\t\t\t\tpsc_save_form($_POST);\n\t\t\t\t\t}\n\t\t\t\t\tpsc_edit_form($_GET['id']);\n\t\t\t\t} else {\n\t\t\t\t\techo 'Error.';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'new_form':\n\t\t\t\tif(wp_verify_nonce($_POST['psc_save'], 'psc_nonce_field')) {\n\t\t\t\t\t$id = psc_save_form($_POST);\n\t\t\t\t}\n\t\t\t\tif(isset($id)) {\n\t\t\t\t\tpsc_edit_form($id);\n\t\t\t\t} else {\n\t\t\t\t\tpsc_edit_form();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t} else {\n\t\tpsc_admin_index();\n\t}\n\treturn true;\n}", "function dlgModify() {\n global $database;\n\n if ((!$this->sql_getEntry($this->section_id,$this->page_id)) && ($database->is_error())) {\n // SQL Fehler\n $this->print_error(); }\n else {\n // sicherstellen, dass nur bei einem Reload die $_REQUEST Daten verwendet werden\n if ((isset($_REQUEST['action'])) && ($_REQUEST['action'] == 'request')) {\t$this->requestToRecord(); }\n $parser = new templateParser();\n $parser->add('h1',dl_backend_header);\n $parser->add('description',dl_backend_description);\n $parser->add('text_header',dl_backend_text_header);\n $parser->add('value_header',$this->record['header']);\n $parser->add('text_prefix',dl_backend_text_prefix);\n $parser->add('value_prefix',$this->record['prefix']);\n $parser->add('text_select',dl_backend_text_select);\n $parser->add('text_suffix',dl_backend_text_suffix);\n $parser->add('value_suffix',$this->record['suffix']);\n\n $parser->add('form_action', WB_URL.'/modules/dirlist/save.php');\n $parser->add('btn_submit',dl_backend_btn_submit);\n $parser->add('btn_abort',dl_backend_btn_abort);\n $parser->add('abort_location',ADMIN_URL. '/pages/index.php');\n $parser->add('page_id',$this->page_id);\n $parser->add('section_id',$this->section_id);\n\t\t\t// Medienverzeichnis auslesen\n $media_dirs = $this->getMediaDirectories();\n if (!empty($this->record['directory']) && (in_array($this->record['directory'],$media_dirs))) {\n $dummy = ''; }\n else {\n $dummy = ' selected=\"selected\"'; }\n $worker = sprintf('<select name=\"directory\"><option value=\"\"%s>%s</option>',$dummy,dl_backend_select_directory);\n while (list($key,$val) = each($media_dirs)) {\n \t$dummy = $key;\n if (!empty($val)) {\n ($val == $this->record['directory']) ? $dummy = ' selected=\"selected\"' : $dummy = '';\n $worker .= sprintf('<option value=\"%s\"%s>%s</option>',$val,$dummy,$val); }}\n $worker .= '</select>';\n $parser->add('directory',$worker);\n\n // Sortierreihenfolge\n $parser->add('text_sort',dl_backend_text_sort);\n $sortArray[1] \t= dl_backend_sortFilesAscending;\n $sortArray[2] \t= dl_backend_sortFilesDescending;\n $sortArray[4] \t= dl_backend_sortSizeAscending;\n\t $sortArray[8] \t= dl_backend_sortSizeDescending;\n $sortArray[16] \t= dl_backend_sortDateAscending;\n $sortArray[32] \t= dl_backend_sortDateDescending;\n\n $worker = '<select name=\"sort\">';\n for ($i=1; $i < 33; $i = $i*2) {\n \t($i == $this->record['sort']) ? $dummy = ' selected=\"selected\"' : $dummy = '';\n \t$worker .= sprintf('<option value=\"%d\"%s>%s</option>',$i,$dummy,$sortArray[$i]); }\n $worker .= '</select>';\n $parser->add('sort',$worker);\n\n $parser->add('text_preselect',dl_backend_text_preselect);\n if ($this->record['exclude'] == 0) {\n $dummy = ' selected=\"selected\"';\n $dummy2 = ''; }\n else {\n $dummy = '';\n $dummy2 = ' selected=\"selected\"'; }\n $worker = sprintf('<option value=\"0\"%s>%s</option>',$dummy,dl_backend_include);\n $worker .= sprintf('<option value=\"1\"%s>%s</option>',$dummy2,dl_backend_exclude);\n $parser->add('exclude_option',$worker);\n $parser->add('value_extensions',$this->record['extensions']);\n\n ($this->record['blank'] == 1) ? $checked = ' checked=\"checked\"' : $checked = '';\n $parser->add('blank_checked',$checked);\n $parser->add('text_blank', dl_backend_blank);\n\n $parser->add('value_header',$this->record['header']);\n $parser->add('value_prefix',$this->record['prefix']);\n $parser->add('value_suffix',$this->record['suffix']);\n\n $parser->parseTemplateFile(WB_PATH.'/modules/dirlist/htt/backend.htt');\n $parser->echoHTML();\n } // else\n\n }", "public function index_onUpdateForm()\n\t{\n\t\t$record_id = post('record_id');\n\t\tparent::update($record_id);\n\t\t$this->controller->vars['record_id'] = $record_id;\n\t\treturn $this->makePartial('update');\n\t}", "function editCondoHandler()\t{\t\n global $inputs;\n\n updateDb('condo',[\t\n 'name' => $inputs['name'],\t\n 'area' => $inputs['area'],\t\n 'cost' => $inputs['cost'],\t\n ], [\t\n 'id' => $inputs['id']\t\n ]);\n\n formatOutput(true, 'update success');\t\n}", "public function onPaymentsEdit()\n\t{\n\t\tif ($this->perms->edit)\n\t\t{\n\t\t\t//JToolBarHelper::save();\n\t\t}\n\n\t\tJToolBarHelper::cancel();\n\t\t$this->setToolbarTitle('Edit');\n\t}", "public function action_updatedo()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n\t\t$id = $post[\"id\"];\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n if($entry){\n\t\t\t$entry[\"venue\"] = $post[\"venue\"];\n\t\t\t$entry[\"post\"] = $post[\"post\"];\n\t\t\t$entry[\"dating\"] = $post[\"dating\"];\n\t\t\t$entry[\"content\"] = $post[\"content\"];\n\t\t\t$entry[\"name\"] = $post[\"name\"];\n\t\t\t$entry[\"man_num\"] = $post[\"man_num\"];\n\t\t\t$entry[\"woman_num\"] = $post[\"woman_num\"];\n\t\t\t$entry[\"visitors_num\"] = $post[\"visitors_num\"];\n\t\t\tif(!$entry->save()){\n\t\t\t\t$data[\"msg\"] = \"更新に失敗しました。\";\n\t\t\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n }\n\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n\t}", "public function edit_subadmin_form()\n\t{\n\t\tif ($this->checkLogin('A') == '') \n\t\t{\n\t\t\tredirect('admin');\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$this->data['heading'] = 'Edit Sub-Admin';\n\t \t $adminid = $this->uri->segment(4,0);\n\t \t\t$condition = array('id' => $adminid);\n\t \t\t$this->data['admin_details'] = $this->subadmin_model->get_all_details(SUBADMIN,$condition);\n\t\t\t \n\t\t\tif ($this->data['admin_details']->num_rows() == 1) \n\t\t\t{\n\t\t\t\t$this->data['privArr'] = unserialize($this->data['admin_details']->row()->privileges);\t\n\t\t\t\t\t\n\t\t\t\tif (!is_array($this->data['privArr'])) \n\t\t\t\t{\n\t\t\t\t\t$this->data['privArr'] = array();\n\t\t\t\t}\n\n\t\t\t\t$this->load->view('admin/subadmin/edit_subadmin', $this->data);\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\t}", "private function update_form()\n\t{\n\t\t$this->title = sprintf(lang('update_title'), $this->installed_version, $this->version);\n\t\t$vars['action'] = $this->set_qstr('do_update');\n\t\t$this->set_output('update_form', $vars);\n\t}", "public function admin_form($data) {\n\t\t\t$ret = 'To enter content into this WYSIWYG:<br/>\n\t\t\t\t\t1. Give this module a name <input onchange=\"cfct_module_wysiwyg_change();\" type=\"text\" name=\"'.$this->get_field_name('title').'\" id=\"'.$this->get_field_id('title').'\" value=\"'.(!empty($data[$this->get_field_name('title')]) ? esc_html($data[$this->get_field_name('title')]) : '').'\" style=\"width: 150px;\" /><br/>\n\t\t\t\t\t2. Click Save<br/>\n\t\t\t\t\t3. Update this page<br/>\n\t\t\t\t\t4. Edit module content via WYSIWYG tab named <span style=\"font-weight:bold;\" id=\"cfct-module-wysiwyg-name\">'.(!empty($data[$this->get_field_name('title')]) ? esc_html($data[$this->get_field_name('title')]) : '').'</span>';\n\t\t\treturn $ret;\n\t\t}", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "protected function AdminPage() {\n\t$oPathIn = fcApp::Me()->GetKioskObject()->GetInputObject();\n\t$oFormIn = fcHTTP::Request();\n\n\t$doSave = $oFormIn->GetBool('btnSave');\n\n\t// save edits before showing events\n\tif ($doSave) {\n\t $frm = $this->PageForm();\n\t $frm->Save();\n\t $this->SelfRedirect();\n\t}\n\n\t$oMenu = fcApp::Me()->GetHeaderMenu();\n\t // ($sGroupKey,$sKeyValue=TRUE,$sDispOff=NULL,$sDispOn=NULL,$sPopup=NULL)\n\t $oMenu->SetNode($ol = new fcMenuOptionLink('do','edit',NULL,NULL,'edit this record'));\n\n\t $doEdit = $ol->GetIsSelected();\n\n\t$frmEdit = $this->PageForm();\n\tif ($this->IsNew()) {\n\t $frmEdit->ClearValues();\n\t} else {\n\t $frmEdit->LoadRecord();\n\t}\n\t$oTplt = $this->PageTemplate();\n\t$arCtrls = $frmEdit->RenderControls($doEdit);\n\t\n\t$out = NULL;\n\t$arCtrls['!ID'] = $this->SelfLink();\n\tif ($doEdit) {\n\t $out .= \"\\n<form method=post>\";\n\t $arCtrls['!extra'] = '<tr>\t<td colspan=2><b>Edit notes</b>: <input type=text name=\"'\n\t .KS_FERRETERIA_FIELD_EDIT_NOTES\n\t .'\" size=60></td></tr>'\n\t ;\n\t $arCtrls['isType'] .= ' is a type';\n\t} else {\n\t $arCtrls['!extra'] = NULL;\n\t $arCtrls['isType'] = $this->IsType()?'type':'folder';\n\t}\n\n\t$oTplt->SetVariableValues($arCtrls);\n\t$out .= $oTplt->RenderRecursive();\n\t\n\tif ($doEdit) {\t \n\t $out .= <<<__END__\n<input type=submit name=\"btnSave\" value=\"Save\">\n<input type=reset value=\"Reset\">\n</form>\n__END__;\n\t}\n\treturn $out;\n }", "function update_process()\n {\n if ($this->acl->otentikasi_admin($this->title) == TRUE){\n\n $data['title'] = $this->properti['name'].' | Campaignistrator '.ucwords($this->modul['title']);\n $data['h2title'] = $this->modul['title'];\n $data['main_view'] = 'admin_update';\n\t$data['form_action'] = site_url($this->title.'/update_process');\n\t$data['link'] = array('link_back' => anchor('admin/','<span>back</span>', array('class' => 'back')));\n\n\t// Form validation\n $this->form_validation->set_rules('ctocustomer', 'Customer Recipient', 'callback_valid_recipient['.$this->input->post('ctodriver').']');\n $this->form_validation->set_rules('ctodriver', 'Courier Recipient', '');\n $this->form_validation->set_rules('ccategory', 'Article Category', 'callback_valid_category['.$this->input->post('tcategory').']');\n $this->form_validation->set_rules('tdesc', 'Article Content', '');\n $this->form_validation->set_rules('ttitle', 'Subject', 'required');\n\n if ($this->form_validation->run($this) == TRUE)\n {\n if ($this->input->post('ctocustomer') != \"\" && $this->input->post('ctodriver') != \"\"){ \n $reicipt = $this->input->post('ctocustomer').','.$this->input->post('ctodriver');\n }elseif ( $this->input->post('ctocustomer') != \"\" && $this->input->post('ctodriver') == \"\" ){\n $reicipt = $this->input->post('ctocustomer');\n }elseif ( $this->input->post('ctodriver') != \"\" && $this->input->post('ctocustomer') == \"\" ){ $reicipt = $this->input->post('ctodriver'); }\n\n if ($this->input->post('tcategory') != \"\"){ $category = $this->input->post('tcategory'); }else{\n $category = $this->input->post('ccategory');\n }\n \n if ($this->input->post('ctype') == 'sms' || $this->input->post('ctype') == 'notif'){ $content = $this->input->post('tdesc'); }else{ $content = $this->input->post('tdescemail'); }\n \n $campaign = array(\n 'email_to' => $reicipt,\n 'type' => $this->input->post('ctype'),\n 'subject' => $this->input->post('ttitle'),\n 'category' => $category,\n 'content' => $content,\n 'dates' => $this->input->post('tdates'));\n \n\t $this->Campaign_model->update($this->session->userdata('langid'), $campaign);\n $this->session->set_flashdata('message', \"One $this->title has successfully updated!\");\n \n\n }\n else{ $this->session->set_flashdata('message', validation_errors()); }\n }else { echo \"error|Sorry, you do not have the right to edit $this->title component..!\"; }\n redirect($this->title.'/update/'.$this->session->userdata('langid'));\n $this->session->unset_userdata('langid');\n }", "function restapi_admin_form_submit($form, &$form_state) {\n\n // Ensure the menu system picks up the changes due to the prefix update.\n if (!empty($form_state['storage']['restapi_url_prefix_changed'])) {\n menu_rebuild();\n }\n\n}", "function onsave(){\n\t\treturn true;\n\t}", "public function event()\r\n {\r\n\r\n\r\n if ($this->_config['changeSubmit']) {\r\n\r\n $changeSubmitId = $this->_config['changeSubmitId'];\r\n\r\n $eventOld = ZArrayHelper::getValue($this->_event, 'change paste keyup cut select');\r\n\r\n $this->_event['change paste keyup cut select'] = $eventOld . \"\r\n console.log('changeSubmit: ' + event.target.id);\r\n $($changeSubmitId).submit();\r\n \";\r\n }\r\n\r\n\r\n if ($this->_config['changeSave']) {\r\n $eventOld = ZArrayHelper::getValue($this->_event, 'change paste keyup cut select');\r\n // $eventOld = ZArrayHelper::getValue($this->_event, 'change');\r\n\r\n /**\r\n *\r\n * Get Attributes\r\n *\r\n */\r\n $id = ZArrayHelper::getValue($this->model, 'id');\r\n\r\n $allApp = $this->modelMain->allApp();\r\n // vd($allApp );\r\n if (!empty($allApp->parentAttr))\r\n $attribute = \"$allApp->parentAttr-$this->attribute\";\r\n else\r\n $attribute = $this->attribute;\r\n\r\n /**\r\n *\r\n * Parent Class\r\n */\r\n\r\n $parentClass = bname($allApp->parentClass);\r\n\r\n if (!empty($allApp->parentClass))\r\n $modelClass = $parentClass;\r\n else\r\n $modelClass = $this->modelClassName;\r\n\r\n\r\n /**\r\n *\r\n * ID Attribute\r\n */\r\n $valueKey = strtolower(\"$modelClass-$attribute\");\r\n // vd($valueKey);\r\n\r\n $changeSave = <<<JS\r\n \r\n //start|DavlatovRavshan|2020.10.12\r\n function isFunctionDefined(functionName) {\r\n if (eval(\"typeof(\" + functionName + \") == typeof(Function)\")) {\r\n return true;\r\n }\r\n }\r\n \r\n var value = $('#$valueKey').val(); \r\n \r\n console.log('changeSave ID: $valueKey');\r\n console.log('changeSave Value: ' + value);\r\n // var url = '/api/core/save/auto.aspx';\r\n var url = '/api/core/save/auto.aspx';\r\n \r\n if (xhr !== undefined) {\r\n console.log('Abort XHR: ' + xhr);\r\n xhr.abort()\r\n }\r\n \r\n var xhr = $.ajax({\r\n \r\n url: url, \r\n type: 'POST', \r\n data: { \r\n id: '$id', \r\n value: value, \r\n attr: '$this->attribute', \r\n parentAttr: '{$allApp->parentAttr}', \r\n parentClass: '{$parentClass}', \r\n parentId: '{$allApp->parentId}', \r\n modelClassName: '$this->modelClassName', \r\n }, \r\n \r\n success: function (data, status, xhr) {\r\n \r\n console.log('Change success! Value: ' + value);\r\n console.log('Data: ', data);\r\n \r\n {sendAjax}\r\n },\r\n \r\n error: function (jqXhr, textStatus, errorMessage) {\r\n console.error(jqXhr);\r\n console.error('message: ---' + errorMessage);\r\n console.error('text-status: ---' + textStatus);\r\n }\r\n });\r\n \r\nJS;\r\n\r\n//start|DavlatovRavshan|2020.10.11\r\n\r\n $sendAjax = '';\r\n if (!empty($this->form)) {\r\n\r\n//vd($this->_config['changeReloadPjax']);\r\n\r\n switch ($this->modelConfigs->changeReloadPjax) {\r\n case ALLData::changeReloadType['ajax']:\r\n $sendAjax = <<<JS\r\n if (event.type === 'change' && isFunctionDefined('sendAjax')) {\r\n \r\n console.log('sendAjax | ' + event.target.id);\r\n sendAjax()\r\n }\r\nJS;\r\n\r\n break;\r\n case ALLData::changeReloadType['pjax']:\r\n $sendAjax = <<<JS\r\n if (event.type === 'change' && isFunctionDefined('sendPjax')) {\r\n console.log('sendPjax | ' + event.target.id);\r\n sendPjax()\r\n }\r\nJS;\r\n\r\n break;\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n $this->_event['change paste keyup cut select'] = $eventOld . strtr($changeSave, [\r\n // $this->_event['change'] = $eventOld . strtr($changeSave, [\r\n '{sendAjax}' => $sendAjax\r\n ]);\r\n\r\n $this->_event['switchChange.bootstrapSwitch'] = $eventOld . strtr($changeSave, [\r\n // $this->_event['change'] = $eventOld . strtr($changeSave, [\r\n '{sendAjax}' => $sendAjax\r\n ]);\r\n }\r\n\r\n if ($this->_config['changeReload']) {\r\n\r\n $changeReloadId = $this->modelConfigs->changeReloadId;\r\n\r\n vd($this->model->className(), $changeReloadId);\r\n\r\n \r\n $eventOld = ZArrayHelper::getValue($this->_event, 'change');\r\n\r\n\r\n if (!empty($changeReloadId))\r\n {\r\n\r\n // vd($changeReloadId);\r\n \r\n $this->_event['change'] = $eventOld . \"\r\n\r\n console.log('changeReload from: ' + event.target.id);\r\n\r\n $.pjax.reload({\r\n container: '#{$changeReloadId}',\r\n async: true,\r\n timeout: false\r\n });\r\n \";\r\n }\r\n\r\n }\r\n\r\n if ($this->_config['enableEvent']) {\r\n\r\n $eventItem = $this->eventsOn($this->_event);\r\n\r\n\r\n // vd( $eventItem);\r\n $this->js .= strtr($this->_layout['eventMain'], [\r\n '{id}' => $this->id,\r\n '{eventItem}' => $eventItem,\r\n ]);\r\n\r\n /*\r\n if ($this::className() === ZFormWidget::class)\r\n vd($this->js);*/\r\n }\r\n\r\n }", "public function hook_after_edit($id) {\n\t\t\t//Your code here \n\t\t\t$cek = DB::table('purchase_invoices')->where('id',$id)->first(['status']);\n\t\t\tif($cek->status == 'submited'){\n\t\t\t\t$this->sendEmail();\n\t\t\t}\n\t\t\t// pr($id);\n\t\t\t// pr('hook_after_edit',1);\n\n\t }" ]
[ "0.7342933", "0.6733799", "0.6613064", "0.6517291", "0.6460631", "0.6450236", "0.6243063", "0.6239055", "0.62146735", "0.6202051", "0.61740947", "0.61668134", "0.61521393", "0.6126466", "0.6101106", "0.61002696", "0.60972315", "0.6092627", "0.60808057", "0.60640264", "0.6044773", "0.60431075", "0.60349303", "0.60184103", "0.60132533", "0.5998435", "0.5998158", "0.5985488", "0.5981356", "0.5980498", "0.5977021", "0.59730464", "0.59389174", "0.593213", "0.5921588", "0.5921197", "0.5921197", "0.59205157", "0.5919588", "0.5916684", "0.59082395", "0.5906619", "0.59039825", "0.5890105", "0.5886657", "0.5876238", "0.5874018", "0.58731365", "0.5871354", "0.5861622", "0.58577305", "0.5853545", "0.5847497", "0.58190966", "0.58152926", "0.581324", "0.5809526", "0.5801716", "0.57887924", "0.5781843", "0.5777773", "0.5776465", "0.57731664", "0.5760106", "0.57564664", "0.5756226", "0.574915", "0.5748421", "0.57476676", "0.57443243", "0.5742758", "0.57399154", "0.5738923", "0.57380617", "0.57352626", "0.57352626", "0.57233125", "0.57214594", "0.571841", "0.57182544", "0.57172817", "0.5716448", "0.57159483", "0.5713455", "0.5711381", "0.57085866", "0.5708445", "0.5703915", "0.56996655", "0.5698301", "0.5692461", "0.5690869", "0.56883204", "0.5685441", "0.56805557", "0.5676864", "0.56758374", "0.5674464", "0.5672965", "0.5671304", "0.5670171" ]
0.0
-1
Verifies the protobuf payload signature.
public function verify($message, $signature) { $jsonMessage = Util::toJson($message); return $this->verifyString($jsonMessage, $signature); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function verify($data, $signature);", "protected function checkSignature()\n {\n $headers = \\Yii::$app->request->headers;\n\n $signature = $headers->get('paypal-transmission-sig');\n if (!$signature)\n throw new BadRequestHttpException;\n\n $checkString = sprintf('%s|%s|%s|%s',\n $headers->get('paypal-transmission-id'),\n $headers->get('paypal-transmission-time'),\n $this->webHookId,\n crc32(\\Yii::$app->request->rawBody)\n );\n\n $certUrl = $headers->get('paypal-cert-url');\n if (!$certUrl)\n throw new BadRequestHttpException;\n\n $publicKey = $this->fetchPublicKey($certUrl);\n if (!$publicKey)\n throw new \\Exception('Certificate error');\n\n// $algo = ArrayHelper::getValue($headers, 'paypal-hash-algo');\n\n $result = openssl_verify($checkString, base64_decode($signature), $publicKey);\n return $result === 1;\n }", "public function validate_signature($params) {\n\n $new_sig = Utils::generate_signature($params['data'], $params['secret']);\n\n if ($new_sig == $params['signature']) {\n return true;\n } else {\n return false;\n }\n\n }", "public function validateInboundMessage(){\n\t\t$hashData = $this->timestamp . \"\" . $this->token;\n\t\t$computedSignature = hash_hmac(\"sha256\",$hashData , $this->MGAPIKEY);\n\t\t$providedSignature = $this->signature;\n\t\tif ($computedSignature == $providedSignature){\n\t\t\tif($this->validateSender()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function verify_msg($data)\n\t{\n\t\t// we are using '-v' specifically to catch clear message\n\t\t// after signature verification is complete\n\t\t$body = $this->call(\"{$this->context} -v -d\", 'post', $data);\n\n\t\t$results = [\n\t\t\tfalse,\t// [0]\n\t\t\tnull,\t// [1]\n\t\t\tnull,\t// [2]\n\t\t\tnull,\t// [3]\n\t\t\t$body,\t// [4], always defined\n\t\t\t0,\t\t// [5]\n\t\t];\n\n\t\t// checking status codes of the verification operation\n\t\tif (false === $status = $this->get_status())\n\t\t{\n\t\t\t// something's wrong, aborting\n\t\t\t$results[0] = null;\n\t\t\treturn $results;\n\t\t}\n\t\telse foreach ($status as $code)\n\t\t{\n\t\t\tif ($code[0] == 'VALIDSIG')\n\t\t\t{\n\t\t\t\t// defining output elements for good sig\n\t\t\t\t$results[0] = true;\n\t\t\t\t$results[1] = $code[10];\n\t\t\t\t$results[2] = $code[3];\n\t\t\t}\n\t\t\telse if ($code[0] == 'BADSIG')\n\t\t\t{\n\t\t\t\t// in case of bad signature we return\n\t\t\t\t// long key_id, not a full FPR!\n\t\t\t\t$results[1] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERRSIG')\n\t\t\t{\n\t\t\t\t// signature verification error (no pubkey?).\n\t\t\t\t// only long key_id is returned!\n\t\t\t\t$results[0] = null;\n\t\t\t\t$results[1] = $code[1];\n\t\t\t\t$results[2] = $code[5];\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPKEYSIG')\n\t\t\t{\n\t\t\t\t// signature with expired key\n\t\t\t\t$results[5] = 1;\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPSIG')\n\t\t\t{\n\t\t\t\t// signature itself is expired\n\t\t\t\t$results[5] = 2;\n\t\t\t}\n\t\t\telse if ($code[0] == 'REVKEYSIG')\n\t\t\t{\n\t\t\t\t// signing key is revoked\n\t\t\t\t$results[5] = 3;\n\t\t\t}\n\t\t\telse if ($code[0] == 'SIG_ID')\n\t\t\t{\n\t\t\t\t// defining remaining output element: sigID\n\t\t\t\t// (if applicable)\n\t\t\t\t$results[3] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERROR' || $code[0] == 'NODATA')\n\t\t\t{\n\t\t\t\t// input error encountered, aborting\n\t\t\t\t$results[0] = null;\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "public function verifyRequest(): void\n {\n $this->verifySignature();\n\n if (!$this->request->hasParameters(['entry.0.messaging.0.sender.id', 'entry.0.messaging.0.message'])) {\n throw new InvalidRequest('Invalid payload');\n }\n }", "public static function verifySignature($signature, $msg, $key) : bool\n {\n $verified = sodium_crypto_sign_verify_detached(\n sodium_hex2bin($signature),\n sodium_hex2bin(self::hashObject($msg)),\n sodium_hex2bin($key)\n );\n\n return is_bool($verified) && $verified == true;\n }", "public function validate_webhook($params) {\n\n $sig = $params['signature'];\n unset($params['signature']);\n\n if (!isset($sig)) {\n return false;\n }\n\n $data = array(\n 'data' => $params,\n 'secret' => $this->account_details['app_secret'],\n 'signature' => $sig\n );\n\n return $this->validate_signature($data);\n\n }", "public function isSignatureRequired();", "public function VerifySignature($signature) {\n return $this->signature->check_signature($this->request, $this->consumer, $this->token, $signature);\n }", "private function checkSignature()\n {\n\n\n\n if (!defined(\"self::TOKEN\")) {\n throw new \\Exception('TOKEN is not defined!');\n }\n\n $signature = $this->getRequest()->get('signature');\n $timestamp = $this->getRequest()->get('timestamp');\n $nonce = $this->getRequest()->get('nonce');\n\n $token = self::TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n $logger = $this->get('logger');\n $logger->error($signature.'==='.$tmpStr);\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "function verifyMessage($certfile, $data, $signature) {\r\n\r\n // $data and $signature are assumed to contain the data and the signature\r\n $ok=0;\r\n // fetch public key from certificate and ready it\r\n $fp = fopen( \"security/\" . $certfile, \"r\");\r\n \r\n if(!$fp) {\r\n return false;\r\n }\r\n \r\n $cert = fread($fp, 8192);\r\n fclose($fp);\r\n $pubkeyid = openssl_get_publickey($cert);\r\n\r\n // state whether signature is okay or not\r\n $ok = openssl_verify($data, $signature, $pubkeyid);\r\n \r\n // free the key from memory\r\n openssl_free_key($pubkeyid);\r\n\r\n return $ok;\r\n\r\n }", "public static function verify($secret, $payload, $signature) {\n [$algorithm, $user_string] = explode('=', $signature);\n $known_string = hash_hmac($algorithm, $payload, $secret);\n if (!hash_equals($known_string, $user_string)) {\n throw new WebhookMismatchSignatureException($user_string, $algorithm . '=' . $known_string, $payload);\n }\n return TRUE;\n }", "protected function validHasSignature()\n {\n if (! $this->request->has('signature')) {\n throw new VanillaInvalidRequestException('Missing signature parameter.');\n }\n }", "public function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\t\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkSignature() {\n\t\tif (! defined ( \"TOKEN\" )) {\n\t\t\tthrow new Exception ( 'TOKEN is not defined!' );\n\t\t}\n\t\t\n\t\t$signature = $_GET [\"signature\"];\n\t\t$timestamp = $_GET [\"timestamp\"];\n\t\t$nonce = $_GET [\"nonce\"];\n\t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array (\n\t\t\t\t$token,\n\t\t\t\t$timestamp,\n\t\t\t\t$nonce \n\t\t);\n\t\t// use SORT_STRING rule\n\t\tsort ( $tmpArr, SORT_STRING );\n\t\t$tmpStr = implode ( $tmpArr );\n\t\t$tmpStr = sha1 ( $tmpStr );\n\t\t\n\t\tif ($tmpStr == $signature) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function verify();", "public function verify()\r\n\t{\r\n\t\treturn ($this->verifyHeaders() && $this->verifyDataFormat() && $this->verifySignature());\r\n\t}", "private function signedSealed ()\n {\n $signature = getenv('HTTP_X_DROPBOX_SIGNATURE');\n if ( $signature === null || empty( $signature ) ){\n return false;\n } else {\n $httpbody = file_get_contents('php://input');\n $hmac = hash_hmac( 'sha256', $httpbody, DBX_APP_SECRET );\n if ( dbx\\Security::stringEquals( $signature, $hmac ) ) {\n return true;\n } else {\n return false;\n }\n }\n }", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = $this->_token;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n {\n \tif (!defined(\"TOKEN\")) {\n \t\tthrow new Exception('TOKEN is not defined!');\n \t}\n\n \t$signature = $_GET[\"signature\"];\n \t$timestamp = $_GET[\"timestamp\"];\n \t$nonce = $_GET[\"nonce\"];\n\n \t$token = TOKEN;\n \t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n \tsort($tmpArr, SORT_STRING);\n \t$tmpStr = implode( $tmpArr );\n \t$tmpStr = sha1( $tmpStr );\n\n \tif( $tmpStr == $signature ){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }", "private function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "public static function verifySignature($reqBody, $reqSignature, $webhookSecretKey)\n\t{\n\t\treturn CryptoUtil::validMAC($reqBody, $reqSignature, $webhookSecretKey);\n\t}", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "public static function checkUnmarshalledVerifySigRequest( ThreeDSecureRequest $fromXmlRequest, PHPUnit_Framework_TestCase $testCase ) {\n\n\t\t$testCase->assertNotNull( $fromXmlRequest );\n\t\t$testCase->assertEquals( self::CARD_NUMBER, $fromXmlRequest->getCard()->getNumber() );\n\t\t$testCase->assertEquals( self::$CARD_TYPE->getType(), $fromXmlRequest->getCard()->getType() );\n\t\t$testCase->assertEquals( self::CARD_HOLDER_NAME, $fromXmlRequest->getCard()->getCardHolderName() );\n\t\t$testCase->assertEquals( self::CARD_EXPIRY_DATE, $fromXmlRequest->getCard()->getExpiryDate() );\n\n\t\t$testCase->assertEquals( self::ACCOUNT, $fromXmlRequest->getAccount() );\n\t\t$testCase->assertEquals( self::MERCHANT_ID, $fromXmlRequest->getMerchantId() );\n\t\t$testCase->assertEquals( ThreeDSecureType::VERIFY_SIG, $fromXmlRequest->getType() );\n\t\t$testCase->assertEquals( self::AMOUNT, $fromXmlRequest->getAmount()->getAmount() );\n\t\t$testCase->assertEquals( self::CURRENCY, $fromXmlRequest->getAmount()->getCurrency() );\n\t\t$testCase->assertEquals( self::TIMESTAMP, $fromXmlRequest->getTimeStamp() );\n\t\t$testCase->assertEquals( self::ORDER_ID, $fromXmlRequest->getOrderId() );\n\n\t\t$testCase->assertEquals( self::THREE_D_SECURE_PARES, $fromXmlRequest->getPares() );\n\t\t$testCase->assertEquals( self::THREE_D_SECURE_VERIFY_SIG_REQUEST_HASH, $fromXmlRequest->getHash() );\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n // 接收参数\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\n // 把参数 压如数组\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\n // use SORT_STRING rule\n // 字典序排序\n\t\tsort($tmpArr, SORT_STRING);\n\n // 切割数组\n\t\t$tmpStr = implode( $tmpArr );\n // 哈希加密\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n // 判断 加密后参数 对比 传递来的加密签名\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function verifyMessageSignature(string $message, string $signature, string $publicKey): bool\n {\n try {\n $publicKey = sodium_hex2bin($publicKey);\n $signature = sodium_hex2bin($signature);\n if (strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES . ' long.');\n }\n\n if (strlen($message) === 0) {\n throw new InvalidArgumentException('The message must not be empty.');\n }\n\n if (strlen($signature) !== SODIUM_CRYPTO_SIGN_BYTES) {\n throw new InvalidArgumentException('The signature must be ' . SODIUM_CRYPTO_SIGN_BYTES . ' long.');\n }\n\n return sodium_crypto_sign_verify_detached($signature, $message, $publicKey);\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not verify data', 0, $e);\n }\n }", "public function verify(string $message, string $signature): string\n {\n return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $this->key);\n }", "protected function validateTokenSignature(): void\n {\n if ($this->header['alg'] !== 'RS256') {\n throw new OidcInvalidTokenException(\"Only RS256 signature validation is supported. Token reports using {$this->header['alg']}\");\n }\n\n $parsedKeys = array_map(function ($key) {\n try {\n return new OidcJwtSigningKey($key);\n } catch (OidcInvalidKeyException $e) {\n throw new OidcInvalidTokenException('Failed to read signing key with error: ' . $e->getMessage());\n }\n }, $this->keys);\n\n $parsedKeys = array_filter($parsedKeys);\n\n $contentToSign = $this->tokenParts[0] . '.' . $this->tokenParts[1];\n /** @var OidcJwtSigningKey $parsedKey */\n foreach ($parsedKeys as $parsedKey) {\n if ($parsedKey->verify($contentToSign, $this->signature)) {\n return;\n }\n }\n\n throw new OidcInvalidTokenException('Token signature could not be validated using the provided keys');\n }", "function checkSignature($encodingAesKey,$token,$corpId)\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"msg_signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $echoStr = $_GET[\"echostr\"]; \n $token = TOKEN;\n $wxcpt = new WXBizMsgCrypt($token, $encodingAesKey, $corpId);\n $errCode = $wxcpt->VerifyURL($signature, $timestamp, $nonce, $echoStr, $sEchoStr);\n if ($errCode == 0) {\n //\n // 验证URL成功,将sEchoStr返回\n //HttpUtils.SetResponce($sEchoStr);\n echo $sEchoStr;\n return true;\n } else {\n print(\"ERR: \" . $errCode . \"\\n\\n\");\n return false;\n }\n }", "abstract public function doVerify(string $expected, string $payload, Key $key): bool;", "public function verifyRequest()\n\t{\n\t\t$this->verifyApplicationId();\n\t\t$this->verifyTimestamp();\n\t\t$this->verifySignatureCertificateUrl($this->getSignatureCertificateUrl());\n\n\t\t$certificate = $this->persistence->getCertificateForKey($this->certificate_url);\n\n\t\tif (! $certificate) {\n\t\t\t$certificate = new Certificate($this->certificate_url);\n\t\t}\n\n\t\t$this->verifyCertificate($certificate);\n\t}", "public function verifySignature($data, $signature)\n {\n $resultStatus = openssl_verify($data, $signature, $this->opensslResource, $this->digest);\n if (-1 === $resultStatus) {\n throw new SignatureErrorException($this->type, $this->getOpenSslErrorString());\n } elseif (0 === $resultStatus) {\n throw new InvalidSignatureException($this->type, $this->getOpenSslErrorString());\n }\n\n return true;\n }", "public function verifyXml(string $xmlContent): bool\n {\n if (!$this->publicKeyId) {\n throw new XmlSignatureValidatorException('No public key provided');\n }\n\n // Read the xml file content\n $xml = new DOMDocument();\n $xml->preserveWhiteSpace = true;\n $xml->formatOutput = false;\n $isValid = $xml->loadXML($xmlContent);\n\n if (!$isValid || !$xml->documentElement) {\n throw new XmlSignatureValidatorException('Invalid XML content');\n }\n\n $digestAlgorithm = $this->getDigestAlgorithm($xml);\n $signatureValue = $this->getSignatureValue($xml);\n $xpath = new DOMXPath($xml);\n $xpath->registerNamespace('xmlns', 'http://www.w3.org/2000/09/xmldsig#');\n\n /** @var DOMElement $signedInfoNode */\n foreach ($xpath->evaluate('//xmlns:Signature/xmlns:SignedInfo') as $signedInfoNode) {\n // Remove SignatureValue value\n $signatureValueElement = $this->xmlReader->queryDomNode($xpath, '//xmlns:SignatureValue', $signedInfoNode);\n $signatureValueElement->nodeValue = '';\n\n $canonicalData = $signedInfoNode->C14N(true, false);\n\n $xml2 = new DOMDocument();\n $xml2->preserveWhiteSpace = true;\n $xml2->formatOutput = true;\n $xml2->loadXML($canonicalData);\n $canonicalData = $xml2->C14N(true, false);\n\n $status = openssl_verify($canonicalData, $signatureValue, $this->publicKeyId, $digestAlgorithm);\n\n if ($status !== 1) {\n // The XML signature is not valid\n return false;\n }\n }\n\n return $this->checkDigest($xml, $xpath, $digestAlgorithm);\n }", "public function validate_webhook( $payload ) {\n\t\tself::log( 'Checking Webhook response is valid' );\n\n\t\tif ( ! isset( $_SERVER['HTTP_X_CC_WEBHOOK_SIGNATURE'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$sig = $_SERVER['HTTP_X_CC_WEBHOOK_SIGNATURE'];\n\n\t\t$secret = $this->get_option( 'webhook_secret' );\n\n\t\t$sig2 = hash_hmac( 'sha256', $payload, $secret );\n\n\t\tif ( $sig === $sig2 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function check_signature($request, $consumer, $token, $signature) {\n $built = $this->build_signature($request, $consumer, $token);\n return $built == $signature;\n }", "public static function validate_request($signed_request){\n list($encoded_sig, $encoded_data) = explode('.', $signed_request);\n\n $decoded_data = base64_decode(strtr($encoded_data, '-_', '+/'));\n\n $correct_decoded_sig = hash_hmac(\n 'sha256',\n $encoded_data,\n Configure::read('Opauth.Strategy.Truenth.client_secret'),\n true\n );\n $correct_encoded_sig = strtr(base64_encode($correct_decoded_sig), '+/', '-_');\n\n if ($correct_encoded_sig !== $encoded_sig){\n CakeLog::write(LOG_ERROR, 'Request signature invalid');\n return false;\n }\n return json_decode($decoded_data, true);\n }", "public function verifyPayload($payload, $signature, $secret, $tolerance = null)\n {\n $timestamp = $this->getTimestamp($signature);\n $value = $this->getValue($signature);\n\n $payload = is_string($payload) ? $payload : json_encode($payload);\n $timedPayload = \"$timestamp.$payload\";\n $expectedValue = $this->computeSignature($timedPayload, $secret);\n\n if ($this->util->secureCompare($expectedValue, $value) === false) {\n throw new SignatureVerificationException(\n \"Value mismatch the expected signature for payload\"\n );\n }\n\n // Check if timestamp is within tolerance\n if (($tolerance > 0) && ((time() - $timestamp) > $tolerance)) {\n throw new SignatureVerificationException(\n \"Timestamp outside the tolerance zone\"\n );\n }\n\n return true;\n }", "public function testValidSignature()\n {\n $authId = key($this->keys);\n $authSecret = reset($this->keys);\n $timestamp = 1432075982;\n\n $headers = [\n 'Content-Type' => 'text/plain',\n 'X-Authorization-Timestamp' => $timestamp,\n 'Authorization' => 'acquia-http-hmac realm=\"Pipet service\",'\n . 'id=\"' . $authId . '\",'\n . 'nonce=\"d1954337-5319-4821-8427-115542e08d10\",'\n . 'version=\"2.0\",'\n . 'headers=\"\",'\n . 'signature=\"MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc=\"',\n ];\n $request = new Request(\n 'GET',\n 'https://example.acquiapipet.net/v1.0/task-status/133?limit=10',\n $headers\n );\n\n $authenticator = new MockRequestAuthenticator(\n new MockKeyLoader($this->keys),\n null,\n $timestamp\n );\n\n $key = $authenticator->authenticate($request);\n\n $this->assertInstanceOf(KeyInterface::class, $key);\n $this->assertEquals($authId, $key->getId());\n $this->assertEquals($authSecret, $key->getSecret());\n }", "public function validateParams($params)\n {\n $notificationSignature = null;\n\n if (isset($params['notificationSignature'])) {\n $notificationSignature = $params['notificationSignature'];\n unset($params['notificationSignature']);\n }\n\n $queryParams = http_build_query($params, '', '&');\n\n $computed = md5($queryParams . $this->getAuthorizationKey());\n\n if ($computed !== $notificationSignature) {\n Mage::throwException('Validate params: Signature and build hash do not match!');\n }\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $logfile = fopen(\"./log/token_log\", \"a\");\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function validateUrlSignature()\n {\n /**\n * @var $validator Validator\n */\n $validator = app()->make('validator')->make($this->request->input(), [\n 'id' => 'required',\n 'expires' => 'required',\n 'hash' => 'required',\n 'signature' => 'required',\n ]);\n\n if($validator->passes()) {\n if(!$this->request->hasCorrectSignature($this->request, false)) {\n $this->apiResponse->setError(\"URL Signature is invalid.\");\n }\n\n if(!$this->request->signatureHasNotExpired($this->request)) {\n $this->apiResponse->setError(\"URL has expired.\");\n }\n\n /**\n * @var User|MustVerifyEmail $user\n */\n $user = User::find($this->request->input('id', null));\n\n if(!$user instanceof User) {\n $this->apiResponse->setError(\"No user found.\");\n } else {\n if (! hash_equals((string) $this->request->input('id'), (string) $user->getKey())) {\n throw new AuthorizationException;\n }\n\n if (! hash_equals((string) $this->request->input('hash'), sha1($user->getEmailForVerification()))) {\n throw new AuthorizationException;\n }\n\n $this->apiResponse->setSuccess(['email' => $user->getEmailForVerification()]);\n }\n } else {\n $this->apiResponse->handleErrors($validator);\n }\n\n return $this->apiResponse->returnResponse();\n }", "protected function verifySignature($key, string $dataToSign): bool\n {\n if (empty($this->signature)) {\n throw new InvalidSignatureException('Invalid signature.');\n }\n\n $method = 'verifyWith' . $this->algorithm;\n\n if (!method_exists($this, $method)) {\n throw new DomainException('Unsupported hashing algorithm.');\n }\n\n $verified = call_user_func_array(\n [$this, $method],\n [$key, $dataToSign, $this->signature]\n );\n\n if (!is_bool($verified)) {\n throw new RuntimeException(sprintf(\n 'Invalid return value given from \"%s\".',\n $method\n ));\n }\n\n return $verified;\n }", "private function checkSignature($signature,$timestamp,$nonce)\n {\n $token = Yii::$app->params['wechat']['token'];\n if (!$token) {\n echo 'TOKEN is not defined!';\n } else {\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }\n }", "function verify () {\n// $aop->alipayrsaPublicKey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjUzhXrdJ7GDsgJ59fMLlk7hyYrXkkeGwnYD/eO2HBZh39Y9gTfLJ61Yogc7keOn2uAnZY/zBlw3n+T6mb6/5JYFgvXQi8Qzeh6BkBrNnROu+k4PjhmSbORJFoLrrIxDnsYkQ995kYYhpbS0yf2Al++55v4SrD3/YoVBhWPcRg4xI0QD94FLwhCmcCkft/ILRtUxQk2QeVPLSesvMx2mmUK2L2x2hFA8ewRoGmUdG2Fu9YFIxk//16RI+H7KI8LaoXoVDqHobPae9p0ACE7k9G5vs/cYuikSMKu+lnxghte1jNO+CqrvTP4Pes/mW4e7CEMCTAmEnsXLUrQ6FpfKMcQIDAQAB';\n return $this->aop->rsaCheckV1($_POST, NULL, \"RSA2\");\n }", "function simpleid_verify_signatures($request) {\n global $version;\n \n log_info('simpleid_verify_signatures');\n \n $is_valid = TRUE;\n \n $assoc = (isset($request['openid.assoc_handle'])) ? cache_get('association', $request['openid.assoc_handle']) : NULL;\n $stateless = (isset($request['openid.response_nonce'])) ? cache_get('stateless', $request['openid.response_nonce']) : NULL;\n \n if (!$assoc) {\n log_notice('simpleid_verify_signatures: Association not found.');\n $is_valid = FALSE;\n } elseif (!$assoc['assoc_type']) {\n log_error('simpleid_verify_signatures: Association does not contain valid assoc_type.');\n $is_valid = FALSE;\n } elseif (!isset($assoc['private']) || ($assoc['private'] != 1)) {\n log_warn('simpleid_verify_signatures: Attempting to verify an association with a shared key.');\n $is_valid = FALSE;\n } elseif (!$stateless || ($stateless['assoc_handle'] != $request['openid.assoc_handle'])) {\n log_warn('simpleid_verify_signatures: Attempting to verify a response_nonce more than once, or private association expired.');\n $is_valid = FALSE;\n } else {\n $mac_key = $assoc['mac_key'];\n $assoc_types = openid_association_types();\n $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];\n \n $signed_keys = explode(',', $request['openid.signed']);\n $signature = openid_sign($request, $signed_keys, $mac_key, $hmac_func, $version);\n log_debug('***** Signature: ' . $signature);\n \n if ($signature != $request['openid.sig']) {\n log_warn('simpleid_verify_signatures: Signature supplied in request does not match the signatured generated.');\n $is_valid = FALSE;\n }\n \n cache_delete('stateless', $request['openid.response_nonce']);\n }\n \n return $is_valid;\n}", "private function checkSignature($signature,$timestamp,$nonce)\n {\n $token = Yii::$app->params['wechat']['token'];\n if (!$token) {\n echo 'TOKEN is not defined!';\n } else {\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }\n }", "public function testPayload($token, $signatureIndex, $valid)\n {\n if (!$valid) {\n $this->expectException(Assert\\InvalidArgumentException::class);\n }\n\n self::$validator->validate($token, $signatureIndex);\n\n $this->assertTrue(true, 'https://github.com/sebastianbergmann/phpunit-documentation/issues/171');\n }", "public function verify(array $message, $sig)\n {\n return $this->verifier->verify($message, $sig);\n }", "function verify_webhook($data, $hmac_header)\n{\n $calculated_hmac = base64_encode(hash_hmac('sha256', $data, SHOPIFY_APP_SECRET, true));\n return hash_equals($hmac_header, $calculated_hmac);\n}", "public function validateSignature(array $request)\n {\n $this->assertRequestParamIsNotNull(\n $request, 'hmac', 'Expected signature in query params'\n );\n\n $hmac = $request['hmac'];\n\n return $this->generateSignature($request, '&') === $hmac;\n }", "private function signatureIsValid(Request $request)\n {\n $url = $request->path();\n\n // Recreate the original signature to compare it and check that it is valid\n $urlSignature = hash_hmac('sha256', $url, Crypt::getEncryptionKey());\n\n $originalSignature = $request->query('sig', '');\n\n return hash_equals($urlSignature, (string) $originalSignature);\n }", "function verify_request ($body) {\n\tglobal $config;\n\treturn strpos($_SERVER['HTTP_USER_AGENT'], 'GitHub-Hookshot') !== false &&\n\t\thash_equals($_SERVER['HTTP_X_HUB_SIGNATURE'], 'sha1=' . hash_hmac('sha1', $body, $config->token));\n}", "public function isSignatureValid(string $response, string $signature, string $publicKey) : bool\n {\n if (\\strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {\n throw new InvalidArgumentException(sprintf(\"Public key should be %d bytes.\", SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES));\n }\n\n if (\\strlen($signature) !== 64) {\n throw new InvalidArgumentException(sprintf(\"Signature %d bytes.\", 64));\n }\n\n try {\n return \\sodium_crypto_sign_verify_detached(\n $signature,\n $response,\n $publicKey\n );\n } catch (SodiumException $e) {\n throw new InvalidArgumentException($e->getMessage());\n }\n }", "public static function isSignature( $string )\n {\n return $string == pack( \"V\", self::magic );\n }", "function verify($filePath, $publicKeys = array(), $fileSign = null){\n $payload = \"\";\n if($fileSign!=null){\n if(file_exists($fileSign))\n $payload = file_get_contents($fileSign);\n else{\n // if not file then it is a payload\n $payload = $fileSign;\n }\n }else{\n $payload = file_get_contents($filePath.'.jwt.sign');\n }\n if($publicKeys==null)\n $publicKeys = array();\n\n $result = array();\n $signs = explode(\"\\n\",str_replace(\"\\r\",'',$payload));\n\n foreach($signs as $temp){\n //sign array 0 is email 1 is jwt\n $sign = explode(\" \",$temp);\n //if it email then process\n if (filter_var($sign[0], FILTER_VALIDATE_EMAIL)) {\n //get public key from payload if publicKeys not provided\n if(!isset($publicKeys[$sign[0]])){\n $tmp = explode(\".\",$sign[1]);\n $data = json_decode(base64_decode($tmp[1]),true);\n $publicKey = $data['key'];\n }else{\n $publicKey = $publicKeys[$sign[0]];\n }\n try{\n $res = (array) JWT::decode($sign[1], $publicKey, array('RS256'));\n foreach($res as $k => $v){\n $result[$sign[0]][$k] = $v;\n }\n $path = ($filePath!=null && file_exists($filePath))? $filePath : $res['file'];\n if(!file_exists($path)){\n $result[$sign[0]]['verified'] = false;\n $result[$sign[0]]['error'] = 'File not found';\n }else{\n $result[$sign[0]]['sha256_verified'] = ($res['sha256']==hash_file(\"sha256\",$path));\n $result[$sign[0]]['sha1_verified'] = ($res['sha1']==sha1_file($path));\n $result[$sign[0]]['md5_verified'] = ($res['md5']==md5_file($path));\n if($result[$sign[0]]['sha256_verified'] && $result[$sign[0]]['sha1_verified'] && \n $result[$sign[0]]['md5_verified']){\n $result[$sign[0]]['verified'] = true;\n }else{\n $result[$sign[0]]['verified'] = false;\n }\n }\n }catch(\\Exception $e){\n $result[$sign[0]]['verified'] = false;\n $result[$sign[0]]['error'] = 'Signature invalid, '.$e->getMessage();\n }\n }\n }\n return $result;\n }", "public function verifySignature(string $name, array $arguments = []) : bool {\n return in_array($name, ['toJson', 'toJson']) && count($arguments) === 0;\n }", "public function testSuccess()\n {\n $signatures = SmartwaiverTypes::createSignatures();\n $swSignatures = new SmartwaiverSignatures($signatures);\n\n $this->assertEquals($signatures['waiverId'], $swSignatures->waiverId);\n $this->assertEquals($signatures['templateId'], $swSignatures->templateId);\n $this->assertEquals($signatures['title'], $swSignatures->title);\n $this->assertEquals($signatures['createdOn'], $swSignatures->createdOn);\n\n $this->assertCount(count($signatures['signatures']['participants']), $swSignatures->participantSignatures);\n foreach($swSignatures->participantSignatures as $participantSignature) {\n $this->assertEquals('BASE64ENCODED', $participantSignature);\n }\n\n $this->assertCount(count($signatures['signatures']['guardian']), $swSignatures->guardianSignatures);\n foreach($swSignatures->guardianSignatures as $guardianSignature) {\n $this->assertEquals('BASE64ENCODED', $guardianSignature);\n }\n\n $this->assertCount(count($signatures['signatures']['bodySignatures']), $swSignatures->bodySignatures);\n foreach($swSignatures->bodySignatures as $bodySignature) {\n $this->assertEquals('BASE64ENCODED', $bodySignature);\n }\n\n $this->assertCount(count($signatures['signatures']['bodyInitials']), $swSignatures->bodyInitials);\n foreach($swSignatures->bodyInitials as $bodyInitial) {\n $this->assertEquals('BASE64ENCODED', $bodyInitial);\n }\n }", "function verifymessage($address, $signature, $message) {\n // curve definition\n // http://www.secg.org/download/aid-784/sec2-v2.pdf\n $secp256k1 = new CurveFp(\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F', '0', '7');\n $secp256k1_G = new Point($secp256k1,\n '0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798',\n '0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8',\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141');\n\n\t// extract parameters\n\t$address = base58check_decode($address);\n\tif (strlen($address) != 21 || $address[0] != \"\\x0\") {\n\t\tthrow new Exception('invalid Bitcoin address');\n\t}\n\n\t$signature = base64_decode($signature, true);\n\tif ($signature === false) {\n\t\tthrow new Exception('invalid base64 signature');\n\t}\n\n\tif (strlen($signature) != 65) {\n\t\tthrow new Exception('invalid signature length');\n\t}\n\n\t$recoveryFlags = ord($signature[0]) - 27;\n\tif ($recoveryFlags < 0 || $recoveryFlags > 7) {\n\t\tthrow new Exception('invalid signature type');\n\t}\n\t$isCompressed = ($recoveryFlags & 4) != 0;\n\n\t// hash message, recover key\n\t$messageHash = hash('sha256', hash('sha256', \"\\x18Bitcoin Signed Message:\\n\" . numToVarIntString(strlen($message)).$message, true), true);\n\t$pubkey = recoverPubKey(bin2gmp(substr($signature, 1, 32)), bin2gmp(substr($signature, 33, 32)), bin2gmp($messageHash), $recoveryFlags, $secp256k1_G);\n\tif ($pubkey === false) {\n\t\tthrow new Exception('unable to recover key');\n\t}\n\t$point = $pubkey->getPoint();\n\n\t// see that the key we recovered is for the address given\n\tif (!$isCompressed) {\n\t\t$pubBinStr = \"\\x04\" . str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT) .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getY()), 32, \"\\x00\", STR_PAD_LEFT);\n\t} else {\n\t\t$pubBinStr =\t(isBignumEven($point->getY()) ? \"\\x02\" : \"\\x03\") .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT);\n\t}\n\t$derivedAddress = \"\\x00\". hash('ripemd160', hash('sha256', $pubBinStr, true), true);\n\n\treturn $address === $derivedAddress;\n}", "protected function checkVerification()\n {\n $verificationString = $this->getRequest()->getHeader('X-GCS-Webhooks-Endpoint-Verification');\n if ($verificationString) {\n $this->getResponse()->setHeader('Content-Type', 'text/plain');\n $this->getResponse()->setBody(\n $verificationString\n );\n\n return true;\n }\n\n return false;\n }", "private function checkSignature($token)\r\n {\r\n /*if (!defined(\"TOKEN\")) {\r\n throw new Exception('TOKEN is not defined!');\r\n }*/\r\n\r\n $signature = $_GET[\"signature\"];\r\n $timestamp = $_GET[\"timestamp\"];\r\n $nonce = $_GET[\"nonce\"];\r\n\r\n //$token = TOKEN;\r\n $tmpArr = array($token, $timestamp, $nonce);\r\n // use SORT_STRING rule\r\n sort($tmpArr, SORT_STRING);\r\n $tmpStr = implode( $tmpArr );\r\n $tmpStr = sha1( $tmpStr );\r\n\r\n if( $tmpStr == $signature ){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function verify_signature($file) {\n $dds = new WebService_DigiDocService_DigiDocService();\n $file[\"content\"] = File::readLocalFile($file[\"tmp_name\"]);\n unlink($file[\"tmp_name\"]);\n\n if ($file[\"format\"] === \"bdoc\") {\n $ret = $dds->StartSession(\"\", base64_encode($file[\"content\"]), FALSE, \"\");\n } else {\n $parser = new DigiDoc_Parser($file[\"content\"]);\n $ret = $dds->StartSession(\"\", $parser->getDigiDoc(TRUE), FALSE, \"\");\n }\n\n if (PEAR::isError($ret)) {\n return \"ERROR: \" . $ret->getMessage();\n }\n $sig_info = $ret[\"SignedDocInfo\"]->SignatureInfo;\n if (is_array($sig_info)) {\n return \"ERROR: The claim can have only one signature.\";\n }\n\n if ($sig_info->Status !== \"OK\") {\n $error = $sig_info->Error;\n return \"ERROR: The signature is invalid - $error->Description ($error->Code).\";\n }\n return \"OK\";\n}", "public function verifySignature(array $aData, $sVerificationSignature)\n\t{\n\t\treturn ($this->signRequest($aData) == $sVerificationSignature);\n\t}", "function verify_digital_signature($fname) {\n\n\tglobal $g;\n\n\treturn mwexec(\"/usr/bin/gzsig verify \" .\n\tescapeshellarg(\"{$g['etc_path']}/id_rsa.pub\") . \" \" .\n\tescapeshellarg($fname));\n}", "protected function assertPayload(): void\n {\n }", "protected function assertPayload(): void\n {\n }", "protected function assertPayload(): void\n {\n }", "private function validate () {\n $payload = $this->payload;\n // Unset fields that don't match the spec\n foreach (array_keys($payload) as $field) {\n if (!in_array($field, $this->fields)) {\n unset($payload[$field]);\n }\n }\n\n // If the user is signing up manually (I.e. not via a social network), then\n // we also need a password\n if ($this->method === 'manual' && empty($payload['password'])) {\n return false;\n }\n\n $this->payload = $payload;\n return true;\n }", "public function validateSignature(string $instance, string $apiKey, string $platform): bool\n {\n $payrexx = $this->getInterface($instance, $apiKey, $platform);\n try {\n $payrexx->getOne(new SignatureCheck());\n return true;\n } catch (\\Payrexx\\PayrexxException $e) {\n return false;\n }\n }", "public function isRequestSigned()\r\n\t{\r\n\t\t$headers = $this->getAllHeaders();\r\n\r\n\t\tif (!isset($headers[\"Authorization\"]))\r\n\t\t\treturn false;\r\n\r\n\t\tif (!isset($headers[\"Signature\"]))\r\n\t\t\treturn false;\r\n\r\n\t\tif (!($this->appId = $this->getApplicationId()))\r\n\t\t\treturn false;\r\n\r\n\t\t$this->secret = $this->appService->getApplicationSecret($this->appId);\r\n\r\n\t\tif (!$this->secret)\r\n\t\t\treturn false;\r\n\r\n\t\t$signature = $headers[\"Signature\"];\r\n\t\t$expected = $this->create();\r\n\r\n\t\treturn $this->compare($signature, $expected);\r\n\t}", "protected function verifyParams() {\n\t\t\treturn true;\n\t\t}", "function check_signature(){\n $nonce = $_GET['nonce'];\n $token = 'hello';\n $timestamp = $_GET['timestamp'];\n $signature = $_GET['signature'];\n $echostr = $_GET['echostr'];\n $arr = array($nonce,$token,$timestamp);\n sort($arr);\n $str = sha1(implode($arr));\n if($str == $signature && $echostr){\n echo $echostr;\n }else{\n response();\n }\n}", "public function verifyRequest()\n {\n }", "protected function verifyResponseSignature(array $responseData, $encoding)\n {\n $hash = $this->generateHash($responseData, $encoding);\n\n $keyId = openssl_pkey_get_public($this->publicKey);\n\n $result = openssl_verify($hash, base64_decode($responseData[$this->fieldsClass::SIGNATURE]), $keyId);\n\n openssl_free_key($keyId);\n\n return $result === 1;\n }", "function openssl_pkcs7_verify(\n string $input_filename,\n int $flags,\n ?string $signers_certificates_filename,\n array $ca_info = [],\n ?string $untrusted_certificates_filename,\n ?string $content,\n #[PhpStormStubsElementAvailable(\"7.2\")] ?string $output_filename\n): int|bool {}", "public function validateProxySignature(array $request)\n {\n $this->assertRequestParamIsNotNull(\n $request, 'signature', 'Expected signature in query params'\n );\n\n $hmac = $request['signature'];\n\n return $this->generateSignature($request, '') === $hmac;\n }", "public function validateRequest($expected_signature, $url, $data = array()) {\n ksort($data);\n \n // append them to the data string in order \n // with no delimiters\n foreach($data AS $key=>$value)\n $url .= \"$key$value\";\n\n // This function calculates the HMAC hash of the data with the key \n // passed in\n // Note: hash_hmac requires PHP 5 >= 5.1.2 or PECL hash:1.1-1.5\n // Or http://pear.php.net/package/Crypt_HMAC/\n $calculated_signature = base64_encode(hash_hmac(\"sha1\",$url, $this->ApiKey, true));\n \n return $calculated_signature == $expected_signature;\n \n }", "public function verify($data, $signature, $alias, $options=array())\n {\n $ok = 0;\n $binSig = '';\n if ($this->isCertificateEntry($alias)) {\n \n $processedOpts = $this->_processAsymmetricOptions($options);\n $entry = $this->getEntry($alias);\n switch ($entry->getEntryType()) {\n case Crypt_KeyStore_BaseEntry::PRIVATEKEY_TYPE:\n $cert = $entry->getCertificate()->getEncoded();\n break;\n case Crypt_KeyStore_BaseEntry::TRUSTEDCERT_TYPE:\n $cert = $entry->getTrustedCertificate()->getEncoded();\n break;\n default:\n throw new Crypt_KeyStore_Exception(\"Invalid entry \"\n . \"type for signature\");\n break;\n }\n \n try {\n $binSig = pack('H*', $signature);\n // compute signature\n $ok = openssl_verify(\n $data, \n $binSig, \n $cert, \n $processedOpts[self::OPT_DIGEST]\n );\n }\n catch (Exception $e) {\n throw new Crypt_KeyStore_Exception($e);\n }\n } else {\n throw new Crypt_KeyStore_Exception(\n \"Entry $alias is not a valid entry for signatures\");\n }\n \n if ($ok < 0) {\n throw new Crypt_KeyStore_Exception(\"Failed to verify signature\");\n }\n \n return ($ok == 1);\n }", "public function compare($data)\n {\n return $this->signature === $data ? true : false;\n }", "public function verifyWithSecret(string $signature, string $data, string $key, bool $keyIsHex = true): bool\n {\n try {\n $signature = sodium_hex2bin($signature);\n if ($keyIsHex) {\n $key = sodium_hex2bin($key);\n }\n if (strlen($key) !== SODIUM_CRYPTO_AUTH_KEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_AUTH_KEYBYTES . ' long.');\n }\n $result = sodium_crypto_auth_verify($signature, $data, $key);\n sodium_memzero($signature);\n sodium_memzero($key);\n return $result;\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not verify data', 0, $e);\n }\n }", "private function checkSignature($str='')\n {\n $signature = isset($_GET[\"signature\"])?$_GET[\"signature\"]:'';\n $signature = isset($_GET[\"msg_signature\"])?$_GET[\"msg_signature\"]:$signature; //如果存在加密验证则用加密验证段\n $timestamp = isset($_GET[\"timestamp\"])?$_GET[\"timestamp\"]:'';\n $nonce = isset($_GET[\"nonce\"])?$_GET[\"nonce\"]:'';\n\n $token = $this->token;\n $tmpArr = array($token, $timestamp, $nonce,$str);\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "public function validate($input = null, $timestamp = null, $signature = null, &$reason = null){\n\t\t$functionCall = true;\n\t\tif (!empty($_REQUEST['input']) && !empty($_REQUEST['timestamp']) && !empty($_REQUEST['signature'])){\n\t\t\t$functionCall = false;\n\t\t\t$provider = $_REQUEST['input'];\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\t\t$signature = $_REQUEST['signature'];\n\t\t}\n\t\t\n\t\t$timestamp_int = strtotime($timestamp);\n\t\tif ($timestamp_int < strtotime('-'.$this->env['security_timeout']) || $timestamp_int > time()){\n\t\t\t$reason = \"Auth response expired\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$hash = OpauthStrategy::hash($input, $timestamp, $this->env['security_iteration'], $this->env['security_salt']);\n\t\t\n\t\tif (strcasecmp($hash, $signature) !== 0){\n\t\t\t$reason = \"Signature does not validate\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private function verify($fileName = \"\", $fileContent = \"\"){\n if (empty($fileName) && empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be empty simultaneously.\");\n }\n if (!empty($fileName) && !empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be passed simultaneously.\");\n }\n if (!empty($fileName) && !file_exists($fileName)){\n throw new Exception(\"File with given filename does not exist.\");\n }\n if (! file_exists($this->tmpDir) || ! is_writable($this->tmpDir)){\n throw new Exception(\"Tmp dir does not exist or is not writable.\");\n }\n\n $randomId = uniqid();\n if (!empty($fileContent)){\n $fileName = sprintf(\"%s/%s.pdf\", $this->tmpDir, $randomId);\n file_put_contents($fileName, $fileContent);\n }\n\n $file = file_get_contents($fileName);\n\n $filters = $this->getFilters($file);\n if (empty($filters)){\n throw new Exception(\"Filter section in given file was not found.\");\n }\n\n $byteRange = $this->getByteRange($file);\n if (empty($byteRange)){\n throw new Exception(\"ByteRange section in given file was not found.\");\n }\n\n $binarySignature = $this->getBinarySignature($file);\n if (empty($binarySignature)){\n throw new Exception(\"Signature section in given file was not found.\");\n }\n\n $extFile = sprintf(\"%s/%s.ext.pdf\", $this->tmpDir, $randomId);\n if (! $this->removeSigatureFromPdf($fileName, $extFile, $byteRange)){\n throw new Exception(\"Extracting a signature from given file was not successfull.\");\n }\n\n $certPem = sprintf(\"%s/%s.pem\", $this->tmpDir, $randomId);\n $certPkcs7 = sprintf(\"%s/%s.pkcs7\", $this->tmpDir, $randomId);\n if (! $this->createPKCS7FromSignature($binarySignature, $certPem, $certPkcs7)){\n throw new Exception(\"Creating a certificate from signature was not successfull.\");\n }\n\n $certDer = sprintf(\"%s/%s.der\", $this->tmpDir, $randomId);\n if (! $this->convertPKCS7ToDER($certPkcs7, $certDer)){\n throw new Exception(\"Conversion of a certificate from PKCS7 to DER was not successfull.\");\n }\n\n $countCertsSignature = $this->convertPKCS7ToPEM($certPkcs7, $certPem);\n if ($countCertsSignature <= 0){\n throw new Exception(\"Conversion of a certificate from PKCS7 to PEM was not successfull.\");\n }\n\n// if($countCertsSignature>1) $countCertsSignature = 1; //onma, je problem s vice certifikaty, v PDF je vetsinou hned prvni soukromy klic\n for ($pocet=0; $pocet<$countCertsSignature; $pocet++ ) {\n $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $pocet));\n $cislo = $parsedCert['subject']['serial'];\n if ($cislo<>'') $pocet = 999999; //vyskocime\n }\n// $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $countCertsSignature - 1));\n\n\n $digest = sprintf(\"%s/%s.dig.bin\", $this->tmpDir, $randomId);\n $digests = $this->extractSignedDigest($certDer, $digest);\n if (empty($digests) || (empty($digests[\"rsaEncoded\"]) && empty($digests[\"messageDigest\"]) && empty($digests[\"PKCS7Data\"]))){\n throw new Exception(\"Extracting of a signed digest from certificate was not successfull.\");\n }\n\n $publicKey = sprintf(\"%s/%s.pubkey.pem\", $this->tmpDir, $randomId);\n\n $fileHashes = array(\n \"sha256\" => hash_file(\"sha256\", $extFile),\n \"sha1\" => hash_file(\"sha1\", $extFile),\n \"md5\" => hash_file(\"md5\", $extFile)\n );\n $signedHashes = array();\n\n if(!empty($digests[\"rsaEncoded\"])){\n if (! $this->createPublicKeyFromPEM($certPem, $publicKey)){\n throw new Exception(\"Creating of a public key from certificate was not successfull.\");\n }\n\n foreach($digests[\"rsaEncoded\"] as $dg){\n if(!empty($dg)){\n $decDigest = sprintf(\"%s.dec\", $dg);\n if (! $this->decryptBinaryDigest($dg, $decDigest, $publicKey)){\n throw new Exception(\"Decryption of a signed digest from certificate was not successfull.\");\n }\n if(file_exists($decDigest)){\n $signedHashes[] = strtolower(substr(bin2hex(file_get_contents($decDigest)), self::MAGIC));\n }\n }\n }\n }\n\n if(!empty($digests[\"messageDigest\"])){\n foreach($digests[\"messageDigest\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(!empty($digests[\"PKCS7Data\"])){\n foreach($digests[\"PKCS7Data\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(self::ENABLE_CLEANING){\n $this->rm($extFile);\n $this->rm($certPem);\n $this->rm($certPkcs7);\n $this->rm($certDer);\n $this->rm($publicKey);\n $this->rm($digest);\n if($countCertsSignature > 0){\n for($i = 0; $i < $countCertsSignature; $i++){\n $this->rm(sprintf(\"%s.%d\", $certPem, $i));\n }\n }\n if(!empty($digests[\"rsaEncoded\"])){\n foreach($digests[\"rsaEncoded\"] as $rsa){\n $this->rm(sprintf(\"%s\", $rsa));\n $this->rm(sprintf(\"%s.dec\", $rsa));\n }\n }\n if(!empty($fileContent)){\n $this->rm($fileName);\n }\n }\n\n foreach ($fileHashes as $algo => $hash) {\n if(in_array($hash, $signedHashes)){\n $r = array(\n \"result\" => true,\n \"alg\" => $algo,\n \"hash\" => $hash\n );\n return array_merge($r, $parsedCert);\n }\n }\n\n return array(\n \"result\" => false,\n \"fileHashes\" => $fileHashes,\n \"signedHashes\" => $signedHashes\n );\n }", "public function hasValidSignature(Request $request)\n {\n $original = rtrim($request->url().'?'.http_build_query(\n Arr::except($request->query(), 'signature')\n ), '?');\n\n $expires = Arr::get($request->query(), 'expires');\n\n $signature = hash_hmac('sha1', $original, call_user_func($this->keyResolver));\n\n return hash_equals($signature, $request->query('signature', '')) &&\n ! ($expires && Carbon::now()->getTimestamp() > $expires);\n }", "public function ChecksigVectors()\n {\n $ec = EcAdapterFactory::getAdapter(new Math(), EccFactory::getSecgCurves()->generator256k1());\n $privateKey = PrivateKeyFactory::fromHex('4141414141414141414141414141414141414141414141414141414141414141', false, $ec);\n\n $standard = ScriptFactory::defaultFlags();\n\n $vectors = [];\n\n // Pay to pubkey hash that succeeds\n $s0 = ScriptFactory::scriptPubKey()->payToPubKeyHash($privateKey->getPublicKey());\n $vectors[] = [\n true,\n $ec,\n $standard, // flags\n $privateKey, // privKey\n $s0,\n null, // redeemscript,\n ];\n\n // Pay to pubkey that succeeds\n $s1 = ScriptFactory::create()->push($privateKey->getPublicKey()->getBuffer())->op('OP_CHECKSIG')->getScript();\n $vectors[] = [\n true,\n $ec,\n $standard, // flags\n $privateKey, // privKey\n $s1,\n null, // redeemscript\n ];\n\n $rs = ScriptFactory::p2sh()->multisig(1, [$privateKey->getPublicKey()]);\n $vectors[] = [\n true,\n $ec,\n InterpreterInterface::VERIFY_P2SH |\n InterpreterInterface::VERIFY_WITNESS |\n InterpreterInterface::VERIFY_CLEAN_STACK\n ,\n $privateKey,\n $rs->getOutputScript(),\n $rs\n ];\n\n return $vectors;\n }", "protected function checkSignature(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request, $signature)\n {\n $secret = $this->getSharedSecret();\n\n if ($request->isSignatureValid($signature, $secret)) {\n return true;\n }\n\n throw new PriceWaiter_NYPWidget_Exception_Signature();\n }", "protected function isSignatureValid($body, $repo_id)\n {\n global $INPUT;\n if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {\n return false;\n }\n list($algo, $signature_github) = explode('=', $INPUT->server->str('HTTP_X_HUB_SIGNATURE'));\n /** @var \\helper_plugin_issuelinks_db $db */\n $db = plugin_load('helper', 'issuelinks_db');\n $secrets = $db->getWebhookSecrets('github', $repo_id);\n foreach ($secrets as $secret) {\n $signature_local = hash_hmac($algo, $body, $secret['secret']);\n if (hash_equals($signature_local, $signature_github)) {\n return true;\n }\n }\n return false;\n }", "function checkSign($echoStr){\r\n if(wmpBasic::checkSignature($this->cfg)){\r\n die($echoStr); \r\n }else{\r\n die('Error: checkSignature');\r\n }\r\n }", "public function verifyWebhook($source)\n {\n $hMac_header = $_SERVER['HTTP_X_SHOPIFY_HMAC_SHA256'];\n $data = file_get_contents('php://input');\n $calculated_hMac = base64_encode(hash_hmac('sha256', $data, $this->shopifySecret, true));\n $result = ($hMac_header == $calculated_hMac);\n if (!$result) {\n Log::error(\"ShopifyApi.verifyWebhook is FALSE for $source, hMac_header = $hMac_header,\n Input = $data\");\n }\n return $result;\n }", "abstract public function verifyRequest(): void;", "abstract public function verifyRequest(): void;", "public function validate($input = null, $timestamp = null, $signature = null, &$reason = null){\n\t\t$functionCall = true;\n\t\tif (!empty($_REQUEST['input']) && !empty($_REQUEST['timestamp']) && !empty($_REQUEST['signature'])){\n\t\t\t$functionCall = false;\n\t\t\t$provider = $_REQUEST['input'];\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\t\t$signature = $_REQUEST['signature'];\n\t\t}\n\t\t\n\t\t$timestamp_int = strtotime($timestamp);\n\t\tif ($timestamp_int < strtotime('-'.$this->env['Security.timeout']) || $timestamp_int > time()){\n\t\t\t$reason = \"Auth response expired\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\trequire $this->env['lib_dir'].'OpauthStrategy.php';\n\t\t$hash = OpauthStrategy::hash($input, $timestamp, $this->env['Security.iteration'], $this->env['Security.salt']);\n\t\t\n\t\tif (strcasecmp($hash, $signature) !== 0){\n\t\t\t$reason = \"Signature does not validate\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function validateWebhook(Request $request)\n {\n $calculatedHmac = base64_encode(hash_hmac('sha256', $request->getContent(), $this->shopifyApiSecret, true));\n return hash_equals($request->headers->get('X-Shopify-Hmac-SHA256'), $calculatedHmac);\n }", "public function validate(array $data) : bool\n {\n // If we dont have all the required parts for decryption exit.\n if (! isset( $data['iv'], $data['data'], $data['mac'])) {\n return false;\n }\n\n // If the extracted iv is invalid exit.\n $iv = base64_decode($data['iv']);\n\n if (strlen( $iv ) !== SODIUM_CRYPTO_SECRETBOX_NONCEBYTES) {\n return false;\n }\n\n return hash_equals($this->hash(base64_decode($data['data']), $iv), $data['mac']);\n }" ]
[ "0.71065193", "0.6450751", "0.64311403", "0.6263562", "0.62411827", "0.623923", "0.6151786", "0.6104499", "0.603157", "0.59497815", "0.5887901", "0.58471227", "0.5843933", "0.5828807", "0.5790779", "0.5761153", "0.57569635", "0.5732492", "0.57151186", "0.57135", "0.57085586", "0.5706755", "0.5705478", "0.57041645", "0.5697651", "0.56899494", "0.5663115", "0.56622547", "0.56622547", "0.56622547", "0.56526", "0.56447977", "0.56016654", "0.5598771", "0.55782807", "0.5565836", "0.5536019", "0.552143", "0.55206573", "0.5482462", "0.5476218", "0.5466742", "0.54619557", "0.5447715", "0.54422104", "0.5427174", "0.54195166", "0.54161596", "0.53916633", "0.537386", "0.53437215", "0.53391445", "0.5336344", "0.5326808", "0.5313737", "0.5292281", "0.5258104", "0.5231186", "0.5223421", "0.5209643", "0.5208348", "0.51841533", "0.51776516", "0.5174231", "0.5160893", "0.51466453", "0.5144292", "0.5136485", "0.5134465", "0.5125519", "0.5104295", "0.5104295", "0.5104295", "0.5100697", "0.509935", "0.5098848", "0.50978124", "0.5074194", "0.5057949", "0.5046128", "0.5043842", "0.5040706", "0.50307244", "0.50299627", "0.5014194", "0.50050753", "0.50025165", "0.50009584", "0.49944153", "0.49934128", "0.4981772", "0.49696985", "0.49684954", "0.49619615", "0.4941522", "0.49408633", "0.49408633", "0.49356508", "0.49283224", "0.4925295" ]
0.55418324
36
Verifies the protobuf payload signature.
public function verifyString($message, $signature) { try { $signature = Base64Url::decode($signature); $verified = \ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $this->publicKey); } catch (\Exception $e) { throw new CryptographicException("Cannot to verify signature."); } if (!$verified) { throw new CryptographicException("Failed to verify signature."); } return $verified; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function verify($data, $signature);", "protected function checkSignature()\n {\n $headers = \\Yii::$app->request->headers;\n\n $signature = $headers->get('paypal-transmission-sig');\n if (!$signature)\n throw new BadRequestHttpException;\n\n $checkString = sprintf('%s|%s|%s|%s',\n $headers->get('paypal-transmission-id'),\n $headers->get('paypal-transmission-time'),\n $this->webHookId,\n crc32(\\Yii::$app->request->rawBody)\n );\n\n $certUrl = $headers->get('paypal-cert-url');\n if (!$certUrl)\n throw new BadRequestHttpException;\n\n $publicKey = $this->fetchPublicKey($certUrl);\n if (!$publicKey)\n throw new \\Exception('Certificate error');\n\n// $algo = ArrayHelper::getValue($headers, 'paypal-hash-algo');\n\n $result = openssl_verify($checkString, base64_decode($signature), $publicKey);\n return $result === 1;\n }", "public function validate_signature($params) {\n\n $new_sig = Utils::generate_signature($params['data'], $params['secret']);\n\n if ($new_sig == $params['signature']) {\n return true;\n } else {\n return false;\n }\n\n }", "public function validateInboundMessage(){\n\t\t$hashData = $this->timestamp . \"\" . $this->token;\n\t\t$computedSignature = hash_hmac(\"sha256\",$hashData , $this->MGAPIKEY);\n\t\t$providedSignature = $this->signature;\n\t\tif ($computedSignature == $providedSignature){\n\t\t\tif($this->validateSender()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function verify_msg($data)\n\t{\n\t\t// we are using '-v' specifically to catch clear message\n\t\t// after signature verification is complete\n\t\t$body = $this->call(\"{$this->context} -v -d\", 'post', $data);\n\n\t\t$results = [\n\t\t\tfalse,\t// [0]\n\t\t\tnull,\t// [1]\n\t\t\tnull,\t// [2]\n\t\t\tnull,\t// [3]\n\t\t\t$body,\t// [4], always defined\n\t\t\t0,\t\t// [5]\n\t\t];\n\n\t\t// checking status codes of the verification operation\n\t\tif (false === $status = $this->get_status())\n\t\t{\n\t\t\t// something's wrong, aborting\n\t\t\t$results[0] = null;\n\t\t\treturn $results;\n\t\t}\n\t\telse foreach ($status as $code)\n\t\t{\n\t\t\tif ($code[0] == 'VALIDSIG')\n\t\t\t{\n\t\t\t\t// defining output elements for good sig\n\t\t\t\t$results[0] = true;\n\t\t\t\t$results[1] = $code[10];\n\t\t\t\t$results[2] = $code[3];\n\t\t\t}\n\t\t\telse if ($code[0] == 'BADSIG')\n\t\t\t{\n\t\t\t\t// in case of bad signature we return\n\t\t\t\t// long key_id, not a full FPR!\n\t\t\t\t$results[1] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERRSIG')\n\t\t\t{\n\t\t\t\t// signature verification error (no pubkey?).\n\t\t\t\t// only long key_id is returned!\n\t\t\t\t$results[0] = null;\n\t\t\t\t$results[1] = $code[1];\n\t\t\t\t$results[2] = $code[5];\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPKEYSIG')\n\t\t\t{\n\t\t\t\t// signature with expired key\n\t\t\t\t$results[5] = 1;\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPSIG')\n\t\t\t{\n\t\t\t\t// signature itself is expired\n\t\t\t\t$results[5] = 2;\n\t\t\t}\n\t\t\telse if ($code[0] == 'REVKEYSIG')\n\t\t\t{\n\t\t\t\t// signing key is revoked\n\t\t\t\t$results[5] = 3;\n\t\t\t}\n\t\t\telse if ($code[0] == 'SIG_ID')\n\t\t\t{\n\t\t\t\t// defining remaining output element: sigID\n\t\t\t\t// (if applicable)\n\t\t\t\t$results[3] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERROR' || $code[0] == 'NODATA')\n\t\t\t{\n\t\t\t\t// input error encountered, aborting\n\t\t\t\t$results[0] = null;\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "public function verifyRequest(): void\n {\n $this->verifySignature();\n\n if (!$this->request->hasParameters(['entry.0.messaging.0.sender.id', 'entry.0.messaging.0.message'])) {\n throw new InvalidRequest('Invalid payload');\n }\n }", "public static function verifySignature($signature, $msg, $key) : bool\n {\n $verified = sodium_crypto_sign_verify_detached(\n sodium_hex2bin($signature),\n sodium_hex2bin(self::hashObject($msg)),\n sodium_hex2bin($key)\n );\n\n return is_bool($verified) && $verified == true;\n }", "public function validate_webhook($params) {\n\n $sig = $params['signature'];\n unset($params['signature']);\n\n if (!isset($sig)) {\n return false;\n }\n\n $data = array(\n 'data' => $params,\n 'secret' => $this->account_details['app_secret'],\n 'signature' => $sig\n );\n\n return $this->validate_signature($data);\n\n }", "public function isSignatureRequired();", "public function VerifySignature($signature) {\n return $this->signature->check_signature($this->request, $this->consumer, $this->token, $signature);\n }", "private function checkSignature()\n {\n\n\n\n if (!defined(\"self::TOKEN\")) {\n throw new \\Exception('TOKEN is not defined!');\n }\n\n $signature = $this->getRequest()->get('signature');\n $timestamp = $this->getRequest()->get('timestamp');\n $nonce = $this->getRequest()->get('nonce');\n\n $token = self::TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n $logger = $this->get('logger');\n $logger->error($signature.'==='.$tmpStr);\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "function verifyMessage($certfile, $data, $signature) {\r\n\r\n // $data and $signature are assumed to contain the data and the signature\r\n $ok=0;\r\n // fetch public key from certificate and ready it\r\n $fp = fopen( \"security/\" . $certfile, \"r\");\r\n \r\n if(!$fp) {\r\n return false;\r\n }\r\n \r\n $cert = fread($fp, 8192);\r\n fclose($fp);\r\n $pubkeyid = openssl_get_publickey($cert);\r\n\r\n // state whether signature is okay or not\r\n $ok = openssl_verify($data, $signature, $pubkeyid);\r\n \r\n // free the key from memory\r\n openssl_free_key($pubkeyid);\r\n\r\n return $ok;\r\n\r\n }", "public static function verify($secret, $payload, $signature) {\n [$algorithm, $user_string] = explode('=', $signature);\n $known_string = hash_hmac($algorithm, $payload, $secret);\n if (!hash_equals($known_string, $user_string)) {\n throw new WebhookMismatchSignatureException($user_string, $algorithm . '=' . $known_string, $payload);\n }\n return TRUE;\n }", "protected function validHasSignature()\n {\n if (! $this->request->has('signature')) {\n throw new VanillaInvalidRequestException('Missing signature parameter.');\n }\n }", "public function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\t\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkSignature() {\n\t\tif (! defined ( \"TOKEN\" )) {\n\t\t\tthrow new Exception ( 'TOKEN is not defined!' );\n\t\t}\n\t\t\n\t\t$signature = $_GET [\"signature\"];\n\t\t$timestamp = $_GET [\"timestamp\"];\n\t\t$nonce = $_GET [\"nonce\"];\n\t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array (\n\t\t\t\t$token,\n\t\t\t\t$timestamp,\n\t\t\t\t$nonce \n\t\t);\n\t\t// use SORT_STRING rule\n\t\tsort ( $tmpArr, SORT_STRING );\n\t\t$tmpStr = implode ( $tmpArr );\n\t\t$tmpStr = sha1 ( $tmpStr );\n\t\t\n\t\tif ($tmpStr == $signature) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function verify();", "public function verify()\r\n\t{\r\n\t\treturn ($this->verifyHeaders() && $this->verifyDataFormat() && $this->verifySignature());\r\n\t}", "private function signedSealed ()\n {\n $signature = getenv('HTTP_X_DROPBOX_SIGNATURE');\n if ( $signature === null || empty( $signature ) ){\n return false;\n } else {\n $httpbody = file_get_contents('php://input');\n $hmac = hash_hmac( 'sha256', $httpbody, DBX_APP_SECRET );\n if ( dbx\\Security::stringEquals( $signature, $hmac ) ) {\n return true;\n } else {\n return false;\n }\n }\n }", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = $this->_token;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n {\n \tif (!defined(\"TOKEN\")) {\n \t\tthrow new Exception('TOKEN is not defined!');\n \t}\n\n \t$signature = $_GET[\"signature\"];\n \t$timestamp = $_GET[\"timestamp\"];\n \t$nonce = $_GET[\"nonce\"];\n\n \t$token = TOKEN;\n \t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n \tsort($tmpArr, SORT_STRING);\n \t$tmpStr = implode( $tmpArr );\n \t$tmpStr = sha1( $tmpStr );\n\n \tif( $tmpStr == $signature ){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }", "private function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "public static function verifySignature($reqBody, $reqSignature, $webhookSecretKey)\n\t{\n\t\treturn CryptoUtil::validMAC($reqBody, $reqSignature, $webhookSecretKey);\n\t}", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public static function checkUnmarshalledVerifySigRequest( ThreeDSecureRequest $fromXmlRequest, PHPUnit_Framework_TestCase $testCase ) {\n\n\t\t$testCase->assertNotNull( $fromXmlRequest );\n\t\t$testCase->assertEquals( self::CARD_NUMBER, $fromXmlRequest->getCard()->getNumber() );\n\t\t$testCase->assertEquals( self::$CARD_TYPE->getType(), $fromXmlRequest->getCard()->getType() );\n\t\t$testCase->assertEquals( self::CARD_HOLDER_NAME, $fromXmlRequest->getCard()->getCardHolderName() );\n\t\t$testCase->assertEquals( self::CARD_EXPIRY_DATE, $fromXmlRequest->getCard()->getExpiryDate() );\n\n\t\t$testCase->assertEquals( self::ACCOUNT, $fromXmlRequest->getAccount() );\n\t\t$testCase->assertEquals( self::MERCHANT_ID, $fromXmlRequest->getMerchantId() );\n\t\t$testCase->assertEquals( ThreeDSecureType::VERIFY_SIG, $fromXmlRequest->getType() );\n\t\t$testCase->assertEquals( self::AMOUNT, $fromXmlRequest->getAmount()->getAmount() );\n\t\t$testCase->assertEquals( self::CURRENCY, $fromXmlRequest->getAmount()->getCurrency() );\n\t\t$testCase->assertEquals( self::TIMESTAMP, $fromXmlRequest->getTimeStamp() );\n\t\t$testCase->assertEquals( self::ORDER_ID, $fromXmlRequest->getOrderId() );\n\n\t\t$testCase->assertEquals( self::THREE_D_SECURE_PARES, $fromXmlRequest->getPares() );\n\t\t$testCase->assertEquals( self::THREE_D_SECURE_VERIFY_SIG_REQUEST_HASH, $fromXmlRequest->getHash() );\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n // 接收参数\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\n // 把参数 压如数组\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\n // use SORT_STRING rule\n // 字典序排序\n\t\tsort($tmpArr, SORT_STRING);\n\n // 切割数组\n\t\t$tmpStr = implode( $tmpArr );\n // 哈希加密\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n // 判断 加密后参数 对比 传递来的加密签名\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function verifyMessageSignature(string $message, string $signature, string $publicKey): bool\n {\n try {\n $publicKey = sodium_hex2bin($publicKey);\n $signature = sodium_hex2bin($signature);\n if (strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES . ' long.');\n }\n\n if (strlen($message) === 0) {\n throw new InvalidArgumentException('The message must not be empty.');\n }\n\n if (strlen($signature) !== SODIUM_CRYPTO_SIGN_BYTES) {\n throw new InvalidArgumentException('The signature must be ' . SODIUM_CRYPTO_SIGN_BYTES . ' long.');\n }\n\n return sodium_crypto_sign_verify_detached($signature, $message, $publicKey);\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not verify data', 0, $e);\n }\n }", "public function verify(string $message, string $signature): string\n {\n return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $this->key);\n }", "protected function validateTokenSignature(): void\n {\n if ($this->header['alg'] !== 'RS256') {\n throw new OidcInvalidTokenException(\"Only RS256 signature validation is supported. Token reports using {$this->header['alg']}\");\n }\n\n $parsedKeys = array_map(function ($key) {\n try {\n return new OidcJwtSigningKey($key);\n } catch (OidcInvalidKeyException $e) {\n throw new OidcInvalidTokenException('Failed to read signing key with error: ' . $e->getMessage());\n }\n }, $this->keys);\n\n $parsedKeys = array_filter($parsedKeys);\n\n $contentToSign = $this->tokenParts[0] . '.' . $this->tokenParts[1];\n /** @var OidcJwtSigningKey $parsedKey */\n foreach ($parsedKeys as $parsedKey) {\n if ($parsedKey->verify($contentToSign, $this->signature)) {\n return;\n }\n }\n\n throw new OidcInvalidTokenException('Token signature could not be validated using the provided keys');\n }", "function checkSignature($encodingAesKey,$token,$corpId)\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"msg_signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $echoStr = $_GET[\"echostr\"]; \n $token = TOKEN;\n $wxcpt = new WXBizMsgCrypt($token, $encodingAesKey, $corpId);\n $errCode = $wxcpt->VerifyURL($signature, $timestamp, $nonce, $echoStr, $sEchoStr);\n if ($errCode == 0) {\n //\n // 验证URL成功,将sEchoStr返回\n //HttpUtils.SetResponce($sEchoStr);\n echo $sEchoStr;\n return true;\n } else {\n print(\"ERR: \" . $errCode . \"\\n\\n\");\n return false;\n }\n }", "public function verify($message, $signature)\n {\n $jsonMessage = Util::toJson($message);\n return $this->verifyString($jsonMessage, $signature);\n }", "abstract public function doVerify(string $expected, string $payload, Key $key): bool;", "public function verifySignature($data, $signature)\n {\n $resultStatus = openssl_verify($data, $signature, $this->opensslResource, $this->digest);\n if (-1 === $resultStatus) {\n throw new SignatureErrorException($this->type, $this->getOpenSslErrorString());\n } elseif (0 === $resultStatus) {\n throw new InvalidSignatureException($this->type, $this->getOpenSslErrorString());\n }\n\n return true;\n }", "public function verifyRequest()\n\t{\n\t\t$this->verifyApplicationId();\n\t\t$this->verifyTimestamp();\n\t\t$this->verifySignatureCertificateUrl($this->getSignatureCertificateUrl());\n\n\t\t$certificate = $this->persistence->getCertificateForKey($this->certificate_url);\n\n\t\tif (! $certificate) {\n\t\t\t$certificate = new Certificate($this->certificate_url);\n\t\t}\n\n\t\t$this->verifyCertificate($certificate);\n\t}", "public function verifyXml(string $xmlContent): bool\n {\n if (!$this->publicKeyId) {\n throw new XmlSignatureValidatorException('No public key provided');\n }\n\n // Read the xml file content\n $xml = new DOMDocument();\n $xml->preserveWhiteSpace = true;\n $xml->formatOutput = false;\n $isValid = $xml->loadXML($xmlContent);\n\n if (!$isValid || !$xml->documentElement) {\n throw new XmlSignatureValidatorException('Invalid XML content');\n }\n\n $digestAlgorithm = $this->getDigestAlgorithm($xml);\n $signatureValue = $this->getSignatureValue($xml);\n $xpath = new DOMXPath($xml);\n $xpath->registerNamespace('xmlns', 'http://www.w3.org/2000/09/xmldsig#');\n\n /** @var DOMElement $signedInfoNode */\n foreach ($xpath->evaluate('//xmlns:Signature/xmlns:SignedInfo') as $signedInfoNode) {\n // Remove SignatureValue value\n $signatureValueElement = $this->xmlReader->queryDomNode($xpath, '//xmlns:SignatureValue', $signedInfoNode);\n $signatureValueElement->nodeValue = '';\n\n $canonicalData = $signedInfoNode->C14N(true, false);\n\n $xml2 = new DOMDocument();\n $xml2->preserveWhiteSpace = true;\n $xml2->formatOutput = true;\n $xml2->loadXML($canonicalData);\n $canonicalData = $xml2->C14N(true, false);\n\n $status = openssl_verify($canonicalData, $signatureValue, $this->publicKeyId, $digestAlgorithm);\n\n if ($status !== 1) {\n // The XML signature is not valid\n return false;\n }\n }\n\n return $this->checkDigest($xml, $xpath, $digestAlgorithm);\n }", "public function validate_webhook( $payload ) {\n\t\tself::log( 'Checking Webhook response is valid' );\n\n\t\tif ( ! isset( $_SERVER['HTTP_X_CC_WEBHOOK_SIGNATURE'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$sig = $_SERVER['HTTP_X_CC_WEBHOOK_SIGNATURE'];\n\n\t\t$secret = $this->get_option( 'webhook_secret' );\n\n\t\t$sig2 = hash_hmac( 'sha256', $payload, $secret );\n\n\t\tif ( $sig === $sig2 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function check_signature($request, $consumer, $token, $signature) {\n $built = $this->build_signature($request, $consumer, $token);\n return $built == $signature;\n }", "public static function validate_request($signed_request){\n list($encoded_sig, $encoded_data) = explode('.', $signed_request);\n\n $decoded_data = base64_decode(strtr($encoded_data, '-_', '+/'));\n\n $correct_decoded_sig = hash_hmac(\n 'sha256',\n $encoded_data,\n Configure::read('Opauth.Strategy.Truenth.client_secret'),\n true\n );\n $correct_encoded_sig = strtr(base64_encode($correct_decoded_sig), '+/', '-_');\n\n if ($correct_encoded_sig !== $encoded_sig){\n CakeLog::write(LOG_ERROR, 'Request signature invalid');\n return false;\n }\n return json_decode($decoded_data, true);\n }", "public function verifyPayload($payload, $signature, $secret, $tolerance = null)\n {\n $timestamp = $this->getTimestamp($signature);\n $value = $this->getValue($signature);\n\n $payload = is_string($payload) ? $payload : json_encode($payload);\n $timedPayload = \"$timestamp.$payload\";\n $expectedValue = $this->computeSignature($timedPayload, $secret);\n\n if ($this->util->secureCompare($expectedValue, $value) === false) {\n throw new SignatureVerificationException(\n \"Value mismatch the expected signature for payload\"\n );\n }\n\n // Check if timestamp is within tolerance\n if (($tolerance > 0) && ((time() - $timestamp) > $tolerance)) {\n throw new SignatureVerificationException(\n \"Timestamp outside the tolerance zone\"\n );\n }\n\n return true;\n }", "public function testValidSignature()\n {\n $authId = key($this->keys);\n $authSecret = reset($this->keys);\n $timestamp = 1432075982;\n\n $headers = [\n 'Content-Type' => 'text/plain',\n 'X-Authorization-Timestamp' => $timestamp,\n 'Authorization' => 'acquia-http-hmac realm=\"Pipet service\",'\n . 'id=\"' . $authId . '\",'\n . 'nonce=\"d1954337-5319-4821-8427-115542e08d10\",'\n . 'version=\"2.0\",'\n . 'headers=\"\",'\n . 'signature=\"MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc=\"',\n ];\n $request = new Request(\n 'GET',\n 'https://example.acquiapipet.net/v1.0/task-status/133?limit=10',\n $headers\n );\n\n $authenticator = new MockRequestAuthenticator(\n new MockKeyLoader($this->keys),\n null,\n $timestamp\n );\n\n $key = $authenticator->authenticate($request);\n\n $this->assertInstanceOf(KeyInterface::class, $key);\n $this->assertEquals($authId, $key->getId());\n $this->assertEquals($authSecret, $key->getSecret());\n }", "public function validateParams($params)\n {\n $notificationSignature = null;\n\n if (isset($params['notificationSignature'])) {\n $notificationSignature = $params['notificationSignature'];\n unset($params['notificationSignature']);\n }\n\n $queryParams = http_build_query($params, '', '&');\n\n $computed = md5($queryParams . $this->getAuthorizationKey());\n\n if ($computed !== $notificationSignature) {\n Mage::throwException('Validate params: Signature and build hash do not match!');\n }\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $logfile = fopen(\"./log/token_log\", \"a\");\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function validateUrlSignature()\n {\n /**\n * @var $validator Validator\n */\n $validator = app()->make('validator')->make($this->request->input(), [\n 'id' => 'required',\n 'expires' => 'required',\n 'hash' => 'required',\n 'signature' => 'required',\n ]);\n\n if($validator->passes()) {\n if(!$this->request->hasCorrectSignature($this->request, false)) {\n $this->apiResponse->setError(\"URL Signature is invalid.\");\n }\n\n if(!$this->request->signatureHasNotExpired($this->request)) {\n $this->apiResponse->setError(\"URL has expired.\");\n }\n\n /**\n * @var User|MustVerifyEmail $user\n */\n $user = User::find($this->request->input('id', null));\n\n if(!$user instanceof User) {\n $this->apiResponse->setError(\"No user found.\");\n } else {\n if (! hash_equals((string) $this->request->input('id'), (string) $user->getKey())) {\n throw new AuthorizationException;\n }\n\n if (! hash_equals((string) $this->request->input('hash'), sha1($user->getEmailForVerification()))) {\n throw new AuthorizationException;\n }\n\n $this->apiResponse->setSuccess(['email' => $user->getEmailForVerification()]);\n }\n } else {\n $this->apiResponse->handleErrors($validator);\n }\n\n return $this->apiResponse->returnResponse();\n }", "protected function verifySignature($key, string $dataToSign): bool\n {\n if (empty($this->signature)) {\n throw new InvalidSignatureException('Invalid signature.');\n }\n\n $method = 'verifyWith' . $this->algorithm;\n\n if (!method_exists($this, $method)) {\n throw new DomainException('Unsupported hashing algorithm.');\n }\n\n $verified = call_user_func_array(\n [$this, $method],\n [$key, $dataToSign, $this->signature]\n );\n\n if (!is_bool($verified)) {\n throw new RuntimeException(sprintf(\n 'Invalid return value given from \"%s\".',\n $method\n ));\n }\n\n return $verified;\n }", "private function checkSignature($signature,$timestamp,$nonce)\n {\n $token = Yii::$app->params['wechat']['token'];\n if (!$token) {\n echo 'TOKEN is not defined!';\n } else {\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }\n }", "function verify () {\n// $aop->alipayrsaPublicKey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjUzhXrdJ7GDsgJ59fMLlk7hyYrXkkeGwnYD/eO2HBZh39Y9gTfLJ61Yogc7keOn2uAnZY/zBlw3n+T6mb6/5JYFgvXQi8Qzeh6BkBrNnROu+k4PjhmSbORJFoLrrIxDnsYkQ995kYYhpbS0yf2Al++55v4SrD3/YoVBhWPcRg4xI0QD94FLwhCmcCkft/ILRtUxQk2QeVPLSesvMx2mmUK2L2x2hFA8ewRoGmUdG2Fu9YFIxk//16RI+H7KI8LaoXoVDqHobPae9p0ACE7k9G5vs/cYuikSMKu+lnxghte1jNO+CqrvTP4Pes/mW4e7CEMCTAmEnsXLUrQ6FpfKMcQIDAQAB';\n return $this->aop->rsaCheckV1($_POST, NULL, \"RSA2\");\n }", "function simpleid_verify_signatures($request) {\n global $version;\n \n log_info('simpleid_verify_signatures');\n \n $is_valid = TRUE;\n \n $assoc = (isset($request['openid.assoc_handle'])) ? cache_get('association', $request['openid.assoc_handle']) : NULL;\n $stateless = (isset($request['openid.response_nonce'])) ? cache_get('stateless', $request['openid.response_nonce']) : NULL;\n \n if (!$assoc) {\n log_notice('simpleid_verify_signatures: Association not found.');\n $is_valid = FALSE;\n } elseif (!$assoc['assoc_type']) {\n log_error('simpleid_verify_signatures: Association does not contain valid assoc_type.');\n $is_valid = FALSE;\n } elseif (!isset($assoc['private']) || ($assoc['private'] != 1)) {\n log_warn('simpleid_verify_signatures: Attempting to verify an association with a shared key.');\n $is_valid = FALSE;\n } elseif (!$stateless || ($stateless['assoc_handle'] != $request['openid.assoc_handle'])) {\n log_warn('simpleid_verify_signatures: Attempting to verify a response_nonce more than once, or private association expired.');\n $is_valid = FALSE;\n } else {\n $mac_key = $assoc['mac_key'];\n $assoc_types = openid_association_types();\n $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];\n \n $signed_keys = explode(',', $request['openid.signed']);\n $signature = openid_sign($request, $signed_keys, $mac_key, $hmac_func, $version);\n log_debug('***** Signature: ' . $signature);\n \n if ($signature != $request['openid.sig']) {\n log_warn('simpleid_verify_signatures: Signature supplied in request does not match the signatured generated.');\n $is_valid = FALSE;\n }\n \n cache_delete('stateless', $request['openid.response_nonce']);\n }\n \n return $is_valid;\n}", "private function checkSignature($signature,$timestamp,$nonce)\n {\n $token = Yii::$app->params['wechat']['token'];\n if (!$token) {\n echo 'TOKEN is not defined!';\n } else {\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }\n }", "public function testPayload($token, $signatureIndex, $valid)\n {\n if (!$valid) {\n $this->expectException(Assert\\InvalidArgumentException::class);\n }\n\n self::$validator->validate($token, $signatureIndex);\n\n $this->assertTrue(true, 'https://github.com/sebastianbergmann/phpunit-documentation/issues/171');\n }", "public function verify(array $message, $sig)\n {\n return $this->verifier->verify($message, $sig);\n }", "function verify_webhook($data, $hmac_header)\n{\n $calculated_hmac = base64_encode(hash_hmac('sha256', $data, SHOPIFY_APP_SECRET, true));\n return hash_equals($hmac_header, $calculated_hmac);\n}", "public function validateSignature(array $request)\n {\n $this->assertRequestParamIsNotNull(\n $request, 'hmac', 'Expected signature in query params'\n );\n\n $hmac = $request['hmac'];\n\n return $this->generateSignature($request, '&') === $hmac;\n }", "private function signatureIsValid(Request $request)\n {\n $url = $request->path();\n\n // Recreate the original signature to compare it and check that it is valid\n $urlSignature = hash_hmac('sha256', $url, Crypt::getEncryptionKey());\n\n $originalSignature = $request->query('sig', '');\n\n return hash_equals($urlSignature, (string) $originalSignature);\n }", "function verify_request ($body) {\n\tglobal $config;\n\treturn strpos($_SERVER['HTTP_USER_AGENT'], 'GitHub-Hookshot') !== false &&\n\t\thash_equals($_SERVER['HTTP_X_HUB_SIGNATURE'], 'sha1=' . hash_hmac('sha1', $body, $config->token));\n}", "public static function isSignature( $string )\n {\n return $string == pack( \"V\", self::magic );\n }", "public function isSignatureValid(string $response, string $signature, string $publicKey) : bool\n {\n if (\\strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {\n throw new InvalidArgumentException(sprintf(\"Public key should be %d bytes.\", SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES));\n }\n\n if (\\strlen($signature) !== 64) {\n throw new InvalidArgumentException(sprintf(\"Signature %d bytes.\", 64));\n }\n\n try {\n return \\sodium_crypto_sign_verify_detached(\n $signature,\n $response,\n $publicKey\n );\n } catch (SodiumException $e) {\n throw new InvalidArgumentException($e->getMessage());\n }\n }", "function verify($filePath, $publicKeys = array(), $fileSign = null){\n $payload = \"\";\n if($fileSign!=null){\n if(file_exists($fileSign))\n $payload = file_get_contents($fileSign);\n else{\n // if not file then it is a payload\n $payload = $fileSign;\n }\n }else{\n $payload = file_get_contents($filePath.'.jwt.sign');\n }\n if($publicKeys==null)\n $publicKeys = array();\n\n $result = array();\n $signs = explode(\"\\n\",str_replace(\"\\r\",'',$payload));\n\n foreach($signs as $temp){\n //sign array 0 is email 1 is jwt\n $sign = explode(\" \",$temp);\n //if it email then process\n if (filter_var($sign[0], FILTER_VALIDATE_EMAIL)) {\n //get public key from payload if publicKeys not provided\n if(!isset($publicKeys[$sign[0]])){\n $tmp = explode(\".\",$sign[1]);\n $data = json_decode(base64_decode($tmp[1]),true);\n $publicKey = $data['key'];\n }else{\n $publicKey = $publicKeys[$sign[0]];\n }\n try{\n $res = (array) JWT::decode($sign[1], $publicKey, array('RS256'));\n foreach($res as $k => $v){\n $result[$sign[0]][$k] = $v;\n }\n $path = ($filePath!=null && file_exists($filePath))? $filePath : $res['file'];\n if(!file_exists($path)){\n $result[$sign[0]]['verified'] = false;\n $result[$sign[0]]['error'] = 'File not found';\n }else{\n $result[$sign[0]]['sha256_verified'] = ($res['sha256']==hash_file(\"sha256\",$path));\n $result[$sign[0]]['sha1_verified'] = ($res['sha1']==sha1_file($path));\n $result[$sign[0]]['md5_verified'] = ($res['md5']==md5_file($path));\n if($result[$sign[0]]['sha256_verified'] && $result[$sign[0]]['sha1_verified'] && \n $result[$sign[0]]['md5_verified']){\n $result[$sign[0]]['verified'] = true;\n }else{\n $result[$sign[0]]['verified'] = false;\n }\n }\n }catch(\\Exception $e){\n $result[$sign[0]]['verified'] = false;\n $result[$sign[0]]['error'] = 'Signature invalid, '.$e->getMessage();\n }\n }\n }\n return $result;\n }", "public function verifySignature(string $name, array $arguments = []) : bool {\n return in_array($name, ['toJson', 'toJson']) && count($arguments) === 0;\n }", "public function testSuccess()\n {\n $signatures = SmartwaiverTypes::createSignatures();\n $swSignatures = new SmartwaiverSignatures($signatures);\n\n $this->assertEquals($signatures['waiverId'], $swSignatures->waiverId);\n $this->assertEquals($signatures['templateId'], $swSignatures->templateId);\n $this->assertEquals($signatures['title'], $swSignatures->title);\n $this->assertEquals($signatures['createdOn'], $swSignatures->createdOn);\n\n $this->assertCount(count($signatures['signatures']['participants']), $swSignatures->participantSignatures);\n foreach($swSignatures->participantSignatures as $participantSignature) {\n $this->assertEquals('BASE64ENCODED', $participantSignature);\n }\n\n $this->assertCount(count($signatures['signatures']['guardian']), $swSignatures->guardianSignatures);\n foreach($swSignatures->guardianSignatures as $guardianSignature) {\n $this->assertEquals('BASE64ENCODED', $guardianSignature);\n }\n\n $this->assertCount(count($signatures['signatures']['bodySignatures']), $swSignatures->bodySignatures);\n foreach($swSignatures->bodySignatures as $bodySignature) {\n $this->assertEquals('BASE64ENCODED', $bodySignature);\n }\n\n $this->assertCount(count($signatures['signatures']['bodyInitials']), $swSignatures->bodyInitials);\n foreach($swSignatures->bodyInitials as $bodyInitial) {\n $this->assertEquals('BASE64ENCODED', $bodyInitial);\n }\n }", "function verifymessage($address, $signature, $message) {\n // curve definition\n // http://www.secg.org/download/aid-784/sec2-v2.pdf\n $secp256k1 = new CurveFp(\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F', '0', '7');\n $secp256k1_G = new Point($secp256k1,\n '0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798',\n '0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8',\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141');\n\n\t// extract parameters\n\t$address = base58check_decode($address);\n\tif (strlen($address) != 21 || $address[0] != \"\\x0\") {\n\t\tthrow new Exception('invalid Bitcoin address');\n\t}\n\n\t$signature = base64_decode($signature, true);\n\tif ($signature === false) {\n\t\tthrow new Exception('invalid base64 signature');\n\t}\n\n\tif (strlen($signature) != 65) {\n\t\tthrow new Exception('invalid signature length');\n\t}\n\n\t$recoveryFlags = ord($signature[0]) - 27;\n\tif ($recoveryFlags < 0 || $recoveryFlags > 7) {\n\t\tthrow new Exception('invalid signature type');\n\t}\n\t$isCompressed = ($recoveryFlags & 4) != 0;\n\n\t// hash message, recover key\n\t$messageHash = hash('sha256', hash('sha256', \"\\x18Bitcoin Signed Message:\\n\" . numToVarIntString(strlen($message)).$message, true), true);\n\t$pubkey = recoverPubKey(bin2gmp(substr($signature, 1, 32)), bin2gmp(substr($signature, 33, 32)), bin2gmp($messageHash), $recoveryFlags, $secp256k1_G);\n\tif ($pubkey === false) {\n\t\tthrow new Exception('unable to recover key');\n\t}\n\t$point = $pubkey->getPoint();\n\n\t// see that the key we recovered is for the address given\n\tif (!$isCompressed) {\n\t\t$pubBinStr = \"\\x04\" . str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT) .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getY()), 32, \"\\x00\", STR_PAD_LEFT);\n\t} else {\n\t\t$pubBinStr =\t(isBignumEven($point->getY()) ? \"\\x02\" : \"\\x03\") .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT);\n\t}\n\t$derivedAddress = \"\\x00\". hash('ripemd160', hash('sha256', $pubBinStr, true), true);\n\n\treturn $address === $derivedAddress;\n}", "protected function checkVerification()\n {\n $verificationString = $this->getRequest()->getHeader('X-GCS-Webhooks-Endpoint-Verification');\n if ($verificationString) {\n $this->getResponse()->setHeader('Content-Type', 'text/plain');\n $this->getResponse()->setBody(\n $verificationString\n );\n\n return true;\n }\n\n return false;\n }", "private function checkSignature($token)\r\n {\r\n /*if (!defined(\"TOKEN\")) {\r\n throw new Exception('TOKEN is not defined!');\r\n }*/\r\n\r\n $signature = $_GET[\"signature\"];\r\n $timestamp = $_GET[\"timestamp\"];\r\n $nonce = $_GET[\"nonce\"];\r\n\r\n //$token = TOKEN;\r\n $tmpArr = array($token, $timestamp, $nonce);\r\n // use SORT_STRING rule\r\n sort($tmpArr, SORT_STRING);\r\n $tmpStr = implode( $tmpArr );\r\n $tmpStr = sha1( $tmpStr );\r\n\r\n if( $tmpStr == $signature ){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function verify_signature($file) {\n $dds = new WebService_DigiDocService_DigiDocService();\n $file[\"content\"] = File::readLocalFile($file[\"tmp_name\"]);\n unlink($file[\"tmp_name\"]);\n\n if ($file[\"format\"] === \"bdoc\") {\n $ret = $dds->StartSession(\"\", base64_encode($file[\"content\"]), FALSE, \"\");\n } else {\n $parser = new DigiDoc_Parser($file[\"content\"]);\n $ret = $dds->StartSession(\"\", $parser->getDigiDoc(TRUE), FALSE, \"\");\n }\n\n if (PEAR::isError($ret)) {\n return \"ERROR: \" . $ret->getMessage();\n }\n $sig_info = $ret[\"SignedDocInfo\"]->SignatureInfo;\n if (is_array($sig_info)) {\n return \"ERROR: The claim can have only one signature.\";\n }\n\n if ($sig_info->Status !== \"OK\") {\n $error = $sig_info->Error;\n return \"ERROR: The signature is invalid - $error->Description ($error->Code).\";\n }\n return \"OK\";\n}", "public function verifySignature(array $aData, $sVerificationSignature)\n\t{\n\t\treturn ($this->signRequest($aData) == $sVerificationSignature);\n\t}", "function verify_digital_signature($fname) {\n\n\tglobal $g;\n\n\treturn mwexec(\"/usr/bin/gzsig verify \" .\n\tescapeshellarg(\"{$g['etc_path']}/id_rsa.pub\") . \" \" .\n\tescapeshellarg($fname));\n}", "protected function assertPayload(): void\n {\n }", "protected function assertPayload(): void\n {\n }", "protected function assertPayload(): void\n {\n }", "public function validateSignature(string $instance, string $apiKey, string $platform): bool\n {\n $payrexx = $this->getInterface($instance, $apiKey, $platform);\n try {\n $payrexx->getOne(new SignatureCheck());\n return true;\n } catch (\\Payrexx\\PayrexxException $e) {\n return false;\n }\n }", "private function validate () {\n $payload = $this->payload;\n // Unset fields that don't match the spec\n foreach (array_keys($payload) as $field) {\n if (!in_array($field, $this->fields)) {\n unset($payload[$field]);\n }\n }\n\n // If the user is signing up manually (I.e. not via a social network), then\n // we also need a password\n if ($this->method === 'manual' && empty($payload['password'])) {\n return false;\n }\n\n $this->payload = $payload;\n return true;\n }", "public function isRequestSigned()\r\n\t{\r\n\t\t$headers = $this->getAllHeaders();\r\n\r\n\t\tif (!isset($headers[\"Authorization\"]))\r\n\t\t\treturn false;\r\n\r\n\t\tif (!isset($headers[\"Signature\"]))\r\n\t\t\treturn false;\r\n\r\n\t\tif (!($this->appId = $this->getApplicationId()))\r\n\t\t\treturn false;\r\n\r\n\t\t$this->secret = $this->appService->getApplicationSecret($this->appId);\r\n\r\n\t\tif (!$this->secret)\r\n\t\t\treturn false;\r\n\r\n\t\t$signature = $headers[\"Signature\"];\r\n\t\t$expected = $this->create();\r\n\r\n\t\treturn $this->compare($signature, $expected);\r\n\t}", "protected function verifyParams() {\n\t\t\treturn true;\n\t\t}", "function check_signature(){\n $nonce = $_GET['nonce'];\n $token = 'hello';\n $timestamp = $_GET['timestamp'];\n $signature = $_GET['signature'];\n $echostr = $_GET['echostr'];\n $arr = array($nonce,$token,$timestamp);\n sort($arr);\n $str = sha1(implode($arr));\n if($str == $signature && $echostr){\n echo $echostr;\n }else{\n response();\n }\n}", "public function verifyRequest()\n {\n }", "protected function verifyResponseSignature(array $responseData, $encoding)\n {\n $hash = $this->generateHash($responseData, $encoding);\n\n $keyId = openssl_pkey_get_public($this->publicKey);\n\n $result = openssl_verify($hash, base64_decode($responseData[$this->fieldsClass::SIGNATURE]), $keyId);\n\n openssl_free_key($keyId);\n\n return $result === 1;\n }", "function openssl_pkcs7_verify(\n string $input_filename,\n int $flags,\n ?string $signers_certificates_filename,\n array $ca_info = [],\n ?string $untrusted_certificates_filename,\n ?string $content,\n #[PhpStormStubsElementAvailable(\"7.2\")] ?string $output_filename\n): int|bool {}", "public function validateProxySignature(array $request)\n {\n $this->assertRequestParamIsNotNull(\n $request, 'signature', 'Expected signature in query params'\n );\n\n $hmac = $request['signature'];\n\n return $this->generateSignature($request, '') === $hmac;\n }", "public function validateRequest($expected_signature, $url, $data = array()) {\n ksort($data);\n \n // append them to the data string in order \n // with no delimiters\n foreach($data AS $key=>$value)\n $url .= \"$key$value\";\n\n // This function calculates the HMAC hash of the data with the key \n // passed in\n // Note: hash_hmac requires PHP 5 >= 5.1.2 or PECL hash:1.1-1.5\n // Or http://pear.php.net/package/Crypt_HMAC/\n $calculated_signature = base64_encode(hash_hmac(\"sha1\",$url, $this->ApiKey, true));\n \n return $calculated_signature == $expected_signature;\n \n }", "public function verify($data, $signature, $alias, $options=array())\n {\n $ok = 0;\n $binSig = '';\n if ($this->isCertificateEntry($alias)) {\n \n $processedOpts = $this->_processAsymmetricOptions($options);\n $entry = $this->getEntry($alias);\n switch ($entry->getEntryType()) {\n case Crypt_KeyStore_BaseEntry::PRIVATEKEY_TYPE:\n $cert = $entry->getCertificate()->getEncoded();\n break;\n case Crypt_KeyStore_BaseEntry::TRUSTEDCERT_TYPE:\n $cert = $entry->getTrustedCertificate()->getEncoded();\n break;\n default:\n throw new Crypt_KeyStore_Exception(\"Invalid entry \"\n . \"type for signature\");\n break;\n }\n \n try {\n $binSig = pack('H*', $signature);\n // compute signature\n $ok = openssl_verify(\n $data, \n $binSig, \n $cert, \n $processedOpts[self::OPT_DIGEST]\n );\n }\n catch (Exception $e) {\n throw new Crypt_KeyStore_Exception($e);\n }\n } else {\n throw new Crypt_KeyStore_Exception(\n \"Entry $alias is not a valid entry for signatures\");\n }\n \n if ($ok < 0) {\n throw new Crypt_KeyStore_Exception(\"Failed to verify signature\");\n }\n \n return ($ok == 1);\n }", "public function compare($data)\n {\n return $this->signature === $data ? true : false;\n }", "public function verifyWithSecret(string $signature, string $data, string $key, bool $keyIsHex = true): bool\n {\n try {\n $signature = sodium_hex2bin($signature);\n if ($keyIsHex) {\n $key = sodium_hex2bin($key);\n }\n if (strlen($key) !== SODIUM_CRYPTO_AUTH_KEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_AUTH_KEYBYTES . ' long.');\n }\n $result = sodium_crypto_auth_verify($signature, $data, $key);\n sodium_memzero($signature);\n sodium_memzero($key);\n return $result;\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not verify data', 0, $e);\n }\n }", "private function checkSignature($str='')\n {\n $signature = isset($_GET[\"signature\"])?$_GET[\"signature\"]:'';\n $signature = isset($_GET[\"msg_signature\"])?$_GET[\"msg_signature\"]:$signature; //如果存在加密验证则用加密验证段\n $timestamp = isset($_GET[\"timestamp\"])?$_GET[\"timestamp\"]:'';\n $nonce = isset($_GET[\"nonce\"])?$_GET[\"nonce\"]:'';\n\n $token = $this->token;\n $tmpArr = array($token, $timestamp, $nonce,$str);\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "public function validate($input = null, $timestamp = null, $signature = null, &$reason = null){\n\t\t$functionCall = true;\n\t\tif (!empty($_REQUEST['input']) && !empty($_REQUEST['timestamp']) && !empty($_REQUEST['signature'])){\n\t\t\t$functionCall = false;\n\t\t\t$provider = $_REQUEST['input'];\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\t\t$signature = $_REQUEST['signature'];\n\t\t}\n\t\t\n\t\t$timestamp_int = strtotime($timestamp);\n\t\tif ($timestamp_int < strtotime('-'.$this->env['security_timeout']) || $timestamp_int > time()){\n\t\t\t$reason = \"Auth response expired\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$hash = OpauthStrategy::hash($input, $timestamp, $this->env['security_iteration'], $this->env['security_salt']);\n\t\t\n\t\tif (strcasecmp($hash, $signature) !== 0){\n\t\t\t$reason = \"Signature does not validate\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function hasValidSignature(Request $request)\n {\n $original = rtrim($request->url().'?'.http_build_query(\n Arr::except($request->query(), 'signature')\n ), '?');\n\n $expires = Arr::get($request->query(), 'expires');\n\n $signature = hash_hmac('sha1', $original, call_user_func($this->keyResolver));\n\n return hash_equals($signature, $request->query('signature', '')) &&\n ! ($expires && Carbon::now()->getTimestamp() > $expires);\n }", "private function verify($fileName = \"\", $fileContent = \"\"){\n if (empty($fileName) && empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be empty simultaneously.\");\n }\n if (!empty($fileName) && !empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be passed simultaneously.\");\n }\n if (!empty($fileName) && !file_exists($fileName)){\n throw new Exception(\"File with given filename does not exist.\");\n }\n if (! file_exists($this->tmpDir) || ! is_writable($this->tmpDir)){\n throw new Exception(\"Tmp dir does not exist or is not writable.\");\n }\n\n $randomId = uniqid();\n if (!empty($fileContent)){\n $fileName = sprintf(\"%s/%s.pdf\", $this->tmpDir, $randomId);\n file_put_contents($fileName, $fileContent);\n }\n\n $file = file_get_contents($fileName);\n\n $filters = $this->getFilters($file);\n if (empty($filters)){\n throw new Exception(\"Filter section in given file was not found.\");\n }\n\n $byteRange = $this->getByteRange($file);\n if (empty($byteRange)){\n throw new Exception(\"ByteRange section in given file was not found.\");\n }\n\n $binarySignature = $this->getBinarySignature($file);\n if (empty($binarySignature)){\n throw new Exception(\"Signature section in given file was not found.\");\n }\n\n $extFile = sprintf(\"%s/%s.ext.pdf\", $this->tmpDir, $randomId);\n if (! $this->removeSigatureFromPdf($fileName, $extFile, $byteRange)){\n throw new Exception(\"Extracting a signature from given file was not successfull.\");\n }\n\n $certPem = sprintf(\"%s/%s.pem\", $this->tmpDir, $randomId);\n $certPkcs7 = sprintf(\"%s/%s.pkcs7\", $this->tmpDir, $randomId);\n if (! $this->createPKCS7FromSignature($binarySignature, $certPem, $certPkcs7)){\n throw new Exception(\"Creating a certificate from signature was not successfull.\");\n }\n\n $certDer = sprintf(\"%s/%s.der\", $this->tmpDir, $randomId);\n if (! $this->convertPKCS7ToDER($certPkcs7, $certDer)){\n throw new Exception(\"Conversion of a certificate from PKCS7 to DER was not successfull.\");\n }\n\n $countCertsSignature = $this->convertPKCS7ToPEM($certPkcs7, $certPem);\n if ($countCertsSignature <= 0){\n throw new Exception(\"Conversion of a certificate from PKCS7 to PEM was not successfull.\");\n }\n\n// if($countCertsSignature>1) $countCertsSignature = 1; //onma, je problem s vice certifikaty, v PDF je vetsinou hned prvni soukromy klic\n for ($pocet=0; $pocet<$countCertsSignature; $pocet++ ) {\n $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $pocet));\n $cislo = $parsedCert['subject']['serial'];\n if ($cislo<>'') $pocet = 999999; //vyskocime\n }\n// $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $countCertsSignature - 1));\n\n\n $digest = sprintf(\"%s/%s.dig.bin\", $this->tmpDir, $randomId);\n $digests = $this->extractSignedDigest($certDer, $digest);\n if (empty($digests) || (empty($digests[\"rsaEncoded\"]) && empty($digests[\"messageDigest\"]) && empty($digests[\"PKCS7Data\"]))){\n throw new Exception(\"Extracting of a signed digest from certificate was not successfull.\");\n }\n\n $publicKey = sprintf(\"%s/%s.pubkey.pem\", $this->tmpDir, $randomId);\n\n $fileHashes = array(\n \"sha256\" => hash_file(\"sha256\", $extFile),\n \"sha1\" => hash_file(\"sha1\", $extFile),\n \"md5\" => hash_file(\"md5\", $extFile)\n );\n $signedHashes = array();\n\n if(!empty($digests[\"rsaEncoded\"])){\n if (! $this->createPublicKeyFromPEM($certPem, $publicKey)){\n throw new Exception(\"Creating of a public key from certificate was not successfull.\");\n }\n\n foreach($digests[\"rsaEncoded\"] as $dg){\n if(!empty($dg)){\n $decDigest = sprintf(\"%s.dec\", $dg);\n if (! $this->decryptBinaryDigest($dg, $decDigest, $publicKey)){\n throw new Exception(\"Decryption of a signed digest from certificate was not successfull.\");\n }\n if(file_exists($decDigest)){\n $signedHashes[] = strtolower(substr(bin2hex(file_get_contents($decDigest)), self::MAGIC));\n }\n }\n }\n }\n\n if(!empty($digests[\"messageDigest\"])){\n foreach($digests[\"messageDigest\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(!empty($digests[\"PKCS7Data\"])){\n foreach($digests[\"PKCS7Data\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(self::ENABLE_CLEANING){\n $this->rm($extFile);\n $this->rm($certPem);\n $this->rm($certPkcs7);\n $this->rm($certDer);\n $this->rm($publicKey);\n $this->rm($digest);\n if($countCertsSignature > 0){\n for($i = 0; $i < $countCertsSignature; $i++){\n $this->rm(sprintf(\"%s.%d\", $certPem, $i));\n }\n }\n if(!empty($digests[\"rsaEncoded\"])){\n foreach($digests[\"rsaEncoded\"] as $rsa){\n $this->rm(sprintf(\"%s\", $rsa));\n $this->rm(sprintf(\"%s.dec\", $rsa));\n }\n }\n if(!empty($fileContent)){\n $this->rm($fileName);\n }\n }\n\n foreach ($fileHashes as $algo => $hash) {\n if(in_array($hash, $signedHashes)){\n $r = array(\n \"result\" => true,\n \"alg\" => $algo,\n \"hash\" => $hash\n );\n return array_merge($r, $parsedCert);\n }\n }\n\n return array(\n \"result\" => false,\n \"fileHashes\" => $fileHashes,\n \"signedHashes\" => $signedHashes\n );\n }", "public function ChecksigVectors()\n {\n $ec = EcAdapterFactory::getAdapter(new Math(), EccFactory::getSecgCurves()->generator256k1());\n $privateKey = PrivateKeyFactory::fromHex('4141414141414141414141414141414141414141414141414141414141414141', false, $ec);\n\n $standard = ScriptFactory::defaultFlags();\n\n $vectors = [];\n\n // Pay to pubkey hash that succeeds\n $s0 = ScriptFactory::scriptPubKey()->payToPubKeyHash($privateKey->getPublicKey());\n $vectors[] = [\n true,\n $ec,\n $standard, // flags\n $privateKey, // privKey\n $s0,\n null, // redeemscript,\n ];\n\n // Pay to pubkey that succeeds\n $s1 = ScriptFactory::create()->push($privateKey->getPublicKey()->getBuffer())->op('OP_CHECKSIG')->getScript();\n $vectors[] = [\n true,\n $ec,\n $standard, // flags\n $privateKey, // privKey\n $s1,\n null, // redeemscript\n ];\n\n $rs = ScriptFactory::p2sh()->multisig(1, [$privateKey->getPublicKey()]);\n $vectors[] = [\n true,\n $ec,\n InterpreterInterface::VERIFY_P2SH |\n InterpreterInterface::VERIFY_WITNESS |\n InterpreterInterface::VERIFY_CLEAN_STACK\n ,\n $privateKey,\n $rs->getOutputScript(),\n $rs\n ];\n\n return $vectors;\n }", "protected function checkSignature(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request, $signature)\n {\n $secret = $this->getSharedSecret();\n\n if ($request->isSignatureValid($signature, $secret)) {\n return true;\n }\n\n throw new PriceWaiter_NYPWidget_Exception_Signature();\n }", "protected function isSignatureValid($body, $repo_id)\n {\n global $INPUT;\n if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {\n return false;\n }\n list($algo, $signature_github) = explode('=', $INPUT->server->str('HTTP_X_HUB_SIGNATURE'));\n /** @var \\helper_plugin_issuelinks_db $db */\n $db = plugin_load('helper', 'issuelinks_db');\n $secrets = $db->getWebhookSecrets('github', $repo_id);\n foreach ($secrets as $secret) {\n $signature_local = hash_hmac($algo, $body, $secret['secret']);\n if (hash_equals($signature_local, $signature_github)) {\n return true;\n }\n }\n return false;\n }", "function checkSign($echoStr){\r\n if(wmpBasic::checkSignature($this->cfg)){\r\n die($echoStr); \r\n }else{\r\n die('Error: checkSignature');\r\n }\r\n }", "public function verifyWebhook($source)\n {\n $hMac_header = $_SERVER['HTTP_X_SHOPIFY_HMAC_SHA256'];\n $data = file_get_contents('php://input');\n $calculated_hMac = base64_encode(hash_hmac('sha256', $data, $this->shopifySecret, true));\n $result = ($hMac_header == $calculated_hMac);\n if (!$result) {\n Log::error(\"ShopifyApi.verifyWebhook is FALSE for $source, hMac_header = $hMac_header,\n Input = $data\");\n }\n return $result;\n }", "abstract public function verifyRequest(): void;", "abstract public function verifyRequest(): void;", "public function validate($input = null, $timestamp = null, $signature = null, &$reason = null){\n\t\t$functionCall = true;\n\t\tif (!empty($_REQUEST['input']) && !empty($_REQUEST['timestamp']) && !empty($_REQUEST['signature'])){\n\t\t\t$functionCall = false;\n\t\t\t$provider = $_REQUEST['input'];\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\t\t$signature = $_REQUEST['signature'];\n\t\t}\n\t\t\n\t\t$timestamp_int = strtotime($timestamp);\n\t\tif ($timestamp_int < strtotime('-'.$this->env['Security.timeout']) || $timestamp_int > time()){\n\t\t\t$reason = \"Auth response expired\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\trequire $this->env['lib_dir'].'OpauthStrategy.php';\n\t\t$hash = OpauthStrategy::hash($input, $timestamp, $this->env['Security.iteration'], $this->env['Security.salt']);\n\t\t\n\t\tif (strcasecmp($hash, $signature) !== 0){\n\t\t\t$reason = \"Signature does not validate\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function validateWebhook(Request $request)\n {\n $calculatedHmac = base64_encode(hash_hmac('sha256', $request->getContent(), $this->shopifyApiSecret, true));\n return hash_equals($request->headers->get('X-Shopify-Hmac-SHA256'), $calculatedHmac);\n }", "public function validate(array $data) : bool\n {\n // If we dont have all the required parts for decryption exit.\n if (! isset( $data['iv'], $data['data'], $data['mac'])) {\n return false;\n }\n\n // If the extracted iv is invalid exit.\n $iv = base64_decode($data['iv']);\n\n if (strlen( $iv ) !== SODIUM_CRYPTO_SECRETBOX_NONCEBYTES) {\n return false;\n }\n\n return hash_equals($this->hash(base64_decode($data['data']), $iv), $data['mac']);\n }" ]
[ "0.7106413", "0.64516515", "0.6432414", "0.626451", "0.62414885", "0.62392163", "0.61530846", "0.6105046", "0.6032275", "0.5950878", "0.5889405", "0.58476335", "0.5845408", "0.5829598", "0.57923114", "0.5762736", "0.57554555", "0.5731509", "0.5716093", "0.5715101", "0.57102084", "0.5708356", "0.5707085", "0.57056886", "0.56987834", "0.569153", "0.5663867", "0.5663867", "0.5663867", "0.56634337", "0.5653997", "0.5646398", "0.5602989", "0.56000227", "0.55794805", "0.5566976", "0.55426127", "0.55363", "0.5521271", "0.55203223", "0.5483441", "0.5477034", "0.54677904", "0.5461971", "0.5449483", "0.54432434", "0.54273695", "0.5421102", "0.54160464", "0.5391968", "0.5376139", "0.5344051", "0.53393704", "0.5338592", "0.5328093", "0.53146076", "0.52927554", "0.52588916", "0.52320856", "0.52233815", "0.52107257", "0.5210546", "0.51851285", "0.51771253", "0.5174753", "0.51620096", "0.51461405", "0.5145951", "0.5136595", "0.5135331", "0.5125989", "0.51043934", "0.51043934", "0.51043934", "0.51011205", "0.50998425", "0.5099677", "0.5096719", "0.50750387", "0.5056457", "0.5046748", "0.50441074", "0.504141", "0.5030704", "0.50302064", "0.50141084", "0.5005508", "0.5004031", "0.5001587", "0.49947396", "0.49945036", "0.49825642", "0.49709088", "0.4968748", "0.49630946", "0.49413267", "0.4939689", "0.4939689", "0.4936213", "0.49281004", "0.4925016" ]
0.0
-1
Set or add variable to current context
public function setVariable(VariableName $variableName, BaseLiteral $value, string $assignmentMode = null) { $this->variables->set($variableName, $value, AbstractContext::ASSIGNMENT_MODE_VARIABLE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setContext( )\n\t{\n\t\t$args = new safe_args();\n\t\t$args->set('name', \tREQUIRED, 'string');\n\t\t$args->set('value', REQUIRED, 'any');\t\t\n\t\t$args = $args->get(func_get_args());\n\t\t\t\n\t\t$this->context[$args['name']] = $args['value'];\n\t}", "protected function _injectTplVariable()\r\n {\r\n $oConfig = oxRegistry::getConfig();\r\n $sTplVariableName = $oConfig->getConfigParam('sTplVariable');\r\n if ($sTplVariableName) {\r\n $oConfig->getActiveView()->addTplParam($sTplVariableName, $this->getToxid());\r\n }\r\n }", "public function setContext(string $key, $value);", "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 addVariable($name, $value);", "protected function setTypo3Context() {}", "public function addVariable($tv);", "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 __set($var, $val) {\n\t\t$this->view_variables[$var] = $val;\n\t}", "public function set($var, $value){\n\t\t\t$this->template_vars[$var] = $value;\n\t\t}", "public function setContext(&$context)\n {\n $this->context = $context;\n }", "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\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 pushContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\t// If no context\n\t\tif ($index == 0 && !empty($this->tpl_vars)) {\n\t\t\t// Copy the variables in context #0\n\t\t\t$this->context[0] = $this->tpl_vars;\n\t\t\t$index = 1;\n\t\t}\n\n\t\t// Create a new context\n\t\t$this->context[$index] = array();\n\n\t\t// Copy global vars\n\t\tforeach ($this->tpl_vars_global_keys as $key) {\n\t\t\t$this->context[$index][$key] = $this->tpl_vars[$key];\n\t\t}\n\n\t\t$this->tpl_vars = &$this->context[$index];\n\t}", "private function set_context_vars() {\n\n\t\t$this->total_pages = $this->data->get_total_pages();\n\t\t$this->total_items = $this->data->get_total_items();\n\t\t$this->current_page = $this->data->get_current_page();\n\t\t$this->current_url = $this->get_current_url();\n\n\t\tif ( 1 === $this->current_page ) {\n\t\t\t$this->disable_first = ' disabled';\n\t\t}\n\n\t\tif ( $this->current_page === $this->total_pages ) {\n\t\t\t$this->disable_last = ' disabled';\n\t\t}\n\t}", "public function set($variable, $value);", "public function addToContext( string $key, $value, string $behavior ): View;", "public static function bind_global($key, & $value) {\r\n View::$_global_data[$key] = &$value;\r\n View::$_global_bound_variables[$key] = TRUE;\r\n if ( self::$_smarty_is_loaded ) {\r\n Smarty::$global_tpl_vars[$key] = new Smarty_variable($value);\r\n Smarty::$global_tpl_vars[$key]->value = &$value;\r\n }\r\n}", "protected function setTemplateVariables() {}", "function add_context_using(ContextInterface $context)\n {\n foil('context')->add($context);\n }", "public function setContext($context) {\r\n\t\t$this->context= $context;\r\n\t}", "function set_context($new = '')\n\t{\n\t\tif\t\t($new == '')\t\treturn $this->context = '';\n\t\telse if\t($new == 'temp')\treturn $this->context = \"--no-default-keyring --keyring {$this->sessdir}/\".GPG_TEMP_RING_NAME;\n\t\telse\t\t\t\t\t\treturn $this->context = \"--no-default-keyring --keyring {$this->homedir}/\" . $new;\n\t}", "abstract public function setContext($context_object);", "public function setContext($context);", "public function setContext($context);", "public function __set($varName, $value) {\n\t\t$this->add($varName, $value);\n\t}", "protected function assign($var,$value = null){\n\t\tif($value === null)\n\t\t\t$this->view_manager->assign($var);\n\t\telse\t\n\t\t\t$this->view_manager->assign($var,$value);\n\t}", "function defineVar(string $name, $value, string $scope=\"global\") {\r\n\r\n }", "function addVariable($name,$value,$eval = true) {\n\t\t $this->Open();\n\t\t if ($eval) {\t\t \t\t \n\t\t $this->Stream .= '$'.$name.' = '.$this->prepareVariableString($value).';'.chr(10);\n\t\t \n\t\t } else {\t\t \n\t\t $this->Stream .= '$'.$name.' = $'.$value.\";\".chr(10);\n\t\t } \n\t\t}", "public function anaContext()\n {\n $this->setContext($this->parent->context);\n }", "public function setVar($key, $value);", "private function setVar($var)\n {\n $this->var = $var;\n }", "public function setContext($context)\r\n {\r\n $this->context = $context;\r\n }", "public function setContext($context) {\n $this->context = $context;\n }", "public function setVar($varName, $value) {\n $this->viewVars[$varName] = $value;\n }", "protected function remebmer_variable( $name, $value ){\n\t\tstatic::$instance->variables[$name] = $value;\n\t}", "public function addToParent($variable, $value) {\n\t\tif (!empty ($this->parent_controller)) {\n\t\t\t$this->parent_controller->view->append($variable, $value);\n\t\t} else {\n\t\t\t$wrn = new AWarning('Parent controller called does not exist in ' . get_class($this));\n\t\t\t$wrn->toDebug();\n\t\t}\n\t}", "protected function setVarToTemplates()\n {\n $this->templates->set_tpl($this->varName, $this->checkNewCommondaty());\n }", "function set($name, $value){\n\t\t$this->vars[$name] = $value;\n\t}", "abstract protected function setContext(array $context);", "public function onTwigSiteVariables()\n {\n }", "public function setContext($context = \"default\")\n {\n $this->context = $context;\n }", "function set($name, $value) {\n $this->vars[$name] = $value; //is_object($value) ? $value->fetch() : $value;\n }", "function init(&$context){}", "public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}", "public function assignTemplateVariable($varName, $varValue);", "protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }", "protected function setAcoVariables() {\n\n $this->set('plugin',\n isset($this->params['named']['plugin']) ? $this->params['named']['plugin'] : '');\n $this->set('controller_name', $this->params['named']['controller']);\n $this->set('action', $this->params['named']['action']);\n }", "public function __set($key, $value)\n\t{\n\t\tswitch ($key) {\n\t\t\tcase 'variables':\n\t\t\t\t$this->vars['variables'] = array_merge($this->vars['variables'], $value);\n\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\tcase 'js':\n\t\t\t\tif (!empty($this->vars[$key])) {\n\t\t\t\t\t$this->vars[$key] .= ', '.$value;\n\t\t\t\t} else {\n\t\t\t\t\t$this->vars[$key] = $value;\n\t\t\t\t}\t\t \n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->vars[$key] = $value;\n\t\t}\t\n\t}", "public function setControllerContext()\n {\n $typo3Version = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\Information\\Typo3Version::class);\n if (version_compare($typo3Version->getVersion(), '11.0', '<')) {\n $requestBuilder = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Mvc\\Web\\RequestBuilder::class);\n\n $requestBuilder->injectConfigurationManager($this->configurationManager);\n $requestBuilder->injectObjectManager($this->objectManager);\n $requestBuilder->injectExtensionService($this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Service\\ExtensionService::class));\n $requestBuilder->injectEnvironmentService($this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Service\\EnvironmentService::class));\n $this->response = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response::class);\n $this->request = $requestBuilder->build();\n\n $this->uriBuilder = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder::class);\n $this->controllerContext = $this->buildControllerContext();\n $flashMessageService = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\Messaging\\FlashMessageService::class);\n $this->controllerContext->injectFlashMessageService($flashMessageService);\n }\n }", "function Assign($tpl_var, $value = null)\n {\n $this->_smarty->assign( $tpl_var, $value );\n }", "function assign_global($key, $value = null)\n\t{\n\t\t\tforeach ($this->data as $k => $v)\t // iterate through data\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (get_class($v) == 'Template') // if data is template object\n\t\t\t\t{\n\t\t\t\t\t$v->assign($key, $value);\t // assign to it\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->assign($key, $value);\t\t // assign to this template also\n\t}", "function add_global_context(array $data)\n {\n foil('context')->add(new GlobalContext($data));\n }", "public function setContext(string $context): void\n {\n $this->context = $context;\n }", "public function assign($var, $value) {\n\t\tparent::assign($var, $value);\n\t}", "function addVar($varName,$value)\n {\n $this->VARS[${'varName'}][0] = $varName;\n $this->VARS[${'varName'}][1] = $value;\n }", "public function context()\n {\n return $this->setRightOperand(PVar::CONTEXT);\n }", "function testSetVariable()\n {\n $result = $this->tpl->setTemplate('{placeholder1} {placeholder2} {placeholder3}', true, true);\n if (PEAR::isError($result)) {\n $this->assertTrue(false, 'Error setting template: '. $result->getMessage());\n }\n // \"scalar\" call\n $this->tpl->setVariable('placeholder1', 'var1');\n // array call\n $this->tpl->setVariable(array(\n 'placeholder2' => 'var2',\n 'placeholder3' => 'var3'\n ));\n $this->assertEquals('var1 var2 var3', $this->tpl->get());\n }", "public static function assign($key,$value) {\r\n\t\tself::$_smarty->assignGlobal($key,$value);\r\n\t}", "public function setContext(Context $context)\r\n\t{\r\n\t\t$this->context = $context;\r\n\t}", "function set($name, $value) {\r\n $this->vars[$name] = $value;\r\n }", "function setSessionVariable($localVarName,$varName, $value) {\n $_SESSION[$this->local_current_module.\"_\".$localVarName.\"_\".$varName] = $value;\n}", "function add_php_var($key, $value){\n\t\t$this->php_vars[$key] = $value;\n\t}", "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 addvar($key, $value)\n {\n if ($this->mode > 0) {\n if (is_string($key)) {\n $this->debugvars[$key] = $value;\n } else {\n $this->debugvars[\"debugvar_\".count($this->debugvars)] = $value;\n }\n }\n }", "function __set($name, $value) {\n $this->vars[$name] = $value;\n }", "public function variable_set($name, $value) {\n // TODO\n variable_set($name, $value);\n }", "public function setContext($context_object = null)\n\t{\n\t\t$this->connection->context = $context_object;\n\t}", "function SetVar( $var, $value )\r\n {\r\n $this->_vars[$var] = $value;\r\n }", "function setModuleVar( $module, $var, $val=NULL ) {\n Registry::set(esf_Extensions::MODULE.'.'.$module.'.'.$var, $val);\n}", "public function setVar( $var, $val ) {\n $this->vars[$var] = $val;\n }", "public function __set($key, $var){\n\t\t$this->vars[$key] = $var;\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}", "function _getJavascriptVar() {\r\n return $this->_name . \"_ctx\";\r\n }", "public function with( $var, $value ) {\n\n global $$var;\n\n $$var = $value;\n\n return $this;\n\n }", "function add_to_context( $context ) {\n\t\t$context['options'] = get_fields('options');\n\t\treturn $context;\n\t}", "public function setContext($context)\n {\n $this->context = $context;\n }", "function set($variable, $value) {\n\t\t$_SESSION[$variable] = $value;\n\t}", "public function setContext($context) {\n\t\treturn $this->setPrivateSetting('context', $context);\n\t}", "public function setVar($name, $value)\n {\n $this->var_holder->set($name, $value);\n }", "public function setupDefaultContextVariables(): void\n {\n $this->sharedState()->basePath = '/';\n }", "function push_no_keep_context($setting = true)\n{\n global $HAS_NO_KEEP_CONTEXT, $NO_KEEP_CONTEXT_STACK;\n array_push($NO_KEEP_CONTEXT_STACK, $HAS_NO_KEEP_CONTEXT);\n $HAS_NO_KEEP_CONTEXT = $setting;\n}", "function setContext($msg_id, $context){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('UPDATE msg_conversation SET watson_context=:context WHERE msg_id=:msg_id');\n\t\t$statement->execute(array(':context'=>$context, ':msg_id'=>$msg_id));\n\t}", "public function doVariable($name, &$value): void\n {\n switch ($name) {\n case 'b':\n $value = 4;\n break;\n }\n }", "protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}", "protected function getContext() {}", "public function SetVariable($var,$value) {\n\t\techo $var.\" = \".$value.\"<br>\";\n\t\t$this->$var=$value;\n\t}", "function addModuleVar( $module, $var, $val ) {\n Registry::add(esf_Extensions::MODULE.'.'.$module.'.'.$var, $val);\n}", "function set_state( $feature ) {\n $context = $feature->get( 'context' );\n switch ( $context->get( '_feature_type' ) ) :\n case 'addon':\n $this->addon = $context;\n $context = $context->get( 'context' );\n case 'app':\n $this->app = $context;\n default :\n $this->view = $feature;\n endswitch;\n }", "public function addVar($key, $value)\n\t{\n\t\tswitch ($key) {\n\t\t\tcase 'variables':\n\t\t\t\t$this->vars['variables'] = array_merge($this->vars['variables'], $value);\n\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\tcase 'js':\n\t\t\t\tif (!empty($this->vars[$key])) {\n\t\t\t\t\t$this->vars[$key] .= ', '.$value;\n\t\t\t\t} else {\n\t\t\t\t\t$this->vars[$key] = $value;\n\t\t\t\t}\t\t \n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->vars[$key] = $value;\n\t\t}\t\n\t}", "public function addGlobalVariable($name, $value='null')\n\t{\n\t\tif (null === $this->resources->itemAt('variables'))\n\t\t\t$this->resources->add('variables', new CMap());\n\n\t\t$this->resources->itemAt('variables')->add($name, $value);\n\t}", "protected function initVars() {\n\n\t\t}", "public function __set ($variableName, $value) {\n // write\n }", "function setVar($key, $val) {\n $this->vars[$key] = $val;\n return true;\n }", "protected function variablesAssign()\n {\n $app = $this->app;\n $this->request = $app['request'];\n $this->session = $app['session'];\n $this->template = $app['template'];\n $this->theme = $app['theme'];\n\n // Set Request Format\n switch ($this->request->getRequestFormat()) {\n case 'json':\n $this->format = 'json';\n break;\n\n case 'xml':\n $this->format = 'xml';\n break;\n\n case 'csv':\n $this->format = 'csv';\n break;\n\n case 'html':\n default:\n $this->format = 'html';\n break;\n }\n }", "public function set($key,$value=null){\n if(is_array($key)){\n $this->vars += $key;\n }else{\n $this->vars[$key]=$value;\n }\n }", "public function addVariables($tvs = array());", "public function setVar($key, $val)\n {\n $this->templateVars[$key] = $val;\n return null;\n }", "public function setVariable($varName, $value) {\n\t\t$this->variables[$varName] = $value;\n\t\t$_SESSION[\"flashVariable\"][$varName] = $value;\n \t}", "abstract public function get_context();" ]
[ "0.64707994", "0.63863385", "0.6277492", "0.62272763", "0.60086715", "0.59832895", "0.5963926", "0.59266794", "0.58900714", "0.5853462", "0.5851892", "0.58209205", "0.5791149", "0.5769363", "0.5760473", "0.57598865", "0.57532513", "0.5730797", "0.5680554", "0.56792337", "0.5669375", "0.5612435", "0.5604867", "0.5589282", "0.5584952", "0.5584952", "0.55687356", "0.55685663", "0.55615264", "0.55538106", "0.5548415", "0.5536382", "0.5512144", "0.5492655", "0.5477581", "0.5474906", "0.5473988", "0.54592526", "0.5456952", "0.5438567", "0.54239535", "0.54095083", "0.5407366", "0.54042727", "0.54036486", "0.5402926", "0.5396389", "0.53894776", "0.53842425", "0.5373209", "0.536929", "0.53597003", "0.5354049", "0.5350982", "0.5339676", "0.5336418", "0.5322804", "0.5312723", "0.5309017", "0.5301533", "0.528323", "0.5279045", "0.5276637", "0.52675444", "0.52548707", "0.5254568", "0.5253171", "0.52527916", "0.52524906", "0.52464604", "0.5233597", "0.5231391", "0.5228555", "0.52276504", "0.52275467", "0.5225706", "0.5210994", "0.52026534", "0.5193319", "0.5191514", "0.51827306", "0.5175565", "0.5168589", "0.5157506", "0.5150689", "0.51463234", "0.51463056", "0.51412547", "0.5132634", "0.51315105", "0.5131113", "0.51230204", "0.5122182", "0.51193666", "0.5103053", "0.51021826", "0.5093659", "0.5081862", "0.5074085", "0.5072007", "0.506832" ]
0.0
-1
Add named reference to Context variables
public function setReference(VariableName $varName, VariableReference $reference) { throw new RuntimeError('Cannot set reference in OptionsContext'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setContext( )\n\t{\n\t\t$args = new safe_args();\n\t\t$args->set('name', \tREQUIRED, 'string');\n\t\t$args->set('value', REQUIRED, 'any');\t\t\n\t\t$args = $args->get(func_get_args());\n\t\t\t\n\t\t$this->context[$args['name']] = $args['value'];\n\t}", "function add_context_using(ContextInterface $context)\n {\n foil('context')->add($context);\n }", "public function addVariable($name, $value);", "public function pushContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\t// If no context\n\t\tif ($index == 0 && !empty($this->tpl_vars)) {\n\t\t\t// Copy the variables in context #0\n\t\t\t$this->context[0] = $this->tpl_vars;\n\t\t\t$index = 1;\n\t\t}\n\n\t\t// Create a new context\n\t\t$this->context[$index] = array();\n\n\t\t// Copy global vars\n\t\tforeach ($this->tpl_vars_global_keys as $key) {\n\t\t\t$this->context[$index][$key] = $this->tpl_vars[$key];\n\t\t}\n\n\t\t$this->tpl_vars = &$this->context[$index];\n\t}", "function add_to_context( $context ) {\n\t\t$context['options'] = get_fields('options');\n\t\treturn $context;\n\t}", "public function setContext(string $key, $value);", "protected function addAdditionalContextData(array & $context)\n {\n $context = array_replace_recursive(array(), $context);\n }", "static public function context( $context_name, $defaults, $rules = false, $messages = false ) {\n\t\tself::$_contexts[ $context_name ] = array(\n\t\t\t\"defaults\" => $defaults,\n\t\t\t\"rules\" => $rules,\n\t\t\t\"messages\" => $messages\n\t\t);\n\t}", "public function add(array $context): void;", "public function addContext(GenericContext $context);", "public function addToContext( string $key, $value, string $behavior ): View;", "function add_global_context(array $data)\n {\n foil('context')->add(new GlobalContext($data));\n }", "protected function _injectTplVariable()\r\n {\r\n $oConfig = oxRegistry::getConfig();\r\n $sTplVariableName = $oConfig->getConfigParam('sTplVariable');\r\n if ($sTplVariableName) {\r\n $oConfig->getActiveView()->addTplParam($sTplVariableName, $this->getToxid());\r\n }\r\n }", "protected function getContext() {}", "function resolveContext($path);", "public function fromContext($key, $default);", "public function setContext($context);", "public function setContext($context);", "public function getContext();", "public function getContext();", "public function getContext();", "public function getContext();", "public function getContext();", "abstract protected function setContext(array $context);", "public function bindVariable($bindVariableName);", "function getContextOptions();", "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 }", "protected function setTypo3Context() {}", "public function setupDefaultContextVariables(): void\n {\n $this->sharedState()->basePath = '/';\n }", "public function set_context_name($context_name)\n {\n $this->set_default_property(self::PROPERTY_CONTEXT_NAME, $context_name);\n }", "function set_context($new = '')\n\t{\n\t\tif\t\t($new == '')\t\treturn $this->context = '';\n\t\telse if\t($new == 'temp')\treturn $this->context = \"--no-default-keyring --keyring {$this->sessdir}/\".GPG_TEMP_RING_NAME;\n\t\telse\t\t\t\t\t\treturn $this->context = \"--no-default-keyring --keyring {$this->homedir}/\" . $new;\n\t}", "public function getContextString() {}", "public static function bind_global($key, & $value) {\r\n View::$_global_data[$key] = &$value;\r\n View::$_global_bound_variables[$key] = TRUE;\r\n if ( self::$_smarty_is_loaded ) {\r\n Smarty::$global_tpl_vars[$key] = new Smarty_variable($value);\r\n Smarty::$global_tpl_vars[$key]->value = &$value;\r\n }\r\n}", "public static function addToContext(array $context)\n {\n\n // determine if user is logged in\n self::$isLoggedIn = isset($context['user']) && is_a($context['user'], 'Timber\\User');\n\n // add comment settings from admin Settings > Discussion to local property\n self::$requireNameEmail = get_option('require_name_email');\n self::$commentRegistration = get_option('comment_registration');\n self::$closeCommentsForOldPosts = get_option('close_comments_for_old_posts');\n self::$closeCommentsDaysOld = get_option('close_comments_days_old');\n self::$threadComments = get_option('thread_comments');\n self::$threadCommentsDepth = get_option('thread_comments_depth');\n self::$pageComments = get_option('page_comments');\n self::$commentsPerPage = get_option('comments_per_page');\n self::$defaultCommentsPage = get_option('default_comments_page');\n self::$commentOrder = get_option('comment_order');\n self::$showAvatars = get_option('show_avatars');\n\n // add comment settings from local property to site\n if (isset($context['site']) && property_exists($context['site'], 'comments')) {\n $context['site']->comments['require_name_email'] = self::$requireNameEmail;\n $context['site']->comments['comment_registration'] = self::$commentRegistration;\n $context['site']->comments['close_comments_for_old_posts'] = self::$closeCommentsForOldPosts;\n $context['site']->comments['close_comments_days_old'] = self::$closeCommentsDaysOld;\n $context['site']->comments['thread_comments'] = self::$threadComments;\n $context['site']->comments['thread_comments_depth'] = self::$threadCommentsDepth;\n $context['site']->comments['page_comments'] = self::$pageComments;\n $context['site']->comments['comments_per_page'] = self::$commentsPerPage;\n $context['site']->comments['default_comments_page'] = self::$defaultCommentsPage;\n $context['site']->comments['comment_order'] = self::$commentOrder;\n $context['site']->comments['show_avatars'] = self::$showAvatars;\n }\n\n return $context;\n }", "protected function context() {\n return ArrayHelper::filter($GLOBALS, $this->logVars);\n }", "function defineVar(string $name, $value, string $scope=\"global\") {\r\n\r\n }", "public function addIdentifier($name)\n\t{\n\t\t$this->_themeExtras['identifier'][] = $name;\n\t}", "function init(&$context){}", "protected function addReferenced($name,$info)\n\t{\n\t\t\n\t\t$value = isset($info['current_value']) ? $info['current_value'] : NULL;\n\t\t$this->addElement($name, new Select($name,$name,$info['references'],$value));\t\n\t}", "public function register_replace_vars( $context ) {\n\t\t$replace_vars = [\n\t\t\t'main_schema_id' => $context->main_schema_id,\n\t\t\t'author_id' => $this->id_helper->get_user_schema_id( $context->indexable->author_id, $context ),\n\t\t\t'person_id' => $context->site_url . Schema_IDs::PERSON_HASH,\n\t\t\t'primary_image_id' => $context->canonical . Schema_IDs::PRIMARY_IMAGE_HASH,\n\t\t\t'webpage_id' => $context->canonical . Schema_IDs::WEBPAGE_HASH,\n\t\t\t'website_id' => $context->site_url . Schema_IDs::WEBSITE_HASH,\n\t\t\t'organization_id' => $context->site_url . Schema_IDs::ORGANIZATION_HASH,\n\t\t];\n\n\t\tif ( $context->post ) {\n\t\t\t// Post does not always exist, e.g. on term pages.\n\t\t\t$replace_vars['post_date'] = $context->post->post_date;\n\t\t}\n\n\t\tforeach ( $replace_vars as $var => $value ) {\n\t\t\t$this->register_replacement( $var, $value );\n\t\t}\n\t}", "public function setContext(array $context = []): void;", "public function setContext(&$context)\n {\n $this->context = $context;\n }", "abstract public function get_context();", "public function createContextAttribute($contextName, $attributeName);", "public function getContextDefinition();", "function setRef($name, &$value) {\n $this->vars[$name] =& $value; //is_object($value) ? $value->fetch() : $value;\n }", "public function tlogVariable($name, $variable);", "public function addGlobalVariable($name, $value='null')\n\t{\n\t\tif (null === $this->resources->itemAt('variables'))\n\t\t\t$this->resources->add('variables', new CMap());\n\n\t\t$this->resources->itemAt('variables')->add($name, $value);\n\t}", "public function getContextValue();", "public function setContext(string $context): void\n {\n $this->context = $context;\n }", "function field( $field_name ) {\n\tglobal $context;\n\t$context['fields'][ $field_name ] = get_field( $field_name );\n\treturn $context;\n}", "public function addVariables($tvs = array());", "public function add(ContextInterface $context);", "public function getContext(): mixed;", "public function setContext(array $context): void\n\t{\n\t\t$this->context = $context;\n\t}", "public function setContext( $context_name, $cached_data = NULL )\n\t{\n\t\tif ( !$this->hasContext( $context_name ) )\n\t\t{\n\t\t\t// Checks if we're given cached data.\n\t\t\tif ( NULL === $cached_data )\n\t\t\t{\n\t\t\t\t// If we aren't given cache data, we create an array with the needed items.\n\t\t\t\t$current_context = array();\n\n\t\t\t\t//$current_context['template_file']\t= '';\n\t\t\t\t$current_context['data']\t\t\t= array();\n\t\t\t\t$current_context['template']\t\t= NULL;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// When we're given cached data, we simply store it.\n\t\t\t\t$current_context = $cached_data;\n\t\t\t}\n\n\t\t\t// Stores the created context in the contexts array.\n\t\t\t$this->contexts[$context_name] = $current_context;\n\t\t}\n\t\t// Sets the current context name to the one given.\n\t\t$this->context_name = $context_name;\n\n\t\t$this->current_context = &$this->contexts[$this->context_name];\n\t}", "public function setContext($context)\r\n {\r\n $this->context = $context;\r\n }", "protected function remebmer_variable( $name, $value ){\n\t\tstatic::$instance->variables[$name] = $value;\n\t}", "public function setContext($context) {\n $this->context = $context;\n }", "protected function addFormObjectNameToViewHelperVariableContainer() {}", "public static function add_to_context($context) {\n foreach(static::$widgets as $key=>&$widget) {\n $context[\"widget_{$key}\"] = \\Timber::get_widgets($widget['id']);\n }\n return $context;\n }", "abstract public function setContext($context_object);", "function _getJavascriptVar() {\r\n return $this->_name . \"_ctx\";\r\n }", "public function getContextInfo() {}", "protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}", "public function setContext($context = \"default\")\n {\n $this->context = $context;\n }", "function twig_timber_context( $context ) {\n\t\t//Useful Variables\n\t\tglobal $template;\n\t\t$context['theme_template'] = str_replace( '.php', '', basename( $template ) );\n\t\t$context['theme_url'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n\t\t//Bam! Magic!\n\t\treturn $context;\n\t}", "function addVars($node, $vars) {\n\tforeach ($vars as $name=>$val) {\n\t\t$var = $node->data->addChild('var', $val);\n\t\t$var->addAttribute('name', $name);\n\t}\n}", "public function setContext($context) {\r\n\t\t$this->context= $context;\r\n\t}", "function addVar($varName,$value)\n {\n $this->VARS[${'varName'}][0] = $varName;\n $this->VARS[${'varName'}][1] = $value;\n }", "function add_to_context($data){\n\t\t$data['menu'] = wp_nav_menu(array('menu' => 175, 'echo' => false));\n\t\t$data['sidebar'] = Timber::get_sidebar();\n\t\treturn $data;\n\t}", "protected function addContext(array &$element) {\n $element['#context'] = [\n '#plugin_type' => 'bef',\n '#plugin_id' => $this->pluginId,\n '#view_id' => $this->view->id(),\n '#display_id' => $this->view->current_display,\n ];\n }", "public function contextStrategy();", "function AppendByRef($tpl_var, &$value, $merge=false)\n {\n $this->_smarty->append_by_ref($tpl_var, $value, $merge);\n }", "public function onTwigSiteVariables()\n {\n }", "public function setContextPath($path) {\n\t\t\n\t}", "public function add_app_env_to_context( array $context ) {\n\t\t$context['APP_ENV'] = getenv( 'APP_ENV' );\n\t\treturn $context;\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 pushContext()\n {\n \\array_push($this->contextStack, $this->context);\n \\array_push($this->showStack, $this->showState);\n }", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }", "function getBindVariableName() ;", "function context($title, \\Closure $closure)\n{\n pho\\context($title, $closure);\n}", "public function testContextual() {\n return [\n '#markup' => 'testContextual',\n 'stuff' => [\n '#type' => 'contextual_links',\n '#contextual_links' => [\n 'menu_test_menu' => [\n 'route_parameters' => ['bar' => 1],\n ],\n ],\n ],\n ];\n }", "function xcontext($title, \\Closure $closure)\n{\n pho\\xcontext($title, $closure);\n}", "public function anaContext()\n {\n $this->setContext($this->parent->context);\n }", "private function set_context_vars() {\n\n\t\t$this->total_pages = $this->data->get_total_pages();\n\t\t$this->total_items = $this->data->get_total_items();\n\t\t$this->current_page = $this->data->get_current_page();\n\t\t$this->current_url = $this->get_current_url();\n\n\t\tif ( 1 === $this->current_page ) {\n\t\t\t$this->disable_first = ' disabled';\n\t\t}\n\n\t\tif ( $this->current_page === $this->total_pages ) {\n\t\t\t$this->disable_last = ' disabled';\n\t\t}\n\t}", "public function storeContext( $context, array $data );", "function cps_changeset_publish_batch_variables(&$context) {\n $item = $context['results']['entity'];\n foreach ($item->variables as $name => $value) {\n db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();\n }\n cache_clear_all('variables', 'cache_bootstrap');\n $context['message'] = t('Publishing variables');\n}", "public function addTwigVar(string $varName, $varValue)\n {\n $this->vars[$varName] = $varValue;\n }", "function add_context(array $data, $needle, $is_regex = false)\n {\n $context = empty($is_regex)\n ? new SearchContext($needle, $data)\n : new RegexContext($needle, $data);\n foil('context')->add($context);\n }", "public function getContext(string $key);", "public function setContext(array $context)\n {\n $context = array_merge($this->getDefaultContext(), $context);\n\n // Always save to property in service for fallback\n $this->context = $context;\n\n // Try to save the context in session,\n if ($this->session) {\n $this->session->set(static::SESSION_KEY, $context);\n $this->session->save();\n }\n }", "public function setContext(Context $context)\r\n\t{\r\n\t\t$this->context = $context;\r\n\t}", "public function get_context_name()\n {\n return $this->get_default_property(self::PROPERTY_CONTEXT_NAME);\n }", "public function get_contextname() {\n return $this->contextname;\n }", "public function setContextValue($name, $value) {\n $this->context->setContextValue($this->info, $name, $value);\n return $this;\n }", "public function context($name, \\Closure $closure)\n {\n $this->context = $name;\n $closure($this);\n $this->context = self::DEFAULT_CONTEXT;\n }", "private function getFileContext () {\n\n $temp = $this->cleanse( filter_var( $_SERVER['HTTP_REFERER'] , FILTER_SANITIZE_URL ) );\n\n $this->referer = substr( $temp , -1 * ( strlen( $temp ) - strrpos( $temp , \"/\" ) - 1 ) );\n $this->log->write( '[Form] [context] Refererring Form: ' . $this->referer );\n\n $this->template = substr( $this->referer , 0 , strpos( $this->referer , \".\" ) ) . \".txt\";\n $this->template = $_SERVER['DOCUMENT_ROOT'] . '/forms-text/' . $this->template;\n $this->log->write( '[Form] [context] Template: ' . $this->template );\n\n $this->thankyou = substr( $this->referer , 0 , strpos( $this->referer , \".\" ) ) . \"-thanks.html\";\n $this->thankyou = '/forms-thanks/' . $this->thankyou;\n $this->log->write( '[Form] [context] Thank You: ' . $this->thankyou );\n\n }", "public function setVariableLocal(?string $variableName, $variableValue): MessageCorrelationBuilderInterface;", "function pagelines_less_var( $name, $value ){\n\t\n\tglobal $less_vars;\n\t\n\t$less_vars[$name] = $value;\n\t\n}" ]
[ "0.65791744", "0.62290967", "0.5801025", "0.5752376", "0.5684924", "0.5683717", "0.56470394", "0.5577331", "0.5482063", "0.547847", "0.54524857", "0.5443162", "0.5330834", "0.53289825", "0.5293912", "0.5275038", "0.52617854", "0.52617854", "0.52303797", "0.52303797", "0.52303797", "0.52303797", "0.52303797", "0.5229171", "0.52270275", "0.51936793", "0.5183338", "0.51673645", "0.516434", "0.5161335", "0.5156807", "0.5142907", "0.5140405", "0.5134748", "0.51334196", "0.5132313", "0.5131312", "0.511434", "0.51143366", "0.5075369", "0.5071066", "0.5065081", "0.50505257", "0.50388306", "0.5034085", "0.5026619", "0.5021999", "0.5018752", "0.5013073", "0.50017697", "0.5000619", "0.49883696", "0.49412844", "0.4940398", "0.49386957", "0.49352142", "0.49228454", "0.4916875", "0.49123254", "0.49073768", "0.4899859", "0.4897694", "0.4896704", "0.48950633", "0.4887042", "0.48843113", "0.48816997", "0.4881639", "0.48748738", "0.48612967", "0.48459855", "0.48432162", "0.48414466", "0.48405153", "0.4834382", "0.48297304", "0.4829457", "0.48292002", "0.4817183", "0.48070025", "0.48036402", "0.48025554", "0.48020416", "0.4797513", "0.47962153", "0.47864765", "0.47830445", "0.47815973", "0.47771364", "0.4771802", "0.47659788", "0.4763739", "0.4761169", "0.4755999", "0.47550717", "0.4754695", "0.47480068", "0.47307956", "0.4730441", "0.47290954" ]
0.49069437
60
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { $type = $this->argument('type'); switch($type){ case "import" : $this->import(); break; case "addition" : $this->addition(); break; case "investigate" : $this->investigate(); break; default : throw new Exception('Empty type commaand for import.'); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Statische Funktion exists() Checkt ob ein Cookie gesetzt ist bzw existiert. Falls ja => return true Falls nicht => return false
public static function exists($name){ return (isset($_COOKIE[$name])) ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cookieExists() {\n if (isset($_COOKIE[$this->cookie['name']])){\n return true;\n }\n\n return false;\n }", "public function cookieExists(): bool\n {\n $result = true;\n if (empty($_COOKIE)) {\n $result = false;\n }\n return $result;\n }", "public function exists($key){\n return isset($_COOKIE[$key]);\n }", "public static function exists($name) {\n\t\t\treturn (isset($_COOKIE[$name])) ? true : false;\n\t\t}", "public static function exists($name) {\n\t\t\treturn (isset($_COOKIE[$name])) ? true : false;\n\t\t}", "public static function isExist($key) {\n return isset($_COOKIE[$key]);\n }", "public static function exists($name){\n\t\treturn isset($_COOKIE[$name]);\n\t}", "public static function exists($name){\n\t\treturn (isset($_COOKIE[$name])) ? true : false;\t\t\t\t// Returns similar to the session method for the name we have defined and see if the cookie has been set.\n\t}", "function exists() {\n $this->log .= \"exists() called<br />\";\n if (!isset($_COOKIE['sid'])) {\n $this->log .= \"sid cookie does not exist.<br />\";\n return false;\n }\n $this->id = $_COOKIE['sid'];\n $this->filename = $this->dir.\"sid_\".$this->id;\n return true;\n }", "public static function exists($name) {\n return (isset($_COOKIE[$name])) ? true : false;\n }", "function exists() {\r\n\t\t$this->log .= \"exists() called<br />\";\r\n\t\tif (!isset($_COOKIE['sid'])) {\r\n\t\t $this->log .= \"sid cookie does not exist.<br />\";\r\n\t\t return false;\r\n\t\t}\r\n\t\t$this->id = $_COOKIE['sid'];\r\n\t\t$this->filename = $this->dir.\"sid_\".$this->id;\r\n\t\treturn true;\r\n\t}", "public function cookieExists($key) {\n return isset($_COOKIE[$key]);\n }", "public static function exists (string $cookie_name)\n {\n if (isset($_COOKIE[$cookie_name])){\n return true;\n }\n return false;\n }", "public static function exists(string $name) : bool {\n\n\t\t\treturn isset($_COOKIE[$name]);\n\t\t}", "public function has_cookie($name) {\n if (isset($this->_cookies[$name])) {\n return true;\n } else {\n return false;\n }\n }", "public static function isExist() {\n return ((self::$_isSessionRunning) && !empty($_COOKIE[session_name()]));\n }", "public static function has($key){\n\n return isset($_COOKIE[$key]);\n }", "public static function cookieExists($cookieName)\n\t\t{\n\t\t if(isset($_COOKIE[$cookieName]))\n\t\t {\n\t\t \treturn(true);\n\t\t }\n\t\t else\n\t\t {\n\t\t \treturn(false);\n\t\t }\n\t\t}", "public function valid() \n {\n return isset($_COOKIE[$this->key()]);\n }", "public function has($path) {\n\t\treturn isset($_COOKIE[$path]);\n\t}", "public function cookieIsset() {\n\t\tif(isset($_COOKIE[$this->cookieName])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function has($name)\n\t{\n\t\tif (isset($this->cookies[$name])) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isset($_COOKIE[\"{$this->prefix}$name\"])) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function hasUserCookies ()\n\t{\n\t\t// Simply check if the storage key for cookies exists and is non-empty.\n\t\treturn ! empty($this->loadUserCookies()) ? true : false;\n\t}", "protected function _hasCookie($cookie_name)\n {\n\n if (!$this->request->hasCookie($cookie_name))\n {\n Cookie::queue(Cookie::forever($cookie_name, 1)); //Cookie::forever($cookie_name, '1');\n return false;\n }\n else\n {\n return true;\n }\n\n }", "public static function has(string $name): bool\n {\n return isset($_COOKIE[$name]);\n }", "function checkCookie(){\n global $cookie;\n\n // Check database to see if a user exists with this cookie\n if (getSingleValue(\"SELECT COUNT(`id`) FROM `private_users` WHERE `cookie` ='\" . $cookie . \"' LIMIT 0 , 1\") != 1){\n // Some user has this cookie, it is valid\n return false;\n }else{\n // Nobody has this cookie, therefore it's invalid\n return true;\n }\n}", "public static function checkAuthCookie()\n {\n foreach (self::get() as $value) {\n if ($value === null) {\n return false;\n }\n }\n\n return true;\n }", "public function hasCookies() {\n\t\treturn $this->hasFirstPartyCookies() || $this->hasThirdPartyCookies();\n\t}", "public static function exists($name)\r\n\t{\r\n\t\t$name = \\Filter::systemID($name);\r\n\t\treturn (array_key_exists($name, $_COOKIE) ? true : false);\r\n\t}", "function checkCookie( $cookie )\n {\n $query = $this->db->get_where( $this->_tablename, 'cookie = \\'' . $cookie . '\\'');\n $result = $query->result();\n \n if( count( $result ) <= 0 ) return false;\n \n foreach( $result as $row )\n {\n $this->setSessoin( $row );\n }\n \n return true;\n }", "public function kapee_cookie_setted() {\n\t\treturn isset( $_COOKIE[self::$cookie['name']] );\n\t}", "public function isCookieSet() {}", "function check_cookie($p)\n{\n\tif(isset($_COOKIE['star_'.$p])) \n\t{ \n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t} \n}", "public function cookieExists(string $cookieName): bool\n {\n if (!isset($this->cookie()[$cookieName])) {\n return false;\n }\n\n return true;\n }", "public function isSetSessionCookie() {}", "public function isSetSessionCookie() {}", "public function is_cookie_set()\n {\n }", "private function checkCookie()\n\t\t{\n\t\t\tif(!empty($_COOKIE['auth_username']) && !empty($_COOKIE['auth_password']))\n\t\t\t\treturn $this->check($_COOKIE['auth_username'], $_COOKIE['auth_password']);\n\t\t}", "public function hasCookie($name)\n {\n // check if request has specific cookie\n return (isset($this->cookies[$name]) && $this->cookies[$name]->getName() === $name);\n }", "public function hasCookie($name)\n {\n return (bool) $this->getCookie($name);\n }", "public function hasObjectForKey($key)\n {\n $key = $this->cookieScopePrefix . $key;\n\n return isset($this->cookies[$key]);\n }", "function isCookieSet (){\n if (empty ($_COOKIE['id'])){\n header (\"location: error.php\");\n }\n}", "public function hasQueueingCookie(): bool;", "public function __isset($index) {\n\t\treturn isset($_COOKIE[$index]);\n\t}", "public function exists();", "public function exists();", "public function exists();", "public function exists() {}", "public function exists(): bool;", "public function exists(): bool;", "public function exists(): bool;", "function exists()\n {\n return false;\n }", "protected function isAccountExist()\n {\n $sessionId = \\Session::getId();\n $account = Account::where('session_id', $sessionId)->first();\n if (!$account) return false;\n\n return true;\n }", "function exists() {\n \n return !empty($this->cache);\n \n }", "function check() {\n\t\tif (isset($_SESSION['id_user']) and isset($_SESSION['login_user'])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t//~ Verify the existence of cookies\n\t\t\tif (isset($_COOKIE['id_user']) and isset($_COOKIE['code_user'])) {\n\t\t\t\t//~ cookies exist. Verified with a table sessions.\n\t\t\t\t$id_user=mysql::screening($_COOKIE['id_user']);\n\t\t\t\t$code_user=mysql::screening($_COOKIE['code_user']);\n\t\t\t\t$query=mysql::query(\"SELECT `session`.*, `users`.`login_user` FROM `session` INNER JOIN `users` ON `users`.`id_user`=`session`.`id_user` WHERE `session`.`id_user`=\".$id_user.\";\");\n\t\t\t\tif ($query and mysql_num_rows($query)!=0) {\n\t\t\t\t\t//~ Cookies are found in the database\n\t\t\t\t\t$user_agent=mysql::screening($_SERVER['HTTP_USER_AGENT']);\n\t\t\t\t\twhile ($row=mysql_fetch_assoc($query)) {\n\t\t\t\t\t\tif ($row['code_sess']==$code_user and $row['user_agent_sess']==$user_agent) {\n\t\t\t\t\t\t\t//~ found record\n\t\t\t\t\t\t\tmysql::query(\"UPDATE `session` SET `used_sess` = `used_sess`+1 WHERE `id_sess` = \".$row['id_sess'].\";\");\n\t\t\t\t\t\t\t//~ start session and update cookie\n\t\t\t\t\t\t\t$_SESSION['id_user']=$row['id_user'];\n\t\t\t\t\t\t\t$_SESSION['login_user']=$row['login_user'];\n\t\t\t\t\t\t\tsetcookie(\"id_user\", $row['id_user'], time()+3600*24*30);\n\t\t\t\t\t\t\tsetcookie(\"code_user\", $row['code_sess'], time()+3600*24*30);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//~ No records with this pair of matching cookies/user agent\n\t\t\t\t\t$this->destroy_cookie();\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t//~ No records for this user\n\t\t\t\t\t$this->destroy_cookie();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//~ cookies nit exist\n\t\t\t\t$this->destroy_cookie();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function exists() {\n return $this->sessionData !== false;\n }", "function isCookieValid($db){\n $isValid = false;\n\n if(isset($_COOKIE['rememberUserCookie'])){\n /**\n * Decode cookies and extract user ID\n */\n $decryptCookieData = base64_decode($_COOKIE['rememberUserCookie']);\n $user_id = explode(\"abcdefABCDEF1234567890\", $decryptCookieData);\n $userID = $user_id[1];\n /**\n * check if id retrieved from the cookie exists in the database\n */\n $sqlQuery = \"SELECT * FROM users WHERE id = :id\";\n $statement = $db->prepare($sqlQuery);\n $statement->exectue(array(':id' => $userID));\n \n if($row = $statement->fetch()){\n $id = $row['id'];\n $username = $row['username'];\n //create the user session variable\n $_SESSION['id']=$id;\n $_SESSION['username']=$username;\n $isValid = true;\n }else{\n $isValid = false;\n signout();\n }\n }\n return $isValid;\n }", "public function isExist() {\n\t\tif (!empty($this->enCryptKey) && !empty($this->deCryptKey) && !empty($this->certKey)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasCookie($cookieName)\n {\n return $this->getRequest()->hasCookie($cookieName);\n }", "public function Exists();", "private function verifyCookie()\n {\n if (isset($this->cookie['auth'])\n && isset($this->cookie['userid'])\n && !empty($this->cookie['auth'])\n && !empty($this->cookie['userid'])\n && ($this->cookie['userid'] > 0)\n ) {\n $this->db->prepare('SELECT `authSalt` FROM `' . $this->config['authTable'] . '` WHERE `' . $this->config['userColumn'] . '` = ?');\n $this->db->execute(array($this->cookie['userid']), 's');\n $result = $this->db->fetch();\n\n if (!$result) {\n return false;\n }\n\n $dbHash = hash('sha256', $result['authSalt'] . $this->cookie['userid']);\n\n if ($dbHash === $this->cookie['auth']) {\n return true;\n }\n }\n return false;\n }", "public function iShouldSeeCookie($cookie_name) {\n if($this->getSession()->getCookie('welcome_info_name') == $cookie_name) {\n return TRUE;\n } else {\n throw new Exception('Cookie not found');\n }\n }", "public function hasRememberMe()\n\t{\n return $this->cookies->has('RMU');\n }", "protected function exists() {}", "function _checkCookies() {\n if(isset($_COOKIE)) {\n if(isset($_COOKIE['user'])) {\n $_SESSION['is_login'] = true;\n $_SESSION['userid'] = $_COOKIE['user'];\n }\n }\n }", "function isCookieValid( $db ) {\n\n\t$isValid = false;\n\n\tif ( isset( $_COOKIE['rememberUserCookie']) ) {\n\n\t\t/**\n\t\t * Decode cookies and extract user ID\n\t\t */\n\t\t$decryptCookieData = base64_decode( $_COOKIE['rememberUserCookie'] );\n\t\t$user_id = explode( \"UaQteh5i4y3dntstemYODEC\", $decryptCookieData );\n\t\t$userID = $user_id[1];\n\n\t\t/**\n\t\t * check if id retrieved from the cookie exist in the database\n\t\t */\n\t\t$sqlQuery = \"SELECT * FROM users WHERE id = :id\";\n\t\t$statement = $db->prepare($sqlQuery);\n\t\t$statement->execute( array( ':id' => $userID) );\n\n\t\tif ( $row = $statement->fetch() ) {\n\n\t\t\t$id = $row['id'];\n\t\t\t$username = $row['username'];\n\n\t\t\t/**\n\t\t\t * Create the user session variable\n\t\t\t */\n\t\t\t$_SESSION['id'] = $id;\n\t\t\t$_SESSION['username'] = $username;\n\t\t\t$isValid = true;\n\n\t\t}else {\n\t\t\t/**\n\t\t\t * cookie ID is invalid destroy session and logout user\n\t\t\t */\n\t\t\t$isValid = false;\n\t\t\tsignout();\n\t\t}\n\n\t}\n\n\treturn $isValid;\n}", "function sessionExists() {\n\t\tif ((isset($_SESSION['valid_user'])) && (($_SESSION['valid_user']) != null)) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function exists()\n {\n return false;\n }", "public function exists()\n {\n return true;\n }", "private function cookieIsValid($hash) {\n //if hash in db\n $sql = \"SELECT username, expiredate, ip FROM \".PREFIX.\"sessions WHERE hash=:hash\";\n $cookie = $this->db->select($sql, array(\":hash\" => $hash));\n $count = count($cookie);\n if ($count == 0) {\n //hash did not exists deleting cookie\n Cookie::destroy(\"auth_cookie\", $hash);\n //Cookie::destroy(\"auth_cookie\", $hash, '');\n //setcookie(\"auth_cookie\", $hash, time() - 3600, \"/\");\n $this->logActivity('UNKNOWN', \"AUTH_CHECKCOOKIE\", \"User cookie cookie deleted - Hash ({$hash}) didn't exist\");\n return false;\n } else {\n $username = $cookie[0]->username;\n $db_expiredate = $cookie[0]->expiredate;\n $db_ip = $cookie[0]->ip;\n if ($_SERVER['REMOTE_ADDR'] != $db_ip) {\n //hash exists but ip is changed, delete cookie and hash\n $this->db->delete(PREFIX.'sessions', array('username' => $username));\n Cookie::destroy(\"auth_cookie\", $hash);\n //setcookie(\"auth_cookie\", $hash, time() - 3600, \"/\");\n $this->logActivity($username, \"AUTH_CHECKCOOKIE\", \"User cookie cookie deleted - IP Different ( DB : {$db_ip} / Current : \" . $_SERVER['REMOTE_ADDR'] . \" )\");\n return false;\n } else {\n $expiredate = strtotime($db_expiredate);\n $currentdate = strtotime(date(\"Y-m-d H:i:s\"));\n if ($currentdate > $expiredate) {\n //cookie has expired delete cookie and cookies\n $this->db->delete(PREFIX.'sessions', array('username' => $username));\n Cookie::destroy(\"auth_cookie\", $hash);\n //setcookie(\"auth_cookie\", $hash, time() - 3600, \"/\");\n $this->logActivity($username, \"AUTH_CHECKCOOKIE\", \"User cookie cookie deleted - Cookie expired ( Expire date : {$db_expiredate} )\");\n } else {\n //all ok\n return true;\n }\n }\n }\n }", "public static function exists()\n {\n return Session::get('UserID') != null;\n }", "public function hasFirstPartyCookies() {\n\t\treturn $this->firstPartyCookies;\n\t}", "function exists() {\n\t\tif ($this->exists) return true;\n\t\treturn false;\n\t}", "public function isLoggedIn() {\n $auth_cookie = Cookie::get(\"auth_cookie\"); //get hash from browser\n //check if cookie is valid\n if ($auth_cookie != '' && $this->cookieIsValid($auth_cookie)) {\n return true;\n } else {\n return false;\n }\n }", "function checkCookie($remember){\t\n\tif(isset($_COOKIE['n']) && isset($_COOKIE['e'])){\n\t\t$cookNonce = $_COOKIE['n'];\n\t\t$userEmail = $_COOKIE['e'];\n\t\t \n\t\t//connect to database to check if nonce exists\n\t\tglobal $mysqli;\n\t\t$q = \"SELECT `Nonce` FROM `Nonce_MHT` WHERE `Email` = '$userEmail'\";\n\t\t$result = $mysqli->query($q);\n\t\t \n\t\t//if nonce matches, return 1\n\t\tif ($result->num_rows == 1){ \t\t \n\t\t\t$row = $result->fetch_assoc();\n\t\t\t \n\t\t\tif ($cookNonce == $row['Nonce']){\n\t\t\t\t//Regenerate new cookie\n\t\t\t\t//createCookie($userEmail);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Invalid nonce, delete cookies\n\t\tdate_default_timezone_set('America/Toronto');\n\t\tsetcookie(\"e\", \"\", time()-60*60*24*100, \"/\");\n\t\tsetcookie(\"n\", \"\", time()-60*60*24*100, \"/\");\n\t\treturn 0;\n\t}\n\telse\n\treturn 0;\n}", "public function hasRememberMe()\n {\n return $this->cookies->has('RMU');\n }", "function check_cookie($value){\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}", "public static function kapee_cookikapee_accepted() {\n\t\treturn ( isset( $_COOKIE[self::$cookie['name']] ) && strtoupper( $_COOKIE[self::$cookie['name']] ) === self::$cookie['value'] );\n\t}", "private static function is_logged_in () {\n\t\t# Check for the existence of the cookie\n\t\tif (isset($_COOKIE[\"user_id\"])) {\n\t\t\treturn (true);\n\t\t} else {\n\t\t\treturn (false);\n\t\t}\n\t}", "public function isExists()\n\t{\n\t\treturn $this->storage->isExists() && $this->dictionary->isExists();\n\t}", "public function isCacheExists()\n {\n if(file_exists($this->cachedPath))\n return true;\n else\n return false;\n }", "public function offsetExists($offset) \n {\n //argument 1 must be scalar, null or bool\n Argument::i()->test(1, 'scalar', 'null', 'bool');\n\n return isset($_COOKIE[$offset]);\n }", "public function hasThirdPartyCookies() {\n\t\treturn $this->thirdPartyCookies;\n\t}", "public function exists()\r\n {\r\n }", "public function exists(){\n\n\t\treturn (!empty($this->_data)) ? true : false;\n\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 }", "static function exists($id) {\n $result = self::get($id);\n if (count($result) > 0) return true;\n return false;\n }", "function isUserRegistered()\r\n{\r\n $statusFlag = FALSE;\r\n \r\n // if user has previously registered, return true;\r\n if( isset($_COOKIE[\"user_email\"] ))\r\n $statusFlag = TRUE;\r\n\t \r\nreturn $statusFlag;\r\n\r\n}", "function verifyCookies()\n\t{\n\t\tif (isset($_COOKIE['cookieUserName']))\n\t\t{\n\t\t\techo json_encode(array('cookieUserName' => $_COOKIE['cookieUserName']));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Cookie not set yet\n\t\t die(json_encode(errors(417)));\n\t\t}\n\t}", "public function exists(Closure $func): bool;", "public function hasIdentity() {\n $objAuth = Zend_Auth::getInstance();\n \n // Verifica se já está autenticado\n if ($objAuth->hasIdentity()) {\n \treturn true;\n } else {\n \tif(Zf_Util_Cookie::cookieExists( Zend_Registry::get('admin_config')->resources->cookie->name )) {\n \t\t\n \t}\n }\n }", "public function isExist(){\n\t\t\tif(file_exists($this->_nameFile)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "private function getCookie() {\n $Cookie = filter_input(INPUT_COOKIE, 'useronline', FILTER_DEFAULT);\n if (!$Cookie):\n return FALSE;\n else:\n return TRUE;\n endif;\n setcookie(\"useronline\", base64_encode(\"ccs\"), time() + 86400);\n }", "function brute_force_authorized_login()\n{\n \t// Si le cookie n'existe pas \n\tif(!isset($_COOKIE['marqueur-try-connect']))\n\t{\n\t return true ;\n\t}\n\t// Si le cookie existe\n else\n {\n // Si le temps de blocage a été dépassé\n if($_COOKIE['marqueur-try-connect'] < time())\n {\n setcookie(\"marqueur-try-connect\", \"\", 0);\n }\n \n return false ;\n }\n}", "public function exists()\n {\n }", "public function exists()\n {\n }", "abstract public function exists();", "abstract public function exists();", "public static function delete(string $cookie_name){\n //check if it exist\n $check = self::exists($cookie_name);\n\n if ($check){\n\n $deleted = setcookie($cookie_name, \"\" , time() - 3600);\n if ($deleted) {\n return true;\n }\n return false;\n } else {\n return false;\n }\n \n \n }" ]
[ "0.8514164", "0.82147855", "0.78937805", "0.77765405", "0.77765405", "0.77705514", "0.7758656", "0.77571714", "0.77445906", "0.77426356", "0.76677513", "0.7633406", "0.76174605", "0.76119006", "0.7590135", "0.74776155", "0.7422178", "0.7400496", "0.73966914", "0.7372403", "0.7345784", "0.73091805", "0.73077184", "0.7268602", "0.72361636", "0.722676", "0.71935713", "0.7185641", "0.7121703", "0.71043533", "0.7096319", "0.7094232", "0.70822644", "0.6989606", "0.6966646", "0.6966646", "0.69184613", "0.6908405", "0.69064826", "0.68922585", "0.6796871", "0.66141", "0.6557518", "0.64973444", "0.64937603", "0.64937603", "0.64937603", "0.64710623", "0.64419013", "0.64419013", "0.64419013", "0.64400005", "0.64307135", "0.64277047", "0.63827544", "0.63723916", "0.63637185", "0.63631606", "0.6353816", "0.63330334", "0.6327288", "0.63230777", "0.6322683", "0.62812686", "0.6268902", "0.626775", "0.62633103", "0.6250108", "0.6244323", "0.62374413", "0.6213656", "0.6211497", "0.62089026", "0.62040555", "0.6202234", "0.6201911", "0.619473", "0.61880296", "0.6187447", "0.6187128", "0.61864406", "0.6153907", "0.6116496", "0.61102873", "0.60883194", "0.60843056", "0.6076593", "0.6070251", "0.6064817", "0.6059615", "0.60579395", "0.6056558", "0.6044209", "0.60383534", "0.6033585", "0.6025832", "0.60243386", "0.60126764", "0.60126764", "0.60122776" ]
0.78919667
3
Statische Funktion put() Setzt ein Cookie Erwartet einen Namen, einen Wert und ein "Verfallsdatum" time() => Aktuelle Zeit
public static function put($name, $value, $expiry) { if(setcookie($name, $value, time() + $expiry, '/')) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_cookie($name,$value,$time_litmit){\n setcookie($name,$value,time() + ($time_litmit * 86400));\n }", "public function set_cookie($name, $value, $time){\t\n\t\t$this->Cookie->write($name, $value, false, $time);\n\n\t}", "public function set()\n {\n setcookie($this->name, $this->value, $this->time);\n\n }", "function cookie($name, $value, $time){\n setCookie($name, $value, $time, \"/\", \"www.cubebomb.com\");\n}", "function set_cookie($name, $value = 'Aceito', $time = null)\n{\n $time = $time != null ? $time : time() + apply_filters('cookie_expiration', 60 * 60 * 24 * 30);\n $value = base64_encode(json_encode(stripslashes_deep($value)));\n $expiration = apply_filters('cookie_expiration_time', $time);\n\n $_COOKIE[$name] = $value;\n setcookie($name, $value, $expiration, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, false);\n}", "function cookie($nom, $valeur) \n{\n return setcookie($nom, $valeur, time() + (86400*30), '/', getDomain());\n}", "public function set_cookie()\n {\n }", "protected function AddCookie($n,$v,$s) { setcookie($n,$v,time()+$s,'/'); }", "function save_cookie($data) {\n //set for ~2 months\n setcookie(Main::getCookieName(), $data, time()+60*60*24*7*8);\n }", "public static function registerCookie($key, $value, $time) {\n\t\t$value = $value . '--' . md5 ( $value . Security_Config::$salt );\n\t\tsetcookie ( $key, $value, $time, '/' );\n\t\treturn;\n\t}", "function mySetcookie($c){\r\n\t\tif($c['sticky'] != 1 AND $c['expires'] <= 0){\r\n\t\t\t$c['expires'] = TIMENOW + $this->vars['sessionLifetime']; //follow session option\r\n\t\t}else{\r\n\t\t\tif($c['sticky'] == 1){\r\n\t\t\t\t$c['expires'] = TIMENOW + 31536000; //365 days\r\n\t\t\t}elseif($c['expires'] > 0){\r\n\t\t\t\t$c['expires'] = TIMENOW + $c['expires'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($c['path'] == ''){\r\n\t\t\t$c['path'] = '/';\r\n\t\t}\r\n\t\tif($c['domain'] == ''){\r\n\t\t\t$c['domain'] == $_SERVER['HTTP_HOST'];\r\n\t\t}\r\n\t\t@setcookie($c['name'], $c['value'], $c['expires'], $c['path'], $c['domain']);\r\n\t}", "function set_cookie($name, $value = '', $expires = 0, $path = '', $domain = '', $secure = false, $http_only = false) {\n header('Set-Cookie: ' . rawurlencode($name) . '=' . rawurlencode($value)\n . (empty($expires) ? '' : '; expires=' . gmdate('D, d-M-Y H:i:s \\\\G\\\\M\\\\T', $expires))\n . (empty($path) ? '' : '; path=' . $path)\n . (empty($domain) ? '' : '; domain=' . $domain)\n . (!$secure ? '' : '; secure')\n . (!$http_only ? '' : '; HttpOnly'), false);\n}", "function setcookie($name, $value, $time, $path, $domain, $secure)\n{\n\t$_SERVER['cookie.stub'][$name] = compact('name', 'value', 'time', 'path', 'domain', 'secure');\n}", "public function put($name, $value)\n\t{\n\t\tsetcookie(\n\t\t\t\"{$this->prefix}$name\",\n\t\t\tjson_encode($value),\n\t\t\ttime() + 157680000, // +5 years\n\t\t\t'/'\n\t\t);\n\t\t\n\t\t$this->cookies[$name] = $value;\n\t\t\n\t\treturn $this;\n\t}", "protected function __setCookie()\n\t{\n\t\t$this->Cookie->type('cipher');\n\t\t$this->Cookie->name = 'Stats';\n\t\t$this->Cookie->time = '90 days';\n\t\t$this->Cookie->path = '/';\n\n\t\t# Dev or production server\n\t\tif (empty($_SERVER['APPLICATION_ENV'])) {\n\t\t\t$domain = get_domain(env('HTTP_HOST'));\n\t\t\t$domain = \"cms.muoriginfree.com\";\n\t\t\t#$domain = '45.117.77.125';\n\t\t} else {\n\t\t\t$domain = env('HTTP_HOST');\n\t\t}\n\t\t$this->Cookie->domain = $domain;\n\t\t\n\t\t$this->Cookie->key = 'quanvh_qSdd%ddId2121232xdddddxqADYhG93b0qyJfIxfs1232guVoUubWwvaniR2G0FgaC9mis*&saX6Owsd121!';\n\t}", "function SaveCookieWord($word, $name)\n{\n setcookie($name, $word, time()+3600*24, \"/\");\n}", "public static function setCookie($name, $value){\n\t\tif( !empty($name) ){\n\t\t\tself::$cookiesToSave[$name] = $value ;\n\t\t}\n\t}", "function setCookieData($pNewData)\n{\n $tData = json_encode([\"ui\" => $pNewData[\"ui\"], \"stats\" => $pNewData[\"stats\"]]);\n setcookie(\"ConwayData\", $tData, time() + (10 * 365 * 24 * 60 * 60));\n}", "public function setCookie($name, $value){\n setcookie($name, $value, time()+86400);\n }", "public static function set($name, $value)\n {\n $domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false;\n setcookie($name, $value, time() + ASTERION_COOKIE_TIME, '/', $domain, false);\n }", "public static function saveCookie(){\n\t\t$expire = time() + Configuration::get(Configuration::APP_COOKIE_TIME) ;\n\t\tforeach( self::$cookiesToSave as $n => $v ){\n\t\t\tsetcookie($n,$v,$expire) ;\n\t\t}\n\t}", "abstract public function setCookie($name , $value = false, $expire = false, $path = false, $domain = false, $secure = false);", "function saveCookie($id){\r\n\tsetcookie(\"r$id\", strval(time()), time()+60*60*24*365);\t\r\n}", "public static function cookieSet($name, $value='', $delete=false) {\r\n\t\t$expires = ($delete) ? time()-86400 : time() + 2678400;\r\n\t\tsetcookie('finefin_'.$name, $value, $expires, '/', NULL);\r\n\t}", "function wpgplus_set_Cookie($my_cookie) {\n\t// cookies which have an expiration date and it is past should not be set\n\tif((!empty($my_cookie->expires)) && ($my_cookie->expires < time())) {\n\t\t//wpgplus_debug(\"\\nNot setting expired cookie for \" . $my_cookie->name . \"\\n\");\n\t\treturn false;\n\t}\n\tif(get_transient('wpgplus_cookie_' . $my_cookie->name)) {\n\t\t//wpgplus_debug(\"\\nUpdating cookie for \" . $my_cookie->name . \"\\n\");\n\t} else {\n\t\t//wpgplus_debug(\"\\nSetting cookie for \" . $my_cookie->name . \"\\n\");\n\t}\n\tset_transient('wpgplus_cookie_'. $my_cookie->name,$my_cookie,60*60);\n}", "public static function set($key, $value){\n\n $expires = time() + (60 * 60 * 24 * 365); // expires after 1 Year\n setcookie($key, $value, $expires, '/', '', false, true);\n return $value;\n\n }", "function settheCookie($name,$val) {\n\n $cookie = $_COOKIE[$name];\n\n if (!$cookie) { \n setcookie ($name, $val); //create cookie\n }\n else {\n setcookie ($name, \"\" , time() - 3600); //delete cookie\n }\n //echo $mycookie;\n}", "function set_cookie($name, $value, $expires = 0) {\n setcookie($name, $value, $expires, \"/\");\n}", "function cjpopups_set_cookie($name, $value='', $expire = 86400, $path='/', $domain='', $secure=false, $httponly=false){\n $_COOKIE[$name] = $value;\n $expire = time() + $expire;\n return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);\n}", "public function test_public_storeCookies_ExpiresFuture() {\n\t// Verify that we have on cookie to start.\n\t$this->assertEquals(1, count($this->object->getCookies($this->serviceUrl_1)));\n\n\t// Send set-cookie header to remove the cookie\n\t$headers = array('Set-Cookie: bob=jones; path=/; expires='.gmdate('D, d-M-Y H:i:s e', time() + 600));\n\t$this->object->storeCookies($this->serviceUrl_1, $headers);\n\n\t$cookies = $this->object->getCookies($this->serviceUrl_1);\n\t$this->assertEquals(2, count($cookies));\n\t$this->assertEquals('jones', $cookies['bob']);\n }", "function setCookies() {\r\n\t\t//cookies are set to 1 month, or 30 days, from now.\r\n\t\tsetcookie(\"phoneNumber\", $this->phone_number, time() + (60 * 60 * 24 * 30));\r\n\t\tsetcookie(\"email\", $this->email, time() + (60 * 60 * 24 * 30));\r\n\t}", "private function updateCookieHeader()\n {\n $strings = [];\n\n foreach ($this->cookies as $key => $value) {\n $strings[] = \"{$key}={$value}\";\n }\n\n $this->setHeader('cookie', implode('; ', $strings));\n }", "protected function setcookie(string $name, string $value, int $expire, string $path, string $domain, bool $secure, bool $httpOnly) {}", "public function format_for_set_cookie()\n {\n }", "public static function setValue($key, $value, $time = null) {\n if (is_null($time)) {\n $expire = 0;\n } else {\n $expire = time() + $time;\n }\n if (!setcookie($key, $value, $expire, '/')) {\n throw new AppException('Cookies disabled! Turn on it please.');\n }\n }", "function setacookiet($value, $expire)\r\n{\r\n\tglobal $cookie_name, $cookie_path, $cookie_domain;\r\n\t$cookie_namet=$cookie_name.\"_terms\";\r\n\tif (version_compare(PHP_VERSION, '5.2.0', '>='))\r\n\t\tsetcookie($cookie_name, $value, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);\r\n\telse\r\n\t\tsetcookie($cookie_name, $value, $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);\r\n}", "private function _write( $name, $value )\n {\n setcookie( us($name), us($value), $this->expire, $this->path, $this->domain, $this->secure, $this->httponly );\n }", "function cookie($key, $value = '')\n{\n if ('' === $value) {\n $res = fnGet($_COOKIE, $key);\n return is_null($res) ? null : unserialize($res);\n }\n if (null === $value) {\n return setcookie($key, $value, time() - 3600, '/');\n }\n return setcookie($key, serialize($value), null, '/');\n}", "private function writeCookieFileCache()\n {\n $timeLive = Carbon::now()->addMinutes(480);\n Cache::put('AuthApiBpmCookie', $this->cookies, $timeLive);\n Log::info('Получены новые куки'.$this->cookies);\n }", "public function setCookie(string $name, string $value, int $expires = 0, string $path = '/', string $domain = '', bool $secure = false, bool $httponly = false): void;", "public function sendHeader()\n\t{\n\t\t# \"Set-Cookie\"\n\t\t$str = 'Set-Cookie: ' . $this->name . '=' . $this->id;\n\n\t\tif (is_string($this->comment))\n\t\t\t$str .= ';comment=' . $this->comment;\n\n\t\tif (is_string($this->domain))\n\t\t\t$str .= ';domain=.' . $this->domain;\n\n\t\tif (! is_null($this->maxage) && $this->maxage >= 0)\n\t\t\t$str .= ';max-age=' . $this->maxage;\n\n\t\tif (is_string($this->path))\n\t\t\t$str .= ';path=' . $this->path;\n\n\t\tif ($this->secure) $str .= ';secure';\n\n\t\t$str .= ';version=1';\n\n\t\t# we can make sure cache files get deleted more efficiently by not\n\t\t# sending \"expires\" info in the cookie\n\t\t# TODO: improve cache deletion efficiency\n\t\tif\n\t\t(\n\t\t\t$this->cookieExpirable\n\t\t\t&& ! is_null($this->expires)\n\t\t\t&& '' != $this->expires\n\t\t)\n\t\t{\n\t\t\t$strDT = gmdate\n\t\t\t(\n\t\t\t\t'D, d-M-Y H:i:s'\n\t\t\t\t, time() + ($this->expires * 60)\n\t\t\t) . ' GMT';\n\n\t\t\t$str .= ';expires=' . $strDT;\n\n\t\t\theader('Expires: ' . $strDT);\n\t\t}\n\n\t\theader($str);\n\n\t\t# \"Cache-Control\"\n\t\tswitch($this->cachectrl)\n\t\t{\n\t\tcase self::CACHECTRL_PROXY_REVALIDATE:\n\t\tcase self::CACHECTRL_MUST_REVALIDATE:\n\t\tcase self::CACHECTRL_PRIVATE:\n\t\tcase self::CACHECTRL_NOCACHE:\n\t\t\theader\n\t\t\t(\n\t\t\t\t'Cache-control: ' . self::$CacheCtrl[$this->cachectrl]\n\t\t\t);\n\t\t\tbreak;\n\t\tcase self::CACHECTRL_NONE:\n\t\tdefault:\n\t\t}\n\t}", "public function save()\n {\n if (headers_sent())\n {\n throw new \\RuntimeException('Cache cookie can not be saved as headers have '\n . 'already been sent to the user agent.');\n }\n\n $headers = headers_list(); // List all headers\n header_remove(); // remove all headers\n $regexp = '/^Set-Cookie\\\\s*:\\\\s*' . preg_quote($this->name) . '=/';\n\n foreach ($headers as $header)\n {\n // Re-add every header except the one for this cookie\n if (!preg_match($regexp, $header))\n {\n header($header, true);\n }\n }\n\n if (!empty($this->content) && count($this->content) > 0)\n {\n if (function_exists('msgpack_pack'))\n {\n $data = msgpack_pack($this->content);\n }\n else\n {\n $data = json_encode($this->content);\n }\n\n // Store expiration time in minutes\n $data = round((time() - $this->start_timestamp + $this->duration*60)/60) . '|' . $data;\n\n $cookie = hash_hmac($this->digest_method, $data, $this->secret) . '|' . $data;\n\n $duration = $this->duration ? time() + $this->duration * 60 : 0;\n\n if (strlen($cookie . $this->path . $duration . $this->domain . $this->name) > 4080)\n {\n throw new \\OverflowException('Cache cookie can not be saved as its size exceeds 4KB.');\n }\n\n setcookie($this->name, $cookie, $duration, $this->path, $this->domain, $this->secure, true);\n $_COOKIE[$this->name] = $cookie;\n }\n else\n {\n setcookie($this->name, '', 1, $this->path, $this->domain, $this->secure, true);\n unset($_COOKIE[$this->name]);\n }\n\n return true;\n }", "public function setHttpCookie(Cookie $cookie): void\n {\n if (self::isAllowedCookie($cookie->name)) {\n $expireDate = date(\"D, d-m-Y H:i:s\", time() + $cookie->duration) . ' GMT';\n Http::header(\"Set-Cookie: {$cookie->name}={$cookie->value}; Expires={$expireDate};\");\n }\n return;\n }", "public function setCookie($key, $value)\n\t{\t\t\n\t\t$_COOKIE[$key] = $this->aes->encrypt(serialize($value));\n\t}", "function saveKartFromCookie()\r\n {\r\n try {\r\n $this->mKart->setKart();\r\n }catch(Exception $e){\r\n $this->error->throwException('311', 'No s`ha pogut guardar la compra.', $e);\r\n }\r\n }", "function cookie($name = null, $value = null, $time = 86400, $path = '/', $domain = null, $secure = false, $httpOnly = true)\n {\n /**\n * @var $cookie \\Very\\Cookie\\CookieJar\n */\n $cookie = app('cookie');\n\n if (is_null($name)) {\n return $cookie;\n }\n\n return $cookie->set($name, $value, $time, $path, $domain);\n }", "public function expires_at ($time) {\n\t\t// session cookies should be set with null instead of 0\n\t\tif (empty($time)) {\n\t\t\t$time = null;\n\t\t}\n\n\t\t$this->expires = $time;\n\t}", "public function cookie($name);", "function setcookie($name, $value, $expire = 0, $path = null,\n $domain = null, $secure = false, $httponly = false\n) {\n MockHttp::$cookies[] = [\n 'name' => $name,\n 'value' => $value,\n 'expire' => $expire,\n 'path' => $path,\n 'domain' => $domain,\n 'secure' => $secure,\n 'httponly' => $httponly,\n ];\n}", "public static function put($name, $value, $expiry){\n\t\tif(setcookie($name, $value, time() + $expiry, '/')){\t\t// Set the cookie and pass the parameters, time plus expirey is set in seconds and the path at the end.\n\t\t\treturn true;\t\t\t\t\t\t\t\t\t\t\t// If cookie works return true.\n\t\t}\n\t\treturn false;\t\t\t\t\t\t\t\t\t\t\t\t// Otherwise return false.\n\t}", "public function add(Cookie $cookie);", "function setcookies()\n\t{\n\t\tfor($x=0; $x<count($this->headers); $x++)\n\t\t{\n\t\tif(preg_match('/^set-cookie:[\\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match))\n\t\t\t$this->cookies[$match[1]] = urldecode($match[2]);\n\t\t}\n\t}", "function set_cookie($name, $value, $days = 30) {\n $expiretime = time() + (86400 * $days);\n setcookie(APP_ID . $name, $value, $expiretime, \"/\");\n}", "function make_cookie($name, $value) {\nsetcookie($name, $value, time() + 60 * 24 *24 * 30, \"/\");\n}", "protected static function _set_cookie()\n\t{\n\t\t/** @var Cookie::$salt string */\n\t\tCookie::$salt = Config::get('cookie.salt');\n\n\t\t/** @var Cookie::$expiration string */\n\t\tCookie::$expiration = Config::get('cookie.lifetime');\n\t}", "public function set($key, $value)\n {\n setcookie($key, serialize($value));\n }", "public function set($key, $value)\n {\n setcookie($key, serialize($value));\n }", "public static function set($cookieItem, $value, $minutes = 720){\n $cookieItem = self::makeCookeName($cookieItem);\n $expiresAt = Carbon::now()->addMinutes($minutes);\n Cache::put($cookieItem, $value, $expiresAt);\n }", "public function add()\n {\n if (!headers_sent()) {\n // Set the cookie via PHP headers\n $added = setcookie(\n $this->name,\n $this->value,\n round(time() + 60 * 60 * 24 * $this->lifetime),\n $this->path,\n $this->host\n );\n } else {\n //Headers have been sent use JavaScript to set the cookie\n echo \"<script>\";\n echo '\n function setCookie(c_name,value,expiredays){\n var exdate=new Date();\n exdate.setDate(exdate.getDate()+expiredays);\n document.cookie=c_name+ \"=\" +escape(value)+((expiredays==null) ? \"\" : \"; expires=\"+exdate.toUTCString()) + \"; domain=\"+ escape(\"' . $this->host . '\") + \"; path=\" + escape(\"' . $this->path . '\");\n }\n ';\n echo \"setCookie('{$this->name}','{$this->value}',{$this->lifetime})\";\n echo \"</script>\";\n $added = true;\n }\n\n return $added;\n }", "public function keep($name,$value,$expire=null) {\n if ($expire!==null) {\n $expire = time()+1; //default\n } else {\n $expire = time() + $expire;\n }\n setcookie($name, $value, $expire);\n \n }", "function set_login_cookies($id,$token,$empresa){\n setcookie('Activo',\"True\",time()+3600,'','','',TRUE);\n setcookie('Id',$id,time()+3600,'','','',TRUE);\n setcookie('token',$token,time()+3600,'','','',TRUE);\n setcookie('empresa',isset($empresa)?$empresa:0,time()+3600,'','','',TRUE);\n }", "function addCookie( $cookiename, $cookievalue ) \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE )\techo \"addCookie( $cookiename, $cookievalue ) \\n\";\r\n\t\t$cookie = $cookiename . \"=\" . $cookievalue;\r\n\t\t$this->requestHeaders[\"Cookie\"] = $cookie;\r\n\t}", "public function setUpCookie() {\n\t\t if (ini_get(\"session.use_cookies\")) {\n\t\t \t$this->time=time()+$this->prp['lifetime'];\n\t\t\t$t=new DateTime();\n\t\t\t$t->setTimestamp($this->time);\n\t\t\t$f=$t->format('c');\n\t\t\t$this->trz[]=\"Expire at {$f}\";\n\t\t\t$params= session_get_cookie_params();\n\t\t\tforeach($this->prp['params'] as $p=>$v) $params[$p]=$v;\n\t\t\tif(0) singleton::show($params,\"Cookie params before set:\");\n\t\t\t // This set the cookie for the next call\n setcookie(session_name(), session_id(),\n \t\t$this->time,\n $params[\"path\"], $params[\"domain\"],\n $params[\"secure\"], $params[\"httponly\"]\n );\n }\n\t\telse die( 'session cookies disabled');\n\t}", "public function setAddresstoCookie($places)\n {\n Mage::getModel('core/cookie')->set('places', serialize($places));\n }", "public static function set_cookie($nome, $valor) {\n setcookie($nome, $valor);\n }", "function cookieSetter()\n{\n $rng = rand(0, 1);\n \n //Hvis cookien er satt og den er lik control: ikke gjør noe\n if (isset($_COOKIE[\"stylesheet\"]) && $_COOKIE[\"stylesheet\"] === \"control\") {\n\n return;\n\n //Hvis cookien er satt og den er lik variation: ikke gjør noe\n } else if (isset($_COOKIE[\"stylesheet\"]) && $_COOKIE[\"stylesheet\"] === \"variation\") {\n\n return;\n\n //Hvis cookien ikke er satt og randomNumber er 0: sett cookie til control\n } else if (!isset($_COOKIE[\"stylesheet\"]) && $rng === 0) {\n\n oneHourCookie(\"stylesheet\", \"control\");\n header(\"Refresh:0\");\n exit;\n\n //Hvis cookien ikke er satt og randomNumber er 1: sett cookie til variation\n } else if (!isset($_COOKIE[\"stylesheet\"]) && $rng === 1) {\n\n oneHourCookie(\"stylesheet\", \"variation\");\n header(\"Refresh:0\");\n exit;\n }\n\n return $rng;\n}", "public static function put($name, $value, $expiry) {\n if (setcookie($name, $value, time() + $expiry, '/')) {\n // if it works return true\n return true;\n }\n return false;\n }", "public function test_public_storeCookies_DontStoreExpiresPast() {\n\t// Verify that we have on cookie to start.\n\t$this->assertEquals(1, count($this->object->getCookies($this->serviceUrl_1)));\n\n\t// Send set-cookie header to remove the cookie\n\t$headers = array('Set-Cookie: bob=jones; path=/; expires='.gmdate('D, d-M-Y H:i:s e', time() - 90000));\n\t$this->object->storeCookies($this->serviceUrl_1, $headers);\n\n\t$cookies = $this->object->getCookies($this->serviceUrl_1);\n\t$this->assertEquals(1, count($cookies));\n\t$this->assertArrayNotHasKey('jones', $cookies);\n }", "public function setCookie($cookie) {\n $this->cookie = $cookie;\n }", "function my_setcookie( $name, $value=\"\", $sticky=1, $expires_x_days=0 )\n {\n\t\t//-----------------------------------------\n\t\t// Check\n\t\t//-----------------------------------------\n\t\t\n if ( $this->no_print_header )\n {\n \treturn;\n }\n \n\t\t//-----------------------------------------\n\t\t// Set vars\n\t\t//-----------------------------------------\n\n if ( $sticky == 1 )\n {\n \t$expires = time() + ( 60*60*24*365 );\n }\n\t\telse if ( $expires_x_days )\n\t\t{\n\t\t\t$expires = time() + ( $expires_x_days * 86400 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$expires = FALSE;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Finish up...\n\t\t//-----------------------------------------\n\t\t\n $this->vars['cookie_domain'] = $this->vars['cookie_domain'] == \"\" ? \"\" : $this->vars['cookie_domain'];\n $this->vars['cookie_path'] = $this->vars['cookie_path'] == \"\" ? \"/\" : $this->vars['cookie_path'];\n \t\n\t\t//-----------------------------------------\n\t\t// Set the cookie\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( in_array( $name, $this->sensitive_cookies ) )\n\t\t{\n\t\t\tif ( PHP_VERSION < 5.2 )\n\t\t\t{\n\t\t\t\tif ( $this->vars['cookie_domain'] )\n\t\t\t\t{\n\t\t\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'], $this->vars['cookie_domain'] . '; HttpOnly' );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'], $this->vars['cookie_domain'], NULL, TRUE );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'], $this->vars['cookie_domain']);\n\t\t}\n }", "function bake($name, $value){\n\tsetcookie($name, $value, 0, '/', 'getnomon.com', isset($_SERVER[\"HTTPS\"]), true);\n}", "public function setCookie($cookie) {\n //TODO: add error control when the cookie array is not valid\n if (isset($cookie[\"expires\"])) {\n $cookie[\"expires\"] = intval($cookie[\"expires\"]) * 1000;\n }\n $cookie['value'] = urlencode($cookie['value']);\n return $this->command('set_cookie', $cookie);\n }", "public function set(Cookie $cookie, $noHttp = false): void\n {\n if (self::isAllowedCookie($cookie->name)) {\n if ($this->viewLogger->requestType !== \"SOCKET\") {\n if (!$noHttp) {\n self::setHttpCookie($cookie);\n }\n }\n $this->viewLogger->cookies[$cookie->name] =\n $GLOBALS[\"_COOKIE\"][$cookie->name] =\n $_COOKIE[$cookie->name] =\n $cookie->value;\n }\n return;\n }", "protected function saveDate()\n\t{\n\t\t$this->year = FilterSingleton::number($_POST['year']);\n\t\t$this->month = FilterSingleton::number($_POST['month']); \n\n\t\tif($this->year !== 0 && $this->month !== 0){\n\t\t\tsetcookie(\"date\", json_encode([$this->year, $this->month]), time()+3600, '/');\n\t\t}\n\t\telse {\n\t\t\tif( isset($_COOKIE['date']) ){\n\t\t\t\t$date = json_decode($_COOKIE['date'], true);\n\t\t\t\t$this->year = $date[0];\n\t\t\t\t$this->month = $date[1];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->year = getdate()['year'];\n\t\t\t\t$this->month = getdate()['mon'];\n\t\t\t}\n\t\t}\n\t}", "public function testSendMethodSetsProperValuesOnCookie()\n\t{\n\t\t$_SERVER['cookie.stub'] = array();\n\t\t$_SERVER['function.headers_sent'] = false;\n\n\t\tCookie::send();\n\t\t$this->assertTrue(count($_SERVER['cookie.stub']) == 0);\n\n\t\tCookie::put('foo', 'bar', 20, 'path', 'domain', false);\n\t\tCookie::send();\n\t\t$this->assertTrue(count($_SERVER['cookie.stub']) == 1);\n\t\t$this->assertEquals('foo', $_SERVER['cookie.stub']['foo']['name']);\n\t\t$this->assertEquals(Cookie::sign('foo', 'bar'), $_SERVER['cookie.stub']['foo']['value']);\n\t\t$this->assertEquals('path', $_SERVER['cookie.stub']['foo']['path']);\n\t\t$this->assertEquals('domain', $_SERVER['cookie.stub']['foo']['domain']);\n\t\t$this->assertEquals((time() + (20 * 60)), $_SERVER['cookie.stub']['foo']['time']);\n\t\t$this->assertFalse($_SERVER['cookie.stub']['foo']['secure']);\n\n\t\tCookie::put('bar', 'baz', 0);\n\t\tCookie::send();\n\t\t$this->assertEquals(0, $_SERVER['cookie.stub']['bar']['time']);\n\t}", "static function prihlas_na_pretek($ID,$ID_pouz,$kat,$poz){\r\n $db = napoj_db();\r\n $sql =<<<EOF\r\n INSERT INTO PRIHLASENY (\r\n ID_POUZ,ID_PRET,KAT,POZNAMKA)\r\n VALUES (\"$ID_pouz\",\"$ID\",\"$kat\",\"$poz\");\r\nEOF;\r\n setcookie('kat_pretekar'.$ID_pouz, $kat, time() + (86400 * 366),\"/\");\r\n $ret = $db->exec($sql);\r\n if(!$ret){\r\n echo $db->lastErrorMsg();\r\n } \r\n $db->close();\r\n}", "function set_user_cookie($args){\n\t\t\t\t//$ip =$this->get_client_ip();\n\t\t\t\t$cookie_name = 'evors_'.$args['email'].'_'.$args['e_id'].'_'.$args['repeat_interval'];\n\t\t\t\t$cookie_value = 'rsvped';\n\t\t\t\tsetcookie($cookie_name, $cookie_value, time() + (86400 * 30), \"/\");\n\t\t\t}", "public function setCookie($name, $value=null)\n {\n if (is_array($name)) {\n $this->_cookie = $name;\n } else {\n $this->_cookie[$name] = $value;\n }\n }", "function save_cookie($id, $type)\n\t{\n\t\t$cookiedata = $this->get_cookie_data();\n\t\t//mysql_query(\"INSERT INTO main.cookies (id, type, cookie_data) VALUES ('$id','$type','\".mysql_real_escape_string($this->get_cookie_data()).\"') ON DUPLICATE KEY UPDATE cookie_data='\".mysql_real_escape_string($this->get_cookie_data()).\"'\");\n\t\tif($type =='aol')\n\t\t{\n\t\t\tmysql_query(\"INSERT INTO main.cookies (id, type, cookie_data) VALUES ('$id','$type','\".mysql_real_escape_string($cookiedata).\"') ON DUPLICATE KEY UPDATE cookie_data='\".mysql_real_escape_string($cookiedata).\"'\") or die(mysql_error());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmysql_query(\"INSERT INTO $type.cookies (id, type, cookie_data) VALUES ('$id','$type','\".mysql_real_escape_string($cookiedata).\"') ON DUPLICATE KEY UPDATE cookie_data='\".mysql_real_escape_string($cookiedata).\"'\") or die(mysql_error());\n\t\t}\n\t}", "function change_total_price_cdek()\n{\n $price = $_POST['price'];\n $name = $_POST['name'];\n $shipping_cost = $price;\n setcookie('shipping_city_cost', $shipping_cost, time() + (86400 * 30), '/');\n setcookie('shipping_name', $name, time() + (86400 * 30), '/');\n echo 'Shipping cost updated : ' . $shipping_cost;\n wp_die();\n}", "public static function put($name, $value, $expiry) {\n\t\t\tif (setcookie($name, $value, time()+$expiry, '/')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function make_cookie($name, $value) {\n\tsetcookie($name, $value, time() + 60 * 60 * 24 * 30, \"/\");\n}", "public function cookie($name, $value, $options = Array()) {\n\t\t\tif($value === null) // Delete the cookie, sets the expire header to 1st January 1970 12:00:01 am\n\t\t\t\t$options[\"expires\"] = 1;\n\t\t\tif(isset($options[\"time\"])) // Set expires, where time is how long the cookie will last until deleted\n\t\t\t\t$options[\"expires\"] = time() - (int)$options[\"time\"];\n\t\t\t\n\t\t\t// Create the cookie header\n\t\t\t// setcookie(): $name, $value, $expires_in_seconds, $path, $host, $https_only, $disallow_javascript\n\t\t\tsetcookie($name, is_string($value) ? $value : \"\", isset($options[\"expires\"]) ? $options[\"expires\"] : 0,\n\t\t\t\tisset($options[\"path\"]) ? $options[\"path\"] : $this->application->configuration([ \"path\" ]),\n\t\t\t\tisset($options[\"host\"]) ? $options[\"host\"] : $this->application->configuration([ \"host\" ]),\n\t\t\t\tisset($options[\"secure\"]) ? $options[\"secure\"] : false, isset($options[\"http\"]) ? $options[\"http\"] : false\n\t\t\t);\n\t\t}", "public function set($key,$value) {\n if($this->isLoggedIn()) {\n $bag = $_SESSION['bag'];\n $_SESSION['bag'][$key] = $value;\n // There's only a cookie if Remember Me is on.\n if(isset($_COOKIE) && array_key_exists($this->_cookieName,$_COOKIE)) {\n $cookieHash = $_COOKIE[$this->_cookieName];\n $cookieHash = preg_replace(\"/[^A-Za-z0-9]/\", '', $cookieHash);\n $this->writeCookieData($cookieHash);\n }\n }\n }", "public function test_public_storeCookies_RemoveViaExpiresPast() {\n\t// Verify that we have on cookie to start.\n\t$this->assertEquals(1, count($this->object->getCookies($this->serviceUrl_1)));\n\n\t// Send set-cookie header to remove the cookie\n\t$headers = array('Set-Cookie: SID=k1jut1r1bqrumpei837kk4jks0; path=/; expires=Fri, 31-Dec-2009 23:59:59 GMT');\n\t$this->object->storeCookies($this->serviceUrl_1, $headers);\n\n\t$this->assertEquals(0, count($this->object->getCookies($this->serviceUrl_1)));\n }", "public static function send()\n {\n foreach (static::$jar as $cookie) {\n setcookie($cookie['name'], $cookie['value'], $cookie['expiration'], $cookie['path'], $cookie['domain'],\n $cookie['secure'], true);\n }\n }", "public function setCookie($index, $value = null)\n {\n if (is_array($index)) {\n foreach ($index as $key => $cookie) {\n $this->cookies[$key] = $cookie;\n }\n } else {\n $this->cookies[$index] = $value;\n }\n }", "public static function setCookie ($name, $value, $path = '/') {\n\n $cookie_time = self::getCookiePersistentSecs(); \n $timestamp = time() + $cookie_time; \n $session_host = conf::getMainIni('session_host');\n \n // secure session\n $session_secure = conf::getMainIni('session_secure');\n if ($session_secure) { \n $secure = true;\n } else {\n $secure = false;\n } \n setcookie($name, $value, $timestamp, $path, $session_host, $secure);\n }", "public function isCookieSet() {}", "public function store()\n {\n return response('200')->cookie(\n 'cookie-popup',\n 'checked',\n time() + (365 * 24 * 60 * 60)\n );\n }", "function ffd_setcookie( $name, $value, $expire = 0, $secure = false ) {\r\n\tif ( ! headers_sent() ) {\r\n\t\tsetcookie( $name, $value, $expire, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, $secure, apply_filters( 'ffd_cookie_httponly', false, $name, $value, $expire, $secure ) );\r\n\t} elseif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {\r\n\t\theaders_sent( $file, $line );\r\n\t\ttrigger_error( \"{$name} cookie cannot be set - headers already sent by {$file} on line {$line}\", E_USER_NOTICE ); // @codingStandardsIgnoreLine\r\n\t}\r\n}", "function setCryostemTokenCookie() {\n\n $current_time = time();\n if(isset($_SESSION['cryostemToken']) && !empty($_SESSION['cryostemToken'])) {\n\n $token = $_SESSION['cryostemToken']->access_token;\n $expires = $current_time + $_SESSION['cryostemToken']->expires_in -100;\n setcookie('cryostemToken', $token, $expires, COOKIEPATH, COOKIE_DOMAIN);\n\n } else {\n unset($_COOKIE['cryostemToken']);\n setcookie(\"cryostemToken\", \"\", $current_time-3600);\n }\n}", "function _setCookies($user) {\n setcookie(\"user\", $user, time()+3600);\n }", "function setObjectCookie($CookieName, $obj) {\n\t$_SESSION[$CookieName] = Encode(serialize($obj));\n}", "public static function apbct_cookie__set ($name, $value = '', $expires = 0, $path = '', $domain = null, $secure = false, $httponly = false, $samesite = 'Lax' ) {\n\n // For PHP 7.3+ and above\n if( version_compare( phpversion(), '7.3.0', '>=' ) ){\n\n $params = array(\n 'expires' => $expires,\n 'path' => $path,\n 'domain' => $domain,\n 'secure' => $secure,\n 'httponly' => $httponly,\n );\n\n if($samesite)\n $params['samesite'] = $samesite;\n\n setcookie( $name, $value, $params );\n\n // For PHP 5.6 - 7.2\n }else {\n setcookie( $name, $value, $expires, $path, $domain, $secure, $httponly );\n }\n\n }", "function doCookies() {\r\n setcookie(\"cli_num\", 123456789, time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_fname\", $_POST['first_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_lname\", $_POST['last_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_dob\", $_POST['dob'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_email\", $_POST['email'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_phone\", $_POST['phone'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_add\", $_POST['address'], time() + (86400 * 1), \"/\");\r\n \r\n /* //print the cookies\r\n echo \"Value is: \" . $_COOKIE[\"cli_num\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_fname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_lname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_dob\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_email\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_phone\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_add\"];*/\r\n \r\n}", "function wp_setcookie($username, $password = '', $already_md5 = \\false, $home = '', $siteurl = '', $remember = \\false)\n {\n }", "public function save($name, $value = NULL, $expire = 1440)\r\n {\r\n // No given value, the user is requesting the cookie value.\r\n if( is_null($value) ):\r\n $this->_cookie = ( (isset($_COOKIE[$name]) ) ? $_COOKIE[$name] : NULL);\r\n\r\n return $this->_cookie;\r\n endif;\r\n $expire = time() + ($expire * 60); // Excfre will passed in minutes, so multiply by 60 seconds.\r\n setcookie($name, $value, $expire); // Define Cookie.\r\n }", "public function salva($nome,$contenuto,$durata_ore=24){\n\t\t$Ndate=new Ndate();\n\t\tsetcookie($nome,$contenuto,time()+$Ndate->oretosecondi($durata));\n\t\treturn NULL;\n\t}", "public function set($name, $value, $expiration = 0, $path = \"\", $domain= \"\", $secure = false,\n $httponly = false) {\n if ($expiration === 0) {\n $this->cookies_update_array[$name] = ['value' => $value, 'expiration' => 0,\n 'delete' => false, 'path' => $path, 'domain' => $domain, 'secure' => $secure, 'httponly' => $httponly];\n } else {\n $this->cookies_update_array[$name] = ['value' => $value, 'expiration' => time() + $expiration,\n 'delete' => false, 'path' => $path, 'domain' => $domain, 'secure' => $secure, 'httponly' => $httponly];\n }\n }" ]
[ "0.71335995", "0.7104699", "0.70262897", "0.7018606", "0.6975085", "0.6890146", "0.6666254", "0.6640133", "0.6557634", "0.65494275", "0.65339243", "0.6504949", "0.6431816", "0.6430758", "0.63897866", "0.63622516", "0.6349736", "0.6347316", "0.63260436", "0.62987655", "0.6291979", "0.62884885", "0.62660515", "0.6240416", "0.6220642", "0.62066525", "0.620106", "0.61988485", "0.61879426", "0.61684865", "0.6161528", "0.61454415", "0.6137842", "0.61323905", "0.6132387", "0.612117", "0.6117659", "0.61123604", "0.61052036", "0.6091806", "0.6063682", "0.60583043", "0.59957075", "0.5992018", "0.5971373", "0.59711295", "0.5967565", "0.5966905", "0.5966267", "0.59638584", "0.5963294", "0.5952666", "0.59524053", "0.5951923", "0.59431803", "0.5941227", "0.5941227", "0.59215194", "0.5921312", "0.59175634", "0.5891659", "0.58772856", "0.58766514", "0.5876122", "0.5874595", "0.5868266", "0.58611554", "0.58392316", "0.5811095", "0.580768", "0.579444", "0.5776133", "0.5775068", "0.5773662", "0.5771528", "0.57631725", "0.57436377", "0.57362854", "0.5733305", "0.57221836", "0.5709039", "0.5703602", "0.569849", "0.56983966", "0.56971705", "0.56935525", "0.5682447", "0.56687236", "0.56678027", "0.5662177", "0.5653329", "0.56513035", "0.5648297", "0.56473726", "0.5643249", "0.5630195", "0.5629985", "0.5629307", "0.5626941", "0.56214476" ]
0.56974506
84
$xfindex = GetInt2d(, 4);
public function isDate( $spos ) { $xfindex = ord( $this->data[ $spos + 4 ] ) | ord( $this->data[ $spos + 5 ] ) << 8; //echo 'check is date '.$xfindex.' '.$this->formatRecords['xfrecords'][$xfindex]['type']."\n"; //var_dump($this->formatRecords['xfrecords'][$xfindex]); if ( $this->formatRecords['xfrecords'][ $xfindex ]['type'] === 'date' ) { $this->curFormat = $this->formatRecords['xfrecords'][ $xfindex ]['format']; $this->recType = 'date'; return true; } if ( $this->formatRecords['xfrecords'][ $xfindex ]['type'] === 'number' ) { $this->curFormat = $this->formatRecords['xfrecords'][ $xfindex ]['format']; $this->recType = 'number'; if ( ( $xfindex === 0x9 ) || ( $xfindex === 0xa ) ) { $this->multiplier = 100; } } else { $this->curFormat = $this->defaultFormat; $this->recType = 'unknown'; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getXfIndex()\n\t{\n\t\treturn $this->_xfIndex;\n\t}", "public function getXfIndex()\n\t{\n\t\treturn $this->_xfIndex;\n\t}", "function getIndex() ;", "function get(array &$grid, int $rowIndex, int $columnIndex): int {//tiene\n \n return $grid[$rowIndex][$columnIndex]; \n}", "function getOffset() ;", "function getInd4ANum() {$args = func_get_args(); return call_user_func_array('getInd4Num', $args);}", "public function getValue(int $indexX, int $indexY): int;", "function get_i($i = 0)\n {\n }", "public function getX(): int;", "function findPoint($px, $py, $qx, $qy) {\n return array(2*$qx - $px,2*$qy - $py);\n}", "function fiftyone_degrees_get_numeric_node_index($node, $index, $headers) {\n $_fiftyone_degrees_data_file = fiftyone_degrees_get_data_file(\n $node['node_numeric_children_offset']\n + ($index * (2 + 4)));\n\n return array(\n 'value' => fiftyone_degrees_read_short($_fiftyone_degrees_data_file),\n 'related_node_index' => fiftyone_degrees_read_int($_fiftyone_degrees_data_file),\n );\n}", "public function getInt($i);", "function pos($array)\n{\n}", "function fiftyone_degrees_get_profile_offset_id_from_index($index, $headers) {\n $_fiftyone_degrees_data_file = fiftyone_degrees_get_data_file(\n $headers['profile_offsets_offset'] + ($index * 8));\n $profile_offset = array();\n $profile_offset['profile_id'] = fiftyone_degrees_read_int(\n $_fiftyone_degrees_data_file);\n $profile_offset['offset'] = fiftyone_degrees_read_int(\n $_fiftyone_degrees_data_file) + $headers['profile_offset'];\n\n return $profile_offset;\n}", "function base32Index($p) {\r\n\tglobal $base32;\r\n\tfor ($i = 0; $i < 32; $i++) {\r\n\t\t\r\n\t\t//echo $base32[$i];\r\n\t\tif ($p == $base32[$i]) {\r\n\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\treturn $i;\r\n\t}", "public function getOffset(): int;", "public function func_refindex() {}", "public function _readint($f)\r\n {\r\n\t $a=unpack('Ni',self::_readstream($f,4));\r\n\t return $a['i'];\r\n }", "public function getArgument($index);", "public function getDrawNumber();", "function getMatrixX() {\n // width\n return 15;\n }", "public function CoordinateToNum($x, $y){\n \treturn (($y * 8) + $x);\n }", "function fiftyone_degrees_get_node_index($node, $index, $headers) {\n $offset = $node['node_indexs_offset'] + ($index * (1 + 4 + 4));\n $_fiftyone_degrees_data_file = fiftyone_degrees_get_data_file($offset);\n\n return array(\n 'is_string' =>\n fiftyone_degrees_read_bool($_fiftyone_degrees_data_file),\n 'value' =>\n fiftyone_degrees_read_int($_fiftyone_degrees_data_file),\n 'related_node_index' =>\n fiftyone_degrees_read_int($_fiftyone_degrees_data_file),\n );\n}", "function _freadint($f)\n\t\t{\n\t\t\t$i=ord(fread($f,1))<<24;\n\t\t\t$i+=ord(fread($f,1))<<16;\n\t\t\t$i+=ord(fread($f,1))<<8;\n\t\t\t$i+=ord(fread($f,1));\n\t\t\treturn $i;\n\t\t}", "public function getPosX();", "function x($i) {\n if ($i < 0)\n return 4294967296 - $i;\n else\n return $i;\n }", "function fiftyone_degrees_get_numeric_node_indexs($node, $headers) {\n $_fiftyone_degrees_data_file = fiftyone_degrees_get_data_file(\n $node['node_numeric_children_offset']);\n\n $indexs = array();\n $bytes = fread($_fiftyone_degrees_data_file, 6 * $node['numeric_children_count']);\n $byte_count = strlen($bytes);\n for ($i = 0; $i < $byte_count; $i += 6) {\n $a = ord($bytes[$i]);\n $b = ord($bytes[$i + 1]);\n $c = ord($bytes[$i + 2]);\n $d = ord($bytes[$i + 3]);\n $e = ord($bytes[$i + 4]);\n $f = ord($bytes[$i + 5]);\n\n $value = $a + ($b << 8);\n $related = $c + ($d << 8) + ($e << 16) + ($f << 24);\n $indexs[] = array(\n 'value' => $value,\n 'related_node_offset' => $related);\n }\n\n // for ($i = 0; $i < $node['numeric_children_count']; $i++) {\n // $indexs[] = array(\n // 'value' => fiftyone_degrees_read_short($_fiftyone_degrees_data_file),\n // 'related_node_offset' => fiftyone_degrees_read_int($_fiftyone_degrees_data_file),\n // );\n // }\n return $indexs;\n}", "public function getFunctionPosition();", "public static function posInts()\n {\n return self::ints()->fmap(function ($x) {\n return abs($x);\n });\n }", "function getIndexOfRegistry($registryNumber, $array) {\n $i = 0;\n\t$index = -1;\n\tfor ($i = 0; $i < sizeof($array); $i++) {\n\t\tif ($array[$i][0] == $registryNumber) {\n\t\t\t$index = $i;\n\t\t\tbreak;\n\t\t}\n\t} \n\treturn $index;\n}", "function getX() {\n $pt = $this->getFirstPoint();\n if ( empty($pt) ) return FALSE;\n \n $poslist = $pt->getPosList();\n $cs = explode(' ',$poslist);\n return $cs[1];\n }", "function getMiiInfoIndex($index){\n return $this->miiInfo[$index];\n }", "function getPosition() ;", "public function getX();", "function element_size_data_array_index($size){\n\tif ( $size == \"\" or $size == 100 ) return 0;\n\telse if ( $size == 75 ) return 1;\n\telse if ( $size == 50 ) return 2;\n\telse if ( $size == 25 ) return 3;\n}", "public function getPos();", "public function getPos();", "public function getSuperscriptXOffset() {}", "function imagepsfreefont($font_index)\n{\n}", "public function x() {\n return $this->coords[0];\n }", "public function getIFFT() {\n\t\treturn $this->w1i;\n\t}", "function getRow($arr, $y){\n\treturn $arr[$y];\n}", "public function getSubscriptXOffset() {}", "function calculateIDX(){\r\n\t\t$out=array(-1,-1,-1);\r\n\t\t$out[0]=number_format($this->_calcScoreIndex(),2,'.','');\r\n\t\t$out[1]=number_format($this->_calcCheckIndex(),2,'.','');\r\n\t\t// only sum up if both values are positive , else just scoreIDX\r\n\t\tif ($out[0]>0){\r\n\t\t\t$out[2]=$out[0];\r\n\t\t\tif ($out[1]>0){$out[2]=$out[2]+$out[1];}\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "public function getPositionXL()\n {\n // Scrutinizer thinks the following could return string. It is wrong.\n return array_search($this->position, self::POSITION_XLREF);\n }", "public function getIdx()\n {\n return $this->get(self::_IDX);\n }", "function getCoords(){\n\tglobal $conn;\n\t$numargs = func_num_args();\n\t/* all foi */\n\tif ($numargs == 0){\n\t\t$result= pg_query($conn,\"SELECT ST_X(geom), ST_Y(geom) FROM feature_of_interest\");\n\t\treturn pg_fetch_all($result);\n\t}\n\t/* one foi */\n\telse\n\t{\n\t\t$foi_id = func_get_arg(0);\n\t\t$result = pg_query($conn,\"SELECT ST_X(geom), ST_Y(geom) \n\t\t\t\tFROM feature_of_interest \n\t\t\t\tWHERE feature_of_interest_id = '$foi_id' \");\n\t\treturn pg_fetch_all($result);\n\t}\n}", "protected function map($index) // -> int\n\t{\n\t\t$r = $index;\n\t\t\n\t\tif( (null !== $index) && is_integer($index))\n\t\t{\n\t\t\t$r = $index + $this->start;\n\t\t\t$size = $this->data->getSize();\n\t\t\t\n\t\t\tif($r >= $size)\n\t\t\t{\n\t\t\t\t$r -= $size;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $r;\n\t}", "public function getPosX($c)\n {\n $x = $this->getWidthOfBorder();\n\n # Beim 1. Feld brauchen wir sonst keinen Abstand\n if($c == 1)\n {\n $x += 0;\n }\n if($c >= 2)\n {\n $x += $this->getFieldsWidthBrutto() * ($c-1);\n }\n if($c >= 3)\n {\n $x += 12;\n }\n if($c >= 5)\n {\n $x += 12;\n }\n\n # Offset left zu x dazu\n $x += $this->getFieldsOffsetLeft();\n\n # Richtiger X Wert wird zurückgegeben\n return $x;\n }", "public function getBits(): int;", "function ST_index($ST_key) {\n\t$this->ST_head = $this->ST_indexR($this->ST_head, $ST_key, 0);\n\treturn $this->ST_val;\n\t}", "public function getUserSpaceXY($x, $y) {}", "public function getUserSpaceXY($x, $y) {}", "function Make16bitNESoffset($target)\n{\n // This is Castlevania II -specific.\n if($target < 0x1C000)\n return 0x8000 + ($target % PAGE_SIZE);\n return 0xC000 + ($target % PAGE_SIZE);\n}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "function sadev_btGetFuncIndex($backtrace,$funcname){\n\tforeach($backtrace as $key=>$bt){\n\t\tif(isset($bt['function']) and $bt['function'] == $funcname){\n\t\t\treturn $key;\n\t\t}\n\t}\n}", "public function getOffset($value);", "function get_index($i, $j, $blocks = 3, $elems = 3) {\n\t$bits = [\n\t\t($j % $elems), // across within block (across elems)\n\t\t((int) floor($j / $elems) * $blocks * $elems), // down within block (down elems)\n\t\t(($i % $blocks) * $elems), // across blocks\n\t\t((int) floor($i / $blocks) * $blocks * $elems * $elems), // down blocks\n ];\n\n\treturn array_sum($bits);\n}", "public function testWideOriginPoint()\n {\n $point = $this->grid100x50->pointToGridIndex(1, 1);\n $this->assertEquals(0, $point);\n }", "function offsetGet(/*. mixed .*/ $offset){}", "function swfRead_u32($data, &$offset) {\n return ord($data[$offset++]) + ord($data[$offset++]) * 0x100 +\n ord($data[$offset++]) * 0x10000 + ord($data[$offset++]) * 0x1000000;\n}", "public function getFloat($i);", "public function getX(){ return $this->_x; }", "function sa_array_index($ary,$idx){\n if( isset($ary) and isset($idx) and isset($ary[$idx]) ) return $ary[$idx];\n}", "function gvcode_to_gvindex($gvcode) {\n\t// preprocess the code arg\n\tswitch (strlen(trim($gvcode))) {\n\t\tcase 0:\n\t\t\t$code = \"o\";\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$code = strtolower($gvcode);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$code = strtolower($gvcode[0]);\n\t}\n\t// convert to an integer type code\n\tswitch ($code) {\n\t\tcase n: // N (1) - number\n\t\t\t$output = 1;\n\t\t\tbreak;\n\t\tcase b: // B (2) - boolean\n\t\t\t$output = 2;\n\t\t\tbreak;\n\t\tcase d: // D (3) - date\n\t\t\t$output = 3;\n\t\t\tbreak;\n\t\tcase t: // T (4) - timeofday\n\t\t\t$output = 4;\n\t\t\tbreak;\n\t\tcase a: // A (5) - datetime\n\t\t\t$output = 5;\n\t\t\tbreak;\n\t\tcase s: // S (6) - string\n\t\t\t$output = 6;\n\t\t\tbreak;\n\t\tcase o: // note everything else returns a 0 - use the default mapping\n\t\tdefault:\n\t\t\t$output = 0;\n\t}\n\treturn $output;\n}", "function int_to_dword($n)\r\n\t{\r\n\t\treturn chr($n & 255).chr(($n >> 8) & 255).chr(($n >> 16) & 255).chr(($n >> 24) & 255);\r\n\t}", "public function getX() { return $this->_x; }", "abstract protected function getIndex();", "public function getSegCountX2() {}", "public function getBackgroundColorIndex()\n {\n if ($this->logicalScreenDescriptor) {\n $index = substr($this->logicalScreenDescriptor, 5, 1);\n $index = unpack('C', $index)[1];\n\n return $index;\n }\n\n return 0;\n }", "function getFoiID($lat, $long){\n\tglobal $conn;\n\tif (isset ($lat) AND isset($long)){\n\t\t\t$result = pg_query($conn,\"SELECT feature_of_interest_id \n\t\t\t\t\tFROM feature_of_interest \n\t\t\t\t\tWHERE ST_X(geom) = '$lat' AND ST_Y(geom) = '$long'\");\n\t\t\treturn pg_fetch_all($result);\n\t}\n}", "function readInt2(): int {\n return \\unpack('v', $this->read(2))[1];\n }", "public function getOffset();", "public function getOffset();", "public function getOffset();", "public function getElementDim(): int\n {\n return $this->col2;\n }", "function get_stdygd($stdyid){\r\n\r\n}", "public function getX()\n\t{\n\t\treturn $this->x;\n\t}", "public function getX()\n\t{\n\t\treturn $this->x;\n\t}", "function extractByIndex($p_index)\n {\n }", "public static function getWindowPosition() : \\raylib\\Vector2 {}", "public function getPO1IndexOf($index){\n\n\t\tif (gettype ($index)!=\"integer\"||$index>15) {\n\t\t\tthrow new Exception(\"PO1IndexOf wrong index; index: \".$index);\n\t\t}\n\t\treturn $this->getValueOfIndex($index);\n\t\t\n\t}", "static private function selectIndex($dataCodeWordsCount, $rectangular){\n if (($dataCodeWordsCount<1 || $dataCodeWordsCount>1558) && !$rectangular) return -1;\n if (($dataCodeWordsCount<1 || $dataCodeWordsCount>49) && $rectangular) return -1;\n \n $n = $rectangular ? 24 : 0;\n \n while (self::$dataCWCount[$n] < $dataCodeWordsCount) $n++;\n return $n;\n }", "function hoge(int $x)\n{\n}", "public function getAt(int $x, int $y): float {\n return $this->array[$x][$y];\n }", "public function getIndexedField() : int\n {\n return $this->indexedField;\n }", "private function getJPEGSegmentSize(&$f, $pos)\r\n\t{\r\n\t\t$arr = unpack('nint', substr($f, $pos + 2, 2)); // segment size has offset 2 and length 2B\r\n\t\treturn $arr['int'];\r\n\t}", "function get_color($image,$i,$iMax,$palette){\n $rgb = get_RGB($i,$iMax,$palette) ;\n $color = imagecolorexact($image,$rgb[0],$rgb[1],$rgb[2]) ;\n if($color==-1){\n $color = imagecolorallocate($image,$rgb[0],$rgb[1],$rgb[2]) ;\n if($color == -1){\n $color = imagecolorclosest($image,$rgb[0],$rgb[1],$rgb[2]) ;\n }\n }\n return $color;\n}", "function usp_ews_find_color_index($index){\n\t\t\n\t$result = array();\n\t$index = $index/2;\n\tif($index <= EWS_DEFAULT_UNSATISFACTORY_INDEX){\n\t\t$color = get_string('notAttempted_colour', 'block_usp_ews');\n\t\t$coloractual = get_string('red', 'block_usp_ews');\n\t}else if($index >= EWS_DEFAULT_SATISFACTORY_INDEX){\n\t\t$color = get_string('attempted_colour', 'block_usp_ews');\n\t\t$coloractual = get_string('green', 'block_usp_ews');\n\t}else{\n\t\t$color = get_string('amber_colour', 'block_usp_ews');\n\t\t$coloractual = get_string('orange', 'block_usp_ews');\n\t}\n\t\n\t$result['color'] = $color;\n\t$result['coloractual'] = $coloractual;\n\t\n\treturn $result;\n\n}", "public function getX()\r\n {\r\n //retourne la valeur saisie x\r\n return $this->x;\r\n }", "function e4fn( $x ) {\r\n #$con;\r\n #$com;\r\n $con = 1.0 + $x;\r\n $com = 1.0 - $x;\r\n return (sqrt( (pow( $con, $con )) * (pow( $com, $com )) ));\r\n}", "function getfactoryIndex()\n\t{\n\t\t$vendorQry = db(\"select * from factories where name = '$this->factory' limit 1\");\n\t\t$this->factoryIndex = $vendorQry[\"tableIndex\"];\n\t\treturn $vendorQry[\"tableIndex\"];\n\t}", "public function getStartIndex();", "public static function getIndex(): int\n {\n return static::$index;\n }", "public function getIndexToLocFormat() {}", "function _getsortby($idx) {\n\tswitch ((int)$idx) {\n\t\tcase 1:\t$idx = 6; break;\n\t\tcase 3:\t$idx = 2; break;\n\t\tcase 4:\t$idx = 3; break;\n\t\tcase 5:\t$idx = 12; break;\n\t\tcase 6:\t$idx = 8; break;\n\t\tcase 7:\t$idx = 9; break;\n\t\tcase 10:\t$idx = 4; break;\n\t\tcase 11:\t$idx = 5; break;\n\t\tdefault: $idx = 6;\n\t}\n\treturn $idx;\n}", "function getX() {\n return $this->x;\n }" ]
[ "0.65891254", "0.65891254", "0.59749633", "0.5793282", "0.5650978", "0.5567238", "0.54772544", "0.5410716", "0.53787327", "0.5365788", "0.5331215", "0.5219962", "0.51785445", "0.5172556", "0.51567656", "0.5146453", "0.5136343", "0.50381577", "0.5033912", "0.50274825", "0.50016105", "0.49894178", "0.49869892", "0.497922", "0.4972809", "0.49491096", "0.4928743", "0.4927457", "0.492655", "0.49243516", "0.4919908", "0.49165878", "0.49131092", "0.49128348", "0.4907058", "0.48781726", "0.48781726", "0.48562303", "0.48354518", "0.48236826", "0.48183405", "0.4814405", "0.4799642", "0.4798857", "0.4795739", "0.4786587", "0.47818264", "0.4771594", "0.47638252", "0.47632313", "0.47584516", "0.4747647", "0.47466224", "0.47456327", "0.47444123", "0.47444123", "0.47444123", "0.47444123", "0.47444123", "0.47438967", "0.47424215", "0.47300074", "0.4728692", "0.47266793", "0.47019124", "0.46992958", "0.4695645", "0.46949673", "0.46840113", "0.46822944", "0.467575", "0.46684992", "0.46675557", "0.46672526", "0.4666582", "0.46663815", "0.46613452", "0.46613452", "0.46613452", "0.46611997", "0.46562886", "0.46533427", "0.46533427", "0.46516353", "0.4650113", "0.46481645", "0.4645264", "0.46443105", "0.46399623", "0.46381336", "0.4631057", "0.46297616", "0.4620088", "0.46189967", "0.46120998", "0.46119708", "0.4606942", "0.46044144", "0.46003157", "0.4599786", "0.45997417" ]
0.0
-1
Convert the raw Excel date into a human readable format Dates in Excel are stored as number of seconds from an epoch. On Windows, the epoch is 30/12/1899 and on Mac it's 01/01/1904
public function createDate( $numValue ) { if ( $numValue > 1 ) { $utcDays = $numValue - ( $this->nineteenFour ? self::UTCOFFSETDAYS1904 : self::UTCOFFSETDAYS ); $utcValue = round( ( $utcDays + 1 ) * self::MSINADAY ); $string = $this->datetimeFormat ? gmdate( $this->datetimeFormat, $utcValue ) : gmdate( $this->curFormat, $utcValue ); $raw = $utcValue; } else { $raw = $numValue; $hours = floor( $numValue * 24 ); /** @noinspection SummerTimeUnsafeTimeManipulationInspection */ $mins = floor( $numValue * 24 * 60 ) - $hours * 60; $secs = floor( $numValue * self::MSINADAY ) - $hours * 60 * 60 - $mins * 60; $ts = mktime( $hours, $mins, $secs ); $string = $this->datetimeFormat ? gmdate( $this->datetimeFormat, $ts ) : gmdate( $this->curFormat, $ts ); } return array( $string, $raw ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function excel_date($serial){\n //from http://richardlynch.blogspot.com/2007/07/php-microsoft-excel-reader-and-serial.html\n // Excel/Lotus 123 have a bug with 29-02-1900. 1900 is not a\n // leap year, but Excel/Lotus 123 think it is...\n if ($serial == 60) {\n $day = 29;\n $month = 2;\n $year = 1900;\n \n return sprintf('%02d/%02d/%04d', $month, $day, $year);\n }\n else if ($serial < 60) {\n // Because of the 29-02-1900 bug, any serial date \n // under 60 is one off... Compensate.\n $serial++;\n }\n \n // Modified Julian to DMY calculation with an addition of 2415019\n $l = $serial + 68569 + 2415019;\n $n = floor(( 4 * $l ) / 146097);\n $l = $l - floor(( 146097 * $n + 3 ) / 4);\n $i = floor(( 4000 * ( $l + 1 ) ) / 1461001);\n $l = $l - floor(( 1461 * $i ) / 4) + 31;\n $j = floor(( 80 * $l ) / 2447);\n $day = $l - floor(( 2447 * $j ) / 80);\n $l = floor($j / 11);\n $month = $j + 2 - ( 12 * $l );\n $year = 100 * ( $n - 49 ) + $i + $l;\n return sprintf('%04d-%02d-%02d', $year, $month, $day);\n }", "function epochToDate($epoch,$format){\n /*\n @epoch = 1483228800;\n $format= Y,m,d,j,n,H,i,s\n */\n $dt = new DateTime(\"@$epoch\");\n $convert= $dt->format($format);\n return $convert;\n}", "protected function dateFromExcelDate($excelDate) {\n $timestamp = ($excelDate - 25569) * 86400;\n return new \\DateTime(\"@$timestamp\");\n }", "function dateExcelFormat ( $w ) {\n\t$w=explode(\"-\",$w);\n\t$y= $w[0];\n\t$m= $w[1];\n\t$d= $w[2];\n\treturn \"$m/$d/$y\";\n}", "function unixstamp_to_human( $unix=0 )\n {\n \t$offset = $this->get_time_offset();\n \t$tmp = gmdate( 'j,n,Y,G,i', $unix + $offset );\n \t\n \tlist( $day, $month, $year, $hour, $min ) = explode( ',', $tmp );\n \n \treturn array( 'day' => $day,\n \t\t\t\t 'month' => $month,\n \t\t\t\t 'year' => $year,\n \t\t\t\t 'hour' => $hour,\n \t\t\t\t 'minute' => $min );\n }", "public static function getHumanReadableDate( $iEpoch = NULL )\n {\n if( ( $iEpoch === NULL ) ||\n ( ! is_int( $iEpoch ) ) )\n {\n return FALSE;\n }\n \n return date( 'Y/n/j', $iEpoch );\n }", "function gttn_tpps_xlsx_translate_date($date) {\n if (strtotime($date) !== FALSE) {\n return $date;\n }\n\n if ($date > 60) {\n $date = $date - 1;\n return date(\"m/d/Y\", strtotime(\"12/31/1899 +$date days\"));\n }\n if ($date < 60) {\n return date(\"m/d/Y\", strtotime(\"12/31/1899 +$date days\"));\n }\n\n return NULL;\n}", "public static function convertUnixToReadableFormat($val)\n {\n\n// Grab the milliseconds as the initial value mod 1000\n $milliseconds = $val % 1000;\n\n// Divide by 1000 to obtain the actual timestamp\n $ts = intval($val / 1000);\n\n// Parse into a DateTime object\n $date = DateTime::createFromFormat('U', $ts);\n\n// Formatted output\n return $date->format('D, d M Y H:i:s');\n }", "function human_date($date) {\n if (empty($date)) {\n return \"Null date\";\n }\n if (is_numeric($date)) {\n $unix_date = $date;\n } else {\n $unix_date = strtotime($date);\n }\n // check validity of date\n if (empty($unix_date)) {\n return \"Bad date\";\n }\n return date(\"jS F, Y\", $unix_date);\n}", "function exibirDataBr($data){\n\t$timestamp = strtotime($data); \n\treturn date('d/m/y', $timestamp);\t\n}", "function dialogue_get_humanfriendly_dates($epoch) {\n $customdatetime = array();\n\n $timediff = time() - $epoch;\n $datetime = usergetdate($epoch);\n\n $periods = array(\n 31536000 => 'year',\n 2592000 => 'month',\n 604800 => 'week',\n 86400 => 'day',\n 3600 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n $customdatetime['timepast'] = get_string('now');\n foreach ($periods as $unit => $text) {\n if ($timediff < $unit) {\n continue;\n }\n $numberofunits = floor($timediff / $unit);\n $customdatetime['timepast'] = $numberofunits . ' ' . (($numberofunits > 1) ?\n new lang_string($text . 's', 'dialogue') :\n new lang_string($text, 'dialogue'));\n break; // Leave on first, this will be largest unit.\n }\n\n $customdatetime['datefull'] = $datetime['mday'] . ' ' . $datetime['month'] . ' ' . $datetime['year'];\n $customdatetime['dateshort'] = $datetime['mday'] . ' ' . $datetime['month'];\n\n $customdatetime['time'] = userdate($epoch, get_string('strftimetime', 'langconfig'));\n $customdatetime['today'] = ($epoch >= strtotime(\"today\")) ? true : false;\n $customdatetime['currentyear'] = ($epoch >= strtotime(\"-1 year\")) ? true : false;\n\n return $customdatetime;\n}", "function human_datetime($date) {\n if (empty($date)) {\n return \"Null date\";\n }\n if (is_numeric($date)) {\n $unix_date = $date;\n } else {\n $unix_date = strtotime($date);\n }\n // check validity of date\n if (empty($unix_date)) {\n return \"Bad date\";\n }\n return date(\"jS F, Y h:i:s\", $unix_date);\n}", "function convertTimestamp($ugly){\n $date = new DateTime($ugly);\n return $date->format('l, F jS, Y');\n}", "function convert_date( $uglydate ){\n\t$date = new DateTime( $uglydate );\n\treturn $nicedate = $date->format('F j, Y');\n}", "function safestrtotime($strInput)\n /* \n Takes a date between 1900 and 1969 and converts it to a usable,\n negative UNIX time stamp. doesn't work on pre-1900 dates.\n\n http://nosheep.net/story/php-strtotime-limitation/\n */\n\n{\n $iVal = -1;\n for ($i=1900; $i<=1969; $i++)\n {\n // Check for this year string in date\n $strYear = (string)$i;\n if (!(strpos($strInput, $strYear)===false))\n\t{\n\t $replYear = $strYear;\n\t $yearSkew = 1970 - $i;\n\t $strInput = str_replace($strYear, '1970', $strInput);\n\t}\n }\n $iVal = strtotime($strInput);\n if ($yearSkew> 0)\n {\n $numSecs = (60 * 60 * 24 * 365 * $yearSkew);\n $iVal = $iVal - $numSecs;\n $numLeapYears = 0; // determine number of leap years in period\n for ($j=$replYear; $j<=1969; $j++)\n\t{\n\t $thisYear = $j;\n\t $isLeapYear = false;\n\t // Is div by 4?\n\t if (($thisYear % 4) == 0)\n\t {\n\t $isLeapYear = true;\n\t }\n\t // Is div by 100?\n\t if (($thisYear % 100) == 0)\n\t {\n\t $isLeapYear = false;\n\t }\n\t // Is div by 1000?\n\t if (($thisYear % 1000) == 0)\n\t {\n\t $isLeapYear = true;\n\t }\n if ($isLeapYear == true)\n {\n\t$numLeapYears++;\n }\n\t}\n $iVal = $iVal - (60 * 60 * 24 * $numLeapYears);\n }\n return $iVal;\n}", "function tep_date_long($raw_date) {\n if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;\n\n $year = (int)substr($raw_date, 0, 4);\n $month = (int)substr($raw_date, 5, 2);\n $day = (int)substr($raw_date, 8, 2);\n $hour = (int)substr($raw_date, 11, 2);\n $minute = (int)substr($raw_date, 14, 2);\n $second = (int)substr($raw_date, 17, 2);\n\n return strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));\n }", "public function getDatetimeFormat() : string\n\t{\n\t\treturn 'epoch';\n\t}", "function dateToCal($timestamp) {\nreturn date('Ymd\\THis', $timestamp);\n}", "public function getDateFormatted()\n\t{\n\t\t$dateKey = self::arrayKeyExistsNc('date', $this->dimensions);\n\t\t$date = $this->dimensions[$dateKey];\n\n\t\tif ($date == '00000000') {\n\t\t\t$date = '19000101';\n\t\t}\n\n\t\t$hour = '00';\n\t\tif ($hourKey = self::arrayKeyExistsNc('hour', $this->dimensions)) {\n\t\t\t$hour = $this->dimensions[$hourKey];\n\t\t}\n\t\t$result = substr($date, 0, 4) . '-' . substr($date, 4, 2) . '-' . substr($date, 6, 2) . ' ' . $hour . ':00:00';\n\n\t\treturn $result;\n\t}", "function datum_nu2() {\n //\n\t\t\t$datestring \t\t\t\t= \"%Y-%m-%d\" ; \n\t\t\t$time \t\t\t\t\t\t= time();\t\t\t\n\t\t\treturn mdate($datestring, $time);\n\t}", "function convert_time($value)\n\t{\n\t\t$dateLargeInt=$value; // nano secondes depuis 1601 !!!!\n\t\t$secsAfterADEpoch = $dateLargeInt / (10000000); // secondes depuis le 1 jan 1601\n\t\t$ADToUnixConvertor=((1970-1601) * 365.242190) * 86400; // UNIX start date - AD start date * jours * secondes\n\t\t$unixTimeStamp=intval($secsAfterADEpoch-$ADToUnixConvertor); // Unix time stamp\n\t\treturn $unixTimeStamp;\n\t}", "function _getFormattedTimestamp()\n {\n return gmdate(\"Y-m-d\\TH:i:s.\\\\0\\\\0\\\\0\\\\Z\", time());\n }", "function exibirDataHoraBr($data){\n\t$timestamp = strtotime($data); \n\treturn date('d/m/y - H:i:s', $timestamp);\t\n}", "public function getDateFormated(){\n\t\treturn date(\"d/m/Y à\\s H:i\", strtotime($this->data));\n\t}", "function WindowsTime2UnixTime($WindowsTime) {\n\t$UnixTime = $WindowsTime / 10000000 - 11644473600;\n\treturn $UnxiTime; \n}", "public static function convertQuickformDateToUnixTimestamp(array $value) {\n\n\t\t/*\n\t\t D = Short names of days\n\t\t l = Long names of days\n\t\t d = Day numbers\n\t\t M = Short names of months\n\t\t F = Long names of months\n\t\t m = Month numbers\n\t\t Y = Four digit year\n\t\t h = 12 hour format\n\t\t H = 23 hour format\n\t\t i = Minutes\n\t\t s = Seconds\n\t\t a = am/pm\n\t\t A = AM/PM\n\n\t\t see: http://midnighthax.com/quickform.php\n\n\t\t */\n\t\t$day = max($value['D'], $value['l'], $value['d'], 1);\n\t\t$month = max($value['M'], $value['F'], $value['m'], 1);\n\t\t$year = $value['Y'];\n\t\t// TODO: support other formats\n\n\t\tif (empty($day) || empty($month) || empty($year)) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn mktime(0, 0, 0, $month, $day, $year);\n\t\t}\n\t}", "function readTimestamp(): int;", "function convDate($theDate) {\r\n return date(\"Y-m-d H:i:s\", strtotime($theDate));\r\n}", "public function convertDateToUnix()\n {\n if (!is_numeric($this->rent_available_date) && $this->rent_available_date != '') {\n $this->rent_available_date = strtotime($this->rent_available_date);\n }\n }", "function _unix_timestamp($date) { return strtotime($date); }", "function ExibeData($data){\n\t\treturn date(\"d/m/Y\", strtotime($data));\n\t}", "private function ical_date_to_unix($ical_date)\n\t{\n\t$ical_date = preg_replace(['/T/', '/Z/'], '', $ical_date); // remove T and Z from strig\n\n\tif (preg_match('/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{0,2})([0-9]{0,2})([0-9]{0,2})/', $ical_date, $date))\n\t{\n\n\t\tif ($date[1] <= 1970)\n\t\t{\n\t\t$date[1] = 1971; // FIXME UNIX timestamps can't deal with pre 1970 dates\n\t\t}\n\n\t\treturn mktime((int) $date[4], (int) $date[5], (int) $date[6], (int) $date[2], (int) $date[3], (int) $date[1]);\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n\t}", "function conv_date($date)\n\t{\n\t\t$arr = explode(' ', $date);\n\t\t$y = $arr[2];\n\t\t$m = $this->convert_month_name('Eng-Num', str_replace(',','',$arr[0]));\n\t\t$d = $arr[1];\n\t\t\n\t\treturn $y.'-'.$m.'-'.$d; // output : 1986-1-24\n\t}", "function dateToGoodFormat($date){\n\t\t$toTest = explode(\"/\",$date);\n\t\t$jj = intval($toTest[0]);\n\t\t$mm = intval($toTest[1]);\n\t\t$aaaa = intval($toTest[2]);\n\t\treturn ($aaaa.\"-\".$mm.\"-\".$jj);\n\t}", "function human_time($date) {\n if (empty($date)) {\n return \"Null date\";\n }\n if (is_numeric($date)) {\n $unix_date = $date;\n } else {\n $unix_date = strtotime($date);\n }\n // check validity of date\n if (empty($unix_date)) {\n return \"Bad date\";\n }\n return date(\"h:i:s\", $unix_date);\n}", "function oos_date_raw($date, $reverse = false) {\n if ($reverse) {\n return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);\n } else {\n return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);\n }\n }", "function str2date($in){\n\n\t$t = split(\"/\",$in);\n\n\tif (count($t)!=3) return -1;\n\n\tif (!is_numeric($t[0])) return -1;\n\tif (!is_numeric($t[1])) return -2;\n\tif (!is_numeric($t[2])) return -3;\n\n\tif ($t[2]<1902 || $t[2]>2037) return -3;\n\n\treturn mktime (0,0,0, $t[1], $t[0], $t[2]);\n}", "function wp_exif_date2ts($str)\n {\n }", "public function getSmartDate()\r\n {\r\n $now = Date::now();\r\n\r\n //other year\r\n if ($this->year != $now->year)\r\n {\r\n return $this->getValue(self::MASK_DATE_USER);\r\n }\r\n //today\r\n else if ($this->isToday())\r\n {\r\n if ($this->getHour() == 0 && $this->getMinute() == 0 && $this->getSecond())\r\n {\r\n return 'Hoje'; //$this->getValue( self::MASK_DATE_USER );\r\n }\r\n\r\n return $this->getValue(self::MASK_HOUR);\r\n }\r\n //other day\r\n else\r\n {\r\n $date = $this->strftime('%d %b');\r\n $search = array('01', '02', '03', '04', '05', '06', '07', '08', '09');\r\n $replace = array('1', '2', '3', '4', '5', '6', '7', '8', '9');\r\n\r\n return self::correctMonthNames(str_replace($search, $replace, $date));\r\n }\r\n }", "private function getTimestamp()\n {\n $originalTime = microtime(true);\n $micro = sprintf(\"%06d\", ($originalTime - floor($originalTime)) * 1000000);\n $date = new DateTime(date('Y-m-d H:i:s.'.$micro, $originalTime));\n\n return $date->format($this->config['dateFormat']);\n }", "function DateStrToInt ($s, $h,$n,$z) {\n\tGlobal $iTimeType;\n\t\n\t$y = (int)substr($s, 0, 4);\t\t// year\n\t$m = (int)substr($s, 5, 2);\t\t// month\n\t$d = (int)substr($s, 8, 2);\t\t// day\n\t\n\tif ($m < 1) $m = 1;\n\tif (12 < $m) $m = 12;\n\tif ($d < 1) $d = 1;\n\tif (31 < $d) $d = 31;\n\tif ($h < 0) $h = 0;\n\tif (23 < $h) $h = 23;\n\tif ($n < 0) $n = 0;\n\tif (59 < $n) $n = 59;\n\t\n\tif ($iTimeType == 1) {\n\t\tif ($y < 1970) $y = 1970;\n\t\tif (2037 < $y) $y = 2037;\n\t\tif ($z < 0) $z = 0;\n\t\tif (59 < $z) $z = 59;\n\t\treturn mktime($h,$n,$z,$m,$d,$y);\n\t}\n\t\n\t$y -= 2000;\n\tif ($y < 0) $y = 0;\n\tif (213 < $y) $y = 213;\n\treturn $y*10000000+(50+$m*50+$d)*10000 + ($h*100) + $n;\n}", "function WindowsTime2DateTime($WindowsTime) {\n\t$UnixTime = $WindowsTime / 10000000 - 11644473600;\n\treturn date('Y-m-d H:i:s', $UnixTime); \n}", "function unix2DosTime($unixtime = 0) {\n $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);\n\n if ($timearray['year'] < 1980) {\n $timearray['year'] = 1980;\n $timearray['mon'] = 1;\n $timearray['mday'] = 1;\n $timearray['hours'] = 0;\n $timearray['minutes'] = 0;\n $timearray['seconds'] = 0;\n } // end if\n\n return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) |\n ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);\n }", "public static function RFCDate() {\n\t $tz = date('Z');\n\t $tzs = ($tz < 0) ? '-' : '+';\n\t $tz = abs($tz);\n\t $tz = (int)($tz/3600)*100 + ($tz%3600)/60;\n\t $result = sprintf(\"%s %s%04d\", date('D, j M Y H:i:s'), $tzs, $tz);\n\t\n\t return $result;\n\t}", "function convertTbsDate($tbsDate){\r\n \t//regex to extract timestamp\r\n\t\tpreg_match(\r\n\t\t\t'/(?:Date\\()([0-9]+)(?:\\+|\\-)/',\r\n\t\t $tbsDate, \r\n\t\t $matches\r\n\t );\r\n\t // grab the capture group \r\n\t $epochTimeInMilliseconds = $matches[1];\r\n \t// regex to extract time zone: not needed currently\r\n\t //convert milliseconds to seconds\r\n\t\t$timestamp = round($epochTimeInMilliseconds / 1000);\r\n \ttry {\r\n\t\t $dateTime = new DateTime('@' . $timestamp);\r\n\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'Conversion of a TBS date failed.\r\n\t\t\t\t\tTBS date: %s\r\n\t\t\t\t\tException: %s',\r\n\t\t\t\t\t$tbsDate,\r\n\t\t\t\t\t$e->getMessage()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t exit('An error has occured converting a TBS date. Please see the TBS API log file for more details.');\r\n\t\t}\r\n\t\treturn $dateTime->format('Y-m-d');\r\n }", "function _unix2DOSTime($unixtime = null) \n {\n $timearray = (is_null($unixtime)) ? getdate() : getdate($unixtime);\n if ($timearray['year'] < 1980) {\n $timearray['year'] = 1980;\n $timearray['mon'] = 1;\n $timearray['mday'] = 1;\n $timearray['hours'] = 0;\n $timearray['minutes'] = 0;\n $timearray['seconds'] = 0;\n }\n return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);\n }", "function unix_time_to_win_time($unix_time) {\n $win_time = ($unix_time + 11644477200) * 10000000;\n return $win_time;\n }", "public function to_s() {\n $format = \"%04d-%02d-%02d\";\n\n return sprintf($format, $this->year, $this->month, $this->day);\n }", "public function readDate()\n {\n $dateReference = $this->readInteger();\n\n $refObj = $this->getReferenceObject($dateReference);\n if($refObj !== false)\n return $refObj;\n\n //$timestamp = floor($this->_stream->readDouble() / 1000);\n $timestamp = new DateTime();\n $timestamp->setTimestamp(floor($this->_stream->readDouble() / 1000));\n\n $this->_referenceObjects[] = $timestamp;\n\n return $timestamp;\n }", "private function convert($date, $validation_format) {\n $format = DateTimeFormat::getRedcapFormat($validation_format);\n $converted = '';\n switch ($format) {\n case DateTimeFormat::TIME:\n $converted = $date->format(DateTimeFormat::TIME);\n break;\n case DateTimeFormat::DATE:\n case DateTimeFormat::DATE_MDY:\n case DateTimeFormat::DATE_DMY:\n $converted = $date->format(DateTimeFormat::DATE);\n break;\n case DateTimeFormat::DATETIME:\n case DateTimeFormat::DATETIME_MDY:\n case DateTimeFormat::DATETIME_DMY:\n $converted = $date->format(DateTimeFormat::DATETIME);\n break;\n case DateTimeFormat::DATETIME_SECONDS:\n case DateTimeFormat::DATETIME_SECONDS_MDY:\n case DateTimeFormat::DATETIME_SECONDS_DMY:\n $converted = $date->format(DateTimeFormat::DATETIME_SECONDS);\n break;\n default:\n break;\n }\n return $converted;\n }", "public function convert_ldap_to_epoch($ldap_date=false) {\n if(empty($ldap_date)) return 0;\n $years_from_1601_to_1970 = 1970 - 1601;\n $days_from_1601_to_1970 = $years_from_1601_to_1970 * 365;\n $days_from_1601_to_1970 += ($years_from_1601_to_1970 / 4); // leap years\n $days_from_1601_to_1970 -= 3; // non-leap centuries (1700,1800,1900). 2000 is a leap century\n $seconds_from_1601_to_1970 = $days_from_1601_to_1970 * 24 * 60 * 60;\n $total_seconds_since_1601 = ($ldap_date / 10000000);\n $total_seconds_since_1970 = $total_seconds_since_1601 - $seconds_from_1601_to_1970;\n \n return $total_seconds_since_1970;\n }", "function olc_date_short($raw_date) {\n\tif ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == EMPTY_STRING) ) return false;\n\n\t$year = substr($raw_date, 0, 4);\n\t$month = (int)substr($raw_date, 5, 2);\n\t$day = (int)substr($raw_date, 8, 2);\n\t$hour = (int)substr($raw_date, 11, 2);\n\t$minute = (int)substr($raw_date, 14, 2);\n\t$second = (int)substr($raw_date, 17, 2);\n\n\tif (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {\n\t\treturn date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));\n\t} else {\n\t\treturn ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));\n\t}\n\n}", "function conv_date_unix($date = NULL, $format = 'Y-m-d')\n{\n\t$pdate = date_parse_from_format($format, $date);\n\t\n\t// make sure date is valid\n\tif (checkdate($pdate['month'], $pdate['day'], $pdate['year']))\n\t{\n\t\treturn mktime($pdate['hour'], $pdate['minute'], $pdate['second'], $pdate['month'], $pdate['day'], $pdate['year']);\n\t}\n\telse // bad date, return false\n\t{\n\t\treturn false;\n\t}\n}", "function human_readable_datetime($date, $format)\n{\n return date_format($date, $format);\n}", "function tep_date_short($raw_date) {\n if ( ($raw_date == '0000-00-00 00:00:00') || empty($raw_date) ) return false;\n\n $year = substr($raw_date, 0, 4);\n $month = (int)substr($raw_date, 5, 2);\n $day = (int)substr($raw_date, 8, 2);\n $hour = (int)substr($raw_date, 11, 2);\n $minute = (int)substr($raw_date, 14, 2);\n $second = (int)substr($raw_date, 17, 2);\n\n if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {\n return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));\n } else {\n return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));\n }\n }", "function _convert_to_unix_timestamp($timestamp)\n\t{\n\t\tlist($time, $date) = explode('.', $timestamp);\n\t\t\n\t\t// breakdown time\n\t\t$hour = substr($time, 0, 2);\n\t\t$minute = substr($time, 2, 2);\n\t\t$second = substr($time, 4, 2);\n\t\t\n\t\t// breakdown date\n\t\t$day = substr($date, 0, 2);\n\t\t$month = substr($date, 2, 2);\n\t\t$year = substr($date, 4, 2);\n\t\t\n\t\treturn gmmktime($hour, $minute, $second, $month, $day, $year);\n\t}", "function modify_lora_date($time)\n\t{\n\t\t$cdate = strtotime($time);\n\t\t# miliseconds unix time\n\t\tif( $cdate == false ) {\n\t\t\t$militime = DateTime::createFromFormat('U.u', $time/1000);\n\t\t\t$militime->setTimezone(new DateTimeZone(date_default_timezone_get())); \n\t\t\treturn $militime->format(\"Y.m.d H:i:s.u\");\n\t\t}\n\t\treturn Date(\"Y.m.d H:i:s\", $cdate);\n\t}", "function MySQLToEpochTime($DateTime)\n{\n\tlist($Year, $Month, $Day, $Hour, $Minute, $Second)=sscanf($DateTime, \"%04d-%02d-%02d %02d:%02d:%02d\");\n\treturn(gmmktime($Hour, $Minute, $Second, $Month, $Day, $Year));\n}", "function showYMD($timestamp) {\r\n\r\n if ($timestamp < 1)\r\n $rtn = \"\";\r\n if ($timestamp > 10000000000)\r\n $rtn = date(\"Y/m/d (J)\", $timestamp/1000);\r\n else\r\n $rtn = date(\"Y/m/d \", $timestamp);\r\n\r\n return $rtn;\r\n}", "public function testConvertToNumberFormat()\n {\n $test_data = array(\n array('2013-12-23 23:59:59', '20131223235959'),\n array('2013.12.23 23\"59\\'59', '20131223235959'),\n array('2013/12/23 23:59:59', '20131223235959'),\n );\n foreach ($test_data as $data) {\n $result = DateUtility::convertToNumberFormat($data[0]);\n $this->assertEquals($data[1], $result);\n }\n }", "function showDate($timestamp) {\r\n if ($timestamp > 10000000000)\r\n $rtn = date(\"M d Y H:i:s (J)\", $timestamp/1000);\r\n else\r\n $rtn = date(\"M d Y H:i:s \", $timestamp);\r\n\r\n return $rtn;\r\n}", "function convertDate ($matches) {\n\t$year = array_pop($matches['year']); //Get last found year\n\t$year = ($year) ? $year : date('Y'); //If nothing found, use this year\n\t$month = array_pop($matches['month']); //Get last found month\n\t$month = ($month) ? $month : '01'; //If nothing found, use January\n\t$day = array_pop($matches['day']); //Get last found day\n\t$day = ($day) ? $day : '01'; //If nothing found, use 1st\n\t$time = date('U', strtotime($month . '/' . $day . '/' . $year)); //Convert to unix timestamp\n\treturn $time;\n}", "function FIFOToEpochTime($DateTime)\n{\n\tlist($Day, $Month, $Year, $Hour, $Minute, $Second)=sscanf($DateTime, \"%02d/%02d/%04d %02d:%02d:%02d\");\n\treturn(gmmktime($Hour, $Minute, $Second, $Month, $Day, $Year));\n}", "function convertDate($date) {\n\tif ($date == '')\n\t\treturn false;\n\tlist ($d, $m, $Y, $H, $M, $S) = sscanf($date, \"%2d-%2d-%4d %2d:%2d:%2d\");\n\tif (!$H && !$M && !$S)\n\t\treturn strtotime(\"$m/$d/$Y\");\n\telse\n\t\treturn strtotime(\"$m/$d/$Y $H:$M:$S\");\n}", "public function getFormattedTimestamp()\n {\n /** @var \\DateTime $date */\n $date = $this->timestamp;\n\n return $date->format('c');\n }", "function uwwtd_get_MM_DD_YYYY_from_YYYY_MM_DD_XXX($date) {\n $return = '';\n if (!empty($date)) {\n if (strlen($date) > 10) {\n $date = substr($date, 0, 10);\n }\n $dateObj = new DateTime($date);\n $return = $dateObj->format('m/d/Y');\n }\n return $return;\n}", "private static function processInputAsDateString() {\n $unix = strtotime(self::$input);\n\n if ($unix) { \n self::$timestamp = $unix;\n self::setDateFromTimestamp(self::$timestamp);\n } else {\n self::setMessage(\"Sorry. Your input was invalid.\");\n }\n }", "function sc_us_date_format($date){\n\treturn date('m/d/Y', $date);\n}", "function jd_to_unix($jd) {\n\t\t$val=(($jd-UNIX_EPOCH) * SECS_IN_DAY * 1000);\n\t\treturn ( round($val/1000) ) ;\n\t}", "function convertdateanglais($date){\n\t$ladate=explode('-',$date);\n\t$jour=$ladate[2];\n\t$moi=$ladate[1];\n\t$anne=$ladate[0];\n\t$madate=date(\"d/m/Y\", mktime(0, 0, 0, $moi, $jour, $anne));\n\treturn $madate;\n}", "function create_date_value($date) {\n\t\t// Since no calendar is specified, should we always convert to gregorian?\n\t\t$date=$date->convert_to_cal('gregorian');\n\t\treturn\n\t\t\t($date->y==0 ? '????' : $date->Format('Y')) .'-'.\n\t\t\t($date->m==0 ? '??' : $date->Format('m')) .'-'.\n\t\t\t($date->d==0 ? '??' : $date->Format('d'));\n\t}", "function tep_date_raw($date, $reverse = false) {\r\n if ($reverse) {\r\n return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);\r\n } else {\r\n return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);\r\n }\r\n}", "function uwwtd_get_DD_MM_YYYY_from_YYYY_MM_DD_XXX($date) {\n $return = '';\n if (!empty($date)) {\n if (strlen($date) > 10) {\n $date = substr($date, 0, 10);\n }\n $dateObj = new DateTime($date);\n $return = $dateObj->format('d/m/Y');\n }\n return $return;\n}", "function timeStamp()\n {\n return date(\"YmdHis\");\n }", "private function to_zruth_date($date) {\n if (strlen($date) >= 10 && substr($date, 4, 1) == '-' && substr($date, 7, 1) == '-')\n return substr($date, 8, 2) . '-' . substr($date, 5, 2) . '-' . substr($date, 0, 4);\n else\n return $date;\n }", "function NZEntryToDateTime($NZEntry)\n {\n if ($NZEntry == \"\")\n return \"\";\n return substr($NZEntry, 6, 2) . \"/\" . substr($NZEntry, 4, 2) . \"/\" . substr($NZEntry, 0, 4);\n }", "function tep_date_raw($date, $reverse = false) {\n if ($reverse) {\n return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);\n } else {\n return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);\n }\n}", "function iu_readable_date($datetime, $format = 'normal'){\n\t$date = New DateTime($datetime);\n\tif($format == 'normal'){\n\t\t$updatedDate = date_format($date,'F j, Y'); //January 15, 2015\n\t}else if($format == 'short'){\n\t\t$updatedDate = date_format($date,'M j, Y'); // Jan 15, 2015\n\t}else if($format == 'numbered'){\n\t\t$updatedDate = date_format($date,'n/j/y'); // 01/15/15\n\t}\n\t\n\treturn $updatedDate;\n\n}", "private function GetUanicDate(&$s, &$res) {\n $s = $this->substr($s, 0, 8);\t \n\tif ($s && (strlen($s) == 8) && @is_numeric($s)) {\n\t $res = @substr_replace(@substr_replace($s, \"-\", 4,0), \"-\", 7, 0);\n }\n }", "public function fixdate($olddate) {\n return date('Y-m-d', self::date_to_timestamp($olddate));\n }", "function tep_date_raw($date, $reverse = false) {\n if ($reverse) {\n return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);\n } else {\n return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);\n }\n}", "public function format_date($unix_time)\n {\n $retstr = gmdate('j F Y, G:i:s', $unix_time);\n return $retstr;\n }", "public function getDateFormatee() {\n return date('d/m/Y', strtotime($this->date));\n }", "function ConvertDate($mysqlDate)\n {\n if($mysqlDate != \"\")\n return $this->app->String->Convert($mysqlDate,\"%1-%2-%3\",\"%3.%2.%1\");\n }", "function human_date_today()\n{\n /*\n * other options\n *\n$today = date(\"F j, Y, g:i a\"); // March 10, 2001, 5:16 pm\n$today = date(\"m.d.y\"); // 03.10.01\n$today = date(\"j, n, Y\"); // 10, 3, 2001\n$today = date(\"Ymd\"); // 20010310\n$today = date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01\n$today = date('\\i\\t \\i\\s \\t\\h\\e jS \\d\\a\\y.'); // It is the 10th day (10ème jour du mois).\n$today = date(\"D M j G:i:s T Y\"); // Sat Mar 10 17:16:18 MST 2001\n$today = date('H:m:s \\m \\e\\s\\t\\ \\l\\e\\ \\m\\o\\i\\s'); // 17:03:18 m est le mois\n$today = date(\"H:i:s\"); // 17:16:18\n$today = date(\"Y-m-d H:i:s\"); // 2001-03-\n */\n\n return date('l jS F Y');\n}", "function datetime_mysql2unix($str) {\n\tlist($date, $time) = explode(' ', $str);\n\tlist($year, $month, $day) = explode('-', $date);\n\tlist($hour, $minute, $second) = explode(':', $time);\n\n\t$timestamp = mktime((int)$hour, (int)$minute, (int)$second, (int)$month, (int)$day, (int)$year);\n\n\treturn $timestamp;\n}", "function tep_date_raw($date, $reverse = false) {\n if ($reverse) {\n return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);\n } else {\n return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);\n }\n}", "function tep_date_raw($date, $reverse = false) {\n if ($reverse) {\n return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);\n } else {\n return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);\n }\n}", "function datum_nu() {\n\t\t//\n\t\t$datestring \t\t\t\t= \"%d-%m-%Y\" ; \n\t\t$time \t\t\t\t\t\t= time();\t\t\t\n\t\t\n\t\treturn date($datestring, $time);\n\t\t//-----/\n\t}", "function EpochToMySQLTime($Epoch)\n{\n\treturn(gmdate(\"Y-m-d H:i:s\", $Epoch));\n}", "function convert_timestamp($timestamp){ \n $limit=date(\"U\"); \n $limiting=$timestamp-$limit; \n return date (\"Ymd\", mktime (0,0,$limiting)); \n}", "function tep_date_short($raw_date) {\n if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;\n\n $year = substr($raw_date, 0, 4);\n $month = (int)substr($raw_date, 5, 2);\n $day = (int)substr($raw_date, 8, 2);\n $hour = (int)substr($raw_date, 11, 2);\n $minute = (int)substr($raw_date, 14, 2);\n $second = (int)substr($raw_date, 17, 2);\n\n if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {\n return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));\n } else {\n $base_year = tep_is_leap_year($year) ? 2036 : 2037;\n return ereg_replace((string)$base_year, $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $base_year)));\n }\n\n}", "function DateIntToStr ($i) {\n\tGlobal $iTimeType;\n\tif ($iTimeType == 1) return date('Y-m-d H:i:s',$i);\n\t\n\t$n = $i % 100;\n\t$i = (int)($i / 100);\n\t$h = $i % 100;\n\t$i = (int)($i / 100);\n\t$d = $i % 50;\n\t$i = (int)($i / 50);\n\t$m = ($i % 20) -1;\n\t$i = (int)($i / 20);\n\t$y = ($i % 1000) + 2000;\n\treturn sprintf (\"%04d-%02d-%02d %02d:%02d\", $y,$m,$d,$h,$n);\n}", "function trenutnimjesec() {\n //DATE_RFC3339\n //return date(DATE_RFC3339);\n return date(\"F\");\n}", "function fechaDesdeUnix($fecha){\n\t$fecha2 = date('Y-m-d H:i:s', $fecha);\n\treturn $fecha2;\n}", "function format_date($date) {\n return substr($date, 8, 2) . '/' . substr($date, 5, 2) . '/' . substr($date, 0, 4);\n }", "function convertDate($old_date, &$datest)\n {\n list($datesd[0], $datesd[1], $datesd[2], $datesd[3], $datesd[4], $datesd[5], $datesd[6], $datesd[7], \n $datesd[8], $datesd[9]) = sscanf($old_date, \"%s %s %s %s %s %s %s %s %s %s\"); \n\n for ($i = 0; $i < 10; $i++)\n {\n if (strlen($datesd[$i]) > 0)\n {\n $count = sscanf($datesd[$i], \"%d/%d/%d\", $month_digit, $day_digit, $year_digit);\n if ($count == 3) \n {\n $temp_date = strtotime(\"$month_digit/$day_digit/$year_digit\");\n if ($temp_date == FALSE)\n {\n /* If it didn't convert, give up and return FALSE. */\n $datest[0] = $old_date;\n for ($j = 1; $j < 10; $j++) $datest[$j] = \"\";\n return;\n }\n else\n {\n /* If it converted to a valid date, then append it to the list of dates already parsed. */\n $datest[$i] = date(\"l, F j, Y\", $temp_date);\n }\n }\n else\n {\n /* It didn't convert, so give up and return FALSE. */\n $datest[0] = $old_date;\n for ($j = 1; $j < 10; $j++) $datest[$j] = \"\";\n return;\n }\n }\n }\n return;\n }", "function standard_date_time2($date) {\n\t$timestamp = strtotime($date);\n\t$fdate=date('d M, Y h:i A', $timestamp);\n\treturn $fdate;\n\t}", "function dateToTimestamp($date){\n\t$dia=substr($date,0,2);\n\t$mes=substr($date,3,2);\n\t$ano=substr($date, 6,4);\t\n\t\n\t$timestamp= mktime(0,0,0,$mes,$dia,$ano);\n\treturn $timestamp;\n }", "function utime2timestamp($string2format) {\n \t\treturn date(\"YmdHis\",$string2format);\n \t}", "public function convertDate($date)\n {\n global $lng;\n \n return ilDatePresentation::formatDate(new ilDateTime($date,IL_CAL_DATETIME));\n }" ]
[ "0.63701296", "0.6099899", "0.5604137", "0.5603164", "0.55994314", "0.55975837", "0.55807817", "0.5516448", "0.55128634", "0.5381836", "0.5371094", "0.5353226", "0.53366977", "0.53205943", "0.5320477", "0.5311208", "0.5291564", "0.5283503", "0.5269034", "0.5261382", "0.5245057", "0.52223045", "0.5203599", "0.5179917", "0.5176024", "0.5163174", "0.51584893", "0.51496196", "0.5136102", "0.511727", "0.5103145", "0.5101828", "0.5096486", "0.5080521", "0.5073538", "0.50725734", "0.5068006", "0.5064273", "0.50554794", "0.50287557", "0.5010932", "0.50081176", "0.5008091", "0.49987212", "0.49895847", "0.49832147", "0.4964018", "0.4952435", "0.49450958", "0.4940316", "0.49376673", "0.49372092", "0.4936965", "0.49358082", "0.49290544", "0.49106735", "0.48861668", "0.4871006", "0.48700088", "0.48680922", "0.4868045", "0.48602054", "0.485548", "0.48467195", "0.48275146", "0.48086944", "0.4799963", "0.4795758", "0.47952473", "0.47950712", "0.47914127", "0.47905782", "0.47865778", "0.47848368", "0.47836816", "0.47817424", "0.4776033", "0.4773674", "0.47729412", "0.47724894", "0.47723165", "0.4769868", "0.47682324", "0.47666377", "0.47635666", "0.4762964", "0.47613493", "0.47613493", "0.4743413", "0.4742879", "0.47385648", "0.47336167", "0.47305897", "0.47171015", "0.4716075", "0.4715365", "0.47127312", "0.47126877", "0.47055906", "0.47021982", "0.4701827" ]
0.0
-1
echo "ADD cel $row$col $string\n";
public function addcell( $row, $col, $string, $raw = '' ) { $this->sheets[ $this->sn ]['maxrow'] = max( $this->sheets[ $this->sn ]['maxrow'], $row + $this->rowoffset ); $this->sheets[ $this->sn ]['maxcol'] = max( $this->sheets[ $this->sn ]['maxcol'], $col + $this->colOffset ); $this->sheets[ $this->sn ]['cells'][ $row + $this->rowoffset ][ $col + $this->colOffset ] = $string; if ( $raw ) { $this->sheets[ $this->sn ]['cellsInfo'][ $row + $this->rowoffset ][ $col + $this->colOffset ]['raw'] = $raw; } if ( isset( $this->recType ) ) { $this->sheets[ $this->sn ]['cellsInfo'][ $row + $this->rowoffset ][ $col + $this->colOffset ]['type'] = $this->recType; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addition(){\n\t\techo \"<p>The \" . $_POST[\"rows\"] . \" x \" . $_POST[\"columns\"] . \" addition table.</p>\\n\";\n\t\techo \"<table border = 1>\\n\";\n\t\t//Goes through each row\n\t\tfor($row = 0; $row <= $_POST[\"rows\"]; $row++){\n\t\t\techo \"\\t<tr>\\n\";\n\t\t\t//Goes through each column of each row\n\t\t\tfor($column = 0; $column <= $_POST[\"columns\"]; $column++){\n\t\t\t\t//If the table box is not a top or left hand border, adds the numbers together unbolded\n\t\t\t\tif($row != 0 && $column != 0)\n\t\t\t\t\techo \"\\t\\t<td align='center'>\" . ($row + $column) . \"</td>\\n\";\n\t\t\t\t//If it is a column header, prints the column number in bold\n\t\t\t\telseif($row == 0)\n\t\t\t\t\techo \"\\t\\t<td align='center'><strong>\" . $column . \"</strong></td>\\n\";\n\t\t\t\t//If it is a row header, prints the row number in bold\n\t\t\t\telseif($column == 0)\n\t\t\t\t\techo \"\\t\\t<td align='center'><strong>\" . $row . \"</strong></td>\\n\";\n\t\t\t}\n\t\t\techo \"\\t</tr>\\n\";\n\t\t}\n\t\techo \"</table>\\n\";\n\t}", "function addSlhs($elm){return \"'\".$elm.\"'\";}", "function xlsWriteLabel($Row, $Col, $Value ) {\r\n$L = strlen($Value);\r\necho pack(\"ssssss\", 0x204, 8 + $L, $Row, $Col, 0x0, $L);\r\necho $Value;\r\nreturn;\r\n}", "function add()\n{\n\t$args = func_get_args();\n\t$string = array_shift($args);\n\tSystem::InterfaceHandler()->content(vsprintf($string, $args));\n}", "protected function add_to_table($string){\n\t\t$query = \"INSERT INTO \" . $this->table . \" (`$this->column_name`) VALUES ('\" . $string . \"')\";\n\t\treturn Database::execute_sql($query);\n\t}", "function AddCol($field=-1,$width=-1,$align='L')\r\n{\r\n\tif($field==-1)\r\n\t{\r\n\t\t$field=count($this->columnProp);\r\n\t}\r\n\r\n\t$this->columnProp[$field]=array('f'=>$field,'w'=>$width,'a'=>$align);\r\n\t#$this->Write(5, \"Ajout de colonne : \".$field.\"/\".$width.\"/\".$align); $this->Ln();\r\n}", "public function appendInstructions($string)\n {\n $this->_instructions = $this->getInstructions() . $string;\n }", "function helper_pdf_add_cell($pdf, $largura, $altura, $texto, $bordas, $pula_linha, $alinhamento){\n\t$pdf->Cell($largura, $altura, $texto, $bordas, $pula_linha, $alinhamento);\n}", "function xlsWriteLabel($Row, $Col, $Value ) {\n $L = strlen($Value);\n echo pack(\"ssssss\", 0x204, 8 + $L, $Row, $Col, 0x0, $L);\n echo $Value;\n return;\n }", "function AddCol($field=-1,$width=-1,$caption='',$align='')\r\n{\r\n if($field==-1)\r\n $field=count($this->aCols);\r\n $this->aCols[]=array('f'=>$field,'c'=>$caption,'w'=>$width,'a'=>$align);\r\n}", "public function testCellWithArguments(): void\n {\n $cell = $this->View->cell('Articles::doEcho', ['dummy', ' message']);\n $render = \"{$cell}\";\n $this->assertStringContainsString('dummy message', $render);\n }", "function setMargemEsquerda($iNumCol = 4) {\n\n $sComando = chr(27) . chr(108) . \" $iNumCol\";\n parent::addComando($sComando);\n }", "function add3($par1, $par2, $par3) {\n\t\t\t\t/*echo \"<br>\" . $par1 . \" \" . $par2 . \" = \" . $par3;*/\n\t\t\t\techo \"<br> $par1 $par2 = $par3\";\n\t\t\t}", "function s_m_put_txt_data_insert($rows, $columnames, $store_data){\r\n // only the data in $store_data\r\n // (not index by column name but column number!)\r\n $row_nr = count($rows);\r\n for($i = 0; $i < count($columnames); $i++){\r\n $this_value = \"\";\r\n if(isset($store_data[$i])){\r\n $this_value = $store_data[$i];\r\n }\r\n $rows[$row_nr][$columnames[$i]] = $this_value;\r\n }\r\n return $rows;\r\n}", "function add($num1, $num2) {\n\techo ($num1 + $num2) . PHP_EOL;\n}", "function __toString()\r\n {\r\n $string = '';\r\n\t$i=0;\r\n foreach ($this->pieces as $column) {\r\n\r\n foreach ($column as $piece) {\r\n if ($piece === '') {\r\n $string .= ('-');\r\n } else {\r\n $string .= $piece;\r\n }\r\n\t\t$i++;\r\n\t\tif($i%3==0)\r\n\t\t{\r\n\t\t\t$string .= \"\\n\";\r\n\t\t}\r\n }\r\n\r\n }\r\n\r\n return $string;\r\n }", "function add_row()\n\t{\n\t\t$args = func_get_args();\n\t\t$this->rows[] = $this->_prep_args($args);\n\t}", "private function writeString($row, $col, $str, $xfIndex): void\n {\n $this->writeLabelSst($row, $col, $str, $xfIndex);\n }", "function finalRow($quantity, $price) {\n ?>\n<tr>\n <th scope=\"row\">#</th>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>Pizza's: <?= $quantity ?></td>\n <td>Prijs: &euro;<?= $price ?></td>\n</tr>\n<?php\n}", "function test ( $str1, $str2, $str3, $num1, $num2 )\n {\n $mystring = $str1.\" \".$str2.\" \".$str3;\n echo \"\\t\\t\\t\".$mystring.\"<br />\"; \n return $num1 * $num2; \n }", "function format($cols,$name,$value='',$unit=''){\n $vlen=strlen($value.$unit)+1;\n $format='%-'.($cols-$vlen).\".\".($cols-$vlen).\"s\".'%'.($vlen).\".\".($vlen).\"s\"; //name & value+unit\n return sprintf($format,$name,$value.$unit);\n}", "public function cell ($text,$options=NULL) { print $this->cell_html ($text,$options); }", "function xlsWriteNumber($Row, $Col, $Value) {\r\necho pack(\"sssss\", 0x203, 14, $Row, $Col, 0x0);\r\necho pack(\"d\", $Value);\r\nreturn;\r\n}", "function entab($num)\n{\n\treturn \"\\n\".str_repeat(\"\\t\",$num);\n}", "public function add($string) \n {\n // Build our statement\n $this->sql .= \" \".$this->clean($string);\n return $this;\t\n }", "function column_job($item){\n return sprintf('%1$s',\n /*$1%s*/ $item['job']\n );\n }", "function drawSimpleRow($color, $text) {\r\n\t\t\t\techo(\"<tr align = 'center' bgcolor = '$color'>\");\r\n\t\t\t\t\techo(\"<td colspan = '8'>$text</td>\");\r\n\t\t\t\techo(\"</tr>\");\r\n\t\t\t}", "function addC(){\n \t$re = new DbManager();\n \t$result = $re -> addColumn();\n \tif ($result == true){\n \t\techo 'colone bien ajouter ';\n \t}\n }", "private function genColAddScripts($table, $columns)\n {\n $query = \"\";\n $i = 0;\n foreach ($columns as $col) {\n $stmt = $this->getTableColStmt($this->conn1, $table, $col);\n if ($stmt) {\n $query .= \"\\nADD `$col` $stmt\";\n if ($i < count($columns) - 1) {\n $query .= \",\";\n }\n }\n $i++;\n }\n return $query;\n }", "function add_cell($val, $link = \"\")\n\t{\n\t\tif(!empty($link))\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"begin_link\");\n\t\t\t$this->tpl->setVariable(\"LINK_TARGET\", $link);\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t$this->tpl->touchBlock(\"end_link\");\n\t\t}\n\n\t\t$this->tpl->setCurrentBlock(\"text\");\n\t\t$this->tpl->setVariable(\"TEXT_CONTENT\", $val);\n\t\t$this->tpl->parseCurrentBlock();\n\t\t$this->tpl->setCurrentBlock(\"table_cell\");\n\t\t$this->tpl->parseCurrentBlock();\n\t}", "function addDataRow($row_str, $num) {\n\t\t/*$str = substr($row_str, 1, -3);\n\t\tif(!$str) {\n\t\t\t$this->footnote_index = $num;\n\t\t\tvar_dump($this->footnote_index);\n\t\t\treturn;\n\t\t}*/\n\t\t\n\t\t//$arr = explode(',', $str);\n\n\t\t$this->first_newcode = 0;\n\n\t\t$arr = $row_str;\n\t\tif(count($arr) < 1) {\n\t\t\t$this->footnote_index = $num;\n\t\t\tvar_dump($this->footnote_index);\n\n\t\t\t//insert last dataset\n\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//\tvar_dump($arr);\n\t\tif($num===0) {\n\t\t\t$this->headers = $arr;\n\t\t\t$this->code_index = array_search('WEO Subject Code', $arr);\n\t\t\t$this->name_index = array_search('Subject Descriptor', $arr);\n\t\t\t$this->note_index = array_search('Subject Notes', $arr);\n\t\t\t$this->unit_index = array_search('Units', $arr);\n\t\t\t$this->data = array();\n\n\t\t} else {\n\t\t\t$this->crnt_code = $arr[$this->code_index];\n\t\t\tif($this->crnt_code != $this->last_code) { //first line of new code\n\t\t\t\t$this->first_newcode = 1;\n\t\t\t\t$this->data[] = array(\n\t\t\t\t\t'code' => $this->crnt_code,\n\t\t\t\t\t'name' => $arr[$this->name_index].\" \".$arr[$this->unit_index],\n\t\t\t\t\t'note' => $arr[$this->note_index],\n\t\t\t\t\t\"data\" => array()\n\t\t\t\t);\n\t\t\t\t$this->data_index = count($this->data) - 1;\n\n\t\t\t\t/*if($this->last_code && $this->last_code != 'BCA') {\n\t\t\t\t\t$this->dumpJSON($this->data[0]);\n\t\t\t\t\t//var_dump($this->data);\n\t\t\t\t\tdie(); //tmp\n\t\t\t\t}*/\n\t\t\t}\n\t\t}\n\n\n\t\t//footnotes\n\t\t//var_dump(\"num:\".$num, \"footnote_index:\".$this->footnote_index);\n\t\tif($this->footnote_index > 0 && $num > $this->footnote_index) {\n\t\t\tif($num > $this->footnote_index+1) {}\n\t\t\treturn;\n\t\t}\n\n\t\tfor($i=-1,$l=count($arr);++$i<$l;) { //yoko\n\t\t\tif($num===0) {\n\t\t\t\tif(!$this->code_year_index && is_numeric($arr[$i])) {\n\t\t\t\t\t$this->code_year_index = $i;\n\t\t\t\t} else {\n\t\t\t\t\t$this->code_year_end = $i;\n\t\t\t\t}\n\n\t\t\t\t/*if($this->code_year_index && $i >= $this->code_year_index) {\n\t\t\t\t\t$this->data[$this->data_index][\"data\"][] = array(\n\t\t\t\t\t\t'year' => $arr[$i],\n\t\t\t\t\t\t'country_value' => array()\n\t\t\t\t\t);\n\t\t\t\t}*/\n\t\t\t} else {\n\t\t\t\tif($this->first_newcode) {\n\t\t\t\t\t/*$this->data[$this->data_index][\"data\"][] = array(\n\t\t\t\t\t\t'year' => $arr[$i],\n\t\t\t\t\t\t'country_value' => array()\n\t\t\t\t\t);*/\n\t\t\t\t\tif($i >= $this->code_year_index && $i < $this->code_year_end) {\n\t\t\t\t\t\t$this->data[$this->data_index][\"data\"][$i-$this->code_year_index]['year'] = $this->headers[$i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($i==0) {\n\t\t\t\t\t$tmp = array();\n\t\t\t\t}\n\t\t\t\tif($i >= $this->code_year_index && $i < $this->code_year_end) {\n\t\t\t\t\t$tmp['value'] = str_replace(\",\", \"\", $arr[$i]) + 0;\n\t\t\t\t\t//var_dump($tmp);\n\t\t\t\t\t/*var_dump($this->data[\"data\"]);\n\t\t\t\t\tvar_dump($i-$this->code_year_index);\n\t\t\t\t\tvar_dump($this->data->data[$i-$this->code_year_index]);*/\n\t\t\t\t\t$this->data[$this->data_index][\"data\"][$i-$this->code_year_index]['country_value'][] = $tmp;\n\t\t\t\t\t//var_dump($this->data);\n\t\t\t\t} elseif($i != $this->name_index && $i != $this->code_index && $i != $this->note_index) {\n\t\t\t\t\t$tmp[$this->headers[$i]] = mb_convert_encoding($arr[$i], \"UTF-8\");\n\t\t\t\t}\n\n\n\n\t\t\t}\n\t\t}\n\t\t$this->last_code = $this->crnt_code; //last of 1 tate\n\t}", "function php07($coordenada, $text_des, $text_tam){\n\t$texto_n = '';\n\tfor($i = 0; $i < strlen($text_des); $i++){\n\t\tif ($i >= $coordenada){\n\t\t\tif ($j < $text_tam) {\n\t\t\t\t$texto_n = $texto_n . $text_des[$i];\n\t\t\t\t$j++;\n\t\t\t}\n\t\t}\n\t}\n\treturn $texto_n;\n}", "function insertNewline($str, $times)\n{\n for ($k = 0; $k < $times; $k++) {\n $str .= PHP_EOL;\n }\n return $str;\n}", "function add_cell($val, $link = \"\")\n\t{\n\t\tif (!empty($link))\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"begin_link\");\n\t\t\t$this->tpl->setVariable(\"LINK_TARGET\", $link);\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t$this->tpl->touchBlock(\"end_link\");\n\t\t}\n\n\t\t$this->tpl->setCurrentBlock(\"text\");\n\t\t$this->tpl->setVariable(\"TEXT_CONTENT\", $val);\n\t\t$this->tpl->parseCurrentBlock();\n\t\t$this->tpl->setCurrentBlock(\"table_cell\");\n\t\t$this->tpl->parseCurrentBlock();\n\t}", "private function getCellOutput($index, $row = null)\r\n {\r\n $cell = $row ? $row[$index] : '-';\r\n $width = $this->columnWidths[$index];\r\n $pad = $row ? ($width - mb_strlen((string)$cell, 'UTF-8')) : $width;\r\n $padding = str_repeat($row ? ' ' : '-', $this->padding);\r\n\r\n $output = '';\r\n\r\n if ($index === 0) {\r\n $output .= str_repeat(' ', $this->indent);\r\n }\r\n\r\n if ($this->border) {\r\n $output .= $row ? '|' : '+';\r\n }\r\n\r\n $output .= $padding; # left padding\r\n $cell = trim(preg_replace('/\\s+/', ' ', $cell)); # remove line breaks\r\n $content = preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $cell);\r\n $delta = mb_strlen((string)$cell, 'UTF-8') - mb_strlen((string)$content, 'UTF-8');\r\n $output .= $this->strPadUnicode($cell, $width + $delta, $row ? ' ' : '-'); # cell content\r\n $output .= $padding; # right padding\r\n if ($row && $index == count($row) - 1 && $this->border) {\r\n $output .= $row ? '|' : '+';\r\n }\r\n\r\n return $output;\r\n }", "public function add() \n { // metodo add, complementar\n $str = \"insert into \".self::$tablename.\"(nitHotel, idCiudad, nomHotel, dirHotel, telHotel1, telHotel2, correoHotel, tipoHotel, Administrador, idRedes, aforo, tipoHabitaciones, status)\";\n $str.= \" values ('$this->nitHotel', $this->idCiudad, '$this->nomHotel', '$this->dirHotel', '$this->telHotel1', '$this->telHotel2', '$this->correoHotel', $this->tipoHotel, '$this->Administrador', $this->idRedes, $this->aforo, $this->tipoHabitaciones, $this->status);\";\n }", "function kdw_row_tiles_txt (){ \r\n \r\n}", "function add_sign_to_formula($sign){\n global $conn;\n //i think this is faster than calling get_calculator_formula(); and concatinating, its all done on the database even though its two statements. \n $query = \"set @formula = (SELECT `string` from calculators where id = \".$_SESSION['id'].\");\n set @formula_with_variable = Concat(@formula,'\".$sign.\"');\n UPDATE `calculators` SET `string`= @formula_with_variable WHERE id = \".$_SESSION['id'].\";\";\n //prep&execute\n //prep\n $statement = $conn->prepare($query);\n $statement->execute();\n $_SESSION['has_sign'] = true;\n}", "public function add_instr()\n {\n $this->instructions++; \n }", "function show_cell($which) {\r\n $token = $this->position[$which];\r\n if ($token <> '-') {\r\n return '<td>' . $token . '</td>';\r\n }\r\n $this->newposition = $this->position;\r\n $this->newposition[$which] = 'o';\r\n $move = implode($this->newposition);\r\n $link = '?board=' .$move;\r\n return '<td><a href=' . $link . '>-</a></td>';\r\n }", "function fcell($c_width,$c_height,$x_axis,$text){\n $w_w=$c_height/3;\n $w_w_1=$w_w+2;\n $w_w1=$w_w+$w_w+$w_w+3;\n $len=strlen($text); \n if($len>10){\n $w_text=str_split($text,10);\n $this->SetX($x_axis);\n $this->Cell($c_width,$w_w_1,$w_text[0],'','','');\n $this->SetX($x_axis);\n $this->Cell($c_width,$w_w1,$w_text[1],'','','');\n $this->SetX($x_axis);\n $this->Cell($c_width,$c_height,'','LTRB',0,'C',0);\n }\n else{\n $this->SetX($x_axis);\n $this->Cell($c_width,$c_height,$text,'LTRB',0,'C',0);\n }\n }", "function add()\n\t{\n\t\t$a = 120;\n\t\t$b = 22;\n\t\t$c = $a + $b;\n\t\treturn $c;\n\n\t}", "function calc_string($string, $con = NULL){\r\n\t// exemplo: calc_string(\"(1 + 2) * 3\"); (retorna 9)\r\n\tif(is_object($con)){\r\n\t\t$res = $con->query(\"SELECT (\".$string.\")\");\r\n\t\treturn $res->fetchColumn();\r\n\t}else{\r\n\t\t//$string = ereg_replace(\"[^0-9\\+-\\*\\/\\(\\) ]\", \"\", trim($string));\r\n\t\t$string = preg_replace(\"[^0-9\\+-\\*\\/\\(\\) ]\", \"\", trim($string));\r\n\t\t$compute = create_function(\"\", \"return (\".$string.\");\");\r\n\t\treturn $compute();\r\n\t}\r\n}", "public function compileInsertString( $data );", "function add_number_to_formula($number){\n global $conn;\n //GET calculator from the id where the id is the same as the users id\n $query = \"UPDATE `calculators` SET `string`= `string` * 10 + \".$number.\" WHERE id = \".$_SESSION['id'].\";\";\n //prep&execute\n //prep\n $statement = $conn->prepare($query);\n $statement->execute();\n}", "public function writeString($row, $col, $value)\n {\n $lenght = strlen($value);\n $this->dataOutput .= pack('ssssss', 0x204, 8 + $lenght, $row, $col, 0x0, $lenght);\n $this->dataOutput .= $value;\n\n return $this;\n }", "function show_cell($which) {\n\n $token = $this->position[$which];\n\n //if the cell is not a dash - place the token in it\n if ($token <> '-')\n return '<td>' . $token . '</td>';\n\n\n //now the hard case\n $this->new_position = $this->position; // copy the original\n $this->new_position[$which] = 'o'; // this would be their move\n $move = implode($this->newposition); // make a string from the board array\n $link = '?board=' . $move; // this is what we want the link to be\n\n // so return a cell containing an anchor and showing a hyphen\n return '<td><a href=\"' . $link . '\">-</a></td>';\n }", "private function generateRowsCharacters()\n {\n $this->rowsCharacters->add([\"+\"]);\n $rowIndex = 1;\n while ($this->shapeIsNotComplete($rowIndex)) {\n $row = $this->getRow($rowIndex);\n $this->rowsCharacters->add($row);\n $rowIndex++;\n }\n }", "public function cekData($string)\n {\n $noUrut = $this->modelSupplier->cekData($string);\n $noUrut++;\n echo sprintf(\"%03s\", $noUrut);\n }", "private function writeRichTextString($row, $col, $str, $xfIndex, $arrcRun): void\n {\n $record = 0x00FD; // Record identifier\n $length = 0x000A; // Bytes to follow\n $str = StringHelper::UTF8toBIFF8UnicodeShort($str, $arrcRun);\n\n // check if string is already present\n if (!isset($this->stringTable[$str])) {\n $this->stringTable[$str] = $this->stringUnique++;\n }\n ++$this->stringTotal;\n\n $header = pack('vv', $record, $length);\n $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]);\n $this->append($header . $data);\n }", "function SetCol($col)\n{\n $this->col=$col;\n $x=10+$col*65;\n $this->SetLeftMargin($x);\n $this->SetX($x);\n}", "function addQuickeditBox($column_name) {\n\tforeach($GLOBALS['custom_fields'] AS $field_key => $field_values) {\n\t\tif($column_name == $field_key) {\n\t\t\techo '\n\t\t\t\t<fieldset class=\"inline-edit-col-left\" style=\"clear: both; padding-top: 3px;\">\n\t\t\t\t\t <div class=\"inline-edit-col\">\n\t\t\t\t\t\t'.$field_values['start'].'\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<span class=\"title\">'.$field_values['title'].'</span>\n\t\t\t\t\t\t\t<span class=\"input-text-wrap\"><input type=\"text\" name=\"'.$field_key.'\" /></span>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t</fieldset>\n\t\t\t';\n\t\t\t\n\t\t\t++$i;\n\t\t}\n\t}\n}", "private function gridToString(){\n\t\t//TODO\n\t\t$return = \"\";\n\t\treturn $return;\n\t}", "public function addRow($row, $file)\n { }", "function addToEpreuve($intitule) {\n $q = 'insert into epreuve (intitule) values (\"'.$intitule.'\");';\n $res = query($q);\n if ($res === false) {\n return $res;\n }\n return true;\n}", "function AddRow()\n\t{\n\t\tif (!func_num_args())\n\t\t{\n\t\t\t// no parameters were passed\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t// increment the row pointer\n\t\tif (!isset($this->_intCurrentRow))\n\t\t{\n\t\t\t$this->_intCurrentRow = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_intCurrentRow++;\n\t\t}\n\t\t\n\t\t// build the array of column values\t\t\n\t\t$arrColumns = func_get_args();\n\t\t$this->_arrRows[] = Array('Columns'=>$arrColumns);\n\t\t\n\t\treturn $this->_intCurrentRow;\n\t}", "function add_seatarr($text)\n {\n $query=$this->db2->query(\"INSERT INTO seats_arrangement VALUES ('','$text')\");\n if($query)\n return 1;\n else\n return 0;\n }", "function drawTableLine($data_len=0) {\n\techo \" \" . str_repeat(\"-\", $data_len + 10) . \"\\r\\n\";\n}", "public function cli() : string\n {\n $table = \"\";\n $largestNumber = $this->rows * $this->columns;\n $largestNumberLength = strlen(\"\" . $largestNumber);\n $spacingPrefab = \"\";\n\n for ($s = 0; $s < $largestNumberLength + 1; $s++) {\n $spacingPrefab .= \" \";\n }\n\n for ($row = 1; $row <= $this->rows + 1; $row++) {\n for ($column = 1; $column <= $this->columns + 1; $column++) {\n $currentChars = \"\";\n $currentCharsColorized = \"\";\n\n if ($row == 1 && $column == 1) {\n $currentChars = \"X\";\n $currentCharsColorized = \"\\033[1;37;44m\" . \"X\" . \"\\033[0m\";\n } elseif ($row == 1) {\n $currentChars = \"\" . ($column - 1) . \"\";\n $currentCharsColorized = \"\\033[1;37;44m\" . ($column - 1) . \"\\033[0m\";\n } elseif ($column == 1) {\n $currentChars = \"\" . ($row - 1) . \"\";\n $currentCharsColorized = \"\\033[1;37;44m\" . ($row - 1) . \"\\033[0m\";\n } else {\n $currentChars = \"\" . ($row - 1) * ($column - 1) . \"\";\n $currentCharsColorized = \"\" . ($row - 1) * ($column - 1) . \"\";\n }\n\n $spacing = substr($spacingPrefab, 0, strlen($spacingPrefab) - strlen($currentChars));\n\n $table .= $currentCharsColorized . $spacing;\n }\n\n $table .= \"\\r\\n\";\n }\n\n return $table;\n }", "function compledom($calleno,$col,$del,$ciudad,$estado,$cp){\n\t\t\t$completo = $calleno.\" \".$col.\" \".$del.\" c.p.\".$cp.\" \".$ciudad.\", \".$estado;\n\t\t\treturn $completo;\n\t\t\t\n\t\t}", "public function setTextMatrix($a, $b, $c, $d, $e, $f) {}", "function add_row($selector, $row = \\false, $post_id = \\false)\n{\n}", "public function testConcatenation(): void\n {\n $evaluator = new Evaluator();\n self::assertEquals(\n 'String concatenation',\n $evaluator->execute('\"String\" + \" \" + \"concatenation\"')\n );\n }", "function _add_sql($add_sql, $type)\r\n\t{\r\n\t\tif (!isset($add_sql[$type]))\r\n\t\t\treturn '';\r\n\r\n\t\treturn implode(' ', $add_sql[$type]);\r\n\t}", "function add($str) {\n\t $this->xml .= $str;\n\t}", "function Concat()\n\t{\n\t\t$s = \"\";\n\t\t$arr = func_get_args();\n\n\t\tif (sizeof($arr) == 1) {\n\t\t\tforeach ($arr as $arg) {\n\t\t\t\t$args = explode(',', $arg);\n\t\t\t}\n\t\t\t$arr = $args;\n\t\t}\n\n\t\tarray_walk($arr, create_function('&$v', '$v = \"CAST(\" . $v . \" AS VARCHAR(255))\";'));\n\t\t$s = implode('+',$arr);\n\t\tif (sizeof($arr) > 0) return \"$s\";\n\t\treturn '';\n\t}", "function db_add($con,$table,$data){\n\t$fild_value = array();\n\tforeach ($data as $field => $value) {\n\t\t$fild_value[] = \"`\".$field.\"` = '\".$value.\"'\";\n\t}\n\t$data_string = implode(\",\", $fild_value);\n\n\t$sql = \"INSERT INTO `$table` SET \".$data_string;\n\t\n\t$query = mysqli_query($con,$sql);\n\tif($query){\n\t\treturn true;\n\t}else{\n\t\treturn mysqli_error($con);\n\t}\n}", "public function label_section($label=''){\n $this -> label = $label;\n $firstCols = 42;\n $first = str_pad($this -> label, $firstCols);\n return \"$first\\n\";\n }", "private function offset()\n {\n $this->strA = ' ' . $this->strA;\n $this->strB = ' ' . $this->strB;\n }", "function increaseEnthusiasm($str)\n{\n return $str . \"!\";\n}", "function ee( $function_call ) // remember to include brackets on the end if no parameters\n{\n\tglobal $title_CRLF ;\n\n\t$result ;\n\n\t\n\teval( \"\\$result = $function_call ;\" ) ;\n\n\n\treturn \"$title_CRLF$function_call$title_CRLF$title_CRLF$result$title_CRLF\" ;\n\n}", "function add($row) {\n\t\t//$y = 0.25 + $this->y * 1.5;\n\t\tif ($this->curLabel == 0) $this->blockOut('page');\n\t\t\n\t\t$this->blockOut('label');\n\t\t\t\n\t\t$short = new slURLShortener();\n\t\t\n\t\t$short->create(WWW_ROOT.\"/item/\".$this->ref.\"/\".$row[\"_KEY\"]);\n\t\t\n\t\t$url = $short->getShortenedURL();\n\n\t\t$qrFile = $this->file.\"-\".($this->imNum++).\".png\";\n\t\t\n\t\t$this->blockOutEnd(array($page, $label, $row));\n\t\t\n\t\t$this->curLabel ++;\n\t\tif ($this->curLabel > $this->labelConfig[\"labels-per-page\"]) {\n\t\t\t$this->blockOutEnd();\n\t\t\t$this->curLabel = 0;\n\t\t\t$this->curPage ++;\n\t\t}\n\t\t\n\t\t//QRcode::png($short->getTinyID(), $qrFile, 'L', 6, 2);\n\t\t\n\t\t//fputs($this->fp,$qrFile.\"\\n\");\n\t\t\n\t\t//$this->pdf->Image($qrFile, $x, $y, 1.5, 1.5, \"PNG\", $url);\n\t\t\t\t\n\t\t//$this->pdf->SetXY(1.5 + $x, $y + 0.1);\n\t\t\n\t\t/*$this->addText($row[\"_NAME\"]);\n\t\tif (isset($row[\"_UNIQUE\"]) && $row[\"_UNIQUE\"] && safeName($row[\"_UNIQUE\"]) != safeName($row[\"_NAME\"])) $this->addText($row[\"_UNIQUE\"]);\n\t\t$this->addText(\"REF: \".$GLOBALS[\"slCore\"]->db->refToNumber(str_replace(\"/\",\".\",$this->ref)).\".\".$row[\"_KEY\"]);\n\t\t$this->addText(WWW_ROOT.\"/sl/tiny?\".$short->id,8);\n\t\t\n\t\t$this->x ++;\n\t\tif ($this->x == 2) {\n\t\t\t$this->x = 0;\n\t\t\t$this->y ++;\n\t\t\tif ($this->y == 7) {\n\t\t\t\t$this->y = 0;\n\t\t\t\t$this->pdf->AddPage();\n\t\t\t}\n\t\t}*/\n\t}", "function addInstruction($recipe,$instruction){\n\t\t\t$str_query=\"INSERT INTO cuisine_instruction SET recipe_id='$recipe', instruction='$instruction'\";\n\t\t\treturn $this->query($str_query);\n\t\t}", "public function new_cell($css = '', $extras='') {\n\n $opts = '';\n\n if ($css == '') {\n $cssfirst = true;\n } else {\n $cssfirst = false;\n }\n\n // Close the previous cell if needed\n if ($this->_cellopen) {\n $this->end_cell();\n }\n\n // Check if column span was set via $this->set_colspan()\n if ($this->_colspan > 1) {\n $opts .= ' colspan=\"'.$this->_colspan.'\"';\n\n $this->_colspan = 0;\n }\n\n // Check if row span was set via $this->set_rowspan()\n if ($this->_rowspan > 1) {\n $opts .= ' rowspan=\"'.$this->_rowspan.'\"';\n\n $this->_rowspan = 0;\n }\n\n // Check if width was set via $this->set_width()\n if ($this->_width > 0) {\n $opts .= ' width=\"'.$this->_width.$this->_wpp.'\"';\n\n $this->_width = 0;\n $this->_wpp = '';\n }\n\n // Check if height was set via $this->set_height()\n if ($this->_height > 0) {\n $opts .= ' height=\"'.$this->_height.$this->_hpp.'\"';\n\n $this->_height = 0;\n $this->_hpp = '';\n }\n\n if ($this->_celltitledata != '') {\n $opts .= ' title=\"'.$this->_celltitledata.'\"';\n\n $this->_celltitledata = '';\n }\n\n if ($this->_newid != '') {\n $opts .= ' id=\"'.$this->_newid.'\"';\n\n $this->_newid = '';\n }\n\n if ($this->_onclickdata != '') {\n $opts .= ' onclick=\"'.$this->_onclickdata.'\"';\n\n $this->_onclickdata = '';\n }\n\n if ($this->_onmouseoverdata != '') {\n $opts .= ' onmouseover=\"'.$this->_onmouseoverdata.'\"';\n\n $this->_onmouseoverdata = '';\n }\n\n if ($css != '') {\n $opts = ' class=\"'.$css.'\"'.$opts;\n }\n\n if ($extras != '') {\n // Allows inline styles to override formatting in the CSS stylesheet\n $opts .= ' '.$extras;\n }\n\n echo '<td'.$opts.'>';\n $this->_cellopen = true;\n }", "function generateRow($arrColumns) {\n\t\n\t\t$str = \"{c:[\";\n\t\tforeach($this->getRow() AS $k => $cell) {\t\n\t\t\t$col = $arrColumns[$k];\t\t\n\t\t\t$str.= $cell->generateCell($col->getGoogleType()).\",\";\n\t\t}\n\t\t\n\t\t$str = substr($str,0,-1);\n\t\t$str.= \"]}\";\n\t\t\n\t\treturn $str;\n\t\t\n\t}", "function show_cell($which) {\r\n $token = $this->position[$which];\r\n if ($token <> '-') {\r\n $player_board = str_split($this->board); \r\n return '<td style=\"text-align:center;' . ($token != $player_board[$which] ? ' background-color: #FFA500;' : '' ) . '\"><div style=\"padding: 1em;\">' . $token . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $which . ':(' . ((int) ($which / $this->grid_size) + 1) . ',' . (($which % $this->grid_size) + 1) . ')</span>') : '') . '</div></td>';\r\n }\r\n $this->newposition = $this->position; \r\n $this->newposition[$which] = 'x'; \r\n $move = implode($this->newposition); \r\n $link = '?size=' . $this->grid_size . '&board=' . $move . ($this->debug ? '&debug' : ''); \r\n return '<td style=\"text-align:center;\"><a href = \"' . $link . '\" style = \"text-decoration: none;\"><div style=\"padding: 1em;\">-' . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $which . ':(' . ((int) ($which / $this->grid_size) + 1) . ',' . (($which % $this->grid_size) + 1) . ')</span>') : '') . '</div></a></td>';\r\n }", "function format_fields_instr($field_array, $row_data=array())\n{\n\t$bool = FALSE;\n\t#assuming instructions are in the first array item\n\tswitch($field_array[0]) \n\t{\n \t\tcase 'UCFIRST': \n\t\t\t$string = ucfirst($row_data[$field_array[1]]); \n\t\t\t$bool = TRUE;\n\t\tbreak;\n\t\t\n\t\tcase 'MONEY': \n\t\t\t$string = '$'.addCommas($row_data[$field_array[1]]); \n\t\t\t$bool = TRUE;\n\t\tbreak;\n\t\t\n\t\tcase 'ADDCOMMAS': \n\t\t\t$string = addCommas($row_data[$field_array[1]]); \n\t\t\t$bool = TRUE;\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t$string = '';\n\t\tbreak;\n\t}\n\t\n\t\n\treturn array('bool'=>$bool, 'string'=>$string);\n}", "static function addThese($num1, $num2) {\n\t\t\treturn ($num1 + $num2) . \"</br>\";\n\t}", "function pgm_list_column_data($column,$post_id){\n $output = '';\n\n switch($column){\n case 'shortcode':\n $output .= '[pgm_form id=\"'. $post_id .'\"]';\n break;\n }\n\n echo $output;\n}", "function addSomeDiv($divTop, $divLeft, $divHeight, $divWidth, $divColor)\n{\n echo \"<div class='col-md-3'><div style='margin-left: 10px; background: $divColor; top: $divTop; left: $divLeft; height: $divHeight; width: $divWidth;'></div></div>\";\n}", "private function BuildCell($_RowNo, $_ColNo, $_Cell) {\r\n if(is_string($_Cell)) {\r\n $Len_ = strlen($_Cell);\r\n return(pack(\"S*\", 0x0204, $Len_ + 8, $_RowNo, $_ColNo, 0x00, $Len_).$_Cell);\r\n }\r\n if(is_int($_Cell))\r\n return(pack(\"S*\", 0x027E, 10, $_RowNo, $_ColNo, 0x00).pack(\"I\", ($_Cell<<2) | 2));\r\n if(is_float($_Cell))\r\n return(pack(\"S*\", 0x0203, 14, $_RowNo, $_ColNo, 0x00).pack(\"d\", $_Cell));\r\n if(is_bool($_Cell))\r\n return($this->BuildCell($_RowNo, $_ColNo, (int)($_Cell ? 1 : 0)));\r\n // Returns a null cell\r\n return(pack(\"S*\", 0x0201, 6, $_RowNo, $_ColNo, 0x17));\r\n }", "function insert($table,$data){\n\t\t$j=0;\n\t\t$c=count($data);\n\t\tforeach($data as $key=>$value){\n\t\t\t$j++;\n\t\t\tif($c==$j){\n\t\t\t\t$line_1.='`'.$key.'`';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"'\";\n\t\t\t} else {\n\t\t\t\t$line_1.='`'.$key.'`, ';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"', \";\n\t\t\t}\n\t\t}\n\t\t$r=mysql_query(\"\n\t\t\tINSERT INTO `$table`\n\t\t\t(\".$line_1.\") VALUES\n\t\t\t(\".$line_2.\")\n\t\t\");\n\t\treturn $r;\n\t}", "function Latex_Table_Multi_Col($ncols,$text,$first=1,$spec=\"c\")\n {\n if ($ncols>1)\n {\n if ($first==0) { $spec=\"|\".$spec; }\n $spec.=\"|\";\n \n $text=\n \"\\\\multicolumn{\".\n $ncols.\n \"}{\".$spec.\"}{\".\n $text.\n \"}\";\n }\n \n return $text;\n }", "function insertAlbumStringBuilder($albumName, $artworkArtistID, $producerID, $releasedYear, $addUserID) {\n $query = \"INSERT INTO album (album_name\";\n if ($artworkArtistID) {$query .= \", album_artwork_artist\";}\n if ($producerID) {$query .= \", album_producer\";}\n if ($releasedYear) {$query .= \", album_released_year\";}\n if ($addUserID) {$query .= \", album_update_user\";}\n $query .= \") VALUES ('${albumName}'\";\n if ($artworkArtistID) {$query .= \", ${artworkArtistID}\";}\n if ($producerID) {$query .= \", ${producerID}\";}\n if ($releasedYear) {$query .= \", ${releasedYear}\";}\n if ($addUserID) {$query .= \", ${addUserID}\";}\n $query .= \")\";\n return $query;\n }", "function make_num_column($preop, $x, $cnum){\n\tif ($preop == 1)\n\t\techo \"<tr><td><a href=\\\"#p\".$cnum.\"\\\">\".$x.\"</a></td>\"; \n\telseif ($preop == 0)\n\t\techo \"<td><a href=\\\"#p\".$x.\"\\\">\".$x.\"</a></td>\"; \n\telse\n\t\techo \"<tr><td>\".$x.\"</td>\";\n}", "public function line($string)\n {\n $this->output->writeln($string);\n }", "function get_placeholder($num)\n\n{\n\n return \"\\x01\".str_repeat(\"\\x00\", $num+1).\"\\x01\";\n\n}", "private function _store($scr)\r\n {\r\n if(!empty($scr[1])){ //string\r\n $i = 's';\r\n } elseif(!empty($scr[6])) { //operator at left\r\n //} elseif(!empty($scr['o'])) { //operator at left\r\n $i = 'o';\r\n } elseif(!empty($scr[7])) { //operator between var\r\n //} elseif(!empty($scr['b'])) { //operator between var\r\n $i = 'b';\r\n } elseif(!empty($scr[8])) { //function\r\n //} elseif(!empty($scr['f'])) { //function\r\n $i = 'f';\r\n } elseif(!empty($scr[9])) { //var\r\n //} elseif(!empty($scr['v'])) { //var\r\n $i = 'v';\r\n } else { //comment + regexp\r\n if( !empty($scr[3]) ){ //comment\r\n if($this->getReduce()) return '';\r\n $i = 'c';\r\n } else { //regexp \\5\r\n $i = 'r';\r\n }\r\n }\r\n //$replacement = '@'.$i.'@';\r\n $replacement = $this->_IdRegex($i,count($this->_data));\r\n $this->_data[] = $scr[0];\r\n return $replacement;\r\n }", "function affichagetableau6_12($tab)\n{\n foreach ($tab as $elt) {\n echo \"[\" . $elt . \"]\" . \"\\t\";\n }\n echo \"\\nLes valeurs du tableau ont été incrémentées de 1.\";\n}", "public function addInsert() {\n if(count($this->cols) != 0) {\n // Only use the parameters that match with columns\n $params = array_slice($this->params, 0, count($this->cols));\n $this->sql .= \" (\" . implode(\", \", $this->cols) . \")\";\n $this->sql .= \" VALUES (\" . implode(\", \", $this->params) . \")\";\n }\n }", "function add_cdata($string){\n\t$newstring = '<![CDATA['.$string.']]>';\n\treturn $newstring;\n}", "function change_tag_col($str,$arr_cols){\r\n\r\n\t\tpreg_match_all('/#COL(\\d+)#/i', $str, $matches, PREG_SET_ORDER);\r\n\r\n\t\tfor($i=0; $i<count($matches); $i++){\r\n\t\t\t$str=str_replace($matches[$i][0], addslashes($arr_cols[$matches[$i][1]-1]), $str);\r\n\t\t}\r\n\r\n\t\treturn $str;\r\n\r\n\t}", "function getCell() {\n \tglobal $synAbsolutePath;\n $ext = $this->translate($this->value);\n $mat=$this->translatePath($this->mat);\n $filename=$mat.$this->createFilename().\".\".$ext;\n $file_exists=file_exists($synAbsolutePath.$filename);\n $isImg=$this->isImage($filename);\n if ($ext and $file_exists and $isImg) $ret=\"<div style='overflow: hidden; height: 25px; display:inline;background: url($filename) no-repeat center;width: 100%' onMouseOver=\\\"openbox('$filename')\\\" onMouseOut=\\\"closebox()\\\"></div>\";\n else if ($ext and $file_exists and !$isImg) $ret=\"<span style='color: gray'>Document $ext</span>\";\n else if ($ext and !$file_exists) $ret=\"<span style='color: gray'>Error $ext</span>\";\n else $ret=\"<span style='color: gray'>Empty</span>\";\n return $ret;\n //die;\n }", "function izq($text){\r\n return \"<div align=\\\"left\\\">$text</div>\";\r\n }", "function add($param) {\n extract($param);\n // nunca suponga el orden de las columnas: INSERT INTO tabla VALUES (v1, v2,v3, ...); tómese el trabajo de indicar los nombres de columnas\n // los nombres de los elementos del array asociativo corresponden a los atributos name de las columnas del jqGrid\n $sql = \"INSERT INTO usuario(id_usuario, direccion, telefonos, correos, contrasena, rol )\n VALUES ('$id_usuario', '$direccion','$telefonos', '$correos', '$contrasena','operario' );\n INSERT INTO operario(fk_usuario,nombres, apellidos) \n VALUES ('$id_usuario','$nombres', '$apellidos');\";\n $conexion->getPDO()->exec($sql);\n echo $conexion->getEstado();\n }", "public function col($col)\n {\n return call_user_func_array(array($this, 'addCol'), func_get_args());\n }", "function add() {\n }", "function CelluUni($valeur,$colonne,$large,$style)\n{\n $balise = '<td';\n if ($colonne != '') $balise.= ' colspan=\"'.$colonne.'\"';\n if ($large != '') $balise.= ' width=\"'.$large.'\"';\n if ($style != '') $balise.= ' class=\"'.$style.'\"';\n html($balise.'>'.$valeur.'</td>'); \n}", "public function add_cell(HTMLCellElement $cell): int\n {\n if($cell === null) $cell = new HTMLCellElement(\"\");\n return $this -> add_child($cell);\n }", "function do_queryTodo($conn, $query)\n{\n//$xColabora=26; // Ejemplo de un colaborador : JOSE MARIA RODRIGUEZ MILLAN\n//$xFASE=$_POST[\"xFASE\"];\n$stid = oci_parse($conn, $query);\n//oci_bind_by_name($stid, ':xFASE', $xFASE, 4, SQLT_CHR);\n\n\n\n$r = oci_execute($stid, OCI_DEFAULT);\n\n\t$suma=\"\";\n\twhile ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) \n\t{\n\t\tforeach ($row as $key =>$field) \n\t\t\t{\n\t\t\t$field = htmlspecialchars($field, ENT_NOQUOTES);\n\t\t\t$suma=$suma.$field.'|';\n\t\t\t}\n\t}\necho $suma;\n}" ]
[ "0.58453137", "0.5450447", "0.53117967", "0.52744913", "0.5242373", "0.5228568", "0.51289696", "0.51108456", "0.50802135", "0.50743777", "0.50566864", "0.5030409", "0.502914", "0.50139403", "0.49946594", "0.49745056", "0.4961674", "0.49226832", "0.48936817", "0.4849694", "0.4844942", "0.48270577", "0.4821831", "0.48110765", "0.47977266", "0.4762435", "0.47573644", "0.47389373", "0.47335115", "0.47285336", "0.47260436", "0.4719984", "0.47102425", "0.4709989", "0.4698021", "0.4694798", "0.46941158", "0.46784586", "0.46772853", "0.46697778", "0.46542907", "0.46541974", "0.46392876", "0.4638732", "0.46250325", "0.46124676", "0.46098676", "0.45931858", "0.45894414", "0.45804325", "0.45723984", "0.4562161", "0.45500785", "0.4537111", "0.4517403", "0.4516594", "0.45165727", "0.4513383", "0.45113987", "0.44938666", "0.44874623", "0.4486705", "0.44864058", "0.44799072", "0.44770628", "0.44690782", "0.44672507", "0.44652423", "0.4462102", "0.44569486", "0.44563225", "0.44431686", "0.44396013", "0.44392496", "0.44296965", "0.442727", "0.44222462", "0.4417458", "0.44167337", "0.44128942", "0.44047025", "0.4404183", "0.44028", "0.43944487", "0.43903205", "0.43896365", "0.4386017", "0.438441", "0.43829867", "0.43785474", "0.4378441", "0.43781132", "0.43776676", "0.43769416", "0.43700555", "0.43607122", "0.435781", "0.43574402", "0.43564627", "0.43539923" ]
0.6314866
0
Set the encoding method
public function setOutputEncoding( $encoding ) { $this->defaultEncoding = $encoding; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_encoding()\n {\n }", "public function encoding($encoding);", "function setEncoding($encode){\n\t\t$this->encodetext=$encode;\n\t}", "public function getEncoding();", "public function getEncoding(): string;", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding(){\n\t\treturn $this->encoding;\n\t}", "protected static function encoding()\n {\n return static::$encoding;\n }", "function setEncoding( $encoding )\n\t{\n\t\t$this->encoding\t=\t$encoding;\n\t}", "public function getContentEncoding()\n {\n }", "public function encoding()\n {\n return $this->getEncoding();\n }", "public function setEncoding($encoding) {\n\t\t$this->encoding = is_null($encoding) ? \"ASCII\" : $encoding;\n\t}", "public static function content_encoding()\n {\n }", "public function encode()\n {\n }", "public function updateAutoEncoding() {}", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function setEncoding(Encode $encode)\n {\n $this->encode = $encode;\n }", "public function setEncoding($encoding) {\r\r\n\t\t$this->encoding = $encoding;\r\r\n\t}", "public function getEncoding()\n {\n return $this->_encoding;\n }", "public function getEncoding()\n {\n return $this->_encoding;\n }", "function setXmlEncoding($value)\n {\n $this->_props['XmlEncoding'] = $value;\n }", "public function getEncoding(): string\n {\n return $this->encoding;\n }", "public function getEncoding(): string\n {\n return $this->encoding;\n }", "public function getEncoding() {\n\t\treturn $this->encoding;\n\t}", "public function set_input_encoding($encoding = \\false)\n {\n }", "public static function encoding($charset)\n {\n }", "private function _setUTFEncoder($encoder = 'iconv')\n\t{\n\t\t$this->_encoderFunction = '';\n\t\tif ($encoder == 'iconv') {\n\t\t\t$this->_encoderFunction = function_exists('iconv') ? 'iconv' : 'mb_convert_encoding';\n\n\t\t} elseif ($encoder == 'mb') {\n\n\t\t}\n\t}", "protected function getCharsetConversion() {}", "public function setEncoding(string $encoding) {\n\t\t$this->_encoding = $encoding;\n\t}", "public function setEncodingType($encoding)\n {\n $this->encoding = $encoding;\n }", "public function setObjectEncoding($encoding);", "abstract public function encode();", "public static function setCharsetEncoding () {\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::getInstance ();\r\n\t\t}\r\n\t\tself::$instance->exec (\r\n\t\t\t\"SET NAMES 'utf8';\r\n\t\t\tSET character_set_connection=utf8;\r\n\t\t\tSET character_set_client=utf8;\r\n\t\t\tSET character_set_results=utf8\" );\r\n\t}", "public function getContentEncoding();", "public static function setEncoding($encoding)\n {\n static::$encoding = $encoding;\n }", "public static function getEncoding()\n {\n return static::$encoding ?: 'utf-8';\n }", "protected function getEncoding(): int\n {\n return $this->encoding;\n }", "public function getEncoder();", "public function getEncoder();", "function setEncoding ($a_encode,$a_overwrite = false)\n\t{\n\t\tif (empty($this->doc->encoding) or ($a_overwrite)) {\n\t\t\t$this->doc->encoding = $a_encode;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function setDoXmlUtf8Encoding($value)\n {\n $this->_props['DoXmlUtf8Encoding'] = $value;\n }", "public function setCodec(Codec $codec);", "function Encoding ( $sEncoding=null )\n{\n if ( isset($sEncoding) ) {\n $this->_Encoding = $sEncoding;\n return true;\n } else {\n return $this->_Encoding;\n }\n}", "function Set_CharacterEncoding($charSet)\r\n\t{\r\n $this->_charEncoding = $charSet;\r\n\t}", "public function getEncodingFilter()\n {\n return $this->encodingFilter;\n }", "public function __construct()\n {\n $this->charset = strtoupper('UTF-8');\n }", "protected function _getEncodingTable() {}", "protected function _getEncodingTable() {}", "protected function _getEncodingTable() {}", "public function getEncoding()\r\n\t{\r\n\t\treturn $this->m_charset;\r\n\t}", "function setCharsetHandler($method = \"none\", $php, $sql) {\n\t\t$this->_charsetMethod = $method;\n\t\t$this->_charsetPhp = $php;\n\t\t$this->_charsetSql = $sql;\n\t}", "function getEncoding ()\n\t{\n\t\treturn $this->doc->encoding;\n\t}", "public function setEncoding($spec)\n {\n $this->_encoding = $spec;\n return $this;\n }", "public function getInputEncoding()\n {\n return $this->input_encoding;\n }", "public static function change_encoding($data, $input, $output)\n {\n }", "abstract protected function set_charset($charset);", "function setXMLEncoding($xmlEncoding) {\n\t\t$this->m_xmlEncoding = $xmlEncoding;\n\t}", "abstract protected function _getEncodingTable();", "protected static function resolveDefaultEncoding() {}", "public function setCharset($charset);", "public function setCharEncoding($encoding) {\n\t\t$this->_text[$this->_lineNumber][$this->_section]['encoding']=$encoding;\n\t}", "public function getCodec();", "public function getCodec();", "function setCharEncoding($sEncoding)\n\t{\n\t\t$this->sEncoding = $sEncoding;\n\t}", "function wp_set_internal_encoding()\n {\n }", "public function getAllowEncoding()\n {\n return $this->allowEncoding;\n }", "function getEncoding(): string\n {\n return $this->getEncodingInfo()['encoding'];\n }", "public function characterSetEncode($charset) {\n if ($this->characterSetEncodeFile && isset($this->element->mimeTypeDetails['charsetUpdatable']) && $this->element->mimeTypeDetails['charsetUpdatable'] && $charset != $this->element->characterSet) {\n $this->element->oldCharacterSet = $this->element->characterSet;\n \n //Set file content to the encoded string of the file\n $this->element->fileContent = mb_convert_encoding(file_get_contents($this->element->path.$this->element->fileName),$this->characterSet,$this->element->oldCharacterSet);\n \n //Add Conversion To Element\n $this->element->fileContentConversions['charset'][] = $charset;\n \n $this->element->characterSet = $this->characterSet; \n } else {\n $this->element->fileContent = file_get_contents($this->element->path.$this->element->fileName);\n }\n }", "abstract public function encode(array $options = array());", "public function getEncoder()\n {\n return $this;\n }", "public function getEncoding()\n {\n return $this->getDomDocument()->encoding;\n }", "protected function setCharacterSet() {}", "public static function getDefaultEncodingFilter()\n {\n return Form::$defaultEncodingFilter;\n }", "public function setCharset($charset)\n {\n parent::setCharset($charset);\n if (isset($this->paramEncoder)) {\n $this->paramEncoder->charsetChanged($charset);\n }\n }", "public function encodeEncodesCorrectlyDataProvider() {}", "function getXmlEncoding()\n {\n return $this->_props['XmlEncoding'];\n }", "function set_encoding($encoding=\"\")\r\n {\r\n if(\"\" == $encoding)\r\n $encoding = $this->encoding;\r\n $sql = \"SET SESSION character_set_database = \" . $encoding; //'character_set_database' MySQL server variable is [also] to parse file with rigth encoding\r\n $res = @mysql_query($sql);\r\n return mysql_error();\r\n }", "public function getCharacterEncoding(): CharacterEncodingInterface;", "public function dataEncodingProperty()\n {\n $config = new stubSoapClientConfiguration('http://example.net/', 'urn:foo');\n $this->assertEquals('iso-8859-1', $config->getDataEncoding());\n $this->assertSame($config, $config->setDataEncoding('utf-8'));\n $this->assertEquals('utf-8', $config->getDataEncoding());\n }", "public function withEncoding($e) {\n $this->setEncoding($e);\n return $this;\n }", "public function passOnEncodingAuto()\n {\n return false;\n }", "private function set_charset() {\n\t\t//regresa bool\n\t\t$this->conn->set_charset(\"utf8\");\n\t}", "function setEncoding($enc) {\n\t\tif (!in_array($enc, array(\"UTF-8\", \"UTF-16\", \"UTF-16le\", \"UTF-16be\"))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_execute(\"PRAGMA encoding = \\\"{$enc}\\\"\") !== false;\n\t}", "abstract public function setUTF();", "function _encode($text)\r\n\t{\r\n\t\t$source_encoding = mb_detect_encoding($text);\r\n\t\t$target_encoding = _get_codeset();\r\n\t\tif ($source_encoding != $target_encoding) {\r\n\t\t\treturn mb_convert_encoding($text, $target_encoding, $source_encoding);\r\n\t\t} else {\r\n\t\t\treturn $text;\r\n\t\t}\r\n\t}", "function getDoXmlUtf8Encoding()\n {\n return $this->_props['DoXmlUtf8Encoding'];\n }", "public function getEncodingFrom()\n {\n return $this->getInputEncoding();\n }", "public function setEncoding(One_Scheme $scheme, $encoding)\n\t{\n\t\treturn null;\n\t}", "function setCharset($value)\n {\n $this->setAttribute(\"charset\", $value);\n return $this;\n }", "public function convPOSTCharset() {}", "public abstract function getCharset();", "public function init_charset()\n {\n }", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}" ]
[ "0.75633955", "0.7462407", "0.74607384", "0.7209357", "0.71258414", "0.6985281", "0.69600546", "0.69311845", "0.69078404", "0.68940026", "0.68752265", "0.6849399", "0.6812024", "0.681063", "0.67781335", "0.677467", "0.677467", "0.677467", "0.677467", "0.67268187", "0.67021084", "0.6683296", "0.6683296", "0.6665812", "0.6658291", "0.6658291", "0.6618457", "0.6601567", "0.65416944", "0.65379316", "0.65052384", "0.6471571", "0.6471278", "0.64495254", "0.644801", "0.6447684", "0.6446051", "0.6444529", "0.64212996", "0.6407631", "0.64039576", "0.64039576", "0.63717157", "0.63633657", "0.63624024", "0.6357691", "0.63383543", "0.631819", "0.6297179", "0.6291872", "0.6291872", "0.62896633", "0.6267102", "0.6252045", "0.62493294", "0.6242758", "0.62395394", "0.62033755", "0.6193116", "0.61923885", "0.6182703", "0.61794555", "0.6165602", "0.6163764", "0.61622334", "0.61622334", "0.6158034", "0.61478096", "0.61252594", "0.61134315", "0.61111146", "0.60984087", "0.6095212", "0.6086679", "0.6073852", "0.60670584", "0.6066722", "0.6057692", "0.6041079", "0.60393345", "0.6029579", "0.6027161", "0.60199565", "0.60167277", "0.5996098", "0.5976887", "0.5975624", "0.5969751", "0.59664667", "0.59544754", "0.59397143", "0.59239376", "0.59114087", "0.5889637", "0.588854", "0.5888323", "0.5887417", "0.5887417", "0.5887417", "0.5887417" ]
0.617535
62
Set the default number format
public function setDefaultFormat( $sFormat ) { $this->defaultFormat = $sFormat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function numberFormatDataProvider() {}", "protected function setInitCurrencyFormatter(){\n # $fmt = new NumberFormatter('en_US', NumberFormatter::CURRENCY);\n $fmt = new NumberFormatter('en_US', NumberFormatter::DECIMAL );\n $fmt->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS ,2 );\n # $fmt->setAttribute(NumberFormatter::MAX_SIGNIFICANT_DIGITS ,25 );\n #$fmt->setAttribute(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL ,'.');\n $fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS,100); #// by default some locales got max 2 fraction digits, so if there are more digi fractions these will be dropped\n $this->currencyFormatter=$fmt;\n }", "private function setNumberFormat($number_format)\n\t{\n\t\t$this->number_format = ($number_format instanceof Number_Format)\n\t\t\t? $number_format\n\t\t\t: new Number_Format($number_format);\n\t}", "public static function setDefaultFormat($format)\n {\n self::$default_format = $format;\n }", "public static function setDefaultFormat($format)\n {\n self::$defaultFormat = $format;\n }", "function number_format($number, $type = _NUM_TYPE)\n\t{\n\t\tswitch ($type) {\n\t\t\tcase \"figure\":\n\t\t\t\treturn XoopsLocaleJalali::Convertnumber2farsi($number);\n\t\t\t\tbreak;\n\t\t\tcase \"word\":\n\t\t\t\treturn ($number > 0) ? self::num2Words($number) : _NUMWORDS_ZERO;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn $number;\n\t\t\t\tbreak;\n\t\t}\t\n\t}", "public function setDlblNumFormat(string $value = ''): self\n {\n $this->DlblNumFormat = $value;\n\n return $this;\n }", "function do_number_format($number)\n\t{\n\t\tif ( $this->vars['number_format'] != 'none' )\n\t\t{ \n\t\t\treturn number_format($number , 0, '', $this->num_format);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $number;\n\t\t}\n\t}", "public function testFormatWithDefaults()\n {\n // test defaultLocale with 3 digits\n $formatted = $this->priceFormatter->format(123.45, 3);\n\n $this->assertEquals('123,450', $formatted, 'price format for defaultLocale does not match');\n\n // test defaultLocale with default amount of digits (see self::setUp)\n $formatted = $this->priceFormatter->format(123.45);\n\n $this->assertEquals('123,45', $formatted, 'price format for default digits does not match');\n }", "public function setFormat($value) {}", "public function getNumberFormat()\n {\n return $this->numberFormat;\n }", "public function setNumFormat($decimals = 0, $decPoint = '.', $thousandsSep = ',') {\n\t\t$this->options['num_decimals'] = $decimals;\n\t\t$this->options['num_dec_point'] = $decPoint;\n\t\t$this->options['num_thousands_sep'] = $thousandsSep;\n\t}", "function numberformat( $num ) {\n\tglobal $lang;\n\tif ( $lang == 'www' || $lang == 'meta' || $lang == 'commons' || $lang == 'en' || $lang == 'incubator' ) {\n\t\treturn number_format($num);\n\t}\n\telseif ( $lang == 'fr' ) {\n\t\treturn number_format($num, 0, ',', ' ');\n\t}\n\telse {\n\t\treturn number_format($num);\n\t}\n}", "public function formatNumber($number);", "protected function get_number_formatter()\n\t{\n\t\treturn new NumberFormatter($this);\n\t}", "function number_format_i18n($number, $decimals = 0)\n {\n }", "public function defaultFormat()\n\t{\n\t\treturn $this->format();\n\t}", "public static function getDefaultFormat()\n {\n return self::$defaultFormat;\n }", "abstract protected function setFormat();", "function format( $number , $format=null )\n {\n if( $format == null ){\n $format = $this->getFormat();\n }\n\n // handle custom formats too\n if ($format >= I18N_CUSTOM_FORMATS_OFFSET) {\n if (isset($this->_customFormats[$format])) {\n $numberFormat = $this->_customFormats[$format];\n }\n } else {\n $numberFormat = $this->_localeObj->numberFormat[$format]; \n }\n return call_user_func_array( 'number_format' , array_merge( array($number),$numberFormat) );\n }", "public static function getDefaultFormat(): string\n {\n return static::$default_format;\n }", "public function formatNumber($value)\n\t{\n\t\treturn $value;\n\t}", "public function setFormat($val)\n {\n $this->_propDict[\"format\"] = $val;\n return $this;\n }", "function international_num_format($input, $decimals = 2)\n\t{\n\t\tglobal $config;\n\n\t\tswitch ($config['number_format_style']) {\n\t\t\tcase '2': // spain, germany\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '3': // estonia\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '4': // france, norway\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '5': // switzerland\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, \",\", \"'\");\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, \",\", \"'\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '6': // kazahistan\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ',');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ',');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t} // end switch\n\t\treturn $output;\n\t}", "public function getDlblNumFormat(): string\n {\n return $this->DlblNumFormat;\n }", "function dayNumberFormat() {\n\t\tif (func_num_args()) {\n\t\t\t$this->_dayNumberFormat = trim(func_get_arg(0));\n\t\t}\n\t\telse return $this->_dayNumberFormat;\n\t}", "public function setDefaultFormat($format)\n {\n foreach (parent::all() as $route) {\n $route->setDefault('_format', $format);\n }\n }", "public function changeFormat() {\r\n\t\tif($this->get_vl_jogo() != 0.0) {\r\n\t\t\treturn 'R$ '. number_format($this->get_vl_jogo(), 2, ',', '.');\r\n\t\t}\r\n\t\treturn 'Gratuito';\r\n\t\t\t\t\r\n\t}", "public function setFormat($format);", "public function setFormat($format);", "public function setFormat($format);", "public function getOutputFormat()\n {\n $formated = $this->formatTxt(0);\n $number = $this->formatTxt(0, array('display' => Zend_Currency::NO_SYMBOL));\n return str_replace($number, '%s', $formated);\n }", "public function setFormat($format) { $this->_format = $format; }", "function format_number(int|float|string $input, int|bool|null $decimals = 0, string $decimal_separator = null, string $thousand_separator = null): string|null\n{\n if (is_string($input)) {\n if (!is_numeric($input)) {\n trigger_error(sprintf('%s(): Invalid non-numeric input', __function__));\n return null;\n }\n\n $input += 0;\n }\n\n $export = var_export($input, true);\n\n // Auto-detect decimals.\n if (is_true($decimals)) {\n $decimals = strlen(stracut($export, '.'));\n }\n\n // Prevent corruptions.\n if ($decimals > PRECISION) {\n $decimals = PRECISION;\n }\n\n $ret = number_format($input, (int) $decimals, $decimal_separator, $thousand_separator);\n\n // Append \".0\" for eg: 1.0 & upper NAN/INF.\n if (!$decimals && !is_int($input) && strlen($export) == 1) {\n $ret .= '.0';\n } elseif ($ret == 'inf' || $ret == 'nan') {\n $ret = strtoupper($ret);\n }\n\n return $ret;\n}", "public function testFormatNumber()\n {\n $target_value = 1.67583978;\n $initial_value = 1.675839781223232323223232323;\n \n $this->assertEquals($target_value, format_number($initial_value));\n }", "public function setFormat($format){\n\t\t$this->_format = $format;\n\t}", "public function testDefaultFormat()\n {\n $phoneNumber = new PhoneNumber('8015551212');\n\n $this->assertSame('(801) 555-1212', $phoneNumber->format());\n }", "function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }", "public static function setDefaultFormatSettings($formatSettings = null): void\n {\n static::$defaultFormatSettings = Options::defaults(static::$defaultFormatSettings)\n ->resolve($formatSettings)\n ->all();\n }", "public static function invoiceNumberFormat($settings, $number)\n {\n //return '#' . sprintf(\"%05d\", $number);\n return $settings[\"invoice_prefix\"] . sprintf(\"%05d\", $number);\n }", "public static function formatNumber($num){\r\n\t\treturn number_format($num, 0, '', '.');\r\n\t}", "function format_number($value=0)\n{\n\tif ((is_numeric( $value ) AND floor( $value ) != $value)) {\n\t\treturn number_format($value, 2, '.', ',');\n\t} else {\n\t\treturn number_format($value);\n\t}\n}", "function numberFormat($amount) {\n try {\n return number_format($amount);\n } catch (Exception $e) {\n return $amount;\n }\n }", "public function setFormat( $format ) {\n\t\t\t$this->_format = $format;\n\t\t\t$this->_data['format'] = $this->_format;\n\t\t}", "public function numero($numero) {\n\n $formatado = $numero / 1000;\n if ($formatado < 10) {\n $formatado = '0' . $formatado;\n }\n return $formatado;\n }", "public function getFormat(): int;", "function format_number(float $num, int $precision = 1, ?string $locale = null, array $options = []): string\n {\n // If locale is not passed, get from the default locale that is set from our config file\n // or set by HTTP content negotiation.\n $locale ??= Locale::getDefault();\n\n // Type can be any of the NumberFormatter options, but provide a default.\n $type = (int) ($options['type'] ?? NumberFormatter::DECIMAL);\n\n $formatter = new NumberFormatter($locale, $type);\n\n // Try to format it per the locale\n if ($type === NumberFormatter::CURRENCY) {\n $formatter->setAttribute(NumberFormatter::FRACTION_DIGITS, $options['fraction']);\n $output = $formatter->formatCurrency($num, $options['currency']);\n } else {\n // In order to specify a precision, we'll have to modify\n // the pattern used by NumberFormatter.\n $pattern = '#,##0.' . str_repeat('#', $precision);\n\n $formatter->setPattern($pattern);\n $output = $formatter->format($num);\n }\n\n // This might lead a trailing period if $precision == 0\n $output = trim($output, '. ');\n\n if (intl_is_failure($formatter->getErrorCode())) {\n throw new BadFunctionCallException($formatter->getErrorMessage());\n }\n\n // Add on any before/after text.\n if (isset($options['before']) && is_string($options['before'])) {\n $output = $options['before'] . $output;\n }\n\n if (isset($options['after']) && is_string($options['after'])) {\n $output .= $options['after'];\n }\n\n return $output;\n }", "protected function getFormat()\n {\n return 'FORMAT: 1A';\n }", "function numberformat($qwe,$asd)\r\n{\r\n if($qwe==0)$zxc='0'; \r\n else{\r\n $zxc=number_format($qwe,$asd);\r\n }\r\n return $zxc;\r\n}", "public function getFormat(): int\n {\n return self::FORMAT_6;\n }", "function setNota_num($inota_num = '')\n {\n // adminto ',' como separador decimal.\n $inota_num = str_replace(\",\", \".\", $inota_num);\n $this->inota_num = $inota_num;\n }", "function Formato1($val){\r\n return number_format($val,0,\",\",\".\");\r\n }", "public function setNumberFormat($decimal, $decimalPoint, $thousandSep)\n {\n $this->numberFormat = array($decimal, $decimalPoint, $thousandSep);\n }", "public function setFormat(Format $format)\n\t{\n\t\t$this->format=$format; \n\t\t$this->keyModified['format'] = 1; \n\n\t}", "function yourls_number_format_i18n( $number, $decimals = 0 ) {\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\t$formatted = number_format( $number, abs( intval( $decimals ) ), $yourls_locale_formats->number_format['decimal_point'], $yourls_locale_formats->number_format['thousands_sep'] );\n\treturn yourls_apply_filter( 'number_format_i18n', $formatted );\n}", "private function numberFormat($value): string\n\t{\n\t\treturn number_format(\n\t\t\t(float) $value,\n\t\t\tRSFormProHelper::getConfig('payment.nodecimals'),\n\t\t\tRSFormProHelper::getConfig('payment.decimal'),\n\t\t\tRSFormProHelper::getConfig('payment.thousands')\n\t\t);\n\t}", "public function setAxisNumberProperties($format_code)\n {\n $this->axisNumber['format'] = (string) $format_code;\n $this->axisNumber['source_linked'] = 0;\n }", "public function setFormat($format) {\n\t\tif ($format !== 'raw') {\n\t\t\t$format = 'parsed';\n\t\t}\n\t\t$this->format = $format;\n\t}", "public static function number($number, $options = '')\n\t{\n\n\t\t// Handle specific values AND types (this makes sure to allow '0' as a string and 0 as an integer)\n\t\tif ($number === '' || $number === false || $number === null) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$formatted_number = false;\n\n\t\t/** Define the default argument array. */\n\t\t$defaults = array(\n\t\t\t'add_commas' => true,\n\t\t\t'add_currency_sign' => true,\n\t\t\t'abbreviate' => true\n\t\t);\n\n\t\t/** Merge the arguments with the defaults. */\n\t\t$options = wp_parse_args($options, $defaults);\n\n\t\t//given a number, properly insert commas. \n\t\tif ($options['add_commas']) {\n\t\t\t$formatted_number = number_format($number);\n\t\t}\n\n\t\tif ($options['abbreviate']) {\n\t\t\t$formatted_number = self::abbreviate_number($formatted_number);\n\t\t}\n\n\t\t//insert $ sign.\n\t\tif ($options['add_currency_sign']) {\n\t\t\t$formatted_number = pls_get_currency_symbol() . $formatted_number;\n\t\t}\n\n\t\treturn $formatted_number;\n\n\t}", "function smarty_modifier_number_format($string, $places=2, $dec=\",\", $thoussep=\" \")\n{\n if (!$string) return $string;\n return number_format($string, $places, $dec, $thoussep);\n}", "public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace('&#160;', ' ', $separator));\n }", "public function setNumber($val)\n {\n $this->_propDict[\"number\"] = $val;\n return $this;\n }", "public function format($format, $callable = 'number_format') {\n\t\t\tif (is_numeric($format)) {\n\t\t\t\t$value = call_user_func_array($callable, $format);\n\t\t\t\treturn static::factory($this->name, $value);\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function getFormat($format){\n\t\t$this->_format = $format;\n\t}", "public function setFormat($value)\n {\n return $this->set('Format', $value);\n }", "public function setFormat($value)\n {\n return $this->set('Format', $value);\n }", "public function setFormat($format)\n {\n $this->format = $format;\n }", "public function setFormat($format)\n {\n $this->format = $format;\n }", "public function __construct() {\n\t\t\t$this->field_type = 'number';\n\n\t\t\tparent::__construct();\n\t\t}", "public static function resetDefaults(): void\n {\n static::$defaultMaxDecPl = static::ORIG_MAX_DEC_PL;\n static::$defaultImmutable = static::ORIG_IMMUTABLE;\n static::$defaultFormatSettings = static::ORIG_FORMAT_SETTINGS;\n\n static::$localeResolver = null;\n }", "function money_format($format, $number) {\r\n\t\tif (function_exists('money_format')) {\r\n\t\t\treturn money_format($format, $number);\r\n\t\t}\r\n\t\tif (setlocale(LC_MONETARY, 0) == 'C') {\r\n\t\t\tsetlocale(LC_MONETARY, '');\r\n\t\t\t//return number_format($number, 2);\r\n\t\t}\r\n\r\n\t\t$locale = localeconv();\r\n\r\n\t\t$regex = '/%((?:[\\^!\\-]|\\+|\\(|\\=.)*)([0-9]+)?'\r\n\t\t\t\t. '(?:#([0-9]+))?(?:\\.([0-9]+))?([in%])/';\r\n\r\n\t\tpreg_match_all($regex, $format, $matches, PREG_SET_ORDER);\r\n\r\n\t\tforeach ($matches as $fmatch) {\r\n\t\t\t$value = floatval($number);\r\n\t\t\t$flags = array(\r\n\t\t\t\t\t'fillchar' => preg_match('/\\=(.)/', $fmatch[1], $match) ? $match[1]\r\n\t\t\t\t\t\t\t: ' ',\r\n\t\t\t\t\t'nogroup' => preg_match('/\\^/', $fmatch[1]) > 0,\r\n\t\t\t\t\t'usesignal' => preg_match('/\\+|\\(/', $fmatch[1], $match) ? $match[0]\r\n\t\t\t\t\t\t\t: '+',\r\n\t\t\t\t\t'nosimbol' => preg_match('/\\!/', $fmatch[1]) > 0,\r\n\t\t\t\t\t'isleft' => preg_match('/\\-/', $fmatch[1]) > 0);\r\n\t\t\t$width = trim($fmatch[2]) ? (int) $fmatch[2] : 0;\r\n\t\t\t$left = trim($fmatch[3]) ? (int) $fmatch[3] : 0;\r\n\t\t\t$right = trim($fmatch[4]) ? (int) $fmatch[4]\r\n\t\t\t\t\t: $locale['int_frac_digits'];\r\n\t\t\t$conversion = $fmatch[5];\r\n\r\n\t\t\t$positive = true;\r\n\t\t\tif ($value < 0) {\r\n\t\t\t\t$positive = false;\r\n\t\t\t\t$value *= -1;\r\n\t\t\t}\r\n\t\t\t$letter = $positive ? 'p' : 'n';\r\n\r\n\t\t\t$prefix = $suffix = $cprefix = $csuffix = $signal = '';\r\n\r\n\t\t\t$signal = $positive ? $locale['positive_sign']\r\n\t\t\t\t\t: $locale['negative_sign'];\r\n\t\t\tswitch (true) {\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 1\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$prefix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 2\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$suffix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 3\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$cprefix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 4\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$csuffix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $flags['usesignal'] == '(':\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 0:\r\n\t\t\t\t$prefix = '(';\r\n\t\t\t\t$suffix = ')';\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (!$flags['nosimbol']) {\r\n\t\t\t\t$currency = $cprefix\r\n\t\t\t\t\t\t. ($conversion == 'i' ? $locale['int_curr_symbol']\r\n\t\t\t\t\t\t\t\t: $locale['currency_symbol']) . $csuffix;\r\n\t\t\t} else {\r\n\t\t\t\t$currency = '';\r\n\t\t\t}\r\n\t\t\t$space = $locale[\"{$letter}_sep_by_space\"] ? ' ' : '';\r\n\r\n\t\t\t$value = number_format($value, $right,\r\n\t\t\t\t\t$locale['mon_decimal_point'],\r\n\t\t\t\t\t$flags['nogroup'] ? '' : $locale['mon_thousands_sep']);\r\n\t\t\t$value = @explode($locale['mon_decimal_point'], $value);\r\n\r\n\t\t\t$n = strlen($prefix) + strlen($currency) + strlen($value[0]);\r\n\t\t\tif ($left > 0 && $left > $n) {\r\n\t\t\t\t$value[0] = str_repeat($flags['fillchar'], $left - $n)\r\n\t\t\t\t\t\t. $value[0];\r\n\t\t\t}\r\n\t\t\t$value = implode($locale['mon_decimal_point'], $value);\r\n\t\t\tif ($locale[\"{$letter}_cs_precedes\"]) {\r\n\t\t\t\t$value = $prefix . $currency . $space . $value . $suffix;\r\n\t\t\t} else {\r\n\t\t\t\t$value = $prefix . $value . $space . $currency . $suffix;\r\n\t\t\t}\r\n\t\t\tif ($width > 0) {\r\n\t\t\t\t$value = str_pad($value, $width, $flags['fillchar'],\r\n\t\t\t\t\t\t$flags['isleft'] ? STR_PAD_RIGHT : STR_PAD_LEFT);\r\n\t\t\t}\r\n\r\n\t\t\t$format = str_replace($fmatch[0], $value, $format);\r\n\t\t}\r\n\t\treturn $format;\r\n\t}", "protected function numberFormat($number)\n {\n return number_format($number, 2, $this->t('decimalSeparator'), $this->t('thousandsSeparator'));\n }", "function format($val) {\r\n //setlocale(LC_MONETARY, 'en_US');\r\n return number_format(money_format('%i', $val), 2);\r\n }", "public function format($format);", "function drush_set_default_outputformat($format, $metadata = array()) {\n $command = drush_get_command();\n $command['engines']['outputformat']['default'] = $format;\n $outputformat = drush_load_command_engine($command, 'outputformat', $metadata);\n}", "function getFormatNumericDecimal( $n, $p=2 )\n{\n // $r = round( $n, $p );\n $r = number_format($n, 2, '.', '');\n if( $r == '' or $r == 0 or $r == 0.00 )\n {\n $r = '0.00';\n }\n return $r;\n}", "public static function numberFormat($number)\n {\n return number_format($number,2,'.','');\n }", "private function init(): void\n {\n $this->value_signs = [\n '+' => 'plus',\n '-' => 'minus',\n ];\n\n // init number formatter\n $formatter = new NumberFormatter($this->getValueLocale(), NumberFormatter::SPELLOUT);\n\n // generate number value array with translated labels per locale\n for ($index = $this->getValueRange()[0]; $index <= $this->getValueRange()[1]; $index++) {\n $this->value_numbers[$index] = $formatter->format($index);\n }\n }", "public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n $decimal_value = $this->getDecimalValue($this->object->getValue());\n\n if (setting_value('visiosoft.field_type.decimal::showDecimalMaxPrice') < intval($this->object->getValue()) and $decimal_value == 0) {\n if (!setting_value('visiosoft.field_type.decimal::showDecimal')) {\n $decimals = 0;\n }\n }\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace('&#160;', ' ', $separator));\n }", "public static function convert_number_field() {\n\n\t\t// Create a new Number field.\n\t\tself::$field = new GF_Field_Number();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Number specific properties.\n\t\tself::$field->rangeMin = rgar( self::$nf_field, 'number_min' );\n\t\tself::$field->rangeMax = rgar( self::$nf_field, 'number_max' );\n\n\t\t// Add currency property if needed.\n\t\tif ( rgar( self::$nf_field, 'mask' ) && 'currency' === self::$nf_field['mask'] ) {\n\t\t\tself::$field->numberFormat = 'currency';\n\t\t}\n\n\t}", "abstract public function getFormat(): int;", "private static function numberFormat($number)\r\n {\r\n if (!is_string($number))\r\n return number_format($number, 2, ',', ' ');\r\n else\r\n return $number;\r\n }", "public function setNumberPattern($pattern)\n\t{\n\t\t$this->number_pattern = $pattern;\n\t\treturn $this;\n\t}", "function iu_format_number($input){\n\t$suffixes = array('', 'k', 'M', 'B');\n\t$suffixIndex = 0;\n\n\twhile(abs($input) >= 1000 && $suffixIndex < sizeof($suffixes)){\n\t\t$suffixIndex++;\n\t\t$input /= 1000;\n\t}\n\treturn round(floatval($input / pow(10, 0)),1).$suffixes[$suffixIndex];\n}", "function getDefaultFormat() {\n return MYSQL_DATETIME_FORMAT;\n }", "public function testFormat(): void\n {\n $tests = $this->currencyPermutationsWithLocales();\n $results = [];\n\n foreach ($tests as $test => $parameters) {\n $locale = new Locale($parameters['locale']);\n $formatOptions = new NumberFormatOptions($parameters['options']);\n $formatter = new NumberFormat($locale, $formatOptions);\n\n $results[$test] = [\n 'result' => $formatter->format(self::NUMBER),\n ];\n }\n\n $this->assertMatchesJsonSnapshot($results);\n }", "public function formatSettings($formatSettings): self\n {\n $realNum = $this->immute();\n $realNum->formatSettings = Options::defaults(static::$defaultFormatSettings)->resolve($formatSettings)->all();\n return $realNum; // chainable - immutable\n }", "protected function get_default_format_fields() {\n\t\treturn null;\n\t}", "function index()\r\n\t{\r\n\t\t//\techo number_format(0, 2, '.', '');\r\n\t}", "protected function formatNumber(string $number, NumberFormat $numberFormat, array $options = []): string\n {\n $parsedPattern = $this->getParsedPattern($numberFormat, $options['style']);\n // Start by rounding the number, if rounding is enabled.\n if (is_int($options['rounding_mode'])) {\n $number = Calculator::round($number, $options['maximum_fraction_digits'], $options['rounding_mode']);\n }\n $negative = (Calculator::compare('0', $number, 12) == 1);\n // Ensure that the value is positive and has the right number of digits.\n $signMultiplier = $negative ? '-1' : '1';\n $number = bcdiv($number, $signMultiplier, $options['maximum_fraction_digits']);\n // Split the number into major and minor digits.\n $numberParts = explode('.', $number);\n $majorDigits = $numberParts[0];\n // Account for maximumFractionDigits = 0, where the number won't\n // have a decimal point, and $numberParts[1] won't be set.\n $minorDigits = isset($numberParts[1]) ? $numberParts[1] : '';\n\n if ($options['use_grouping'] && $parsedPattern->isGroupingUsed()) {\n // Reverse the major digits, since they are grouped from the right.\n $majorDigits = array_reverse(str_split($majorDigits));\n // Group the major digits.\n $groups = [];\n $groups[] = array_splice($majorDigits, 0, $parsedPattern->getPrimaryGroupSize());\n while (!empty($majorDigits)) {\n $groups[] = array_splice($majorDigits, 0, $parsedPattern->getSecondaryGroupSize());\n }\n // Reverse the groups and the digits inside of them.\n $groups = array_reverse($groups);\n foreach ($groups as &$group) {\n $group = implode(array_reverse($group));\n }\n // Reconstruct the major digits.\n $majorDigits = implode(',', $groups);\n }\n\n if ($options['minimum_fraction_digits'] < $options['maximum_fraction_digits']) {\n // Strip any trailing zeroes.\n $minorDigits = rtrim($minorDigits, '0');\n if (strlen($minorDigits) < $options['minimum_fraction_digits']) {\n // Now there are too few digits, re-add trailing zeroes\n // until the desired length is reached.\n $neededZeroes = $options['minimum_fraction_digits'] - strlen($minorDigits);\n $minorDigits .= str_repeat('0', $neededZeroes);\n }\n }\n\n // Assemble the final number and insert it into the pattern.\n $number = strlen($minorDigits) ? $majorDigits . '.' . $minorDigits : $majorDigits;\n $pattern = $negative ? $parsedPattern->getNegativePattern() : $parsedPattern->getPositivePattern();\n $number = preg_replace('/#(?:[\\.,]#+)*0(?:[,\\.][0#]+)*/', $number, $pattern);\n $number = $this->localizeNumber($number, $numberFormat);\n\n return $number;\n }", "function twig_number_format_filter(Twig_Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null)\n{\n $defaults = $env->getExtension('core')->getNumberFormat();\n if (null === $decimal) {\n $decimal = $defaults[0];\n }\n if (null === $decimalPoint) {\n $decimalPoint = $defaults[1];\n }\n if (null === $thousandSep) {\n $thousandSep = $defaults[2];\n }\n return number_format((float) $number, $decimal, $decimalPoint, $thousandSep);\n}", "public function setNumber($value)\n {\n // strip non-numeric characters\n return $this->setParameter('number', preg_replace('/\\D/', '', $value));\n }", "public function formatNumber($value = 0, $type = 0, $minimumDigits = -1, $maximumDigits = -1)\n {\n if (empty($type)) {\n $type = \\NumberFormatter::DECIMAL;\n }\n\n $numberFormatter = new \\NumberFormatter($this->_currentLocale, $type);\n\n if ($minimumDigits > -1) {\n $numberFormatter->setAttribute(\\NumberFormatter::MIN_FRACTION_DIGITS, $minimumDigits);\n }\n\n if ($maximumDigits > -1) {\n $numberFormatter->setAttribute(\\NumberFormatter::MAX_FRACTION_DIGITS, $maximumDigits);\n }\n return $numberFormatter->format($value);\n }", "public function setSetNumberFormat($setNumberFormat)\n {\n $this->setNumberFormat = (bool) $setNumberFormat;\n\n return $this;\n }", "public function formatNumber($value)\n {\n $decimal = Configuration::first()->decimal;\n return number_format($value, $decimal, \".\", \"\");\n }", "public function setNtry($value,$options=array('required'=>true)){ \n $this->_data['ntry'] = new ZendT_Type_Number($value,array('numDecimal'=>0));\n if ($options['db'])\n $this->_data['ntry']->setValueFromDb($value);\n \n if (!$options['db']){\n \n }\n return $this;\n }", "function erp_number_format_i18n( $number ) {\n // cast as string\n $number = (string) $number;\n\n // check if . exist\n if ( strpos( $number, '.' ) !== false ) {\n $extract = explode( '.', $number );\n if ( isset( $extract[1] ) && absint( $extract[1] > 0 ) ) {\n return number_format_i18n( $number, 1 );\n }\n }\n return number_format_i18n( $number );\n}", "public function decimalFormat($value, $locale = null, $symbol = null);", "protected function _setNumeric($name, $value) {}", "function formatNumbers($inputID)\n\t{\n\t\t$number_format = number_format($inputID);\n\t\t\n\t\techo $number_format;\n\t}" ]
[ "0.706731", "0.6768794", "0.66845965", "0.6681815", "0.6614024", "0.6586625", "0.6567919", "0.6553958", "0.654645", "0.6540927", "0.65261793", "0.648505", "0.6400045", "0.63865906", "0.6278716", "0.6273468", "0.62404364", "0.6206308", "0.6142955", "0.6021968", "0.60026103", "0.59859115", "0.5950749", "0.5925028", "0.591897", "0.5869387", "0.58631915", "0.58415234", "0.58064574", "0.58064574", "0.58064574", "0.57641596", "0.57473123", "0.5730726", "0.5727784", "0.57146376", "0.5690908", "0.56398976", "0.56367767", "0.56328994", "0.56290233", "0.5612058", "0.5594404", "0.55886143", "0.55757236", "0.55683583", "0.5529876", "0.55233693", "0.5518501", "0.55172205", "0.5515766", "0.55080056", "0.55059123", "0.5505286", "0.5487832", "0.54701036", "0.5459014", "0.54548216", "0.54500955", "0.541209", "0.54076314", "0.53965235", "0.5377815", "0.53705055", "0.5365925", "0.5365925", "0.53414106", "0.53414106", "0.5341251", "0.53411174", "0.534059", "0.53373444", "0.5333535", "0.53107697", "0.53073156", "0.530723", "0.53036636", "0.53036034", "0.5300624", "0.5287666", "0.5281078", "0.5277505", "0.5274766", "0.52724934", "0.52701074", "0.52652067", "0.5264318", "0.5262394", "0.5262171", "0.52615887", "0.52593505", "0.5246671", "0.5239498", "0.5218519", "0.5214689", "0.52096885", "0.520895", "0.52085996", "0.52063346", "0.5206317" ]
0.6113993
19
Force a column to use a certain format
public function setColumnFormat( $column, $sFormat ) { $this->columnsFormat[ $column ] = $sFormat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAlterColumnFormat()\n {\n $this->format = '{type}{length}{notnull}{append}';\n }", "public function cellFormat($row, $column) {\n\t}", "function formatColumn($column , $db)\n\t{\n\t\tif(JString::stristr(JString::strtolower($column->cacheSqlSpec),'date'))\n\t\t\treturn \"DATE_FORMAT(\".$db->quoteName($column->cacheColumnName).\", '%d-%m-%Y') \";\n\n\t\t return parent::formatColumn($column, $db);\n\t}", "public function setCellFormat($row, $column, $format) {\n\t}", "public function formatRow($row){\r\n \tif(!empty($row))\r\n \t$row['_rev'] = \"\";\r\n return $row;\r\n }", "public function setFormat($value) {}", "public function setAllowFormatColumns(?bool $value): void {\n $this->getBackingStore()->set('allowFormatColumns', $value);\n }", "private static function normalizeColumnType($col)\n {\n if (preg_match('/\\((.+)\\)/', $col['type'], $matches)) {\n $col['precision'] = $matches[1];\n $col['type'] = preg_replace('/\\(.*/', '', $col['type']);\n }\n $col['type'] = strtolower($col['type']);\n switch ($col['type']) {\n case 'bool':\n case 'tinyint':\n $col['type'] = 'boolean';\n break;\n case 'int':\n $col['type'] = 'integer';\n break;\n case 'nvarchar':\n $col['type'] = 'varchar';\n break;\n case 'float':\n case 'double':\n case 'decimal':\n $col['type'] = 'numeric';\n break;\n case 'timestamp':\n $col['type'] = 'datetime';\n break;\n case 'enum':\n $col['precision'] = array_map(function($e) { return trim($e, \"'\"); }, explode(',', $col['precision']));\n }\n return $col;\n }", "protected abstract function formatWithQuote($s, $type = 'column');", "protected function beforeValidate ()\n {\n //$this->tglrevisimodul = date ('Y-m-d', strtotime($this->tglrevisimodul));\n $format = new MyFormatter();\n //$this->tglrevisimodul = $format->formatDateTimeForDb($this->tglrevisimodul);\n foreach($this->metadata->tableSchema->columns as $columnName => $column){\n if ($column->dbType == 'date')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n }\n else if ($column->dbType == 'timestamp without time zone')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n } \n }\n\n return parent::beforeValidate ();\n }", "protected function beforeValidate ()\n {\n //$this->tglrevisimodul = date ('Y-m-d', strtotime($this->tglrevisimodul));\n $format = new MyFormatter();\n //$this->tglrevisimodul = $format->formatDateTimeForDb($this->tglrevisimodul);\n foreach($this->metadata->tableSchema->columns as $columnName => $column){\n if ($column->dbType == 'date')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n }\n else if ( $column->dbType == 'timestamp without time zone')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n }\n }\n\n return parent::beforeValidate ();\n }", "public function getSqlFormattedValue()\n {\n if ($this->getType() == \"string\" || $this->getType() == \"time\" || $this->getType() == \"enum\") {\n return \"{\" .\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName() .\",'notNumber')},\";\n } else if ($this->getType() == \"date\") {\n return \"{\" .\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName() .\",'date')},\";\n } else if ($this->getType() == \"datetime\") {\n return \"{\" .\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName() .\",'datetime')},\";;\n } else {\n return \"{\". \"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName().\")},\";\n }\n /*\n } else if ($this->getType() == \"date_OLD\") {\n return \"STR_TO_DATE(\". \"{\".\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName().\",'date')},\".\"'\". \"{\".\"$\".\"constants['STORED_DATE_FORMAT']}\" .\"'),\";\n } else if ($this->getType() == \"datetime_OLD\") {\n return \"STR_TO_DATE(\". \"{\".\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName().\",'date')},\".\"'\". \"{\".\"$\".\"constants['STORED_DATETIME_FORMAT']}\" .\"'),\";\n */\n\n }", "public function formatRowWithStringsAlignRightByDefault()\n {\n // Given\n $fieldSpecs = array(\n array(\n \"len\" => \"10\",\n \"type\" => \"s\"),\n array(\n \"len\" => \"15\",\n \"type\" => \"s\"),\n );\n $values = array(\"first\", \"second\");\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \" \");\n\n // Then\n $this->assertEquals($result, \" first second\");\n }", "abstract protected function setFormat();", "function customformat() {\n return false;\n }", "private function colConvert($col) {\n return \":\" . preg_replace(\"/[^a-zA-Z]/\", \"\", $col);\n }", "public static function format($table_data){\r\n return (!is_numeric($table_data) && !is_bool($table_data))? \"'$table_data'\": $table_data;\r\n }", "function format_data_out_db($db_date_column)\n{\n $formatted_date = \"DATE_FORMAT($db_date_column, '%a %d %m %Y') \";\n return $formatted_date;\n}", "public function writeCol($column, $data, $row_start = 0, $format = null) {\n\t}", "public function testFormat(): void\n\t{\n\t\t$datetime = $this->grid->addColumnDateTime('date', 'Date');\n\t\tAssert::same('15. 12. 2015', $this->render($datetime));\n\n\t\t$datetime->setFormat('H:i:s');\n\t\tAssert::same('22:58:42', $this->render($datetime));\n\t}", "function formatRow(){\n $this->hook('formatRow');\n }", "function formatField($fieldname, $format)\n\t{\n\t\tif (isset($this->table->fields[$fieldname]))\n\t\t{\n\t\t\t$this->table->fields[$fieldname]->format = $format;\n\t\t}\n\t\telse\n\t\t\ttrigger_error(\"No field exists with the name: $fieldname\");\n\t}", "protected function type_float(Magic $column)\n {\n return 'FLOAT';\n }", "protected function type_float(Magic $column)\n {\n return 'FLOAT';\n }", "function _clean_column($val)\n {\n return str_replace(array(';', \"'\", '\"', '`'), array(''), $val);\n }", "protected function typeFloat(Magic $column)\n {\n return 'FLOAT';\n }", "public function formatRowWPadsWithGivenChar()\n {\n // Given\n $fieldSpecs = array(\n array(\"len\" => \"10\", \"type\" => \"s\"),\n array(\"len\" => \"15\", \"type\" => \"s\"),\n );\n $values = array(\"first\", \"second\");\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \"0\");\n\n // Then\n $this->assertEquals($result, \"00000first000000000second\");\n }", "function removeDot00( $value, $column = '' )\n{\n\treturn str_replace( '.00', '', $value );\n}", "public function treatEntity() {\n foreach ($this->entity as $columnName => &$column) {\n if (($column['contraint'] != 'pk' || $column['is_null'] == 'YES') && empty($column['value'])) {\n $column['value'] = 'NULL';\n } else if (!empty($column['value'])) {\n\n if ($column['type'] == 'numeric') {\n $column['value'] = str_replace('.', '', $column['value']);\n $column['value'] = (float) str_replace(',', '.', $column['value']);\n }\n //\n if ($column['type'] == 'date') {\n $dateExplode = explode(\"/\", $column['value']);\n $column['value'] = \"'\" . implode(\"-\", array_reverse($dateExplode)) . \"'\";\n } elseif ($column['type'] == 'timestamp without time zone' && strpos($column['value'], '/')) {\n $column['value'] = addslashes($column['value']);\n if (strpos($column['value'], ':')) {\n $dateExplode = explode(\" \", $column['value']);\n $dateExplode[0] = explode(\"/\", $dateExplode[0]);\n $column['value'] = \"'\" . implode(\"-\", array_reverse($dateExplode[0])) . ' ' . $dateExplode[1] . \"'\";\n } else {\n $dateExplode = explode(\"/\", $column['value']);\n $column['value'] = \"'\" . implode(\"-\", array_reverse($dateExplode)) . \"'\";\n }\n } else {\n $column['value'] = addslashes($column['value']);\n $column['value'] = \"'{$column['value']}'\";\n }\n }\n }\n }", "public static function format($data, $column = array(), $sm = null)\n {\n return str_pad($data[$column['name']], 5, '0', STR_PAD_LEFT) .\n ($data[$column['name']] === 0 ? ' (Office copy)' : '');\n }", "public static function updateTableColumnFormat($table, $column, $definition, $problems)\n {\n if (in_array('type', $problems)) {\n // Cahnge data type\n $type = '';\n switch ($definition['type']) {\n case 'int':\n case 'uint':\n $size = array_key_exists('size', $definition) ? $definition['size'] : 'medium';\n if (!$size) {\n $size = 'medium';\n }\n $s2s = array('small' => 'smallint', 'medium' => 'integer', 'big' => 'bigint');\n $type .= $s2s[$size];\n break;\n \n case 'string':\n $type .= 'character varying('.$definition['size'].')';\n break;\n \n case 'bool':\n $type .= 'boolean';\n break;\n \n case 'text':\n $type .= 'text';\n break;\n\n case 'mediumtext':\n $type .= 'text';\n break;\n \n case 'date':\n $type .= 'date';\n break;\n \n case 'datetime':\n $type .= 'timestamp';\n break;\n \n case 'time':\n $type .= 'time';\n break;\n }\n \n if ($type) {\n DBI::exec('ALTER TABLE '.$table.' ALTER COLUMN '.$column.' TYPE '.$type);\n }\n }\n \n // Options defaults\n foreach (array('null', 'primary', 'unique', 'autoinc') as $k) {\n if (!array_key_exists($k, $definition)) {\n $definition[$k] = false;\n }\n }\n \n // Change nullable\n if (in_array('null', $problems)) {\n if ($definition['null']) {\n DBI::exec('ALTER TABLE '.$table.' ALTER COLUMN '.$column.' DROP NOT NULL');\n } else {\n DBI::exec('ALTER TABLE '.$table.' ALTER COLUMN '.$column.' SET NOT NULL');\n }\n }\n\n // Change default\n if (in_array('default', $problems)) {\n if (array_key_exists('default', $definition)) {\n if (is_null($definition['default'])) {\n DBI::exec('ALTER TABLE '.$table.' ALTER COLUMN '.$column.' SET DEFAULT NULL');\n } elseif (is_bool($definition['default'])) {\n DBI::exec('ALTER TABLE '.$table.' ALTER COLUMN '.$column.' SET DEFAULT '.($definition['default'] ? 'true' : 'false'));\n } else {\n $s = DBI::prepare('ALTER TABLE '.$table.' ALTER COLUMN '.$column.' SET DEFAULT :default');\n $s->execute(array(':default' => $definition['default']));\n }\n } else {\n DBI::exec('ALTER TABLE '.$table.' ALTER COLUMN '.$column.' DROP DEFAULT');\n }\n }\n \n // Change primary\n if (in_array('primary', $problems)) {\n if ($definition['primary']) {\n DBI::exec('ALTER TABLE '.$table.' ADD CONSTRAINT primary_'.$column.' PRIMARY KEY ('.$column.')');\n } else {\n DBI::exec('ALTER TABLE '.$table.' DROP CONSTRAINT primary_'.$column);\n }\n }\n \n // Change unique\n if (in_array('unique', $problems)) {\n if ($definition['unique']) {\n DBI::exec('ALTER TABLE '.$table.' ADD CONSTRAINT unique_'.$column.' UNIQUE ('.$column.')');\n } else {\n DBI::exec('ALTER TABLE '.$table.' DROP CONSTRAINT unique_'.$column);\n }\n }\n \n // Change autoinc\n if (in_array('autoinc', $problems)) {\n if ($definition['autoinc']) {\n self::createSequence($table, $column);\n } else {\n DBI::exec('ALTER TABLE '.$table.' ALTER COLUMN '.$column.' DROP DEFAULT'); // Should we drop the sequence as well ?\n }\n }\n }", "protected function type_date(Magic $column)\n {\n return 'DATETIME';\n }", "protected function type_date(Magic $column)\n {\n return 'DATETIME';\n }", "public function getMySQLFormat()\r\n\t{\r\n\t\treturn $this->format('Y-m-d');\r\n\t}", "protected function typeDate(Magic $column)\n {\n return 'DATETIME';\n }", "public function GetColumnFormatCSSClass()\n {\n return 'THTMLTableColumnText';\n }", "public function setColumna($col){\n if($col>3 ){\n $this->columna = 3;\n }\n elseif ($col<0) {\n $this->columna = 0;\n }\n else{\n $this->columna = $col;\n }\n }", "public function formatValueForDatabase($value) {\n\t\tswitch ($this->type) {\n\t\t\tcase 'Date':\n\t\t\t\t/**\n\t\t\t\t * @var \\DateTime $value\n\t\t\t\t */\n\t\t\t\t$value = $value->format('Y-m-d');\n\t\t\t\tbreak;\n\n\t\t\tcase 'DateTime':\n\t\t\t\t/**\n\t\t\t\t * @var \\DateTime $value\n\t\t\t\t */\n\t\t\t\t$value = $value->format('Y-m-d H:i:s');\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}", "protected function setUpOldColumn()\n {\n return new Column('foo', Type::getType(Type::STRING));\n }", "function format($value);", "function dbformatvalue($format, $value) {\n switch ($format) {\n case '%s':\n case '%g':\n if (is_null($value)) {\n return 'NULL';\n } else {\n return \"'\" . addslashes($value) . \"'\";\n }\n case '%S':\n if (is_null($value)) {\n return \"''\";\n } else {\n return \"'\" . addslashes($value) . \"'\";\n }\n case '%d':\n case '%f':\n if (is_null($value) || !is_numeric($value)) {\n return 'NULL';\n } else {\n return $value;\n }\n case '%D':\n case '%F':\n if (is_null($value) || !is_numeric($value)) {\n return 0;\n } else {\n return $value;\n }\n case '%G':\n if (is_null($value)) {\n return '0.0';\n } else {\n return \"'\" . $value . \"'\";\n }\n case '%x':\n if (is_null($value) || !is_int($value)) {\n return 'NULL';\n } else {\n return '0x' . sprintf(\"%X\", $value);\n }\n case '%X':\n if (is_null($value) || !is_int($value)) {\n return '0x0';\n } else {\n return '0x' . sprintf(\"%X\", $value);\n }\n default:\n return sprintf($format, \"'\" . addslashes($value) . \"'\");\n }\n}", "public function dateFormat($format = null): Column\n {\n if ($format === null) {\n $format = __('boilerplate::date.YmdHis');\n }\n\n if (is_string($format)) {\n $format = function () use ($format) {\n return \"$.fn.dataTable.render.moment('$format')\";\n };\n }\n\n if ($format instanceof Closure) {\n $this->attributes['render'] = $format;\n }\n\n $this->filter(function ($query, $q) {\n if (preg_match('#^[0-9]{4}-[0-9]{2}-[0-9]{2}\\s[0-9]{2}:[0-9]{2}:[0-9]{2}|[0-9]{4}-[0-9]{2}-[0-9]{2}\\s[0-9]{2}:[0-9]{2}:[0-9]{2}$#', $q)) {\n [$start, $end] = explode('|', $q);\n $query->whereBetween($this->name ?? $this->data, [$start, $end]);\n }\n });\n\n $this->filterType('daterangepicker');\n\n return $this;\n }", "protected function type_timestamp(Magic $column)\n {\n return 'DATETIME';\n }", "public static function htmlColumnType($value, $column, $record)\n {\n return $value;\n }", "function format($cols,$name,$value='',$unit=''){\n $vlen=strlen($value.$unit)+1;\n $format='%-'.($cols-$vlen).\".\".($cols-$vlen).\"s\".'%'.($vlen).\".\".($vlen).\"s\"; //name & value+unit\n return sprintf($format,$name,$value.$unit);\n}", "protected function typeTimestamp(Magic $column)\n {\n return 'DATETIME';\n }", "protected function type_decimal(Magic $column)\n {\n return 'FLOAT';\n }", "public function format($form_name, $column_header, $column_data, $rowid, $state)\n\t{\n\t\treturn htmlspecialchars((string)$column_data);\n\t}", "public function updateColumnForFormatAction()\n\t{\n\t\t$searchColumns = new Model_Table_SearchColumns();\n\t\t$columnId = $searchColumns->getColumnIdFromTypeAndValue(\n\t\t\t\t$this->_request->getParam('type_id'),\n\t\t\t\t$this->_request->getParam('columnValue')\n\t\t);\n\t\t$searchFormatColumns = new Model_Table_SearchFormatColumns();\n\t\t$searchFormatColumns->updateColumnForFormat(\n\t\t\t\t$this->_request->getParam('format_id'),\n\t\t\t\t$columnId,\n\t\t\t\tsubstr($this->getRequest()->getParam('column'), -1, 1)\n\t\t);\n\t\techo Zend_Json::encode(array('success' => 1));\n\t\texit;\n\t}", "public function testNumberToExcellColumnFormat()\n {\n $numberFormatter = new NumberFormatService();\n $z = $numberFormatter->toExcelColumnFormat(26);\n $aa = $numberFormatter->toExcelColumnFormat(27);\n $abb = $numberFormatter->toExcelColumnFormat(730);\n\n $this->assertEquals('Z', $z);\n $this->assertEquals('AA', $aa);\n $this->assertEquals('ABB', $abb);\n }", "public function canRequireSQLConversion()\n {\n return true;\n }", "protected function typeDecimal(Magic $column)\n {\n return 'FLOAT';\n }", "protected function getFormat()\n {\n return 'FORMAT: 1A';\n }", "public function numberFormatDataProvider() {}", "abstract function format();", "protected function preprocessModel()\n {\n parent::preprocessModel();\n \n $labeledCols = $this->getLabeledColumns();\n foreach($labeledCols as $columnName) {\n $options = array();\n $type = $this->model->get($columnName, 'type');\n switch ($type) {\n case \\MUtil_Model::TYPE_DATE:\n $options['excelDateFormat'] = 'dd-mm-yyyy';\n break;\n\n case \\MUtil_Model::TYPE_DATETIME:\n $options['excelDateFormat'] = 'dd-mm-yyyy hh:mm:ss';\n $options['excelCellSize'] = 20;\n break;\n\n case \\MUtil_Model::TYPE_TIME:\n $options['excelDateFormat'] = 'hh:mm:ss';\n break;\n\n case \\MUtil_Model::TYPE_NUMERIC:\n break;\n\n //When no type set... assume string\n case \\MUtil_Model::TYPE_STRING:\n default:\n //$type = \\MUtil_Model::TYPE_STRING;\n //$options['formatFunction'] = 'formatString';\n break;\n }\n $options['type'] = $type;\n $this->model->set($columnName, $options);\n }\n }", "protected function modifyNullable(Blueprint $blueprint, Fluent $column)\n {\n return ' null';\n }", "protected function dateFormatDatabase()\n {\n return $this->dateFormat('mysql');\n }", "public function checkDataFormat($data) {\n return true;\n }", "protected function parseValue($value, $column)\n {\n $method = 'format'. ucfirst($column);\n if (method_exists($this, $method)) {\n return $this->$method($value);\n }\n\n return $value;\n }", "protected function formatData($data)\n {\n $isInt = ($data == preg_replace('/[^0-9]/', '', $data)) ? $data : false;\n if ((array)$data === $data) {\n return null;\n } elseif ($isInt) {\n return number_format($data);\n } elseif ((bool)$data === $data) {\n return $data;\n } else {\n return $data;\n }\n }", "public function testFormat($data, $column, $expected)\n {\n $sm = $this->createMock('\\stdClass', array('get'));\n $this->assertEquals($expected, Date::format($data, $column, $sm));\n }", "public function formatRowShouldThrow()\n {\n // Given\n $fieldSpecs = array(\n array(\"len\" => \"10\", \"type\" => \"s\")\n );\n $values = array(\"first\", 12);\n $this->expectException(\\InvalidArgumentException::class);\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \" \");\n }", "private function changeDateFormat($val,$format){\n \n if($val != \"\" && count($this->dbConfigs) > 0){\n switch ($this->dbConfigs['driver']){\n case \"mysql\":\n if($format == \"date\"){\n $val = date(\"Y-m-d\", strtotime($val));\n }\n elseif($format == \"datetime\"){\n $val = date(\"Y-m-d H:i:s\", strtotime($val));\n }\n break;\n case \"sqlsrv\":\n if($format == \"date\"){\n $val = date(\"Y-m-d\",strtotime($val));\n }\n elseif($format == \"datetime\"){\n $val = date(\"Y-m-d H:i:s\",strtotime($val));\n }\n break;\n }\n return $val;\n }\n }", "protected function type_timestamp(Magic $column)\n {\n return 'TIMESTAMP';\n }", "public function getMetricDataFormat() {}", "public function formatRowWithStringsAlignRight()\n {\n // Given\n $fieldSpecs = array(\n array(\n \"len\" => \"10\",\n \"type\" => \"s\",\n \"align\" => \"right\"),\n array(\n \"len\" => \"15\",\n \"type\" => \"s\",\n \"align\" => \"right\"),\n );\n $values = array(\"first\", \"second\");\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \" \");\n\n // Then\n $this->assertEquals($result, \" first second\");\n }", "protected function set_date_column( $column, $value ) {\n\t\tif ( is_a( $value, 'DateTime' ) ) {\n\t\t\t// convert to UTC time\n\t\t\t$utc_date = new DateTime();\n\t\t\t$utc_date->setTimestamp( $value->getTimestamp() );\n\t\t\t$this->set_prop( $column, $utc_date->format( 'Y-m-d H:i:s' ) );\n\t\t}\n\t\telseif ( $value ) {\n\t\t\t$this->set_prop( $column, ES_Clean::string( $value ) );\n\t\t}\n\t}", "function getDefaultFormat() {\n return MYSQL_DATETIME_FORMAT;\n }", "protected function formatter() {\n return '';\n }", "protected function convertRow(&$row) {\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'int':\n\t\t\t\t\tif (! is_null($row[$name])) {\n\t\t\t\t\t\t$row[$name] = (int) $row[$name];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'real':\n\t\t\t\t\tif (! is_null($row[$name])) {\n\t\t\t\t\t\t$row[$name] = (float) $row[$name];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// Currently unsure how to handle \"date\" formats\n\t\t\t\tcase 'datetime':\n\t\t\t\tcase 'timestamp':\n\t\t\t\t\tif (! is_null($row[$name])) {\n\t\t\t\t\t\tif ('0000-00-00 00:00:00' === $row[$name]) {\n\t\t\t\t\t\t\t$row[$name] = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$row[$name] = new DateTime($row[$name]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "protected function valueForUnparsableDate($columnName, $columnValue, $row)\n {\n //is specified in the read data as the value\n return trim($columnValue);\n }", "public function getGlyphDataFormat() {}", "public function checkDataFormat(&$data)\n {\n return true;\n }", "protected function typeFloat(Fluent $column)\n {\n return 'float';\n }", "protected function formatColumns()\n {\n $output = '[';\n foreach ($this->incorrect as $column) {\n $output .= $column . ', ';\n }\n\n // Remove last delimiter, and close the bracket.\n $output = substr($output, 0, -2);\n $output .= ']';\n\n return $output;\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 toText()\n {\n if ($this->column->autoIncrement) {\n $this->typeMethodName = \"tinyIncrements\";\n }\n\n return parent::toText();\n }", "function AddCol($field=-1,$width=-1,$align='L')\r\n{\r\n\tif($field==-1)\r\n\t{\r\n\t\t$field=count($this->columnProp);\r\n\t}\r\n\r\n\t$this->columnProp[$field]=array('f'=>$field,'w'=>$width,'a'=>$align);\r\n\t#$this->Write(5, \"Ajout de colonne : \".$field.\"/\".$width.\"/\".$align); $this->Ln();\r\n}", "public function format($data);", "public function format($data);", "private function filter_format( $value ) {\n\t\tif ( empty( $this->format ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tif ( empty( $value ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tswitch ( $this->format->case() ) {\n\t\t\tcase Schema_Format::URI:\n\t\t\t\t$value = filter_var( $value, FILTER_VALIDATE_URL );\n\t\t\t\tbreak;\n\t\t\tcase Schema_Format::DATE:\n\t\t\t\t$value = date( 'Y-m-d', strtotime( $value ) );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}", "public function fix_format($array)\n {\n return $this->accountCtrl->fix_format($array);\n }", "private static function _formatValue($type, $value){\n $nativeType = self::_getNativeType($type);\n if ($nativeType != $type && $type == 'ascii'){\n if (self::$_extendedTypes[$type]['format']){\n $value = preg_replace(self::$_extendedTypes[$type]['format'][0], self::$_extendedTypes[$type]['sanitize'][1], $value);\n }\n }\n return $value;\n }", "function fieldFormat($fieldNo, $format){\n\t\t// add the field format to the fieldFormats array\n\t\t$this->fieldFormats[$fieldNo] = $format;\n\t}", "public function formatField( $item, $column )\n\t{\n\t\t$method = 'format' . studly_case($column) . 'Field';\n\n\t\treturn method_exists($this, $method) ?\n\t\t\t$this->{$method}($item) :\n\t\t\t$this->escape( $item->{$column} );\n\t}", "protected function get_default_format_fields() {\n\t\treturn null;\n\t}", "public function renderAppliesCorrectTimestampConversionDataProvider() {}", "public function setFormat($format);", "public function setFormat($format);", "public function setFormat($format);", "public function defaultFormat()\n\t{\n\t\treturn $this->format();\n\t}", "function storeDatabaseFormat($val, $data)\n\t{\n\t\treturn $this->_indStoreDBFormat($val);\n\t}", "function format_excel($num)\n{\n\t$num=number_format($num,2,'.',',');\n\treturn $num;\n}", "public function format($format);", "public function afterFind(){\n // Format dates based on the locale\n foreach($this->metadata->tableSchema->columns as $columnName => $column){\n if ($column->dbType == 'date'){\n $aux= CDateTimeParser::parse($this->$columnName,\"yyyy-MM-dd\");\n $this->$columnName = ($aux != null )?date('d/m/Y',$aux ):null;\n }elseif ($column->dbType == 'datetime'){\n $aux= CDateTimeParser::parse($this->$columnName,\"yyyy-MM-dd HH:mm:ss\");\n $this->$columnName = ($aux != null )?date('d/m/Y H:i:s',$aux ):null;\n }\n }\n }", "public function grid_settings_modify_column($data)\n {\n return $this->get_column_type($data, true);\n }", "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 setFormat($format = null){\n\t\t$this->format = $this->columnLength = array();\n\n\t\tif(func_num_args() >= 1 && !is_array($a = func_get_arg(0)) && !($a instanceof \\Traversable))\n\t\t\t$format = func_get_args();\n\n\t\t// Set format\n\t\tif($format !== null){\n\t\t\t$format = $format instanceof \\Traversable ? iterator_to_array($format) : $format;\n\t\t\tif(!is_array($format))\n\t\t\t\tthrow new \\InvalidArgumentException('Format must be an array or a Traversable instance.');\n\t\t\t$this->format = array_map(function($v){return \"$v&N\";}, $format);\n\t\t}\n\n\t\treturn $this;\n\t}", "function rawpheno_function_delformat($xls_cell_value) {\n // Remove any extra spaces, new lines, leading and trainling spaces\n // and covert the final result to lowercase.\n return trim(strtolower(preg_replace('!\\s+!', '', $xls_cell_value)));\n}" ]
[ "0.78407544", "0.6187301", "0.609634", "0.5828629", "0.57821405", "0.57443774", "0.5724616", "0.5718049", "0.56908894", "0.5680358", "0.5650185", "0.55430275", "0.55306876", "0.54844326", "0.5463617", "0.5449677", "0.5437607", "0.54372156", "0.5431347", "0.54197943", "0.5392973", "0.5390735", "0.53746635", "0.53746635", "0.536797", "0.5348659", "0.53337735", "0.53197384", "0.5314697", "0.53139395", "0.5293754", "0.5280681", "0.5280681", "0.524195", "0.5241899", "0.523921", "0.52225804", "0.522206", "0.51538306", "0.5124948", "0.511599", "0.51120687", "0.5102824", "0.510016", "0.50851417", "0.50746113", "0.50551677", "0.50489473", "0.50368834", "0.50242805", "0.5015973", "0.5009104", "0.49875042", "0.49664924", "0.4966254", "0.49633494", "0.49579132", "0.49436614", "0.4942243", "0.49331596", "0.49260986", "0.49256453", "0.49233258", "0.49140072", "0.49089876", "0.48940524", "0.48838967", "0.48820037", "0.48769423", "0.48730263", "0.48723903", "0.48721406", "0.48695874", "0.4869204", "0.4864666", "0.48642343", "0.48633465", "0.4850665", "0.4850228", "0.4845532", "0.4845532", "0.48434755", "0.48426354", "0.48360294", "0.4833891", "0.4826566", "0.48186505", "0.4815128", "0.481357", "0.481357", "0.481357", "0.48101497", "0.48098394", "0.48066133", "0.4806452", "0.47999364", "0.47969607", "0.47900394", "0.47878376", "0.47846845" ]
0.57933205
4
/ To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. throw this in your helper.php
function set_active($path, $active = 'active') { return call_user_func_array('Request::is', (array)$path) ? $active : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "public function getHelper()\n {\n }", "private function _addHelper()\n {\n require __DIR__.'/../Support/SsoHelper.php';\n }", "function ra_helper() {\n\treturn RA_Helper::instance();\n}", "public function get_app_script_helpers()\n {\n }", "public function includeAppHelpers() {\n\t\tinclude_once( MWW_PATH . '/app/Support/helpers.php' );\n\t}", "function agnosia_initialize_helpers() {\r\n\r\n\tinclude_once agnosia_get_path( '/inc/utils/agnosia-helpers.php' );\r\n\r\n}", "public function getHelper()\n {\n return Mage::helper('billsafe/data');\n }", "public function loadHelpers()\n {\n require_once __DIR__.'/helpers.php';\n }", "protected function _helper()\n {\n return Mage::helper('onepageCheckout');\n }", "function helper(){\n // vde(Application::$helpers);\n foreach(func_get_args() as $helper)\n Application::$helpers->load($helper);\n // System::include_helper($helper);\n}", "protected function registerHelpers()\n {\n require __DIR__.'/Support/helpers.php';\n }", "public function custom()\n\t{\n\t}", "function _load_helpers()\r\n\t{\r\n\t\t// Load inflector helper for singular and plural functions\r\n\t\t$this->load->helper('inflector');\r\n\r\n\t\t// Load security helper for prepping functions\r\n\t\t$this->load->helper('security');\r\n\t}", "protected function getHelper()\n {\n return Mage::helper('Ltc_Komfortkasse');\n\n }", "public function __construct()\n {\n $this->helper = new Helpers;\n }", "public function __construct()\n {\n $this->helper = new Helpers;\n }", "public function __construct()\n {\n $this->helper = new Helpers;\n }", "public function __construct()\n {\n $this->helper = new Helpers;\n }", "public function __construct()\n {\n $this->helper = new Helpers;\n }", "public function helper($helper){\n\n include_once (HELPER_PATH . \"{$helper}_helper.php\");\n\n }", "function Better_Framework() {\n\n\treturn Better_Framework::self();\n}", "public function getHelper()\n {\n return Mage::helper('ops/data');\n }", "public function uniqueId(){\n $this->load->helper('string');\n}", "public function __construct()\r\n {\r\n helper([\"url\"]);\r\n }", "function vibrantlife_field_helpers() {\n\n\tif ( ! class_exists( 'RBM_FieldHelpers' ) ) {\n\t require_once 'rbm-field-helpers/rbm-field-helpers.php';\n\t}\n\n\tstatic $field_helpers;\n\n\tif ( $field_helpers === null ) {\n\n\t\t$field_helpers = new RBM_FieldHelpers( array(\n\t\t\t'ID' => 'vibrantlife',\n\t\t) );\n\t}\n\n\treturn $field_helpers;\n}", "public function helperWizard()\n {\n return Mage::helper('novalnet_payment');\n }", "function base_url()\n{\n return APP::getBaseUrl();\n}", "public function helper($helperName){\r\n if(file_exists(\"../system/helpers/\" . $helperName . \".php\")){\r\n require_once \"../system/helpers/\" . $helperName . \".php\";\r\n }else{\r\n echo \"<div style='margin:0; padding:10px;background-color:silver;'>Désolé le fichier $helperName.php n'a pas été trouvé</div>\";\r\n } \r\n\r\n }", "public function loadHelpers(){\n $this->file->require('vendor/helpers.php');\n }", "private function __() {\n }", "protected function getHelper()\n {\n return Mage::helper('postfinancecheckout_payment');\n }", "private static function support()\n {\n require_once static::$root.'Support'.'/'.'FunctionArgs.php';\n }", "function helper()\n{\n return TFThemeHelper::getInstance();\n}", "protected function _getHelper()\n {\n return Mage::helper('ecomdev_checkitout');\n }", "public function library()\n\t{\n\t\n\t}", "private function _i() {\n }", "public function registerHelpers()\n {\n parent::registerHelpers();\n require __DIR__.'/../src/helpers.php';\n }", "public function helperText()\n {\n return \"\";\n }", "public function someStuff()\n {\n \n }", "function wpcom_vip_load_helper() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "private function helpers()\n {\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR;\n $helper_directory = $this->args['location'] . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR;\n if (!empty($this->args['subdirectories']))\n {\n $relative_location .= $this->args['subdirectories'];\n $helper_directory .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n $relative_helper_location = $relative_location . DIRECTORY_SEPARATOR . strtolower($this->args['name']) . '_helper.php';\n $helper_file = $helper_directory . strtolower($this->args['name']) . '_helper.php';\n\n if (!is_dir($helper_directory))\n {\n $message = \"\\t\";\n if (mkdir($helper_directory, 0755, TRUE))\n {\n $message .= 'Created folder: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_location;\n }\n else\n {\n $message .= $relative_location;\n }\n fwrite(STDOUT, $message . PHP_EOL);\n unset($message);\n }\n else\n {\n $message .= 'Unable to create folder: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red') . $relative_location;\n }\n else\n {\n $message .= $relative_location;\n }\n fwrite(STDOUT, $message . PHP_EOL);\n return false;\n }\n }\n\n if (file_exists($helper_file))\n {\n $message = \"\\tHelper already exists: \";\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue') . $relative_helper_location;\n }\n else\n {\n $message .= $relative_helper_location;\n }\n fwrite(STDOUT, $message . PHP_EOL);\n unset($message);\n return true;\n }\n else\n {\n $content = \"<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\" . PHP_EOL;\n $content .= PHP_EOL . PHP_EOL . PHP_EOL;\n $content .= '/* End of file ' . strtolower($this->args['name']) . '_helper.php */' . PHP_EOL;\n $content .= '/* Location: ./' . $relative_location . ' */';\n\n $message = \"\\t\";\n if (file_put_contents($helper_file, $content))\n {\n $message .= 'Created helper: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_helper_location;\n }\n else\n {\n $message .= $relative_helper_location;\n }\n }\n else\n {\n $message .= 'Unable to create helper: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red') . $relative_helper_location;\n }\n else\n {\n $message .= $relative_helper_location;\n }\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n unset($message);\n }\n\n return true;\n }", "protected function _getHelper()\n {\n return Mage::helper('adminhtml');\n }", "protected function _getHelper()\n {\n return Mage::helper('innobyte_emag_marketplace');\n }", "protected function _getHelper()\n {\n return Mage::helper('innobyte_emag_marketplace');\n }", "function test_helper(){\n return \"OK\";\n}", "public function admin_includes()\n {\n\n }", "function wpcom_vip_load_helper_wpcom() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "public function getName()\n {\n return \"hexmedia.seo.helper\";\n }", "public function slashJsDataProvider() {}", "public function index()\r\n\t{\r\n\t\t$this->addHook($this->i18n->languageDetector()); #jaki jest domyslny jezyk usera\r\n\t\t\r\n\t\t$this->main->metatags_helper; #do pliku main.php zostaje wczytany plik metatags_helper itd\r\n\t\t$this->main->head_helper;\r\n\t\t$this->main->loader_helper;\r\n\t\t$this->main->module_helper;\r\n\t\t$this->main->model_helper;\r\n\t\t$this->main->directory_helper;\r\n\t\t$this->main->translate_helper;\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// $this->load->helper('utility_helper');\n\t}", "function admin_html()\n {\n }", "protected function &_helper() {\n\t\t$helper = $this->context(true)->helper($this->_helper);\n\t\treturn $helper;\n\t}", "public function include_template_functions() {\n\n\t}", "protected function _initControllerHelpers()\n\t{\n\t\tZend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/Helper', 'Tourchhelper');\t\n\t}", "public function xxxxx(){\n\n }", "public function getBaseHelper()\n {\n return Mage::helper('customgrid');\n }", "protected function _welcome() {\n\n }", "protected function registerHelpers() {\r\n $this->service\r\n ->sharedData()\r\n ->set('appHelper', array(\r\n 'absotuleUri' => $this->request->server()->exists('HTTPS') ? \"https://{$this->request->server()->get('SERVER_NAME')}/{$this->request->uri()}\" : \"http://{$this->request->server()->get('SERVER_NAME')}/{$this->request->uri()}\",\r\n ));\r\n }", "public function ex4()\n {\n }", "public function getGravityHelper()\n {\n return Mage::helper('me_gravity');\n }", "public function getGravityHelper()\n {\n return Mage::helper('me_gravity');\n }", "function wp_templating_constants()\n {\n }", "function _initViewHelpers()\n {\n // defined in /config/application.ini\n $this->bootstrap('layout');\n $layout = $this->getResource('layout');\n $view = $layout->getView();\n $view->addHelperPath(APPLICATION_PATH . '/common/helpers', 'My_View_Helper');\n $view->addHelperPath(APPLICATION_PATH . '/controllers/helpers', 'My_Action_Helper');\n //$view->addHelperPath(APPLICATION_PATH .'/view/helpers', '');\n\n //enable Zend JQuery\n ZendX_JQuery::enableView($view);\n\n // use zend helpers to generate meta tags\n $view->doctype('HTML4_STRICT');\n $view->headMeta()->appendHttpEquiv('Content-type', 'text/html;charset=utf-8')\n ->appendName('description', 'FACES');\n\n // use zend helpers to seperate major and minor titles\n $view->headTitle()->setSeparator(' - ');\n $view->headTitle('FACES');\n }", "public function help()\r\n{\r\n // You could include a file and return it here.\r\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n}", "public static function get_data(){\n\n }", "public function getHelpers()\n {\n return [\n ];\n }", "function admin_head()\n {\n }", "private function _getCoreHelper()\n {\n return Mage::helper('core');\n }", "protected function _welcome(){\n\t}", "function helper_autoloader($class)\n {\n\n }", "function __construct() {\n\t\tparent::__construct();\n\t\t$this->load->helper('welcome');\n\t}", "function __construct() { \r\n $this->helper = Mage::helper('lycenok_datafeed');\r\n}", "public function Header(){\n\n }", "public function __construct() {\n parent::__construct();\n \n $this->load->helper('funciones_custom_helper');\n\n\n }", "public function demo();", "public function demo();", "function __construct()\n {\n // Construct our parent class\n parent::__construct();\n $this->load->helper('call_helper');\n\n }", "public function getGridHelper()\n {\n return Mage::helper('customgrid/grid');\n }", "function getCustomerLocatorHelper() {\n\t\t\treturn Mage::helper( 'customerlocator' );\n\t\t}", "protected function generateHtml()\n\t{\n\t}", "public static function how_to_use() {\n\t\t$msg = '';\n\t\tinclude 'views/_how_to_use.php';\n\t}", "function wpcom_vip_load_helper_stats() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "public function direct () {\n\t\treturn $this->getHelper();\n\t}", "public function ogs()\r\n {\r\n }", "protected static function getFacadeAccessor() { return 'apphelper'; }", "private function loadLib() {\r\n $this->load->library( 'javascript' );\r\n\r\n $this->load->helper( 'url' );\r\n $this->load->helper( 'html' );\r\n }", "protected function _toHtml()\n{\n// use arguments like $this->getMyParam1() , $this->getAnotherParam()\n \nreturn $html;\n}", "public function helper($helper)\n\t{\n\t\trequire_once INC_ROOT . '/app/libs/'. $helper .'_Helper.php';\n\t\treturn new $helper;\n\t}", "private function _getSetupHelper()\n {\n return Mage::helper('route/setup');\n }", "protected function protected_method() {}", "protected function helper($helper)\r\n {\r\n if (file_exists(ROOT_DIR . '/app/include/' . $helper . '.php'))\r\n {\r\n require_once ROOT_DIR . '/app/include/' . $helper . '.php';\r\n return new $helper;\r\n }\r\n return NULL;\r\n }", "public function cs(){\n }", "function get_html()\n\t{\n\n\t// incrase views\n\n\t}", "protected function getDialogHelper() {}", "function addCommonHtml() \n\t{\n\t\treturn true;\n\t}", "function maxDoc_inc_custom_inc(){\n\n\t/**\n\t * Place your custom functions below so you can upgrade common_inc.php without trashing\n\t * your custom functions.\n\t *\n\t * An example function is commented out below as a documentation example\n\t *\n\t * View common_inc.php for many more examples of documentation and starting\n\t * points for building your own functions!\n\t */\n}", "function xarpages_customapi_pageform_helpers($args)\n{\n return true;\n}", "function _initActionHelpers(){\n Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/helpers', 'My_Action_Helper');\n }" ]
[ "0.8344205", "0.7142574", "0.6672269", "0.65845424", "0.654298", "0.65316266", "0.65109575", "0.6411258", "0.6395039", "0.6360593", "0.63323176", "0.6239795", "0.62017804", "0.6165343", "0.6158514", "0.6121251", "0.6121251", "0.6121251", "0.6121251", "0.6121251", "0.6098572", "0.60892963", "0.60671335", "0.60360724", "0.6034673", "0.6027649", "0.6012341", "0.60120195", "0.5982274", "0.59821695", "0.5960577", "0.5942351", "0.59145486", "0.5904451", "0.5903232", "0.5893447", "0.5886058", "0.58837706", "0.58555716", "0.5845383", "0.58419806", "0.5790988", "0.5775223", "0.57629293", "0.57629293", "0.5762526", "0.57615113", "0.57352614", "0.57311386", "0.57209796", "0.57029355", "0.5700262", "0.5694444", "0.5693588", "0.5685346", "0.5682038", "0.5677429", "0.5661253", "0.565289", "0.565083", "0.5649648", "0.56348073", "0.5633363", "0.5633363", "0.56251013", "0.56240207", "0.5619949", "0.5596337", "0.5588473", "0.5587525", "0.5583369", "0.55745614", "0.5566038", "0.55587286", "0.55563927", "0.5549712", "0.5546303", "0.5539418", "0.5539418", "0.5529522", "0.55166125", "0.5511562", "0.5511295", "0.549286", "0.54901814", "0.5488722", "0.5482805", "0.547226", "0.5471522", "0.5461085", "0.545087", "0.5448808", "0.5446418", "0.5445554", "0.5442498", "0.5441242", "0.5440992", "0.5430342", "0.54262483", "0.54230607", "0.5416467" ]
0.0
-1
Replace empty value with NULL example: ['T1_3'> ''...] converts to ['T1_3' => 'NULL']
public function addNull($datas) { $post = array(); foreach ($datas as $key => $val){ (!$val && $val !== 0)? ($post += [$key => "NULL"]) : ($post += [$key => $val]); } return $post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emptyToNull($val)\n {\n foreach ($val as $name => $value) {\n if (is_string($value) && trim($value) === \"\") {\n $val[$name] = null;\n }\n\n if (is_array($value)) {\n $val[$name] = emptyToNull($value);\n }\n }\n\n return $val;\n }", "public static function null_safe($arr)\n {\n $newArr = array();\n foreach ($arr as $key => $value) {\n $newArr[$key] = ($value == NULL) ? \"\" : $value;\n }\n return $newArr;\n }", "function emptystr_tonull($arr)\n {\n return array_map(function ($val) {\n if ($val === '') {\n $val = null;\n }\n\n return $val;\n }, $arr);\n }", "function createNulls(&$array)\n{\n foreach ($array as &$element) {\n if (is_array($element)) {\n createNulls($element);\n } //is_array($element)\n if (empty($element) || ($element == ' ')) {\n $element = NULL;\n } //empty($element)\n } //$array as &$element\n unset($element);\n}", "public function nullifyEmpty(array &$array)\n {\n $array = array_map(function ($value) {\n if (!is_array($value) && !is_object($value) && $value === '') {\n $value = null;\n }\n\n return $value;\n }, $array);\n }", "public static function changeEmptyStrings($arr) {\r\n \tforeach ($arr as $key=>$value) {\r\n \t\tif (strlen($value) == 0) {\r\n \t\t\t$arr[$key] = NULL;\r\n \t\t} else {\r\n \t\t\t$arr[$key] = htmlspecialchars_decode(utf8_decode($value));\r\n \t\t} \r\n \t}\r\n \treturn $arr;\r\n }", "function empty2null($value)\n{\n return $value === '' ? null : $value;\n}", "public static function set_null_data($field)\n\t{\n\t\tforeach($field as $key => $value)\n\t\t{\n\t\t\tif($value == null || $value == '')\n\t\t\t{\n\t\t\t\t$field[$key] = null;\n\t\t\t}\n\t\t}\n\n\t\treturn $field;\n\t}", "private function clear_empty_values($row) {\n\t\tforeach( $row as $key => $datum)\n\t\t\tif (($datum==='' || $datum===null)) $row[$key] = $this->default_value;\n\t\treturn $row;\n\t}", "function fluff_array($array) {\r\n foreach ($array as $key => $value) {\r\n if (($array[$key] == NULL) || (empty($array[$key]) && \r\n\t (isset($array[$key]) && ($array[$key] != 0)))) {\r\n\t\t\r\n $array[$key] = 'N/A'; \r\n }\r\n }\r\n return $array;\r\n}", "protected function _setEmptyFieldsToNull(array &$data)\n {\n array_walk($data, array('TicketEvolution_Db_Table_Abstract', '_emptyFieldsToNull'));\n }", "public function getArrayNullEmpty () {\n\n $values = array();\n\n foreach ($this->values as $key => $value) {\n\n if ($value !== null && is_string($value) && strlen($value) == 0) {\n\n $value = null;\n\n }\n\n $values[$key] = $value;\n\n }\n\n return $values;\n\n }", "protected function emptyStringsToNull($data)\n {\n $result = null;\n if (is_string($data)) {\n $data = trim($data);\n $result = '' === $data ? null : $data;\n } elseif (is_numeric($data)) {\n $result = $data;\n } elseif (is_array($data) || is_object($data)) {\n $result = [];\n foreach ($data as $key => $value) {\n $result[$key] = self::emptyStringsToNull($value);\n }\n }\n\n return $result;\n }", "protected function transformNULLs($value)\n {\n return ($value === \"NULL\" || $value === \"null\") ? null : $value;\n }", "function ArrayRemoveEmptyOrder($arr)\r\n{\r\n\r\n $arr = array_filter($arr);\r\n\r\n $newMy = array();\r\n $i = 0;\r\n\r\n foreach ($arr as $key => $value) {\r\n if (!is_null($value)) {\r\n $newMy[$i] = $value;\r\n $i++;\r\n }\r\n }\r\n return $newMy;\r\n}", "function emptyToNull($ChartID) { return(empty($ChartID)?'NULL':\"'\".$ChartID.\"'.\");}", "function del_empty($arr)\n{\n\tforeach ($arr as $key => $value)\n\t{\n\t\tif (trim(strval($value))!='')\n\t\t\t$rzygi[$key] = $value;\n\t}\n\treturn $rzygi;\n}", "function array_remove_null($item)\n{\n if (!is_array($item)) {\n return $item;\n }\n\n return collect($item)\n ->reject(function ($item) {\n return is_null($item);\n })\n ->flatMap(function ($item, $key) {\n\n return is_numeric($key)\n ? [array_remove_null($item)]\n : [$key => array_remove_null($item)];\n })\n ->toArray();\n}", "public function testImplodeArrayWithNull()\n {\n $this->assertEquals(StringUtils::NULL_STR, StringUtils::implodeRecursively(array(null)));\n }", "protected function setNullAllAttributes()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\tif( $value == \"real\" ) $this->$field = \"\" ;\n\t\t\telse if( $value == \"int\" ) $this->$field = \"\" ;\n\t\t\telse if( $value == \"date\" ) $this->$field = \"\" ;\n\t\t\telse if( $value == \"string\" ) $this->$field = null ;\n\t\t}\n\t}", "function AlertsArrayRemoveEmptyOrder($arr)\r\n{\r\n\r\n $arr = array_filter($arr);\r\n\r\n $newMy = array();\r\n $i = 0;\r\n\r\n foreach ($arr as $key => $value) {\r\n if (!is_null($value)) {\r\n $newMy[$i] = $value;\r\n $i++;\r\n }\r\n }\r\n return $newMy;\r\n}", "public function asignaNull($arreglo) {\r\n foreach ($arreglo as $i => $value) {\r\n $respuesta[$i] = ($value == '') ? NULL : $value;\r\n }\r\n return $respuesta;\r\n }", "public static function deleteEmptyStrings($arr) {\r\n \t$temp = array();\r\n \tforeach ($arr as $key=>$value) {\r\n \t\tif (strlen($value) != 0) {\r\n \t\t\t$temp[$key] = htmlspecialchars(utf8_encode($value), ENT_NOQUOTES);\r\n \t\t}\r\n \t}\r\n \treturn $temp;\r\n }", "private function ignoreBlankValueFields($data){\n $arrData = array();\n if(!is_array($data)) return false;\n foreach($data as $valData => $value){\n if($value){\n foreach($value as $valSubKey => $val){\n if(trim($val) != \"\") $arrData[$valData][$valSubKey] = $val;\n }\n }\n }\n return $arrData;\n }", "function acapi_convert_values($arr) {\n foreach ($arr as $k => $v) {\n if (!isset($v)) {\n $arr->{$k} = '';\n }\n elseif (is_array($v) || is_object($v)) {\n $arr->{$k} = '...';\n }\n }\n return (array) $arr;\n}", "public function nullToEmpty($value)\n {\n if ($value == NULL) {\n $value = '';\n }\n return $value;\n }", "function cleanT($tArr) {\r\n for($a = count($tArr); $a > 0; $a--) {\r\n if (strcmp($tArr[$a-1], '')) {\r\n break;\r\n } else {\r\n unset($tArr[$a-1]);\r\n }\r\n }\r\n return $tArr;\r\n }", "public function set_null($value = '', $force_null = FALSE) {\n if ($force_null == TRUE && ($value === 0 || $value === '0')) {\n return NULL;\n }\n\n return $value == '' || $value == '<br>' ? NULL : $value;\n //return $value == '' ? NULL : $value;\n }", "public function xml2ArrayConvertsEmptyArraysToElementWithoutContent() {}", "function remove_empty_items($old_array, $mantain_keys=FALSE)\n{\n\t$new_array = array();\n\tforeach($old_array AS $key=>$value)\n\t{\n\t\tif(trim($value) != ''){\n\t\t\tif($mantain_keys)\n\t\t\t{\n\t\t\t\t$new_array[$key] = $value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray_push($new_array, $value);\n\t\t\t}\n\t\t}\n\t}\n\treturn $new_array;\n}", "function ss_remove_empty_element_array($arr) { \n\tforeach($arr as $key => $val) {\n\t\tif (is_array($val)){\n ss_remove_empty_element_array($val);\n } else {\n if (trim($val) == \"\") unset($arr[$key]);\n }\n }\n return $arr;\n}", "function non_null(array $list): array\n{\n return array_values(\n array_filter($list, function ($item) {\n return !is_null($item);\n })\n );\n}", "public function chek_Null($post_value){\n if ($post_value == '' || $post_value == null || (!isset($post_value))) {\n $val = '';\n return $val;\n } else {\n return strip_tags($post_value);\n }\n }", "function onespace2empty(&$item, $key=null) {\n $item = $item == ' ' ? '' : $item;\n return true;\n}", "function _set_null_default_value($value) {\n\t\tif ($value == '') {\n\t\t\treturn \"NULL\";\n\t\t} else {\n\t\t\treturn \"'\".$value.\"'\";\n\t\t}\n\t}", "protected function escapeNULL()\n {\n return 'NULL';\n }", "function null($input)\n{\n return ($input != NULL || $input!='')? $input : \" -- \";\n}", "public function getCleanValue()\n {\n return null;\n }", "function arrayClean(&$array) {\n\tif (!is_array($array)) return null;\n\treturn array_filter($array, create_function('$o', 'return !empty($o);'));\n}", "public static function filterEmptyAndNullValuesFromArray(array $arr): array\n {\n return array_filter($arr, function ($value): bool {\n return $value !== null && $value !== '';\n });\n }", "function filter_empty($arr)\n {\n return array_filter($arr, function ($val) {\n if (is_bool($val) || is_array($val)) {\n return true;\n }\n\n return $val !== '' && $val !== null && strlen(trim($val)) > 0;\n });\n }", "public function getToArrayValuesNotNull()\r\n\t\t{\r\n\t\t\t$arrayValues = $this->getToArrayValues();\r\n\t\t\t$arrayValues = $this->OutNullArray($arrayValues);\r\n\t\t\treturn $arrayValues;\r\n\t\t}", "public function cleanValues($values) {\n\t\tforeach($values as $key => $val) {\n\t\t\tif( empty($val) ) {\n\t\t\t\tunset($values[$key]);\n\t\t\t}\n\t\t}\n\t\treturn $values;\n\t}", "public function cleanValues($values) {\n\t\tforeach($values as $key => $val) {\n\t\t\tif( empty($val) ) {\n\t\t\t\tunset($values[$key]);\n\t\t\t}\n\t\t}\n\t\treturn $values;\n\t}", "private function emptyStringToNull(&$var) {\n if ($var === '') {\n $var = null;\n }\n }", "function sql_null_unwrap($attribute) //-> String\n\t{\n\t\tif (is_null($attribute))\n\t\t{\n\t\t\treturn 'null';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn strval($attribute);\n\t\t}\n\t}", "public static function removeNullValues($data)\n {\n return array_filter($data, function ($item) {\n return is_array($item)\n ? !empty($item)\n : !in_array($item, [null, ''], true);\n });\n }", "function fn_advanced_import_filter_out_null_values(&$row)\n{\n foreach ($row as $key => $value) {\n\n if ($value === null) {\n unset($row[$key]);\n }\n }\n\n return true;\n}", "public function getArraySkipEmpty () {\n\n $values = array();\n\n foreach ($this->values as $key => $value) {\n\n if ($value !== null && (!is_string($value) || strlen($value) > 0)) {\n\n $values[$key] = $value;\n\n }\n\n }\n\n return $values;\n\n }", "public static function remove_empty($arr, $remove_space=false){\n foreach ( $arr as $k => $v ){\n if ( is_object($arr) ){\n if ( is_array($v) || is_object($v) ){\n $arr->$k = self::remove_empty($v);\n }\n if ( empty($arr->$k) ){\n unset($arr->$k);\n }\n }\n else{\n if ( is_array($v) || is_object($v) ){\n $arr[$k] = self::remove_empty($v);\n }\n else if ( $remove_space ){\n $arr[$k] = trim($arr[$k]);\n }\n if ( empty($arr[$k]) ){\n unset($arr[$k]);\n }\n }\n }\n return $arr;\n }", "function set_array_value(&$array, $ignore_if_blank, $key, $value)\n{\n if ($value || (!$ignore_if_blank && isset($array[$key])))\n {\n if ($value)\n $array[$key] = $value;\n else\n unset($array[$key]);\n }\n}", "protected function blankToNull($var){\n if ($var == '' || $var == 'null') {\n return null;\n }else{\n return $var;\n }\n }", "public function getEmptyValues();", "protected function _emptyFieldsToNull(&$field, $key)\n {\n if ($this->_metadata[$key]['NULLABLE'] && empty($field)) {\n $field = null;\n }\n }", "private static function fixNulls( array $array, $count ) {\n\t\tif ( count( $array ) === $count ) {\n\t\t\treturn $array;\n\t\t} else {\n\t\t\treturn array_replace( array_fill( 1, $count, null ), $array );\n\t\t}\n\t}", "public function testValueIsNull(): void {\n $transform = $this->getTransform('count', [\n 'source' => 'source',\n 'field' => 'example_source_field',\n ]);\n $result = $transform->transform([\n 'example_source_field' => null\n ]);\n // Make sure it stays an array\n $this->assertEquals(null, $result);\n }", "public static function clearEmptyValues($array) {\r\n\r\n/*\tThis function unsets any empty values in an associate array\r\n\tand returns the array back. This is useful, perhaps, if we \r\n\texpect some $_POST values are unset and we need to clear \r\n\tthose empty values out of the array. */\r\n\r\n foreach ($array as $key => $value) {\r\n \tif ($value == \"\") { unset($array[$key]); }\r\n }\r\n \r\n return $array;\r\n \r\n}", "function clean_value( $t )\n\t{\n\t\treturn $this->parse_clean_value( $t );\n\t}", "function cleanNullsOfObject(&$object) {\n foreach ($object as $property => &$value) {\n if (is_object($value)) {\n cleanNullsOfObject($value);\n if (empty(get_object_vars($value))) {\n unset($object->$property);\n }\n }\n if (is_null($value) || (is_array($value) && empty($value))) {\n unset($object->$property);\n }\n }\n}", "protected function clean_saved_value() {\n\t\tif ( $this->saved_value !== '' ) {\n\t\t\tif ( ! is_array( $this->saved_value ) && ! is_object( $this->saved_value ) ) {\n\t\t\t\tFrmAppHelper::unserialize_or_decode( $this->saved_value );\n\t\t\t}\n\n\t\t\tif ( is_array( $this->saved_value ) && empty( $this->saved_value ) ) {\n\t\t\t\t$this->saved_value = '';\n\t\t\t}\n\t\t}\n\t}", "public static function removeEmptyValues($data)\n {\n $result = [];\n if(is_array($data)){\n foreach ($data as $k => $v) {\n if (!empty($v)) {\n $result[$k] = $v;\n }\n }\n }\n\n return $result;\n }", "protected function transform(string $key, $value)\n {\n return is_string($value) && $value === '' ? null : $value;\n }", "function unfck($v) {\n return is_array($v) ? array_map('unfck', $v) : addslashes($v);\n}", "private function arrayClean($array)\n {\n foreach ($array as $key=>$value) {\n if(is_array($value))\n $this->arrayClean($value);\n else if($value!==null)\n unset($value);\n }\n }", "function _webform_csv_data_email($data) {\r\n return empty($data['value']['0']) ? '' : $data['value']['0'];\r\n}", "function Clean($arr){\n foreach($arr as $key=>$value){\n $arr[$key] = strip_tags($value);\n }\n return $arr;\n}", "protected final function prepareValues($array)\n {\n\n foreach ($array as $index => $value)\n {\n if ((array_key_exists(\"table\", $array)))\n {\n unset($array[\"table\"]);\n }\n elseif ($value == null || $value == \"\")\n {\n unset($array[$index]);\n }\n }\n return \":\" . implode(\", :\", array_keys($array));\n\n }", "function array_sanitize(&$item){\n $item = htmlentities(strip_tags(mysql_real_escape_string($item)));\n }", "function trim_array(&$arr) \n {\n foreach ($arr as $k => $v) {\n if (is_array($v))\n App::trim_array($arr[$k]);\n else\n $arr[$k] = trim($v);\n }\n }", "function createArray($post)\n{\n $temp = trim($post);\n $temp = explode(' ', $temp);\n for ($i = 0; $i < sizeof($temp); $i++) {\n if ($temp[$i] == \"\") {\n unset($temp[$i]);\n } //$temp[$i] == \"\"\n } //$i = 0; $i < sizeof($temp); $i++\n return $temp;\n}", "public static function emptyToNull(&$value, $trim=true)\n {\n $value = $value ?? \"\";\n if ($trim) {\n $value=trim($value);\n }\n if ($value==\"\") {\n $value = null;\n }\n return $value;\n }", "function types_liaisons_existent($array){\n\tif (empty($array) or $array==array(''=>'')){\n\t\treturn '';\n\t}\n\treturn ' ';\n}", "function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format ['cname=value'......]\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return \"`$obj->name`=$value\";\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n return implode(\",\",$values_str);\n }", "public function collapse_array($value)\n\t{\n\t\tif (count($value)==0)\n\t\t\treturn null;\n\t\t\t\n\t\t$result='';\n\t\tforeach($value as $val)\n\t\t\tif ($val==null)\n\t\t\t\t$result.='NULL,';\n\t\t\telse\n\t\t\t\t$result.=\"$val,\";\n\t\t\n\t\treturn 'ARRAY['.trim($result,',').']';\n\t}", "function clear_sanity($values)\n {\n $values = (is_array($values)) ?\n array_map(\"clear_sanity\", $values) :\n htmlentities($values, ENT_QUOTES, 'UTF-8');\n\n return $values;\n }", "protected function skipEmptyValue($value)\n {\n if ('-' === $value) {\n return null;\n }\n if (is_array($value)) {\n $result = [];\n foreach ($value as $key => $subValue) {\n $data = $this->skipEmptyValue($subValue);\n if ($data !== null) {\n $result[$key] = $data;\n }\n }\n return empty($result) ? null : $result;\n }\n return $value;\n }", "public static function mongo_sanitize(&$data) {\n foreach ($data as $key => $item) {\n is_array($item) && !empty($item) && $data[$key] = self::mongo_sanitize($item);\n if (is_array($data) && preg_match('/^\\$/', $key)) {\n unset($data[$key]);\n }\n }\n return $data;\n }", "public function arrayReplaceNull(&$content, $replace) {\t\n\t\ttry {\n\t\t\tforeach ($content as &$haystack) {\n\t\t\t\t// If it's not an array, replace it\n\t\t\t\tif (!is_array($haystack)) {\n\t\t\t\t\tif (is_null($haystack)) {\n\t\t\t\t\t\t$haystack = $replace;\n\t\t\t\t\t} //<-- end if -->\n\t\t\t\t} else { // it IS an array, so recurse\n\t\t\t\t\tself::arrayReplaceNull($haystack, $replace);\n\t\t\t\t} //<-- end if -->\n\t\t\t} //<-- end foreach -->\t\n\t\t} catch (Exception $e) { \n\t\t\tthrow new Exception($e->getMessage().' from '.$this->className.'->'.\n\t\t\t\t__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} //<-- end try -->\n\t}", "function arrayornull($spliter, $str) {\r\n if ($str != \"\" && $str) {\r\n return explode($spliter, $str);\r\n }\r\n return null;\r\n}", "protected static function clean_array() {\n\t\treturn array( '<', '>', '&', \"'\", '\"' );\n\t}", "function restore_empty($data, $filed)\n {\n return array_merge(array_fill_keys($filed, ''), $data);\n }", "function rest_sanitize_array($maybe_array)\n {\n }", "function getValueOrNull($value) {\n global $db;\n if(strlen($value) == 0) return \"NULL\";\n else return \"'\".$db->validate($value).\"'\";\n}", "function clean_url_data($urldata)\n{\n\t$new_urldata = array();\n\tforeach($urldata AS $key=>$value)\n\t{\n\t\tif($value === FALSE || trim($value) == '')\n\t\t{\n\t\t\t$new_urldata[$key] = '';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$new_urldata[$key] = $value;\n\t\t}\n\t}\n\t\n\treturn $new_urldata;\n}", "public function removeNullBytes() {\r\n $this->contents = str_replace(\"\\0\", \"\", $this->contents);\r\n }", "public function _cleanData (array $arr)\n {\n foreach ($arr as $key => $element)\n {\n if (is_array ($element))\n {\n $arr [$key] = $this->_cleanData ($element);\n }\n elseif ($arr [$key] instanceof DotNotation_NullElement)\n {\n unset ($arr [$key]);\n }\n }\n \n return $arr;\n }", "function cleanValueMapMappings(array $mappings) {\n\t$cleanedMappings = $mappings;\n\n\tforeach ($cleanedMappings as $key => $mapping) {\n\t\tif (zbx_empty($mapping['value']) && zbx_empty($mapping['newvalue'])) {\n\t\t\tunset($cleanedMappings[$key]);\n\t\t}\n\t}\n\n\treturn $cleanedMappings;\n}", "function ArrayRemoveEmpty($arr)\r\n{\r\n $arr = array_filter($arr);\r\n return $arr;\r\n}", "function sanitize_null_character($param) {\n\treturn input_filter($param);\n}", "function _clean_column($val)\n {\n return str_replace(array(';', \"'\", '\"', '`'), array(''), $val);\n }", "protected function filterEmptyArrayValues(array $array): array\n {\n $return = [];\n\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $return[$key] = $this->filterEmptyArrayValues($value);\n } else {\n if ($value != '') {\n $return[$key] = $value;\n }\n }\n }\n return $return;\n// return array_filter($array);\n }", "public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}", "public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_item('');\n $this->setId_ubi('');\n $this->setF_gasto('');\n $this->setTipo('');\n $this->setCantidad('');\n $this->setPrimary_key($aPK);\n }", "function array_sanitize (&$item) {\n\t\tif (is_string ($item)) {\n\t\t\t$item = htmlentities (mysqli_real_escape_string ($GLOBALS['con'], $item),ENT_NOQUOTES,\"utf-8\");\n\t\t}\n\t}", "public function testQuoteArrayWithEmptyArray()\n {\n $originalArray = array();\n\n $quotedArray = $this->database->quoteArray($originalArray);\n\n $this->assertEquals($originalArray, $quotedArray);\n }", "public function transform($value)\n {\n if (null === $value) {\n return null;\n }\n if (!is_array($value)) {\n $value = $value->toArray();\n }\n\n return implode($this->separator, array_map(function($tag) { return $tag->getTitle(); }, $value));\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_item('');\n $this->setId_enc('');\n $this->setId_nom('');\n $this->setModo('');\n $this->setF_ini('');\n $this->setF_fin('');\n $this->setId_nom_new('');\n $this->setPrimary_key($aPK);\n }", "private function _clean($key, $value, $row = NULL)\n {\n if ($key == 'item_number') {\n if ($value === '') {\n return NULL;\n }\n return $value;\n }\n if ($key == 'product_id') {\n if ($value === '') {\n return NULL;\n }\n return $value;\n }\n if ($key == 'name') {\n if (! $value) {\n return '';\n }\n return $value;\n }\n if ($key == 'category_id') {\n if ($value) {\n \n // remove false or empty values\n $category_list = explode('|', $value);\n $category_list = array_values(array_filter($category_list, function ($value) {\n return $value !== '';\n }));\n $value = implode(\"|\", $category_list);\n \n if (! isset($this->categories_indexed_by_name[strtoupper($value)])) {\n $this->Category->create_categories_as_needed($value, $this->categories_indexed_by_name);\n }\n \n return $this->categories_indexed_by_name[strtoupper($value)];\n }\n \n return NULL;\n }\n if ($key == 'supplier_id') {\n if ($value) {\n $supplier_name_before_searching = $value;\n $value = $this->Supplier->exists($value) ? $value : $this->Supplier->find_supplier_id($value);\n \n if (! $value) {\n $person_data = array(\n 'first_name' => '',\n 'last_name' => ''\n );\n $supplier_data = array(\n 'company_name' => $supplier_name_before_searching\n );\n $this->Supplier->save_supplier($person_data, $supplier_data);\n $value = $supplier_data['person_id'];\n }\n return $value;\n }\n \n return NULL;\n }\n if ($key == 'cost_price') {\n return make_currency_no_money($value);\n }\n if ($key == 'unit_price') {\n return make_currency_no_money($value);\n }\n if ($key == 'promo_price') {\n return make_currency_no_money($value);\n }\n if ($key == 'start_date') {\n if ($value) {\n return date('Y-m-d', strtotime($value));\n }\n return NULL;\n }\n if ($key == 'end_date') {\n if ($value) {\n return date('Y-m-d', strtotime($value));\n }\n return NULL;\n }\n if ($key == 'tax_included') {\n $true_values = array(\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 1;\n }\n \n return 0;\n }\n if ($key == 'is_service') {\n $true_values = array(\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 1;\n }\n \n return 0;\n }\n if ($key == 'reorder_level') {\n if (is_numeric($value)) {\n return $value;\n }\n return NULL;\n }\n if ($key == 'description') {\n if (! $value) {\n return '';\n }\n return $value;\n }\n if ($key == 'allow_alt_description') {\n $true_values = array(\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 1;\n }\n \n return 0;\n }\n if ($key == 'is_serialized') {\n $true_values = array(\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 1;\n }\n \n return 0;\n }\n if ($key == 'size') {\n if (! $value) {\n return '';\n }\n return $value;\n }\n if ($key == 'commission_fixed') {\n \n if ($value === '' || $value === NULL) {\n return NULL;\n }\n \n return make_currency_no_money($value);\n }\n if ($key == 'commission_percent') {\n \n if ($value === '' || $value === NULL) {\n return NULL;\n }\n \n return strval((float) $value);\n }\n if ($key == 'commission_percent_type') {\n $true_values = array(\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 'profit';\n }\n \n return 'selling_price';\n }\n if ($key == 'override_default_tax') {\n $true_values = array(\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 1;\n }\n \n return 0;\n }\n if ($key == 'expire_days') {\n \n if ($value != '' && $value == (int) $value) {\n return (int) $value;\n }\n \n return null;\n }\n if ($key == 'change_cost_price') {\n $true_values = array(\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 1;\n }\n \n return 0;\n }\n if ($key == 'manufacturer_id') {\n if ($value) {\n $manufacturer_id = NULL;\n \n if (isset($this->manufacturers_map[strtoupper($value)])) {\n $manufacturer_id = $this->manufacturers_map[strtoupper($value)];\n } else {\n $manufacturer_id = $this->Manufacturer->save($value);\n $this->manufacturers_map[strtoupper($value)] = $manufacturer_id;\n }\n return $manufacturer_id;\n }\n }\n if ($key == 'disable_loyalty') {\n $true_values = array(\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 1;\n }\n \n return 0;\n }\n if ($key == 'is_ebt_item') {\n $true_values = array(\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 1;\n }\n \n return 0;\n }\n if ($key == 'item_id') {\n if ($value == NULL) {\n return NULL;\n }\n if ($value == (int) $value) {\n return strval((int) $value);\n }\n return NULL;\n }\n if ($key == 'quantity') {\n if (is_numeric($value)) {\n return $value;\n }\n return '';\n }\n if ($key == 'unit_price') {\n return make_currency_no_money($value);\n }\n if ($key == 'cost_plus_percent') {\n if (is_numeric($value)) {\n return strval((float) $value);\n }\n return NULL;\n }\n if ($key == 'percent_off') {\n if ($value == (float) $value) {\n return strval((float) $value);\n }\n return NULL;\n }\n if ($key == 'tags') {\n if ($value) {\n return $value;\n }\n return '';\n }\n if ($key == 'quantity') {\n if ($value == (float) $value) {\n return strval((float) $value);\n }\n return 0;\n }\n if ($key == 'is_ecommerce') {\n $true_values = array(\n \"\",\n \"true\",\n \"yes\",\n \"y\",\n \"1\"\n );\n if (in_array(strtolower($value), $true_values)) {\n return 1;\n }\n \n return 0;\n }\n }", "public function reverseTransform($val)\n {\n if (!$val) {\n return null;\n }\n\n return array_map(function($item) {\n return trim($item);\n }, explode($this->delimiter, $val));\n }" ]
[ "0.7417876", "0.7371679", "0.7066087", "0.6866505", "0.68410903", "0.67649287", "0.6627573", "0.6499125", "0.64900583", "0.6181105", "0.6161043", "0.6111059", "0.61004144", "0.60958314", "0.6052273", "0.60055727", "0.5985833", "0.597373", "0.59357303", "0.59246415", "0.5910706", "0.5892869", "0.5866271", "0.5827495", "0.5788497", "0.57866806", "0.57856995", "0.57539725", "0.57125926", "0.5709843", "0.57044894", "0.5695874", "0.5686845", "0.5677096", "0.5650844", "0.56477225", "0.5558136", "0.5552552", "0.554198", "0.55114543", "0.5488752", "0.54743797", "0.54578453", "0.54578453", "0.5431301", "0.54126114", "0.5408852", "0.5396695", "0.5394118", "0.53851944", "0.5379805", "0.5364995", "0.5339368", "0.5333359", "0.5329877", "0.5324851", "0.5317984", "0.53147155", "0.5301046", "0.52972233", "0.5290055", "0.52769077", "0.52584684", "0.52527636", "0.5245847", "0.52287215", "0.5226943", "0.52118224", "0.5207712", "0.5194183", "0.5192816", "0.5192711", "0.51913136", "0.5191077", "0.51894116", "0.51815045", "0.5171718", "0.5148539", "0.51477695", "0.51451665", "0.51427543", "0.51293725", "0.5110367", "0.5106055", "0.50873363", "0.50677156", "0.50617015", "0.5047588", "0.50403976", "0.50180954", "0.5014684", "0.50116646", "0.50108355", "0.50087607", "0.49890986", "0.49866286", "0.4984768", "0.4982201", "0.49783155", "0.49747235" ]
0.5269036
62
Determine if the user is authorized to make this request.
public function authorize() { $token_sent = request()->bearerToken(); if (empty(auth()->user()) && !empty($token_sent)) { $token = CompanyToken::whereToken($token_sent)->first(); $user = $token->user; Auth::login($user); } return auth()->user()->can('create', Invoice::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.83988106", "0.8375419", "0.8375419", "0.83422995", "0.8251736", "0.82455397", "0.82108665", "0.8144899", "0.8109159", "0.8082", "0.7990051", "0.7987851", "0.798199", "0.7958163", "0.7949029", "0.7946942", "0.79250675", "0.7913215", "0.78981346", "0.78917295", "0.78889436", "0.78883326", "0.78593844", "0.783886", "0.783886", "0.7837413", "0.7822166", "0.78110564", "0.78064126", "0.77906877", "0.7785905", "0.7780735", "0.77793187", "0.7761016", "0.77523595", "0.77171916", "0.77171916", "0.77143407", "0.7711753", "0.7701846", "0.7692613", "0.7690749", "0.7690104", "0.7688827", "0.7671174", "0.76656014", "0.76646394", "0.7654714", "0.76486903", "0.76410675", "0.76410496", "0.76400185", "0.763243", "0.7628761", "0.7626861", "0.76255405", "0.76200867", "0.76200867", "0.76113725", "0.7602363", "0.7601313", "0.7600614", "0.7600614", "0.75994784", "0.7597175", "0.7593741", "0.758599", "0.7584371", "0.75786763", "0.7560661", "0.7551552", "0.75501144", "0.7550086", "0.7541874", "0.75402915", "0.75372165", "0.7536008", "0.7527105", "0.7515016", "0.7511648", "0.7498465", "0.7495165", "0.74936795", "0.74896306", "0.7486042", "0.7484901", "0.7479097", "0.74750495", "0.7470983", "0.7470015", "0.7463743", "0.7463166", "0.7461619", "0.7460629", "0.74603736", "0.74478126", "0.74382544", "0.7435131", "0.7432152", "0.7430674", "0.74216324" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'customer_id' => 'required|exists:customers,id,account_id,' . $this->account_id, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\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 rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function getValidationRules() : array;", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8343639", "0.80130327", "0.79360276", "0.79255855", "0.79239005", "0.79037446", "0.78590554", "0.7790031", "0.77837574", "0.77627355", "0.7737216", "0.7732475", "0.770997", "0.7692687", "0.76860934", "0.7682087", "0.7682087", "0.7682087", "0.7682087", "0.7682087", "0.7682087", "0.767629", "0.7673094", "0.76659316", "0.76577026", "0.7642518", "0.7630142", "0.7629714", "0.76177", "0.76093864", "0.760788", "0.76026917", "0.7599231", "0.75976247", "0.7592885", "0.7590676", "0.7587207", "0.7580831", "0.7555999", "0.75551915", "0.7550872", "0.75467736", "0.75408036", "0.75364316", "0.75363505", "0.7529687", "0.751916", "0.7514591", "0.7507539", "0.75064474", "0.7505799", "0.7499315", "0.7495464", "0.7494931", "0.7493377", "0.74903196", "0.74895173", "0.7489464", "0.7486621", "0.7485344", "0.74787694", "0.7478685", "0.74702436", "0.74637425", "0.7462516", "0.74616563", "0.7459644", "0.7455637", "0.74540275", "0.7453935", "0.74512756", "0.7447664", "0.7441413", "0.7441147", "0.74355644", "0.74355227", "0.7432824", "0.74292976", "0.74291885", "0.7423746", "0.7419448", "0.7415849", "0.7413657", "0.7413395", "0.7412141", "0.74109566", "0.74056846", "0.74046373", "0.7403286", "0.74009603", "0.73910713", "0.73844725", "0.7373299", "0.7371283", "0.73684394", "0.7361356", "0.73553497", "0.7345503", "0.73446465", "0.73430985", "0.73359156" ]
0.0
-1
/ Activa a un Establecimiento
public function activar() { if($this->getEstado() == 1) return false; else { $this->setEstado(1); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activar()\n {\n $this->estatus = 1;\n $this->save();\n }", "function Activar($id) {\n $fecha=date(\"Y-m-d H:i:s\");\n $query=\"UPDATE \".self::$table.\" SET activa='si', fechamodificacion='$fecha' WHERE id=$id\";\n return DBManager::execute($query);\n }", "function Activar(){\r\n\r\n}", "public function activar()\n {\n $id = $this->input->post('activar');\n $this->load->model('Usuario_model');\n $this->Usuario_model->activar_cuenta($id);\n $this->listar_usuarios();\n }", "public function activar($id, $codigo)\n {\n //si no exite el id o codigo entonces muetra un error de cuenta inexistente\n //y renderiza a la vista activar registro\n if(!$this->filtrarInt($id) || !$this->filtrarInt($codigo)){\n $this->_view->assign('_error', 'Esta cuenta no existe');\n $this->_view->renderizar('activar', 'registro');\n exit; \n }\n //guarda una fila con la consuta de conseguir usuario\n $row = $this->_registro->getUsuario(\n $this->filtrarInt($id),\n $this->filtrarInt($codigo)\n );\n //si no existe la fila entonces se produce un error de cuenta inexistente\n if(!$row){\n $this->_view->assign('_error', 'Esta cuenta no existe');\n $this->_view->renderizar('activar', 'registro');\n exit;\n }\n //si el estado del usuario ya esta activado ser produce un error de cuenta ya activada\n //muestra la vista activar registro.\n if($row['estado'] == 1){\n $this->_view->assign('_error', 'Esta cuenta ya ha sido activada');\n $this->_view->renderizar('activar', 'registro');\n exit;\n }\n //Cambia el estado del usuario a activado\n $this->_registro->activarUsuario(\n $this->filtrarInt($id),\n $this->filtrarInt($codigo)\n );\n //consigue nuevamente información del usuario y lo guarda en una fila\n $row = $this->_registro->getUsuario(\n $this->filtrarInt($id),\n $this->filtrarInt($codigo)\n );\n //si el estado sigue siendo igual a 0 entonces se produce un erro de activación pendiente\n if($row['estado'] == 0){\n $this->_view->assign('_error', 'Error al activar la cuenta, por favor intente mas tarde');\n $this->_view->renderizar('activar', 'registro');\n exit;\n }\n //En otros casos se muestra activación realizada con exito y se muetra vista activar registro.\n $this->_view->assign('_mensaje', 'Su cuenta ha sido activada');\n $this->_view->renderizar('activar', 'registro');\n }", "function activar($id){\n\t\trequire_once('../conexion/conexion.php');\n\t\t$conn = conexion();\n\t\ttry{\n\t\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$sql = \"UPDATE tipousuario SET idestado = '1' where idtipoUsuario = '$id'\";\n\t\t\t$conn->exec($sql);\n\t\t}catch(PDOExcepcion $e){\n \t\t\techo \"Error:\".$e->getMessage();\n\t\t}\n\t}", "public function actionActivar($id)\n {\n $model = $this->findModel($id);\n $auth = Yii::$app->authManager;\n if($model->activo==True)\n {\n $model->activo=False;\n $auth->revokeAll($model->fk_usuario);\n $authorRole = $auth->getRole('Invitado');\n $auth->assign($authorRole, $model->fk_usuario);\n Yii::$app->getSession()->setFlash('warning',\"Se desactivó el usuario.\");\n }\n else\n {\n $model->activo=True;\n $auth->revokeAll($model->fk_usuario);\n $authorRole = $auth->getRole('Usuario');\n $auth->assign($authorRole, $model->fk_usuario);\n Yii::$app->getSession()->setFlash('success',\"Se activó el usuario.\");\n //Se crea una notificación por correo\n \\Yii::$app->mailer->compose()\n ->setTo($model->fkUsuario->email)\n ->setFrom([\\Yii::$app->params['supportEmail'] => \\Yii::$app->name . ' robot'])\n ->setSubject('Activación por el admin de legalitas')\n ->setTextBody(\"\n Fue activado por el admin de legalitas, ya puede utilizar el sistema\"\n )\n ->send();\n }\n $model->save();\n return $this->redirect('index');\n }", "public function activate();", "public function activate();", "public function activate() {\n\t\t\n\t}", "public function activar($equi_tip_id){\n\t\t$sql = \"UPDATE equipo_tipo \n\t\t\t\tSET equi_tip_estado = '1'\n\t\t\t\tWHERE equi_tip_id = '$equi_tip_id'\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function activarEvento($id)\n {\n $sede = Evento::find($id);\n $sede->activo = 'A';\n $sede->save();\n //flash('La categoría ' . $category->name . ' ha sido desactivada de manera exitosa', 'warning');\n return redirect()->route('lista_sedes');\n }", "public function activar($categoria){\n\t\t\t\t\t\t\t\t\t$db=DB::conectar();\n\t\t\t\t\t\t\t\t\t$update=$db->prepare('UPDATE categoria SET estado = 1 WHERE id = :id;');\n\t\t\t\t\t\t\t\t\t$update->bindValue('id',$categoria->getId());\n\t\t\t\t\t\t\t\t\t$update->execute();\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "public function aprova()\n {\n $this -> estadoAtual -> aprova($this);\n }", "function activate()\n {\n if( $this->attribute( 'is_temporary' ) )\n {\n $this->setAttribute( 'is_temporary', 0 );\n\n $nextID = $this->getNewID();\n $this->setAttribute( 'order_nr', $nextID );\n $this->store();\n\n // Create an order status history element that matches the current status\n $this->createStatusHistory();\n }\n }", "public function activaAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n //VERIFICAR SI EL USUARIO ESTA LOGUEADO\n\n //VERIFICAR SI EL USUARIO ESTA LOGUEADO\n \t\tif (false === $this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY'))\n \t\t{\n \t\t\tthrow new AccessDeniedException();\n \t\t}\n\n $idusuario = $this->get('security.context')->getToken()->getUser()->getId();\n $usuario = $em->getRepository('UsuarioBundle:Perfil')->find($idusuario);\n\n $trivias_activas = $this->get('trivias');\n\n $activaa = $trivias_activas->activa($usuario);\n\n $encuestas = $activaa[0];\n $activa = $activaa[1];\n $contador = $activaa[2];\n $puntos = $activaa[3];\n $voto = $activaa[4];\n\n return $this->render('EncuestaBundle:Encuesta:activa.html.twig', array(\n 'entities' => $encuestas,\n 'activa' => $activa,\n 'contador' => $contador,\n 'puntos' => $puntos,\n 'voto' => $voto\n ));\n }", "function activate() {\r\r\n }", "public function reescalarActi(){\n }", "public function setActivation(): void;", "public function activacion($codimpuesto){\n\n\t\tyii::app()->db->createCommand()\n\t\t\t->update($this->tableName(),\n\t\t\t\tarray(\"activo\"=>'0'),\n\t\t\t\t\"id <> :vid AND hcodimpuesto=:vcodigo\",\n\t\t\t\tarray(\":vid\"=>$this->id,\":vcodigo\"=>trim($codimpuesto)));\n return 1;\n\t}", "public function setActive() {}", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "public function activarUsuario() {\n\t\t$this->id_status = self::STATUS_ACTIVED;\n\t\treturn $this->save () ? $this : null;\n\t}", "public function activarPantalla() {\n\n\t$pantallaActual=new Properties();\n $pantallaActual->load(file_get_contents(\"./pantallaActiva.properties\"));\n $pantallaActual->setProperty(\"Pantalla.activa\",1);\n file_put_contents('./pantallaActiva.properties', $pantallaActual->toString(true));\n }", "function activate() {\n }", "public function contarInventario(){\n\t}", "public function activate() {\n\t\t\t// just in case I want to do anything on activate\n\t\t}", "function activate($correo){\n $campos = array('activa' => 1);\n \n return $this->db->updateParameters(self::TABLA, $campos, array('email' => $correo));\n }", "public static function activate(){\n }", "function activar_usuario ($id_colaborador) {\n\t\n\t$UpdateRecords = \"UPDATE colaboradores \n\t\tSET estado='1' 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($UpdateRecords);\n\t\tmysql_close($connection);\n\t\n\t}", "public function activarPantalla() {\n\n\n $pantallaActual=new Properties();\n $pantallaActual->load(file_get_contents(\"./pantallaActiva.properties\"));\n $pantallaActual->setProperty(\"Pantalla.activa\",12);\n file_put_contents('./pantallaActiva.properties', $pantallaActual->toString(true));\n }", "public function Anular()\n\t{\n\t\tif($this->TieneCobranzasVigentes())\n\t\t\tthrow new Exception('No se puede anular una factura que tiene cobranzas');\n\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t\t//echo 'ejecutar como trans';\n\t\t\t$this->FechaAnulacion = date('Y-m-d');\n\t\t\t\n\t\t\t$q =\tDoctrine_Query::create()\n\t\t\t\t\t\t->from('OrdenDeTrabajo ot')\n ->Update()\n ->Set('FacturaId', 'NULL')\n ->andWhere('ot.ClienteId = ?', $this->ClienteId)\n ->andWhere('ot.FacturaId = ?', $this->Id);\n \n\t\t\t$conn->beginTransaction();\n\t\t\t\n\t\t\t$this->save();\n\t\t\t//actualizar ordenes asociadas la factura\n\t\t\t$q->execute();\n\t\t\t\n\t\t\t$conn->commit();\n\t\t\n\t}", "public function inativarregistroAction()\n\t{\n\n\t}", "public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }", "function evt__enviar(){\n if($this->dep('datos')->tabla('mesa')->esta_cargada()){\n $m = $this->dep('datos')->tabla('mesa')->get();\n // print_r($m);\n $m['estado'] = 2;//Cambia el estado de la mesa a Enviado\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 $m = $this->dep('datos')->tabla('mesa')->get_listado($m['id_mesa']);\n if($m[0]['estado'] == 2){//Obtengo de la BD y verifico que hizo cambios en la BD\n //Se enviaron correctamente los datos\n toba::notificacion()->agregar(utf8_decode(\"Los datos fueron enviados con éxito\"),\"info\");\n }\n else{\n //Se generó algún error al guardar en la BD\n toba::notificacion()->agregar(utf8_decode(\"Error al enviar la información, verifique su conexión a internet\"),\"info\");\n }\n }\n \n }", "public function activarPantalla() {\n $pantallaActual=new Properties();\n $pantallaActual->load(file_get_contents(\"./pantallaActiva.properties\"));\n $pantallaActual->setProperty(\"Pantalla.activa\",4);\n file_put_contents('./pantallaActiva.properties', $pantallaActual->toString(true));\n\n\n // $this->pantalla_activa=$pantalla;\n }", "public function desactivar()\n {\n $this->estatus = 0;\n $this->save();\n }", "public function activarSeccion($id)\n {\n $seccion = Seccion::find($id);\n $seccion->activo = 'A';\n $seccion->save();\n //flash('La categoría ' . $category->name . ' ha sido desactivada de manera exitosa', 'warning');\n return redirect()->route('lista_secciones');\n }", "function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t \t$sql = \"UPDATE proveedor SET status='0' WHERE id_prov='$this->cod_prov'\";\n\t\t\t$this->ejecuta($sql);\n\t}", "public function activate()\r\n\t{\r\n\t\treturn $this->_changeStatus(1);\r\n\t}", "public function setActive()\n {\n $this->status = AutoEvent::STATUS_ACTIVE;\n $this->save();\n }", "public function isEtablissementActif(): bool{\n return true;\n }", "public function activate() {\n\t\t// TODO define activation functionality here\n\t}", "public function isActivatable()\n {\n return true ;\n }", "public function actualizar_estado() {\n }", "function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t\t$sql=\"UPDATE motivo_movimiento SET status='0' WHERE id_motivo_mov='$this->id_motivo'\";\n\t\t\t$this->ejecuta($sql);\n\t\t//}\n\t}", "public function inactivarHorarioFecha($idAgendaHorarioFechaUsuario){\n\t\t\n\t\t $idAgendaHorarioFechaUsuario \t\t= parent::escaparQueryBDCliente($idAgendaHorarioFechaUsuario); \t\t\n\n\n $query = \"UPDATE tb_agendaHorarioFechaUsuario SET estado = 'I'\n \t\t\t\tWHERE idAgendaHorarioFechaUsuario = '$idAgendaHorarioFechaUsuario' \";\n \n $conexion = parent::conexionCliente();\n \t\t\n if($res = $conexion->query($query)){\n \n $resultado = \"Ok\";\n }\n \n return $resultado; \n\n\t}", "public function actionInactivarCodigoPresupuestario()\r\n {\r\n\r\n $idCodigo = yii::$app->request->get('value');\r\n $_SESSION['idCodigo'] = $idCodigo; \r\n\r\n $inactivar = self::beginSave(\"inactivar\", 0);\r\n\r\n if($inactivar == true){\r\n return MensajeController::actionMensaje(200);\r\n }else{\r\n return MensajeController::actionMensaje(920);\r\n } \r\n\r\n }", "public static function activate() {\n\n }", "public function getActivo()\n {\n return $this->activo;\n }", "public function inactivarRecesoDia($idAgendaHorarioReceso){\n\t\t\n\t\t $idAgendaHorarioReceso \t\t= parent::escaparQueryBDCliente($idAgendaHorarioReceso); \t\t\n\n\n $query = \"UPDATE tb_agendaHorarioReceso SET estado = 'I'\n \t\t\t\tWHERE idAgendaHorarioReceso = '$idAgendaHorarioReceso' \";\n \n $conexion = parent::conexionCliente();\n \t\t\n if($res = $conexion->query($query)){\n \n $resultado = \"Ok\";\n }\n \n return $resultado; \n\n\t}", "function procesar_edicion ($datos){\n \n $this->dep('datos')->tabla('asignacion')->cargar(array('id_asignacion'=>$this->s__id_asignacion));\n $datos['id_asignacion']=$this->s__id_asignacion;\n $this->dep('datos')->tabla('asignacion')->set($datos);\n $this->dep('datos')->tabla('asignacion')->sincronizar();\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 }", "public static function activate()\n {\n }", "public function activate_user() {\n global $database;\n $sql = \"UPDATE user SET is_active = 1 WHERE id = \";\n $sql .= $database->escape_value($this->id);\n $database->query($sql);\n }", "public function update_ofert_activate($id)\n {\n $this->db->update('ofertas_negocios', array('ofertaActivacion'=>'1'), array('ofertaId'=>$id));\n }", "public function activar(Request $request)\n {\n if (!$request->ajax()) {\n return redirect('/');\n }\n\n $almacen = Almacen::findOrFail($request->id);\n $almacen->estado = true; \n $almacen->save();\n }", "function evt__agregar()\n\t{\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "public function inactivarRecesoFecha($idAgendaHorarioRecesoFecha){\n\t\t\n\t\t $idAgendaHorarioRecesoFecha \t\t= parent::escaparQueryBDCliente($idAgendaHorarioRecesoFecha); \t\t\n\n\n $query = \"UPDATE tb_agendaHorarioRecesoFecha SET estado = 'I'\n \t\t\t\tWHERE idAgendaHorarioRecesoFecha = '$idAgendaHorarioRecesoFecha' \";\n \n $conexion = parent::conexionCliente();\n \t\t\n if($res = $conexion->query($query)){\n \n $resultado = \"Ok\";\n }\n \n return $resultado; \n\n\t}", "public function activate(): bool\n {\n $this->{$this->getDeactivatedAtColumn()} = null;\n return $this->save();\n }", "public function inactivarCodigoContable($conn, $conexion)\r\n {\r\n $idCodigo = $_SESSION['idCodigo'];\r\n\r\n \r\n $tableName = 'codigos_contables';\r\n \r\n $arregloCondition = ['id_codigo' => $idCodigo];\r\n \r\n $arregloDatos['inactivo'] = 1;\r\n\r\n\r\n \r\n\r\n $conexion = new ConexionController();\r\n\r\n $conn = $conexion->initConectar('db');\r\n \r\n $conn->open();\r\n\r\n \r\n\r\n if ($conexion->modificarRegistro($conn, $tableName, $arregloDatos, $arregloCondition)){\r\n\r\n \r\n\r\n return true;\r\n \r\n }\r\n\r\n }", "public function activar_cliente($id,$estado){\n $conectar= parent::conexion();\n parent::set_names();\n $sql=\"CALL spc_actualizar_estadoCliente(?,?)\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $estado);\n $sql->bindValue(2, $id);\n $sql->execute();\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n }", "public function update_active(){\n\t\t$sql = \"update set creado=NOW() where id=$this->id\";\n\t\t\n\t}", "public function activar($id){\n $user = User::find($id);\n $user->activo = 1;\n $user->update();\n $usuario = \\Auth::user()->name;\n DB::select('call logs(\"'.$usuario.'\", \"Activó usuario\", \"Administrador\")');\n return redirect()->route('listar')\n ->with(['message'=>'Ya puede entrar este usuario ¡CUIDADO!']);\n }", "public function verActividades() {\n $eventos = Evento::all()->sortByDesc('fecha_desde');\n $this->render('costa/portal/actividades.twig', [\n 'actividades' => $eventos\n ]);\n }", "protected function activateTrainee($id){\n Trainee::where('id',$id)->update(array('status' => 'paid'));\n $email = Trainee::where('id',$id)->value('email_address');\n // $this->email_function->basic_email($email);\n return redirect()->back()->with('message','A trainee has been Activated Successfully and notified via email');\n }", "public function activar($id)\n {\n try {\n\n $user = User::FindOrFail($id);\n $user->activo = 1;\n $user->save();\n \n } catch (\\Trowable $e) {\n \n throw $e;\n \n }\n \n return redirect('admin/operadores');\n\n }", "function habilitarContrato(){\n $this->procedimiento = 'adq.f_cotizacion_ime';\n $this->transaccion = 'ADQ_HABCONT_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_cotizacion','id_cotizacion','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function activate(){\n\t\treturn $this->_sendPacketToController(self::ACTIVATE);\n\t}", "public function sendActivation()\n\t{\n\t}", "public function activate(PropelPDO $con = null)\n {\n $this->setIsActive(true);\n $this->save($con);\n }", "public function markAsActivate() : bool\n {\n $this->is_active = 1;\n $this->paid = 1;\n //$this->grace_period_ends = new RawValue('NULL');\n $this->ends_at = null; //new rawValue('NULL');\n $this->next_due_payment = $this->ends_at;\n $this->is_cancelled = 0;\n return $this->update();\n }", "public function GuardarEstado()\n\t{\n\t\t$query=\"INSERT INTO estado (idpais,estado,descripcion) VALUES ($this->id_pais,'$this->estado','$this->descripcion')\";\n\t\t$resp=$this->db->consulta($query);\n\t\t$this->id_estado = $this->db->id_ultimo();\n\t\t\n\t\t\n\t\t\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "public function activar($car_id){\n\t\t$sql = \"UPDATE cargo \n\t\t\t\tSET car_estado = '1'\n\t\t\t\tWHERE car_id = '$car_id'\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "function opcion__empaquetar()\n\t{\n\t\t//Aca tengo que decidir si empaqueto para produccion o desarrollo.\n\t\t//* @consola_parametros Opcional: [-d 'deployment'] Indica si el instalador sera para produccion o desarrollo.\n\t\t$param = $this->get_parametros();\n\t\t/*if (isset($param['-d']) && trim($param['-d']) == 'desarrollo') {\n\t\t\t$paquete = self::tipo_paquete_desarrollo;\n\t\t} else {*/\n\t\t\t$paquete = self::tipo_paquete_produccion;\n\t\t//}\n\t\t$es_legacy = (isset($param['-L']) && ($param['-L'] == 1));\n\t\t$this->get_proyecto()->empaquetar($paquete, $es_legacy);\n\t}", "function activation()\n {\t\n\t\t$data['fal'] = $this->fal_front->activation();\n\t\t$this->load->view($this->_container, $data); \n }", "public function setActive()\r\n {\r\n $this->active = true;\r\n }", "public function EntregarDelivery()\n\t{\n\t\tself::SetNames();\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" entregado = ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $entregado);\n\t\t$stmt->bindParam(2, $codventa);\n\t\t\n\t\t$entregado = strip_tags(\"0\");\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\t\t\n echo \"<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 PEDIDO EN DELIVERY FUE ENTREGADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t\n }", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public function activate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 1]);\n }\n\n $this->resetSelected();\n }", "public function activar($prod_id){\n\t\t$sql = \"UPDATE producto \n\t\t\t\tSET prod_estado = '1'\n\t\t\t\tWHERE prod_id = '$prod_id'\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "function AsignarVacacion(){\n\t $this->procedimiento='asis.ft_vacacion_sel';\n\t\t$this->transaccion='ASIS_ASIGVAC_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\n\t\t$this->setCount(false); \n\t\t\n\t\t$this->tipo_conexion='seguridad';\n\t\t\n\t\t$this->arreglo=array(\"id_usuario\" =>1,\n\t\t\t\t\t\t\t \"tipo\"=>'TODOS'\n\t\t\t\t\t\t\t );\n\t\t\n\t\t$this->setParametro('id_usuario','id_usuario','int4');\t\t\t\t\t\t \n $this->captura('dias_asignados','int4');\n\n\t //Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//echo (\"entro al cron modelo vacacion juan \".$this->consulta.' fin juan');\n\t\t//exit;\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function inactivarHorarioDiaUsuario($idUsuario, $dia){\n\t\t\n\t\t\t$dia \t\t\t= parent::escaparQueryBDCliente($dia); \n\t\t\t$idUsuario \t= parent::escaparQueryBDCliente($idUsuario); \t\n\n $query = \"UPDATE tb_agendaHorarioUsuario SET estado = 'I'\n \t\t\t\tWHERE numeroDia = '$dia' AND idUsuario = '$idUsuario' \";\n \n $conexion = parent::conexionCliente();\n \t\t\n $conexion->query($query);\n \n\t\t\n\t\t\n\t}", "public function contractActiveByAdmin($active){\n $sql = \"UPDATE contract SET\n isActive=:isActive\n WHERE id = :id\";\n\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->bindValue(':isActive', 1);\n $stmt->bindValue(':id', $active);\n $result = $stmt->execute();\n if ($result) {\n echo \"<script>location.href='contract.php';</script>\";\n Session::set('msg', '<div class=\"alert alert-success alert-dismissible mt-3\" id=\"flash-msg\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>\n <strong>Success !</strong> Contract activat cu succes!</div>');\n }else{\n echo \"<script>location.href='contract.php';</script>\";\n Session::set('msg', '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>\n <strong>Error !</strong> Contract nu este activat!</div>');\n }\n }", "public function enfocarCamaraPresidencia() {\n\n self::$presidencia->enfocar();\n\n }", "public function activation($cnestudent)\r\n {\r\n $req=$this->student->changeetat($cnestudent); // change the etat\r\n $this->students(); // show the update list of student\r\n }", "public function iniciarTransaccion() {\n $this->ejecutar(\"START TRANSACTION\");\n }", "public final function active()\n {\n }", "public final function active()\n {\n }", "public final function active()\n {\n }", "public function setActive()\n\t\t{\n\t\t\t$this->_state = 1;\n\t\t}", "protected function activateSelf() {}", "public function reprova()\n {\n $this -> estadoAtual -> reprova($this);\n }", "public function setActive()\n {\n $this->update(['status' => static::STATUS_ACTIVE]);\n }" ]
[ "0.7388194", "0.71274936", "0.70013523", "0.69527704", "0.66529655", "0.65395486", "0.65207744", "0.64978504", "0.64978504", "0.6482271", "0.64422095", "0.6436188", "0.63589257", "0.6341745", "0.633046", "0.63076043", "0.6298394", "0.6295622", "0.62947345", "0.62815976", "0.627227", "0.6249575", "0.6249575", "0.6249575", "0.62107176", "0.61985004", "0.6198401", "0.61895996", "0.6181464", "0.61701447", "0.61555904", "0.61361504", "0.6135088", "0.61312544", "0.6115398", "0.6114944", "0.6108212", "0.61043704", "0.6104115", "0.6069728", "0.6066988", "0.60458493", "0.60184246", "0.6015436", "0.60072124", "0.600353", "0.5973089", "0.5970506", "0.5961565", "0.59551585", "0.59535545", "0.59512705", "0.59501565", "0.5942372", "0.59399545", "0.5858248", "0.58567053", "0.5850378", "0.58463717", "0.58459216", "0.58456475", "0.5844017", "0.5837837", "0.5806451", "0.5800478", "0.5795411", "0.5794931", "0.5793569", "0.57896256", "0.57679224", "0.5762651", "0.5758625", "0.57525295", "0.57497585", "0.57392526", "0.5736471", "0.57363147", "0.57363147", "0.5730087", "0.5729815", "0.5726007", "0.57228345", "0.57218105", "0.57142115", "0.57142115", "0.57118464", "0.56971526", "0.5694712", "0.5693306", "0.5690582", "0.5689948", "0.56788486", "0.5676745", "0.5676123", "0.567576", "0.567576", "0.5675601", "0.5674092", "0.56714267", "0.5655964" ]
0.6797022
4
/ Desactiva a un Establecimiento
public function desactivar() { if($this->getEstado() == 2) return false; else { $this->setEstado(2); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function desactivar()\n {\n $this->estatus = 0;\n $this->save();\n }", "function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t \t$sql = \"UPDATE proveedor SET status='0' WHERE id_prov='$this->cod_prov'\";\n\t\t\t$this->ejecuta($sql);\n\t}", "function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t\t$sql=\"UPDATE motivo_movimiento SET status='0' WHERE id_motivo_mov='$this->id_motivo'\";\n\t\t\t$this->ejecuta($sql);\n\t\t//}\n\t}", "public static function es_deactivation() {\n\t}", "public function desactivar_principal(){\n\t\t$data = array(\n 'sli_estado' => \"1\"\n );\n\n\t\t$this->db->where('sli_estado', \"2\");\n\t\t$this->db->update('slide', $data); \n\t\treturn $this->db->affected_rows();\n\t}", "public function deactivate(): void;", "public function deactivate();", "abstract public function deactivate();", "public function deactivate() {\n\n }", "public function deactivate() {\n\n }", "public function desactivarCuenta() {\n\n\t/*Recoge el usuario actual*/\n\t$currentuser = $_SESSION[\"currentuser\"];\n\n\t/*Actualiza el estado del usuario a inactivo=0 */\n\t$this->user->updateEstado($currentuser->getEmailU());\n\n\t//mensaje de confirmación y redirige al método login del UsersController.php\n\techo \"<script> alert('Cuenta eliminada correctamente'); </script>\";\n\techo \"<script>window.location.replace('index.php');</script>\";\n\n\t// renderiza la vista (/view/vistas/consultaJprof.php)\n\t$this->view->render(\"vistas\", \"consultaJprof\");\n}", "public function desactivar($idtarifas){\n\n $sql=\" UPDATE tarifas SET estado='0' WHERE idtarifas='$idtarifas' \";\n return ejecutarConsulta($sql);\n\n\n }", "function desactivar($id){\n\t\trequire_once('../conexion/conexion.php');\n\t\t$conn = conexion();\n\t\ttry{\n\t\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$sql = \"UPDATE tipousuario SET idestado = '2' where idtipoUsuario = '$id'\";\n\t\t\t$conn->exec($sql);\n\t\t}catch(PDOExcepcion $e){\n \t\t\techo \"Error:\".$e->getMessage();\n \t\t}\n\t}", "public static function deactivate(){\n }", "public static function deactivate(){\n }", "public static function deactivate() {\n\n }", "public static function deactivate() {\n\t}", "public static function deactivate(){\n // Do nothing\n }", "public static function deactivate()\n\t{\n\n\t}", "public function deactivate() {\n\t\t\t// just in case I want to do anyting on deactivate\n\t\t}", "function deactivate() {\n\t}", "public static function deactivate ()\n\t{\n\t}", "public function deshacervisadoAction()\n {\n $documento_id = $this->_getParam('documento_id');\n $documento_visto_id = $this->_getParam('documento_visto_id'); \n \n /* Desactivo el auto renderizado */\n $this->disableAutoRender();\n\n try {\n\n $this->_modelo->deshacerFirma($documento_id, $this->_usuario->id, 1, $documento_visto_id);\n\n } catch(Exception $ex) {\n\n $message = $ex->getMessage();\n echo 'error|'.$message;\n }\n \n }", "public static function deactivate()\n {\n }", "public function desactivar($equi_tip_id){\n\t\t$sql = \"UPDATE equipo_tipo \n\t\t\t\tSET equi_tip_estado = '0'\n\t\t\t\tWHERE equi_tip_id = '$equi_tip_id'\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function desactivar($id){\n $user = User::find($id);\n $user->activo = 0;\n $user->update();\n $usuario = \\Auth::user()->name;\n DB::select('call logs(\"'.$usuario.'\", \"Desactivó usuario\", \"Administrador\")');\n return redirect()->route('listar')\n ->with(['message'=>'Se le acabo la tonteria juajuajua']);\n }", "public function desactivarEvento($id)\n {\n $sede = Evento::find($id);\n $sede->activo = 'I';\n $sede->save();\n //flash('La categoría ' . $category->name . ' ha sido desactivada de manera exitosa', 'warning');\n return redirect()->route('lista_sedes');\n }", "function _deactivate() {}", "public function reescalarActi(){\n }", "public function register_deactivation();", "public function deactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeInactive', array(\n 'title' => t('Remove recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }", "public static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function deactivate()\n {\n // Do nothing\n }", "public function desactivar($id_tipo_operaciones)\n {\n $sql=\"UPDATE tbl_tipo_operaciones SET estado='0' WHERE id_tipo_operaciones='$id_tipo_operaciones'\";\n return ejecutarConsulta($sql);\n }", "public function acfedu_plugin_deactivation() {\n\t\t\t // nothing yet\n // @TODO: delete any settings\n\t\t\t}", "public static function deactivate() {\n\t\t\t// Do nothing\n\t\t}", "public function _deactivate() {\r\n\t\t// Add deactivation cleanup functionality here.\r\n\t}", "public static function deactivate() {\n\t\t// Do nothing.\n\t}", "public function des_activarAction($id)\n {\n //denegamos el acceso a eliminar a los investigadores\n if ($this->get('security.context')->isGranted('ROLE_ADMIN')){\n $admin=true;}\n else{\n $admin=false;\n }\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('proyectobackendBundle:Estudio')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Estudio entity.');\n }\n if($entity->getActiva()==true){\n $entity->setActiva(false);\n $em->persist($entity);\n }else{\n $entity2 = $em->getRepository('proyectobackendBundle:Estudio')->findOneBy(array('activa' => true));\n if(isset($entity2)){\n $entity2->setActiva(false);\n $em->persist($entity2);\n }\n $entity->setActiva(true);\n $em->persist($entity);\n }\n $em->flush();\n $paginator = $this->get('knp_paginator');\n $entities = $em->getRepository('proyectobackendBundle:Estudio')->findAll();\n $pagination = $paginator->paginate(\n $entities,\n $this->get('request')->query->get('page', 1)/*page number*/,\n 10/*limit per page*/\n ); \n return $this->render('proyectobackendBundle:Estudio:index.html.twig', array(\n 'pagination' => $pagination,\n 'filtro' => '',\n 'sort' => '',\n 'direction' => '',\n 'admin' => $admin,\n ));\n }", "function deactivate_acquaint_crm_epl() {\n\trequire_once ACQUAINT_CRM_EPL_DIR . 'includes/models/setup/AcquaintEplDeactivator.php';\n\tAcquaintEplDeactivator::deactivate();\n}", "public function desactivarSeccion($id)\n {\n $seccion = Seccion::find($id);\n $seccion->activo = 'I';\n $seccion->save();\n //flash('La categoría ' . $category->name . ' ha sido desactivada de manera exitosa', 'warning');\n return redirect()->route('lista_secciones');\n }", "function on_deactivation ()\n{\n}", "function on_deactivation ()\n{\n}", "function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}", "public function desactivarMesa(Request $request)\n {\n\n Mesa::where('id', $request->idMesa)->update([\n 'IsActive' => '0'\n ]);\n }", "private static function single_deactivate() {\n\t\t// @TODO: Define deactivation functionality here\n\t}", "private static function single_deactivate() {\n\t\t// @TODO: Define deactivation functionality here\n\t}", "function motivoDeAsignacion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ASIGNACIÓN' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "public function desasociar($id_activo, $id_maleza){\n\n $activo = Activo::find($id_activo);\n $activo->malezas()->detach($id_maleza);\n\n Session::flash(\"mensaje\",[\"contenido\"=>\"Registro Correcto\", \"color\" => \"green\"]);\n return redirect()->back();\n\n\n }", "public function desactiver($id)\n {\n DB::table('entreprise')\n ->where('id', $id)\n ->update(array('ent_status' => 0));\n return redirect()->route('entreprise.index');\n \n }", "function deleteArticulo( $id ){\n $sql = \"UPDATE `articulo` SET `activo`= 0 WHERE `id`= $id\";\n ejecutarConsulta($sql);\n }", "private function eliminarCita(){\n $query = \"UPDATE \" . $this->table . \" SET estado = 'Inactivo' WHERE CitaId = '\" . $this->idcita . \"'\";\n $resp = parent::nonQuery($query);\n if($resp >= 1 ){\n return $resp;\n }else{\n return 0;\n }\n }", "public function deactivateAction()\n {\n $this->deactivateParameters = $this->deactivateParameters + $this->_deactivateExtraParameters;\n\n parent::deactivateAction();\n }", "public function desactivarPizarra( ) {\n $this->setComando(self::$PIZARRA_DIGITAL, \"MUTE\");\n $this->setPizarraMuteado(1);\n }", "static function desactivarDescuento($descuentoID) {\n $conn = getConn();\n $sql = \"UPDATE tso_descuentos_cantidad_vehiculos SET esta_activo = FALSE WHERE id = ?\";\n $values = array($descuentoID);\n $count = $conn->executeUpdate($sql, $values);\n return ($count > 0) ? true : false;\n }", "public function activar()\n {\n $this->estatus = 1;\n $this->save();\n }", "function deactivator()\n{\n require_once plugin_dir_path( __FILE__ ) . 'includes/Deactivator.php';\n\tDeactivator::deactivate();\n}", "function mailmaga_x_deactivation(){\n\t$mailmaga_x_data = new Mailmaga_x_install();\n\t$mailmaga_x_data->deactivation();\n}", "public function desactivar(Request $request)\n {\n if (!$request->ajax()) {\n return redirect('/');\n }\n\n $almacen = Almacen::findOrFail($request->id);\n $almacen->estado = false; \n $almacen->save();\n }", "public function detalheAction () {\n // Título da tela (action)\n $this->view->telaTitle = 'Visualizar Exercício Orçamentário';\n\n // Identifica o parâmetro da chave primária a ser buscada\n $chavePrimaria = $this->_getParam('cod');\n\n if ($chavePrimaria) {\n // Busca registro específico\n $negocio = new $this->_classeNegocio ();\n $registro = $negocio->retornaRegistro($chavePrimaria);\n\n if ($registro) {\n // Exibe os dados do registro\n $this->view->dados = $registro;\n } else {\n $this->registroNaoEncontrado();\n }\n } else {\n $this->codigoNaoInformado();\n }\n }", "public function desactivar($idresponsable)\n\t{\n\t\t$sql = \"UPDATE responsable SET condicion='0' \n\t\tWHERE idresponsable='$idresponsable'\";\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function declineSingle(){\n\t\tif(isset($_SESSION['admin_email'])){\n\t\t$this->model(\"AdminApproveModel\");\n\t\tif(isset($_POST['admin_decline'])){\n\t\t\t$this->sanitizeString($_POST['admin_decline']);\n\t\t\t$id = $this->sanitizeString($_POST['id']);\n\t\t\tAdminApproveModel::where('id', $id)->delete();\n\t\t}\n\t}\n\n\t}", "function deactivate()\n {\n delete_option( 'ultimosPostPorAutor' );\n }", "protected function deactivateSelf() {}", "public function actualizar_estado() {\n }", "function virustotalscan_deactivate()\r\n{\r\n global $db;\r\n // se sterg setarile din baza de date\r\n $db->query(\"DELETE FROM \".TABLE_PREFIX.\"settinggroups WHERE name = 'virustotalscan_group'\");\r\n \t$db->query(\"DELETE FROM \".TABLE_PREFIX.\"settings WHERE name LIKE 'virustotalscan_setting_%'\");\r\n // se actualizeaza toate setarile\r\n\trebuild_settings();\r\n // daca tabela \"virustotalscan_log\" exista in baza de date atunci se sterge!\r\n\tif ($db->table_exists('virustotalscan_log'))\r\n $db->drop_table('virustotalscan_log');\r\n // se sterge din baza de date stil-urile adaugate\r\n $db->delete_query('templates', 'title = \"virustotalscan_url_css\"'); \r\n}", "public function plugin_deactivate() {\r\n\r\n\t}", "public function videoconferenciaDesconectado( ) {\n $this->setComando(\"DESCONECTADO\");\n }", "function deactivate() {\n \n $this->reset_caches();\n $this->ext->update_option( 'livefyre_deactivated', 'Deactivated: ' . time() );\n\n }", "public function desativar()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"UPDATE EncontroComDeus SET \t ativo = 0\n WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n //var_dump($erro);\n //exit();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n }", "function trans_off()\r\n\t{\r\n\t\t$this->db->trans_enabled = FALSE;\r\n\t}", "public function desactivar($car_id){\n\t\t$sql = \"UPDATE cargo \n\t\t\t\tSET car_estado = '0'\n\t\t\t\tWHERE car_id = '$car_id'\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function desenfocarCamaraPresidencia() {\n\n self::$presidencia->desenfocar();\n\n }", "public function deactivate() {\n\t\t/**\n\t\t * Fires when the plugin is being deactivated.\n\t\t *\n\t\t * @since 7.0\n\t\t */\n\t\tdo_action('audition_deactivate');\n\t}", "public function deactivate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 0]);\n }\n\n $this->resetSelected();\n }", "function eliminar_autonomo()\n\t{\n\t\ttry {\n\t\t\t$this->db->abrir_transaccion();\n\t\t\t$this->db->retrasar_constraints();\n\t\t\t$this->eliminar();\n\t\t\t$this->db->cerrar_transaccion();\n\t\t\t$this->manejador_interface->mensaje(\"El proyecto '{$this->identificador}' ha sido eliminado\");\n\t\t} catch ( toba_error $e ) {\n\t\t\t$this->db->abortar_transaccion();\n\t\t\t$this->manejador_interface->error( \"Ha ocurrido un error durante la eliminacion de TABLAS de la instancia:\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t$e->getMessage() );\n\t\t}\n\t}", "function deactivation_hook() {\n\n\t}", "public function decopersonnel()\n {\n $this->session-> unset_userdata('admin','info','id');\n $this ->session->sess_destroy();\n $this->template->display('acceuil');\n }", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public function execute_deactivation_hooks() {\r\n }", "public function desactivar($idmedicamento)\n {\n $sql= \"UPDATE medicamento SET estado ='0' \n WHERE idmedicamento = '$idmedicamento'\";\n \n return ejecutarConsulta($sql);\n }", "public function actionDeixarSeguir(){\r\n $me = new MetodosExtras();\r\n \r\n $ss = new Sessao();\r\n $sm = new SeguirModel();\r\n $sm->setId($ss->devSessao('id'));\r\n $sm->setIdSeguir($_GET['usu']);\r\n \r\n \r\n $sd = new SeguirDAO();\r\n if($sd->dexarSeguir($sm) == 2):\r\n if($_GET['tp'] == 1):\r\n $me->redireciona('Artista/Perfil&usu='.$_GET['usu'].'&tp='.$_GET['tp'].'&op=tres');\r\n else:\r\n $me->redireciona('Companhia/Perfil&usu='.$_GET['usu'].'&tp='.$_GET['tp'].'&op=tres');\r\n endif;\r\n else:\r\n if($_GET['tp'] == 1):\r\n $me->redireciona('Artista/Perfil&usu='.$_GET['usu'].'&tp='.$_GET['tp'].'&op=quatro');\r\n else:\r\n $me->redireciona('Companhia/Perfil&usu='.$_GET['usu'].'&tp='.$_GET['tp'].'&op=quatro');\r\n endif;\r\n endif;\r\n }", "function Desintegrar()\n\t{\n\t\t$usuario = UsuarioFacebook::ObtenerUsuarioActivo();\n\t\tif(!$usuario->TienePermiso('IntegrarUsuarios'))\n\t\tthrow new Exception('No puede desvincular este usuario del club porque no tiene permiso para hacerlo');\n\t\tif(!$this->EsMiembroClubOrion)\n\t\tthrow new Exception('Este usuario ya está desvinculado del club');\n\t\t$conexionBd = new ConectorBaseDatos();\n\t\t$conexionBd->IniciarTransaccion();\n\t\t// Eliminar permisos\n\t\t$conexionBd->Sentencia = sprintf(\"DELETE FROM PermisoUsuario WHERE Usuario = %s\",\n\t\t$conexionBd->Escapar($this->IdFacebook)\n\t\t);\n\t\t$conexionBd->EjecutarComando();\n\t\t// Eliminar asociaciones a los grupos\n\t\t$conexionBd->Sentencia = sprintf(\"DELETE FROM UsuarioGrupo WHERE Usuario = %s\",\n\t\t$conexionBd->Escapar($this->IdFacebook)\n\t\t);\n\t\t$conexionBd->EjecutarComando();\n\t\t$conexionBd->Sentencia = sprintf(\"UPDATE UsuarioFacebook SET ValidadoPor = NULL WHERE IdFacebook = %s\",\n\t\t$conexionBd->Escapar($this->IdFacebook)\n\t\t);\n\t\t$conexionBd->EjecutarComando();\n\t\t$conexionBd->ConfirmarTransaccion();\n\t\t$conexionBd->Desconectar();\n\t\t$this->validadoPorIdFacebook = null;\n\t}", "function urt_deactivate() {\n remove_role( 'urt_secretary' );\n}", "function monitis_addon_deactivate() {\n // Remove Custom DB Table\n // TODO handle db failures \n $query = \"DROP TABLE `mod_monitis_addon`, `mod_monitis_server`\";\n\t$result = mysql_query($query);\n return array('status'=>'success','description'=>'Deactivation successful');\n}", "public function desactivar(Request $request){\n \t$exito = 0;\n \t$msg = Lang::get ( 'general.error' );\n \ttry{\n \t\t$id = $request->get('idPrueba');\n \t\tif((int) $id > 0){\n \t\t\t$this->pruebaRepository->eliminaPrueba($id);\n \t\t\t$exito = 1;\n \t\t\t$msg = Lang::get ( 'general.success' );\n \t\t}\n \t}\n \tcatch (\\Exception $e) {\n $this->log->error($e);\n \t}\n \tfinally {\n \t\treturn json_encode(array('exito' => $exito,'msg' => $msg));\n \t}\n }", "public static function cancella()\n {\n $delete_id = $_SESSION['current_user']->getId();\n UtenteFactory::cancellaAzienda($delete_id);\n }", "public function deactivate( Deactivator $deaactivator_object ) {\n\t\t$deaactivator_object->deactivate();\n\t}", "public function inactividad_logout()\n\t{\n\t\t// realizamos la peticion al modelo de cerrar sesion\n\t\t$this->auth->logout();\n\t\t// retornamos a la vista de inicio de sesion\n\t\techo \"true\";\n\t}", "function eliminarHerrajeaccesorio(){\n\t\t$this->procedimiento='snx.ft_herrajeaccesorio_ime';\n\t\t$this->transaccion='SNX_HAC_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_herrajeaccesorio','id_herrajeaccesorio','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}", "function edithistory_deactivate()\n{\n\tglobal $db;\n\t$db->delete_query(\"settings\", \"name IN('editmodvisibility','editsperpages','edithistorychar')\");\n\t$db->delete_query(\"settinggroups\", \"name IN('edithistory')\");\n\t$db->delete_query(\"templates\", \"title IN('edithistory','edithistory_nohistory','edithistory_item','postbit_edithistory','edithistory_comparison','edithistory_viewfull','editpost_reason')\");\n\trebuild_settings();\n\n\tinclude MYBB_ROOT.\"/inc/adminfunctions_templates.php\";\n\tfind_replace_templatesets(\"editpost\", \"#\".preg_quote('{$reason}').\"#i\", '', 0);\n\tfind_replace_templatesets(\"postbit_editedby\", \"#\".preg_quote('<!-- editreason -->').\"#i\", '', 0);\n\tfind_replace_templatesets(\"postbit\", \"#\".preg_quote('{$post[\\'edithistory\\']}').\"#i\", '', 0);\n\tfind_replace_templatesets(\"postbit_classic\", \"#\".preg_quote('{$post[\\'edithistory\\']}').\"#i\", '', 0);\n\n\tchange_admin_permission('tools', 'edithistory', -1);\n}", "public static function destroyEstudiante($idEstu)\n{\n $estudiante = Estudiante::find($idEstu);\n $estudiante->delete();\n}", "final public function delete() {\n global $config; \n # Borrar el elemento de la base de datos\n $this->db->query(\"DELETE FROM guarderia_2 WHERE id_guarderia = $this->id\");\n # Redireccionar a la página principal del controlador\n $this->functions->redir($config['site']['url'] . 'sedes/&success=true');\n }", "public function update_ofert_desactivate($id)\n {\n $this->db->update('ofertas_negocios', array('ofertaActivacion'=>'2'), array('ofertaId'=>$id));\n }", "public function undeleteAction(){\n\t}", "public function revert(){\n\t}", "function dprv_deactivate()\r\n\t{\r\n\t\t$log = new DPLog(); \r\n\t\t$log->lwrite(\"VERSION \" . DPRV_VERSION . \" DEACTIVATED\"); \r\n\t}", "public function desactivar($prod_id){\n\t\t$sql = \"UPDATE producto \n\t\t\t\tSET prod_estado = '0'\n\t\t\t\tWHERE prod_id = '$prod_id'\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function deactivate()\r\n\t{\r\n\t\treturn $this->_changeStatus(0);\r\n\t}" ]
[ "0.7926159", "0.7895316", "0.7810465", "0.7340913", "0.7098539", "0.7073685", "0.70395964", "0.6929026", "0.6920492", "0.6920492", "0.6819458", "0.6803504", "0.68014956", "0.6774368", "0.6774368", "0.66854185", "0.6642239", "0.6637082", "0.66355294", "0.6627273", "0.6602912", "0.65863115", "0.6569408", "0.65460885", "0.64942855", "0.6482303", "0.64789826", "0.6417546", "0.6388163", "0.6382662", "0.63671356", "0.63484854", "0.63484854", "0.6327759", "0.6309875", "0.6298257", "0.6287912", "0.6280342", "0.62764317", "0.62724775", "0.6269337", "0.6257418", "0.6241523", "0.6241523", "0.6239068", "0.62299275", "0.6217682", "0.6217682", "0.61968344", "0.6190706", "0.6162768", "0.61582655", "0.614228", "0.6137848", "0.6136224", "0.6131779", "0.6116835", "0.61168003", "0.6112399", "0.6091747", "0.6087057", "0.6085453", "0.6078169", "0.60734427", "0.60533226", "0.60435396", "0.60388064", "0.6037745", "0.6027798", "0.6021383", "0.5986552", "0.5966534", "0.59658176", "0.59647596", "0.59560233", "0.59473115", "0.5944959", "0.59400487", "0.59348184", "0.5929711", "0.5928139", "0.59241396", "0.5897538", "0.58947176", "0.5889086", "0.5871531", "0.585652", "0.5851913", "0.5850735", "0.58461475", "0.5845739", "0.58430344", "0.5839311", "0.58336043", "0.58278316", "0.5826346", "0.5823122", "0.58213735", "0.58205986", "0.58179194" ]
0.6921164
8
Prepares collection of versions
protected function _prepareCollection() { $userId = Mage::getSingleton('admin/session')->getUser()->getId(); /* var $collection Gri_Cms_Model_Mysql4_Version_Collection */ $collection = Mage::getModel('gri_cms/page_version')->getCollection() ->addPageFilter($this->getPage()) ->addVisibilityFilter($userId, Mage::getSingleton('gri_cms/config')->getAllowedAccessLevel()) ->addUserColumn() ->addUserNameColumn(); if (!$this->getParam($this->getVarNameSort())) { $collection->addNumberSort(); } $this->setCollection($collection); return parent::_prepareCollection(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVersions(): Collection;", "public function getVersions();", "public function getVersions();", "public function getVersions();", "function create_versions($numversions, $params) {\n $policy = add_policy($params);\n\n for ($i = 2; $i <= $numversions; $i++) {\n $formdata = api::form_policydoc_data($policy);\n $formdata->revision = 'v'.$i;\n api::form_policydoc_update_new($formdata);\n }\n\n $list = api::list_policies($policy->get('policyid'));\n\n return $list[0]->draftversions;\n}", "public function get_all_versions()\n\t\t{\n\t\t\t$versions = array();\n\t\t\t$dir_path = $this->get_path_hashed_dir();\n\n\t\t\tif (\\System\\Directory::check($dir_path, false)) {\n\t\t\t\t$version_files = \\System\\Directory::find($dir_path);\n\t\t\t\t$model = get_class($this);\n\n\t\t\t\tforeach ($version_files as $fp) {\n\t\t\t\t\t$file = $model::from_path($fp);\n\t\t\t\t\t$file->time = $file->name;\n\t\t\t\t\t$versions[] = $file;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $versions;\n\t\t}", "public function setVersions($versions);", "public function Init() {\n\t\t\n\t\t$version = array();\n\t}", "function reset_versions() {\n\t\tcalldpc_method('database.droptable use versions');\n \t //$sSQL = \"drop table if exists versions\";\n //$db->Execute($sSQL);\n\t\t$sSQL = \"create table versions \" .\n \"(\" .\n\t \"recid integer auto_increment primary key,\" .\n\t \"id varchar(255),\" .\n\t \"section varchar(64),\" .\t\t\t\t\t\n\t \"cdate varchar(64),\" .\t\t\t\t\t\n\t \"mkey varchar(255),\" .\t\t\t\t\t\n\t \"type varchar(64),\" .\n\t \"ver varchar(64),\" .\t\t\t\t\t\t\t\t\t\t\t\n\t \"data text,\" .\n\t \"comments text,\" .\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \"UNIQUE (id)\" .\t\t\t\t\t\n \")\";\n //$db->Execute($sSQL); \n\t\tcalldpc_method_use_pointers('database.exesql',array(0=>&$sSQL));\t\t\n\t\t\t\n\t\tsetInfo(\" Reset successfully!\");\n }", "protected function get_versions()\n\t{\n\t\t// determine the current versions\n\t\t$data = array(0 => '&nbsp;');\n\n\t\tforeach (\\Documentation\\Model_Version::query()->order_by('major', 'ASC')->order_by('minor', 'ASC')->order_by('branch', 'ASC')->get() as $version)\n\t\t{\n\t\t\t$data[$version->id] = $version->major.'.'.$version->minor.'/'.$version->branch;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function __construct(\n array $versionsDefinition = []\n ) {\n $this->versionsDefinition = self::instantiateRevisionDefinitions($versionsDefinition);\n\n Version::setList(\n array_keys($this->versionsDefinition)\n );\n }", "public function getVersionOrder();", "public function updateVersionMatrix() {}", "public function updateVersionMatrix() {}", "public function prepareMyUpgrades() {\n\t\t\n\t\t$query = sprintf(\"SELECT `machine_upgrade_linker`.`upgrade_id` FROM `hmi_plc_mgr`.`customer_machine_upgrade`, `hmi_plc_mgr`.`machine_upgrade_linker` WHERE `customer_machine_upgrade`.`machine_type` = '%s' AND `machine_upgrade_linker`.`customer_id` = '%s' AND `customer_machine_upgrade`.`id` =`machine_upgrade_linker`.`upgrade_id` ORDER BY `customer_machine_upgrade`.`id` %s\", mysql_real_escape_string($this->machine_type), mysql_real_escape_string($this->customer_id), mysql_real_escape_string($this->sort));\n\n\t\t//echo $query;\n\t\t$result = mysql_query($query);\n\t\twhile ($row = mysql_fetch_assoc($result)) {\n\t\t $this->my_upgrade_id[] = $row['upgrade_id']; \n\t\t //$this->my_created_by[] = $row['created_by']; \n\t\t //$this->my_created_on[] = $row['created_on']; \n\t\t //$this->my_time_added[] = $row['timeAdded']; \n\t\t //$this->my_upgrade_subject[] = $row['upgrade_subject'];\n\t\t //$this->my_upgrade[] = $row['upgrade'];\t\t\n\t\t}\t\t\t\n\t}", "public function retrieveAll(): array\n {\n return self::flatten($this->versionsDefinition);\n }", "public function dataVersions()\n {\n return array(\n array('1.0.0', 1000050),\n array('2.0.0.2-dev', 2000002),\n array('3.4.2.1', 3040251),\n array('3.4.2-dev3', 3040203),\n array('3.4.2-dev', 3040200),\n array('3.4.2-pl', 3040260),\n array('3.4.2-pl3', 3040263),\n array('4.4.2-rc22', 4040252),\n array('4.4.2-rc', 4040230),\n array('4.4.22-beta22', 4042242),\n array('4.4.22-beta', 4042220),\n array('4.4.21-alpha22', 4042132),\n array('4.4.20-alpha', 4042010),\n array('4.40.20-alpha-dev', 4402010),\n array('4.4a', 4000050),\n array('4.4.4-test', 4040400),\n array('4.1.0', 4010050),\n array('4.0.1.3', 4000153),\n array('4.1-dev', 4010000),\n );\n }", "protected function assignVersion()\n {\n\n }", "public function createMigrationCollection()\n {\n $this->validate();\n\n if (true !== $this->migrationCollectionCreated) {\n $collection = $this->getCollection();\n $collection->createIndex(['v' => -1], ['name' => 'version', 'unique' => true]);\n $this->migrationCollectionCreated = true;\n }\n\n return true;\n }", "public function getVersions()\n { \n return $this->versions;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->setOrder('ID','DESC');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function versions()\n {\n return $this->morphMany(Version::class, 'versionable');\n }", "public function getAllVersions(): Collection\n {\n $guzzleClient = new Client(['base_uri' => config('bitbucket.api_base_url')]);\n $response = $guzzleClient\n ->get(\"2.0/repositories/\" . config('bitbucket.vendor') . \"/\" . config('bitbucket.repo') . \"/refs/tags\", [\n 'auth' => [config('bitbucket.username'), config('bitbucket.password')]\n ])->getBody();\n\n return collect(\\GuzzleHttp\\json_decode($response)->values);\n }", "private static function initVersionCompatibility()\n {\n $reflection = new ReflectionClass('Iterator');\n $extension = strtolower($reflection->getExtensionName());\n $extension = ($extension === '' ? 'standard' : $extension);\n\n if (defined('CORE_PACKAGE') === false ) {\n define('CORE_PACKAGE', '+' . $extension);\n }\n }", "function addPluginVersions() {\n\t\t$versionDao =& DAORegistry::getDAO('VersionDAO');\n\t\timport('lib.pkp.classes.site.VersionCheck');\n\t\t$fileManager = new FileManager();\n\t\t$categories = PluginRegistry::getCategories();\n\t\tforeach ($categories as $category) {\n\t\t\tPluginRegistry::loadCategory($category);\n\t\t\t$plugins = PluginRegistry::getPlugins($category);\n\t\t\tif (is_array($plugins)) {\n\t\t\t\tforeach ($plugins as $plugin) {\n\t\t\t\t\t$versionFile = $plugin->getPluginPath() . '/version.xml';\n\n\t\t\t\t\tif ($fileManager->fileExists($versionFile)) {\n\t\t\t\t\t\t$versionInfo =& VersionCheck::parseVersionXML($versionFile);\n\t\t\t\t\t\t$pluginVersion = $versionInfo['version'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$pluginVersion = new Version(\n\t\t\t\t\t\t\t1, 0, 0, 0, // Major, minor, revision, build\n\t\t\t\t\t\t\tCore::getCurrentDate(), // Date installed\n\t\t\t\t\t\t\t1,\t// Current\n\t\t\t\t\t\t\t'plugins.'.$category, // Type\n\t\t\t\t\t\t\tbasename($plugin->getPluginPath()), // Product\n\t\t\t\t\t\t\t'',\t// Class name\n\t\t\t\t\t\t\t0,\t// Lazy load\n\t\t\t\t\t\t\t$plugin->isSitePlugin()\t// Site wide\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t$versionDao->insertVersion($pluginVersion, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function sitemgr_upgrade0_9_13_001()\n{\n\tglobal $setup_info;\n\t$setup_info['sitemgr']['currentver'] = '0.9.14.001';\n\n\t$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_sitemgr_pages',\n\t\t'sort_order',array('type'=>int, 'precision'=>4));\n\t$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_sitemgr_categories',\n\t\t'sort_order',array('type'=>int, 'precision'=>4));\n\n\treturn $setup_info['sitemgr']['currentver'];\n}", "protected function doInitialize()\n {\n $this->collection = new ArrayCollection();\n\n $this->stmtIniEntries = $this->dbal->prepare(\n 'SELECT i.name,' .\n ' ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\",' .\n ' deprecated' .\n ' FROM bartlett_compatinfo_inientries i, bartlett_compatinfo_extensions e' .\n ' WHERE i.ext_name_fk = e.id AND i.name = :name COLLATE NOCASE'\n );\n\n $this->stmtTraits = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\"' .\n ' FROM bartlett_compatinfo_classes c, bartlett_compatinfo_extensions e' .\n ' WHERE c.ext_name_fk = e.id AND c.name = :name COLLATE NOCASE'\n );\n\n $this->stmtClasses = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\"' .\n ' FROM bartlett_compatinfo_classes c, bartlett_compatinfo_extensions e' .\n ' WHERE c.ext_name_fk = e.id AND c.name = :name COLLATE NOCASE'\n );\n\n $this->stmtInterfaces = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\"' .\n ' FROM bartlett_compatinfo_interfaces i, bartlett_compatinfo_extensions e' .\n ' WHERE i.ext_name_fk = e.id AND i.name = :name COLLATE NOCASE'\n );\n\n $this->stmtFunctions = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\",' .\n ' parameters, php_excludes as \"php.excludes\",' .\n ' deprecated' .\n ' FROM bartlett_compatinfo_functions f, bartlett_compatinfo_extensions e' .\n ' WHERE f.ext_name_fk = e.id AND f.name = :name COLLATE NOCASE'\n );\n\n $this->stmtConstants = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\",' .\n ' php_excludes as \"php.excludes\"' .\n ' FROM bartlett_compatinfo_constants c, bartlett_compatinfo_extensions e' .\n ' WHERE c.ext_name_fk = e.id AND c.name = :name COLLATE NOCASE'\n );\n\n $this->stmtMethods = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\",' .\n ' prototype, proto_since' .\n ' FROM bartlett_compatinfo_methods m, bartlett_compatinfo_extensions e' .\n ' WHERE m.ext_name_fk = e.id' .\n ' AND m.class_name = :class_name AND m.name = :name COLLATE NOCASE'\n );\n }", "public function versioningMgm() {}", "private function packResolvers()\n {\n $this->builder->putVehicle($this->builder->createVehicle('xPDOScriptVehicle', [\n 'vehicle_class' => 'xPDOScriptVehicle',\n 'object' => ['source' => __DIR__ . '/resolvers/tables.php']\n ]));\n\n $this->builder->putVehicle($this->builder->createVehicle('xPDOScriptVehicle', [\n 'vehicle_class' => 'xPDOScriptVehicle',\n 'object' => ['source' => __DIR__ . '/resolvers/sources.php']\n ]));\n\n $this->builder->putVehicle($this->builder->createVehicle('xPDOScriptVehicle', [\n 'vehicle_class' => 'xPDOScriptVehicle',\n 'object' => ['source' => __DIR__ . '/resolvers/updater.php']\n ]));\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('oggetto_oneclick/order')->getResourceCollection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function getUpdatableInstances() {\n\t\t$packages = $this->getDuplicates();\n\t\t$updatable = array();\n\t\t$newVersion = $this->packageInfo['version'];\n\t\t\n\t\tforeach ($packages as $package) {\n\t\t\tif (Package::compareVersion($newVersion, $package['packageVersion']) == 1) {\n\t\t\t\t$updatable[$package['packageID']] = $package;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $updatable;\n\t}", "public function _translatableInit($params = [])\n {\n $this->meta()->set('protected->traits->versionable', $params);\n $this->relations()->add([\n 'name' => 'Versions',\n 'key' => $this->meta()->get('table') . '_id',\n 'table' => $this->meta()->get('table') . '_version',\n 'class' => 'Makiavelo\\\\Flex\\\\Flex',\n 'remove_orphans' => true,\n 'type' => 'Has'\n ]);\n $this->meta()->add('fields', [\n 'version' => ['type' => 'INT', 'nullable' => false]\n ]);\n }", "function _dataone_admin_version_options() {\n\n $options = array();\n\n $versions = _dataone_api_versions();\n if (!empty($versions)) {\n foreach ($versions as $version_id => $version_data) {\n $options[$version_id] = $version_data['name'];\n }\n }\n\n return $options;\n}", "public function versions() : array\n {\n return $this->versions;\n }", "protected function sortAvailablePackagesByDependencies() {}", "public function initOfferVoucher1s()\n\t{\n\t\t$this->collOfferVoucher1s = array();\n\t}", "public function prepareForValidation(): void\n {\n $products = [];\n foreach ($this->products as $key => $product) {\n $products['products'][$key] = [\n 'id' => $product['id'],\n 'qty' => $product['qty'],\n 'product' => Product::find($product['id']),\n ];\n }\n\n $this->merge($products);\n }", "protected function _prepareCollection()\n {\n $collection = $this->collectionFactory->create();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "private function insert_dummy_version_data($data)\n {\n foreach ($data as $version) {\n $insert_sql = sprintf(\"INSERT INTO %s (version) VALUES ('%s')\", RUCKUSING_TS_SCHEMA_TBL_NAME, $version);\n $this->adapter->query($insert_sql);\n }\n }", "private static function sortVersions(array &$versions): void\n {\n usort($versions, function (string $a, string $b): int {\n $aParts = explode('-', $a);\n $bParts = explode('-', $b);\n\n // First part is the same (3.0.0), but one string does have second part (-beta) while the other one does not\n if ($aParts[0] === $bParts[0] && (count($aParts) !== count($bParts))) {\n // The one with less parts should be ordered after the longer one\n return count($bParts) <=> count($aParts);\n }\n\n return strnatcmp(mb_strtolower($a), mb_strtolower($b));\n });\n }", "public function initVenueratings()\n\t{\n\t\t$this->collVenueratings = new PropelObjectCollection();\n\t\t$this->collVenueratings->setModel('Venuerating');\n\t}", "public function setUp() {\n\n\t\tparent::setup();\n\n\t\t$this->page_versions = new \\Dep\\PageVersions();\n\n\t}", "public function getMigratedVersions()\n {\n $this->createMigrationCollection();\n\n $cursor = $this->getCollection()->find();\n $versions = [];\n foreach ($cursor as $record) {\n $versions[] = $record['v'];\n }\n\n return $versions;\n }", "function getVersionList($limitstart=0, $versionsperpage=0)\r\n\t{\r\n\t\t$query \t= 'SELECT v.version_id AS nr, v.created AS date, u.name AS modifier, v.comment AS comment'\r\n\t\t\t\t.' FROM #__flexicontent_versions AS v'\r\n\t\t\t\t.' LEFT JOIN #__users AS u ON v.created_by = u.id'\r\n\t\t\t\t.' WHERE item_id = ' . (int)$this->_id\r\n\t\t\t\t.' ORDER BY version_id ASC'\r\n\t\t\t\t. ($versionsperpage?' LIMIT '.$limitstart.','.$versionsperpage:'')\r\n\t\t\t\t;\r\n\t\t$this->_db->setQuery($query);\r\n\t\treturn $this->_db->loadObjectList();\r\n\t}", "function upgrade_all()\n {\n }", "protected function setPreloads()\n {\n if (!$this->preloadList = \\Xoops_Cache::read('system_modules_preloads')) {\n // get active modules from the xoops instance\n $modules_list = \\Xoops::getInstance()->getActiveModules();\n if (empty($modules_list)) {\n // this should only happen if an exception was thrown in setActiveModules()\n $modules_list = array ('system');\n }\n $this->preloadList =array();\n $i = 0;\n foreach ($modules_list as $module) {\n if (is_dir($dir = XOOPS_ROOT_PATH . \"/modules/{$module}/preloads/\")) {\n $file_list = \\XoopsLists::getFileListAsArray($dir);\n foreach ($file_list as $file) {\n if (preg_match('/(\\.php)$/i', $file)) {\n $file = substr($file, 0, -4);\n $this->preloadList[$i]['module'] = $module;\n $this->preloadList[$i]['file'] = $file;\n $i++;\n }\n }\n }\n }\n \\Xoops_Cache::write('system_modules_preloads', $this->preloadList);\n }\n }", "protected function resolveWorkspacesSetStageDependencies() {}", "public function iteratePluginVersions(): Generator;", "function _prepareVertexTypes() {\n\t\t//Load Model of Relations\n\t\t$this->loadModel('VertexType');\n\t\t$this->VertexType = new VertexType();\n\t\t\n\t\t$this->VertexType->contain();\n\t\t$vertexTypes = $this->VertexType->find('list', array('conditions' => array('VertexType.deleted' => '0'), 'order' => 'VertexType.title'));\n\t\t$this->set(compact('vertexTypes',$vertexTypes));\n\t}", "protected function resolveWorkspacesSwapDependencies() {}", "public function getPatchversionList(){\n return $this->_get(40);\n }", "public function prepare()\r\n\t{\r\n\t\t$this->sort();\r\n\r\n\t\t// prepare urls\r\n\t\tforeach ($this->items as $mpoz)\r\n\t\t{\r\n\t\t\tif (empty($mpoz->url))\r\n\t\t\t{\r\n\t\t\t\t$mpoz->url = $this->getModuleUrl($mpoz->moduleName);\r\n\t\t\t}\r\n\t\t\t// one-level submenu\r\n\t\t\tif (!empty($mpoz->submenu))\r\n\t\t\t{\r\n\t\t\t\tforeach ($mpoz->submenu as &$subpoz)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (empty($subpoz['url']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$subpoz['url'] = $this->getModuleUrl($mpoz->moduleName, $subpoz['action']);\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}", "protected function getPresets() {}", "public function getVersions()\n {\n if (array_key_exists(\"versions\", $this->_propDict)) {\n return $this->_propDict[\"versions\"];\n } else {\n return null;\n }\n }", "public function getVersions()\n {\n return $this->getData()->get('versions', array());\n }", "public function prepare_deployment() {\n if ( wpsho_fr()->is__premium_only() ) {\n\n $this->clear_file_list();\n\n $this->create_s3_deployment_list(\n $this->_archiveName,\n $this->_archiveName,\n $this->_remotePath\n );\n\n echo 'SUCCESS';\n }\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('lavi_news/news')->getResourceCollection();\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function initialize()\n {\n $this->queue = new \\SplPriorityQueue();\n $this->queue->setExtractFlags(\\SplPriorityQueue::EXTR_DATA);\n $extension = [];\n\n foreach ($this->converters as $converter) {\n $converter->initialize($this->configuration->getRepository()->getArray());\n $priority = $converter->getPriority();\n\n $this->queue->insert($converter, $priority);\n\n $extension = array_merge($extension, $converter->getSupportExtension());\n }\n\n $this->extension = array_unique($extension);\n }", "public function getExplicitVersionOperations()\n {\n $ret = [];\n foreach ($this->versionOperations as $className => $instances) {\n foreach ($instances as $id => $operationDetails) {\n $ret[]= array_merge(\n [$className, $id],\n $operationDetails\n );\n }\n }\n\n return $ret;\n }", "public function needToMigrateList(): array;", "public function getVersions()\n {\n return json_decode(\n file_get_contents(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'version.json'),\n true\n );\n }", "public function verifyVersionsDataProvider(): array\n {\n return $this->loadDataFromFile(__DIR__.'/../data/version_comparator/version_comparator.json');\n }", "public function getPackagesVersions()\n {\n $components = [\n 'core' => [],\n 'theme' => [],\n 'widget' => [],\n 'module' => [],\n ];\n\n $components['core']['ZEDx'] = Core::VERSION;\n\n foreach (Themes::all() as $theme) {\n $components['theme'][$theme['manifest']['name']] = $theme['manifest']['version'];\n }\n\n foreach (Widgets::noType()->noFilter()->all(null, true) as $namespace => $widget) {\n $components['widget'][$namespace] = $widget->get('version');\n }\n\n foreach (Modules::all() as $module) {\n $components['module'][$module->name] = $module->version;\n }\n\n return $components;\n }", "protected function _prepareColumns()\n {\n/*\n $this->addColumn('version_number', array(\n 'header' => Mage::helper('gri_cms')->__('Version #'),\n 'width' => 100,\n 'index' => 'version_number',\n 'type' => 'options',\n 'options' => Mage::helper('gri_cms')->getVersionsArray($this->getPage())\n ));\n*/\n $this->addColumn('label', array(\n 'header' => Mage::helper('gri_cms')->__('Version Label'),\n 'index' => 'label',\n 'type' => 'options',\n 'options' => $this->getCollection()\n ->getAsArray('label', 'label')\n ));\n\n $this->addColumn('owner', array(\n 'header' => Mage::helper('gri_cms')->__('Owner'),\n 'index' => 'username',\n 'type' => 'options',\n 'options' => $this->getCollection()->getUsersArray(false),\n 'width' => 250\n ));\n\n $this->addColumn('access_level', array(\n 'header' => Mage::helper('gri_cms')->__('Access Level'),\n 'index' => 'access_level',\n 'type' => 'options',\n 'width' => 100,\n 'options' => Mage::helper('gri_cms')->getVersionAccessLevels()\n ));\n\n $this->addColumn('revisions', array(\n 'header' => Mage::helper('gri_cms')->__('Revisions Qty'),\n 'index' => 'revisions_count',\n 'type' => 'number'\n ));\n\n $this->addColumn('created_at', array(\n 'width' => 150,\n 'header' => Mage::helper('gri_cms')->__('Created At'),\n 'index' => 'created_at',\n 'type' => 'datetime',\n ));\n\n return parent::_prepareColumns();\n }", "public function getVersions()\n\t{\n\t\tforeach( $GLOBALS['TL_JQUERY_VERSIONS'] as $version => $settings)\n\t\t{\n\t\t\tif( $version == 'contao_version' || $version == 'latest_jquery_version' )\n\t\t\t\t$return[$version] = $GLOBALS['TL_LANG']['tl_layout']['jquery_version'][$version]; \n\t\t\telse \n\t\t\t\t$return[$version] = $version;\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "protected function _prepareCollection () {\n $collection\n = Mage::getResourceModel('mventory/carrier_volumerate_collection')\n ->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n $shippingTypes\n = Mage::getModel('mventory/system_config_source_allowedshippingtypes')\n ->toArray();\n\n foreach ($collection as $rate) {\n $name = $rate->getConditionName();\n\n if ($name == 'weight')\n $rate->setWeight($rate->getConditionValue());\n else if ($name == 'volume')\n $rate->setVolume($rate->getConditionValue());\n\n $shippingType = $rate->getShippingType();\n\n $shippingType = isset($shippingTypes[$shippingType])\n ? $shippingTypes[$shippingType]\n : '';\n\n $rate->setShippingType($shippingType);\n }\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\r\n {\r\n $this->setCollection(Mage::getModel('dynamic_brand/brand')->getCollection());\r\n return parent::_prepareCollection();\r\n }", "function getVersionList($limit = null)\n\t{\n\t\treturn $this->store->getVersionList($this->area, $this->page, \n\t\t\t$limit);\n\t}", "protected function fetchVersionMatrixFromRemote() {}", "public function forceSortAndSavePackageStates() {}", "public static function fetch_wordpress_versions()\n {\n //Cache File name for wordpress version\n $version_list = Package::get_config('package', 'version', 'file');\n\n //Connect To Wordpress API\n $list = \\WP_CLI_Helper::http_request(Package::get_config('wordpress_api', 'version'));\n if ($list != false) {\n //convert list to json file\n $list = json_decode($list, true);\n\n //Create Cache file for wordpress version list\n \\WP_CLI_FileSystem::create_json_file($version_list, $list, false);\n } else {\n //Show Error connect to WP API\n return array('status' => false, 'data' => Package::_e('wordpress_api', 'connect'));\n }\n\n return array('status' => true, 'data' => $list);\n }", "public function getVersions($flav)\n {\n return new OrderedList($this->get($flav . '_versions', []));\n }", "private function majorReleaseDefinitionProvider(): Generator\n {\n yield 'amqp' => [\n 'classes' => ['0', '1', '2'],\n 'const' => ['1'],\n 'constants' => ['1', '2'],\n 'iniEntries' => ['0', '1', '2'],\n 'methods' => ['0', '1', '2'],\n 'releases' => ['0', '1', '2'],\n ];\n\n yield 'apc' => [\n 'classes' => ['3'],\n 'constants' => ['3'],\n 'functions' => ['2', '3'],\n 'iniEntries' => ['2', '3'],\n 'methods' => ['3'],\n 'releases' => ['2', '3'],\n ];\n\n yield 'apcu' => [\n 'classes' => ['5'],\n 'constants' => ['4'],\n 'functions' => ['4', '5'],\n 'iniEntries' => ['4'],\n 'methods' => ['5'],\n 'releases' => ['4', '5'],\n ];\n\n yield 'ast' => [\n 'classes' => ['0'],\n 'constants' => ['0', '1'],\n 'functions' => ['0'],\n 'methods' => ['0'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'bcmath' => [\n 'functions' => ['40', '50'],\n 'iniEntries' => ['40'],\n 'releases' => array_merge(\n ['40', '50'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n )\n ];\n\n yield 'bz2' => [\n 'functions' => ['40'],\n 'releases' => array_merge(\n ['40'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'calendar' => [\n 'constants' => ['40', '43', '50'],\n 'functions' => ['40'],\n 'releases' => array_merge(\n ['40', '43', '50'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'core' => [\n 'classes' => [\n '40',\n '50', '51', '53', '55',\n '70', '71', '73', '74',\n '80', '81', '82',\n ],\n 'const' => ['80'],\n 'constants' => [\n '40', '42', '43', '44',\n '50', '51', '52', '53', '54',\n '71', '72',\n ],\n 'functions' => [\n '40', '42', '43',\n '50', '51', '53', '54',\n '70', '73', '74',\n '80', '81',\n ],\n 'methods' => [\n '51', '53', '55',\n '70', '72', '74',\n '80', '81', '82',\n ],\n 'iniEntries' => [\n '40', '41',\n '50', '54', '55', '56',\n '70', '71', '73', '74',\n '80', '81', '82',\n ],\n 'interfaces' => [\n '51', '53',\n '70', '72',\n '80', '81',\n ],\n 'releases' => array_merge(\n [\n '40', '41', '42', '43', '44',\n '50', '51', '52', '53', '54', '55', '56',\n ],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'ctype' => [\n 'functions' => ['40'],\n 'releases' => array_merge(\n ['40'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'curl' => [\n 'classes' => ['55', '80', '81'],\n 'constants' => ['40', '51', '52', '53', '54', '55', '56', '70', '73', '81', '82'],\n 'functions' => ['40', '50', '51', '55', '71', '82'],\n 'iniEntries' => ['53'],\n 'methods' => ['55', '81'],\n 'releases' => array_merge(\n ['40', '51', '52', '53', '54', '55', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'date' => [\n 'classes' => ['52', '53', '55'],\n 'const' => ['52', '53', '70', '71', '72', '82'],\n 'constants' => ['51', '70', '82'],\n 'functions' => ['40', '50', '51', '52', '53', '55'],\n 'iniEntries' => ['51'],\n 'interfaces' => ['55'],\n 'methods' => ['52', '53', '55', '56', '72', '73', '80', '82'],\n 'releases' => array_merge(\n ['40', '50', '51', '52', '53', '55'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'dom' => [\n 'classes' => ['50', '51'],\n 'constants' => ['50'],\n 'functions' => ['50'],\n 'interfaces' => ['80'],\n 'methods' => ['50', '80'],\n 'releases' => array_merge(\n ['50', '51'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'enchant' => [\n 'classes' => ['80'],\n 'constants' => ['1', '80'],\n 'functions' => ['0', '1', '80'],\n 'releases' => array_merge(\n ['0', '1'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'ereg' => [\n 'functions' => ['40'],\n 'releases' => ['40'],\n ];\n\n yield 'exif' => [\n 'constants' => ['40'],\n 'functions' => ['40', '42', '43'],\n 'iniEntries' => ['43'],\n 'releases' => array_merge(\n ['40', '42', '43'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'fileinfo' => [\n 'classes' => ['0'],\n 'constants' => ['0', '1', '72'],\n 'functions' => ['0', '1'],\n 'methods' => ['0', '80'],\n 'releases' => array_merge(\n ['0', '1'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'filter' => [\n 'constants' => ['0', '70', '71', '73', '80', '82'],\n 'functions' => ['0'],\n 'iniEntries' => ['0'],\n 'releases' => array_merge(\n ['0'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'ftp' => [\n 'classes' => ['81'],\n 'constants' => ['40', '43', '56'],\n 'functions' => ['40', '42', '43', '50', '72'],\n 'releases' => array_merge(\n ['40', '42', '43', '50', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'gd' => [\n 'classes' => ['80', '81'],\n 'constants' => ['40', '52', '53', '55', '56', '72', '74', '81'],\n 'functions' => ['40', '43', '50', '51', '52', '54', '55', '72', '74', '80', '81'],\n 'iniEntries' => ['51'],\n 'releases' => array_merge(\n ['40', '43', '50', '51', '52', '53', '54', '55', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'gender' => [\n 'classes' => ['0'],\n 'const' => ['0', '1'],\n 'methods' => ['0'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'geoip' => [\n 'constants' => ['0', '1'],\n 'functions' => ['0', '1'],\n 'iniEntries' => ['1'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'gettext' => [\n 'functions' => ['40', '42'],\n 'releases' => array_merge(\n ['40', '42'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'gmp' => [\n 'classes' => ['80'],\n 'constants' => ['40', '53', '56'],\n 'functions' => ['40', '52', '53', '56', '70', '73'],\n 'methods' => ['81', '82'],\n 'releases' => array_merge(\n ['40', '52', '53', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'haru' => [\n 'classes' => ['0'],\n 'const' => ['0'],\n 'methods' => ['0', '1'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'hash' => [\n 'classes' => ['72'],\n 'constants' => ['1', '53', '54', '81'],\n 'functions' => ['1', '53', '55', '56', '71', '72'],\n 'iniEntries' => [],\n 'methods' => ['72'],\n 'releases' => array_merge(\n ['1', '53', '54', '55', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'htscanner' => [\n 'iniEntries' => ['0', '1'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'http' => [\n 'classes' => ['0', '1', '2', '3'],\n 'const' => ['2', '3'],\n 'constants' => ['1', '2', '4'],\n 'functions' => ['1'],\n 'iniEntries' => ['1', '2'],\n 'interfaces' => ['2'],\n 'methods' => ['2', '3', '4'],\n 'releases' => ['0', '1', '2', '3', '4'],\n ];\n\n yield 'iconv' => [\n 'constants' => ['43', '50'],\n 'functions' => ['40', '50'],\n 'iniEntries' => ['40'],\n 'releases' => array_merge(\n ['40', '43', '50'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'igbinary' => [\n 'functions' => ['1'],\n 'iniEntries' => ['1'],\n 'releases' => ['1', '2', '3'],\n ];\n\n yield 'imagick' => [\n 'classes' => ['2', '3'],\n 'const' => ['2', '3'],\n 'iniEntries' => ['3'],\n 'methods' => ['2', '3'],\n 'releases' => ['2', '3'],\n ];\n\n yield 'imap' => [\n 'classes' => ['81'],\n 'constants' => ['40', '53'],\n 'functions' => ['40', '43', '50', '51', '53', '82'],\n 'iniEntries' => ['56'],\n 'releases' => array_merge(\n ['40', '43', '50', '51', '53', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'inclued' => [\n 'functions' => ['0'],\n 'iniEntries' => ['0'],\n 'releases' => ['0'],\n ];\n\n yield 'intl' => [\n 'classes' => ['1', '2', '55', '70', '81'],\n 'const' => ['1', '2', '55', '70', '73', '74', '80'],\n 'constants' => ['1', '2'],\n 'functions' => ['1', '2', '55', '71', '73'],\n 'iniEntries' => ['1', '3'],\n 'methods' => ['1', '2', '55', '70', '71', '73', '81'],\n 'releases' => array_merge(\n ['1', '2', '3', '55'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'jsmin' => [\n 'constants' => ['0'],\n 'functions' => ['0'],\n 'releases' => ['0', '1', '2', '3'],\n ];\n\n yield 'json' => [\n 'classes' => ['73'],\n 'constants' => ['53', '54', '55', '56', '70', '71', '72', '73', '81'],\n 'functions' => ['52', '53', '55'],\n 'interfaces' => ['54'],\n 'methods' => ['54'],\n 'releases' => array_merge(\n ['52', '53', '54', '55', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'ldap' => [\n 'classes' => ['81'],\n 'constants' => ['40', '53', '54', '56', '70', '71', '72'],\n 'functions' => ['40', '42', '50', '54', '56', '72', '73', '80'],\n 'iniEntries' => ['40'],\n 'releases' => array_merge(\n ['40', '42', '50', '53', '54', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'libevent' => [\n 'constants' => ['0'],\n 'functions' => ['0'],\n 'releases' => ['0'],\n ];\n\n yield 'libxml' => [\n 'classes' => ['51'],\n 'constants' => ['51', '52', '53', '54', '55', '70'],\n 'functions' => ['50', '51', '52', '54', '82'],\n 'releases' => array_merge(\n ['51', '52', '53', '54', '55'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'lzf' => [\n 'functions' => ['0', '1'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'mailparse' => [\n 'classes' => ['0'],\n 'constants' => ['0'],\n 'functions' => ['0'],\n 'iniEntries' => ['0'],\n 'methods' => ['0', '3'],\n 'releases' => ['0', '2', '3'],\n ];\n\n yield 'mbstring' => [\n 'constants' => ['40', '73', '74'],\n 'functions' => ['40', '42', '43', '44', '50', '52', '53', '54', '72', '74'],\n 'iniEntries' => ['40', '42', '43', '51', '73', '74'],\n 'releases' => array_merge(\n ['40', '42', '43', '44', '50', '51', '52', '53', '54'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'mcrypt' => [\n 'constants' => ['40', '1'],\n 'functions' => ['40', '1'],\n 'iniEntries' => ['40', '1'],\n 'releases' => ['40', '1'],\n ];\n\n yield 'memcache' => [\n 'classes' => ['0', '3'],\n 'constants' => ['0', '2', '3'],\n 'functions' => ['0', '1', '2', '3'],\n 'iniEntries' => ['2', '3', '4'],\n 'methods' => ['0', '3'],\n 'releases' => ['0', '1', '2', '3', '4', '8'],\n ];\n\n yield 'memcached' => [\n 'classes' => ['0', '2'],\n 'const' => ['2', '3'],\n 'iniEntries' => ['2', '3'],\n 'methods' => ['0', '2'],\n 'releases' => ['0', '2', '3'],\n ];\n\n yield 'mhash' => [\n 'constants' => ['40'],\n 'functions' => ['40'],\n 'releases' => ['40'],\n ];\n\n yield 'mongo' => [\n 'classes' => ['0', '1'],\n 'const' => ['0', '1'],\n 'constants' => ['1'],\n 'functions' => ['1'],\n 'iniEntries' => ['0'],\n 'interfaces' => ['1'],\n 'methods' => ['0', '1'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'msgpack' => [\n 'classes' => ['0'],\n 'const' => ['0'],\n 'constants' => ['2'],\n 'functions' => ['0'],\n 'iniEntries' => ['0'],\n 'methods' => ['0'],\n 'releases' => ['0', '2'],\n ];\n\n yield 'mssql' => [\n 'constants' => ['40'],\n 'functions' => ['40', '42', '43'],\n 'iniEntries' => ['40', '42', '43', '51', '55'],\n 'releases' => ['40', '42', '43', '51', '55'],\n ];\n\n yield 'mysql' => [\n 'constants' => ['40', '43'],\n 'functions' => ['40', '43', '52'],\n 'iniEntries' => ['40', '43'],\n 'releases' => ['40', '43', '52'],\n ];\n\n yield 'mysqli' => [\n 'classes' => ['50'],\n 'constants' => ['50', '51', '52', '53', '54', '55', '56', '72', '81'],\n 'functions' => ['50', '53', '54', '55', '56', '81', '82'],\n 'iniEntries' => ['50', '56', '81'],\n 'methods' => ['50', '81', '82'],\n 'releases' => array_merge(\n ['50', '51', '52', '53', '54', '55', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'oauth' => [\n 'classes' => ['0', '1'],\n 'constants' => ['0', '1'],\n 'functions' => ['0'],\n 'methods' => ['0', '1'],\n 'releases' => ['0', '1', '2'],\n ];\n\n yield 'oci8' => [\n 'classes' => ['1', '3'],\n 'constants' => ['1'],\n 'functions' => ['1', '2', '3'],\n 'iniEntries' => ['1', '3'],\n 'methods' => ['1', '3'],\n 'releases' => array_merge(\n ['1', '2', '3'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'odbc' => [\n 'constants' => ['40', '43', '54'],\n 'functions' => ['40', '82'],\n 'iniEntries' => ['40', '53'],\n 'releases' => array_merge(\n ['40', '43', '53', '54'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'opcache' => [\n 'functions' => ['70'],\n 'iniEntries' => ['56', '70', '71', '74', '80'],\n 'releases' => array_merge(\n ['56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'openssl' => [\n 'classes' => ['80'],\n 'constants' => ['40', '43', '50', '52', '53', '54', '56', '71', '80'],\n 'functions' => [\n '40', '42',\n '52', '53', '55', '56',\n '71', '72', '73', '74',\n '80', '82',\n ],\n 'iniEntries' => ['56'],\n 'releases' => array_merge(\n ['40', '42', '43', '50', '52', '53', '54', '55', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'pcntl' => [\n 'constants' => ['41', '50', '53', '70', '72', '74'],\n 'functions' => ['41', '42', '43', '50', '53', '70', '71', '74'],\n 'releases' => array_merge(\n ['41', '42', '43', '50', '53'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'pcre' => [\n 'constants' => ['40', '43', '52', '70', '72', '73'],\n 'functions' => ['40', '52', '53', '70', '80'],\n 'iniEntries' => ['52', '70'],\n 'releases' => array_merge(\n ['40', '43', '52', '53'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'pdflib' => [\n 'classes' => ['2'],\n 'functions' => ['2', '3'],\n 'methods' => ['2', '3'],\n 'releases' => ['1', '2', '3', '4'],\n ];\n\n yield 'pdo' => [\n 'classes' => ['51'],\n 'const' => ['51', '80', '81'],\n 'functions' => ['51'],\n 'methods' => ['51'],\n 'releases' => array_merge(\n ['51'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'pgsql' => [\n 'classes' => ['81'],\n 'constants' => ['40', '51', '54', '56', '71', '73'],\n 'functions' => ['40', '42', '43', '50', '51', '52', '54', '56'],\n 'iniEntries' => ['40'],\n 'releases' => array_merge(\n ['40', '42', '43', '50', '51', '52', '54', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'phar' => [\n 'classes' => ['1', '2'],\n 'const' => ['1', '2', '81'],\n 'iniEntries' => ['1', '2'],\n 'methods' => ['1', '2'],\n 'releases' => array_merge(\n ['1', '2'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'posix' => [\n 'constants' => ['51', '70'],\n 'functions' => ['40', '42', '51', '52', '70'],\n 'releases' => array_merge(\n ['40', '42', '51', '52'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'pthreads' => [\n 'classes' => ['0', '1', '2'],\n 'constants' => ['0', '2'],\n 'methods' => ['0', '1', '2', '3'],\n 'releases' => ['0', '1', '2', '3'],\n ];\n\n yield 'raphf' => [\n 'functions' => ['2'],\n 'iniEntries' => ['2'],\n 'releases' => ['2'],\n ];\n\n yield 'rar' => [\n 'classes' => ['2'],\n 'const' => ['0', '2', '4'],\n 'constants' => ['2'],\n 'functions' => ['2', '3'],\n 'methods' => ['0', '2', '3', '4'],\n 'releases' => ['0', '1', '2', '3', '4'],\n ];\n\n yield 'rdkafka' => [\n 'classes' => ['1', '4'],\n 'constants' => ['1', '5'],\n 'functions' => ['1', '5'],\n 'methods' => ['1', '3', '4', '5'],\n 'releases' => ['1', '2', '3', '4', '5', '6'],\n ];\n\n yield 'readline' => [\n 'constants' => ['54'],\n 'functions' => ['40', '51'],\n 'iniEntries' => ['54'],\n 'releases' => array_merge(\n ['40', '51', '54'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'recode' => [\n 'functions' => ['40'],\n 'releases' => ['40'],\n ];\n\n yield 'redis' => [\n 'classes' => ['2', '5'],\n 'const' => ['2', '4', '5'],\n 'iniEntries' => ['2', '3', '4', '5'],\n 'methods' => ['2', '3', '4', '5'],\n 'releases' => ['2', '3', '4', '5'],\n ];\n\n yield 'reflection' => [\n 'classes' => ['50', '54', '70', '71', '74', '80', '81'],\n 'const' => [\n '50', '51',\n '80', '81', '82',\n ],\n 'interfaces' => ['50'],\n 'methods' => [\n '50', '54',\n '70', '71', '72', '74',\n '80', '81', '82',\n ],\n 'releases' => array_merge(\n ['50', '51', '54'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'riak' => [\n 'classes' => ['0', '1'],\n 'iniEntries' => ['0', '1'],\n 'interfaces' => ['0', '1'],\n 'methods' => ['0', '1'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'session' => [\n 'classes' => ['54'],\n 'constants' => ['40', '54'],\n 'functions' => ['40', '42', '43', '44', '54', '56', '71'],\n 'iniEntries' => ['40', '43', '50', '52', '54', '55', '70', '71', '73'],\n 'interfaces' => ['54', '55', '70'],\n 'methods' => ['54', '55', '70'],\n 'releases' => array_merge(\n ['40', '42', '43', '44', '50', '52', '54', '55', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'shmop' => [\n 'classes' => ['80'],\n 'functions' => ['40'],\n 'releases' => array_merge(\n ['40'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'simplexml' => [\n 'classes' => ['50', '51'],\n 'functions' => ['50'],\n 'methods' => ['50'],\n 'releases' => array_merge(\n ['50', '51'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'snmp' => [\n 'classes' => ['54'],\n 'const' => ['54'],\n 'constants' => ['43', '52', '54'],\n 'functions' => ['40', '43', '50', '52'],\n 'methods' => ['54'],\n 'releases' => array_merge(\n ['40', '43', '50', '52', '54'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'soap' => [\n 'classes' => ['50'],\n 'constants' => ['50', '55'],\n 'functions' => ['50'],\n 'iniEntries' => ['50'],\n 'methods' => ['50', '80'],\n 'releases' => array_merge(\n ['50', '55'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'sockets' => [\n 'classes' => ['80'],\n 'constants' => [\n '41', '43',\n '52', '54', '55',\n '70', '72',\n '81', '82',\n ],\n 'functions' => ['41', '42', '43', '54', '55', '70', '72'],\n 'releases' => array_merge(\n ['41', '42', '43', '52', '54', '55'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'solr' => [\n 'classes' => ['0', '1', '2'],\n 'const' => ['0', '2'],\n 'constants' => ['0'],\n 'functions' => ['0'],\n 'methods' => ['0', '1', '2'],\n 'releases' => ['0', '1', '2'],\n ];\n\n yield 'sphinx' => [\n 'classes' => ['0'],\n 'constants' => ['0', '1'],\n 'methods' => ['0', '1'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'spl' => [\n 'classes' => ['50', '51', '52', '53', '54'],\n 'const' => ['50', '51', '52', '53'],\n 'functions' => ['50', '51', '52', '54', '72'],\n 'interfaces' => ['51'],\n 'methods' => [\n '50', '51', '52', '53', '54',\n '70',\n '82',\n ],\n 'releases' => array_merge(\n ['50', '51', '52', '53', '54'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'sqlite' => [\n 'classes' => ['2'],\n 'constants' => ['2'],\n 'functions' => ['2'],\n 'iniEntries' => ['2'],\n 'releases' => ['2'],\n ];\n\n yield 'sqlite3' => [\n 'classes' => ['53'],\n 'const' => ['80'],\n 'constants' => ['53', '71'],\n 'iniEntries' => ['53', '56'],\n 'methods' => ['53', '74', '80'],\n 'releases' => array_merge(\n ['53', '56'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'ssh2' => [\n 'constants' => ['0'],\n 'functions' => ['0', '1'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'standard' => [\n 'classes' => [\n '40',\n '50',\n '70'\n ],\n 'constants' => [\n '40', '41', '43',\n '51', '52', '53', '54', '55', '56',\n '70', '71', '72', '73', '74',\n '80', '81'\n ],\n 'functions' => [\n '40', '41', '42', '43',\n '50', '51', '52', '53', '54', '55',\n '70', '71', '72', '73', '74',\n '80', '81', '82',\n ],\n 'iniEntries' => [\n '40',\n '53',\n '70', '71', '74'\n ],\n 'methods' => [\n '40',\n '50',\n ],\n 'releases' => array_merge(\n [\n '40', '41', '42', '43', '44',\n '50', '51', '52', '53', '54', '55', '56',\n ],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'stomp' => [\n 'classes' => ['0'],\n 'functions' => ['0', '1'],\n 'iniEntries' => ['0', '1'],\n 'methods' => ['0', '1'],\n 'releases' => ['0', '1', '2'],\n ];\n\n yield 'svn' => [\n 'classes' => ['0'],\n 'const' => ['1'],\n 'constants' => ['0', '1'],\n 'functions' => ['0', '1'],\n 'methods' => ['1'],\n 'releases' => ['0', '1', '2'],\n ];\n\n yield 'sync' => [\n 'classes' => ['1'],\n 'methods' => ['1'],\n 'releases' => ['1'],\n ];\n\n yield 'sysvmsg' => [\n 'classes' => ['80'],\n 'constants' => ['43', '52'],\n 'functions' => ['43', '53'],\n 'releases' => array_merge(\n [\n '43', '52', '53'\n ],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'sysvsem' => [\n 'classes' => ['80'],\n 'functions' => ['40', '41'],\n 'releases' => array_merge(\n [\n '40', '41'\n ],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'sysvshm' => [\n 'classes' => ['80'],\n 'functions' => ['40', '53'],\n 'releases' => array_merge(\n [\n '40', '53'\n ],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'tidy' => [\n 'classes' => ['0'],\n 'constants' => ['0', '74'],\n 'functions' => ['0', '50', '51'],\n 'iniEntries' => ['0'],\n 'methods' => ['0'],\n 'releases' => array_merge(\n [\n '0', '1', '50', '51'\n ],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'tokenizer' => [\n 'classes' => ['80'],\n 'constants' => ['42', '43', '50', '51', '53', '54', '55', '56', '70', '74', '80', '81'],\n 'functions' => ['42'],\n 'methods' => ['80'],\n 'releases' => array_merge(\n [\n '42', '43',\n '50', '51', '53', '54', '55', '56'\n ],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'uopz' => [\n 'constants' => ['2'],\n 'functions' => ['2', '5'],\n 'iniEntries' => ['2', '5', '6'],\n 'releases' => ['2', '5', '6'],\n ];\n\n yield 'uploadprogress' => [\n 'functions' => ['0'],\n 'iniEntries' => ['0'],\n 'releases' => ['0', '1', '2'],\n ];\n\n yield 'uuid' => [\n 'constants' => ['1'],\n 'functions' => ['1'],\n 'releases' => ['1'],\n ];\n\n yield 'varnish' => [\n 'classes' => ['0'],\n 'const' => ['0', '6'],\n 'constants' => ['0'],\n 'methods' => ['0', '1'],\n 'releases' => ['0', '1', '6'],\n ];\n\n yield 'wddx' => [\n 'functions' => ['40'],\n 'releases' => ['40'],\n ];\n\n yield 'xcache' => [\n 'constants' => ['1', '2'],\n 'functions' => ['1', '2'],\n 'iniEntries' => ['1', '2', '3'],\n 'releases' => ['1', '2', '3'],\n ];\n\n yield 'xdebug' => [\n 'constants' => ['2', '3'],\n 'functions' => ['1', '2', '3'],\n 'iniEntries' => ['1', '2', '3'],\n 'releases' => ['1', '2', '3'],\n ];\n\n yield 'xhprof' => [\n 'constants' => ['0'],\n 'functions' => ['0'],\n 'iniEntries' => ['0', '2'],\n 'releases' => ['0', '2'],\n ];\n\n yield 'xlswriter' => [\n 'classes' => ['1'],\n 'const' => ['1'],\n 'functions' => ['1'],\n 'methods' => ['1'],\n 'releases' => ['1'],\n ];\n\n yield 'xml' => [\n 'classes' => ['80'],\n 'constants' => ['40'],\n 'functions' => ['40'],\n 'releases' => array_merge(\n ['40'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'xmldiff' => [\n 'classes' => ['0'],\n 'methods' => ['0'],\n 'releases' => ['0', '1'],\n ];\n\n yield 'xmlreader' => [\n 'classes' => ['50'],\n 'const' => ['50'],\n 'methods' => ['50'],\n 'releases' => array_merge(\n ['50'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'xmlrpc' => [\n 'classes' => ['1'],\n 'functions' => ['41', '1'],\n 'releases' => ['41', '43', '1'],\n ];\n\n yield 'xmlwriter' => [\n 'classes' => ['51'],\n 'functions' => ['51', '52'],\n 'methods' => ['51'],\n 'releases' => array_merge(\n ['51', '52'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'xsl' => [\n 'classes' => ['50'],\n 'constants' => ['50', '51', '53'],\n 'methods' => ['50'],\n 'iniEntries' => ['53'],\n 'releases' => array_merge(\n ['50', '51', '53'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n\n yield 'yac' => [\n 'classes' => ['0'],\n 'constants' => ['0', '2'],\n 'iniEntries' => ['0', '2'],\n 'methods' => ['0', '2'],\n 'releases' => ['0', '2'],\n ];\n\n yield 'yaml' => [\n 'constants' => ['0'],\n 'functions' => ['0'],\n 'iniEntries' => ['0', '1'],\n 'releases' => ['0', '1', '2'],\n ];\n\n yield 'zip' => [\n 'classes' => ['1'],\n 'const' => ['1'],\n 'functions' => ['1'],\n 'methods' => ['1'],\n 'releases' => ['1'],\n ];\n\n yield 'zlib' => [\n 'classes' => ['80'],\n 'constants' => ['40', '54', '70'],\n 'functions' => ['40', '43', '54', '70', '72'],\n 'iniEntries' => ['40', '43'],\n 'releases' => array_merge(\n ['40', '43', '54'],\n self::PHP_RELEASES_7,\n self::PHP_RELEASES_8\n ),\n ];\n }", "public function setVersions($val)\n {\n $this->_propDict[\"versions\"] = $val;\n return $this;\n }", "protected function getInitialPackagePairs()\n {\n return [];\n }", "protected function _prepareCollection() {\n $collection = Mage::helper('ProductReturn/SupplierReturn')->getProductsPending();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function _versionablePreSave()\n {\n if (!$this->version) $this->version = 0;\n\n $this->version++;\n $this->version = (string) $this->version;\n $model = new Flex();\n $model->meta()->add('table', $this->meta()->get('table') . '_version');\n $model->id = '';\n $attrs = $this->getAttributes();\n\n foreach ($attrs as $field => $value) {\n $model->$field = $value;\n }\n\n $this->versions()->add($model);\n return true;\n }", "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t$this->setCollection($collection);\n\t\t \n\t\treturn parent::_prepareCollection();\n\t}", "protected function sortAndSavePackageStates() {}", "protected function sortAndSavePackageStates() {}", "protected function sortAndSavePackageStates() {}", "protected function versionablePreSave()\n {\n if ($this->versioningEnabled === true) {\n $this->versionableDirtyData = $this->getDirty();\n $this->updating = $this->exists;\n }\n }", "protected function initializeCompatibilityLoadedExtArray() {}", "public function initHistorys()\n\t{\n\t\t$this->collHistorys = array();\n\t}", "public function iterateToolVersions(): Generator;", "protected function initializePackageObjects() {}", "protected function getVersionMatrix() {}", "public function prepareVars()\n {\n $this->vars['history'] = $this->model->revision_history;\n $this->vars['chapter_id'] = $this->model->id;\n }", "protected function _prepareCollection() {\n /**\n * \n * @var unknown\n */\n /**\n * Calling the parent Construct Method.\n * \n * Getting collection for bank details\n */\n $managebankdetailsCollection = Mage::getModel ( 'airhotels/managebankdetails' )->getCollection ();\n $this->setCollection ( $managebankdetailsCollection ); \n return parent::_prepareCollection ();\n /**\n * return _prepareCollection\n */\n }", "private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}", "private function _reinit()\n {\n $this->compressed_list = array();\n $this->central_dir_list = array();\n $this->end_of_central = array();\n $this->info = array();\n $this->error = array();\n }", "protected function _prepareCollection()\n {\n /** @var \\Mage_Catalog_Model_Resource_Product_Attribute_Collection $collection */\n $collection = Mage::getResourceModel('catalog/product_attribute_collection')\n ->addVisibleFilter();\n\n $store = $this->_getStore();\n// $prefix = Mage::getConfig()->getTablePrefix()->__toString();\n// $jobAttributeQuery = 'select a.`version`, a.`attribute_id` from `'.$prefix.'straker_job_attribute` as a\n// left join `'.$prefix.'straker_job` as b on a.`job_id`=b.`id`\n// where b.`store_id` ='.$store->getId().' and a.`version` =1\n// GROUP BY a.`attribute_id`';\n//\n// //join straker job product table to get version for each product\n// $collection->getSelect()->joinLeft(\n//\n// new Zend_Db_Expr('('.$jobAttributeQuery.')'),\n// 'main_table.attribute_id = t.attribute_id',\n// array('version')\n//\n// );\n /** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Attribute_Collection $strakerJobProductCollection */\n $strakerJobAttributeCollection = Mage::getModel('strakertranslations_easytranslationplatform/job_attribute')->getCollection();\n $strakerJobAttributeCollection->getSelect()\n ->reset(Zend_Db_Select::COLUMNS)\n ->joinLeft(\n ['b' => $strakerJobAttributeCollection->getTable('strakertranslations_easytranslationplatform/job')],\n '`main_table`.`job_id` = `b`.`id`',\n []\n )->where(\n '`b`.`store_id` = ?', $store->getId()\n )->where(\n '`main_table`.`version` = ?', 1\n )->group(\n 'main_table.attribute_id'\n )->columns(\n ['version' => 'version', 'attribute_id' => 'attribute_id']\n );\n\n $jobAttributeQuery = $strakerJobAttributeCollection->getSelect();\n\n $collection->getSelect()->joinLeft(\n $jobAttributeQuery,\n 'main_table.attribute_id = t.attribute_id',\n array('version')\n );\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function getVersions():array\n {\n return json_decode(\n copy_to_string($this->request('GET', '/unoconv/versions')->getBody()),\n true\n );\n }", "private function getVersionChoices(): array\n {\n $versions = [];\n foreach (Php::getSupportedVersions() as $version) {\n $versions[$version] = $version;\n }\n\n return $versions;\n }", "public function convertVersionsStringToVersionNumbersForcesVersionNumberInRangeDataProvider() {}", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('name')\n ->addAttributeToSelect('type')\n ->addAttributeToSelect('status')\n ->addAttributeToSelect('visibility')\n ->addAttributeToSelect('sku');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function getAvailableVersions()\n\t{\n\t\treturn array('v1', 'v2');\n\t}", "public function setVersions(array $versions = array())\n {\n $this->getData()->set('versions', $versions);\n return $this;\n }", "function prepareFields() {\r\n\t\t$data = array_keys($this->modx->getFieldMeta('msProductData'));\r\n\t\tforeach ($this->resourceArray as $k => $v) {\r\n\t\t\tif (is_array($v) && in_array($k, $data)) {\r\n\t\t\t\t$tmp = $this->resourceArray[$k];\r\n\t\t\t\t$this->resourceArray[$k] = array();\r\n\t\t\t\tforeach ($tmp as $v2) {\r\n\t\t\t\t\tif (!empty($v2)) {\r\n\t\t\t\t\t\t$this->resourceArray[$k][] = array('value' => $v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (empty($this->resourceArray['vendor'])) {\r\n\t\t\t$this->resourceArray['vendor'] = '';\r\n\t\t}\r\n\t}", "public function getApiVersions()\n {\n $version = array(\n \"2006-03-01\" => \"2006-03-01 (default)\",\n \"latest\" => \"latest\",\n );\n return $version;\n }" ]
[ "0.6291015", "0.580985", "0.580985", "0.580985", "0.5686358", "0.5559735", "0.55013156", "0.54993564", "0.54655325", "0.5370976", "0.5329479", "0.52314943", "0.5230681", "0.5229511", "0.5224053", "0.5222117", "0.52141285", "0.521043", "0.52002615", "0.5187085", "0.5184733", "0.51825327", "0.5179879", "0.51623166", "0.51621777", "0.51533467", "0.5102617", "0.50762707", "0.5064107", "0.5056944", "0.50568324", "0.5050611", "0.50486135", "0.50314707", "0.50273746", "0.5025452", "0.50201046", "0.50162077", "0.5008055", "0.50076455", "0.4999381", "0.4982165", "0.49808347", "0.49776885", "0.49774244", "0.49727613", "0.4966793", "0.49543327", "0.495089", "0.49470428", "0.49460283", "0.4934446", "0.49263316", "0.491835", "0.49085057", "0.4889901", "0.48864806", "0.48859027", "0.48779085", "0.4874438", "0.48587212", "0.48552316", "0.48538598", "0.4849608", "0.48476902", "0.4844987", "0.48407668", "0.48404893", "0.48330882", "0.48321325", "0.48308462", "0.48195842", "0.48180974", "0.48129973", "0.4801371", "0.48000842", "0.47945353", "0.4794331", "0.4789137", "0.4789137", "0.47882718", "0.47831738", "0.47795132", "0.4757891", "0.47539234", "0.47496316", "0.47460404", "0.47349057", "0.47331697", "0.4726722", "0.47227678", "0.4718458", "0.47122407", "0.47097152", "0.47084948", "0.47052452", "0.47035363", "0.47019458", "0.46977225", "0.4696706" ]
0.6390335
0
Retrieve collection for grid if there is not collection call _prepareCollection
public function getCollection() { if (!$this->_collection) { $this->_prepareCollection(); } return $this->_collection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t$this->setCollection($collection);\n\t\t \n\t\treturn parent::_prepareCollection();\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->setOrder('ID','DESC');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t//$collection->getSelect()->joinLeft(array('st' => 'core_store'),'main_table.SiteID = st.store_id',array('storename' => 'st.name'));\n $this->setCollection($collection);\n \n return parent::_prepareCollection();\n }", "protected function _prepareCollection() {\n /**\n * \n * @var unknown\n */\n /**\n * Calling the parent Construct Method.\n * \n * Getting collection for bank details\n */\n $managebankdetailsCollection = Mage::getModel ( 'airhotels/managebankdetails' )->getCollection ();\n $this->setCollection ( $managebankdetailsCollection ); \n return parent::_prepareCollection ();\n /**\n * return _prepareCollection\n */\n }", "protected function _prepareCollection()\n {\n $collection = $this->collectionFactory->create();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $currentCampaign = Mage::getSingleton('adminhtml/session')->getCurrentCampaign();\n $collection = Mage::getModel('campaign/bannerslider')->getCollection();\n $collection->getSelect()\n ->joinLeft(array('campaign'=>$collection->getTable('campaign/campaign')),\n 'main_table.campaign_id = campaign.campaign_id', '')\n ->columns(array('campaign_name'=>'IF(main_table.campaign_id = \"'.$currentCampaign->getId().'\", \"Current\", campaign.name)'))\n ->group('main_table.bannerslider_id');\n $filter = Mage::registry('banner_reloaded_ids');\n if(!isset($filter)){//if reset no filter\n $selected_id = $this->_selectedId();\n if(!empty($selected_id)){\n $collection->addFieldToFilter('bannerslider_id', array('in'=>$selected_id));\n }\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('lavi_news/news')->getResourceCollection();\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('oggetto_oneclick/order')->getResourceCollection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n /** @var $collection ChazkiExpressCollection */\n $collection = $this->_collectionFactory->create();\n $collection->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function getCollection() ;", "protected function _prepareCollection()\n {\n $userId = Mage::getSingleton('admin/session')->getUser()->getId();\n\n /* var $collection Gri_Cms_Model_Mysql4_Version_Collection */\n $collection = Mage::getModel('gri_cms/page_version')->getCollection()\n ->addPageFilter($this->getPage())\n ->addVisibilityFilter($userId,\n Mage::getSingleton('gri_cms/config')->getAllowedAccessLevel())\n ->addUserColumn()\n ->addUserNameColumn();\n\n if (!$this->getParam($this->getVarNameSort())) {\n $collection->addNumberSort();\n }\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection() {\n /**\n * Get the Collection of Manage Subscription\n */\n $manageSubscription = Mage::getModel ( 'airhotels/managesubscriptions' )->getCollection ();\n \n /**\n * Get the Table Prefix Value\n */\n $tablePrefix = Mage::getConfig ()->getTablePrefix ();\n $manageSubscription->getSelect ()->group ( 'main_table.product_id' )->joinLeft ( $tablePrefix . 'apptha_productsubscriptions', 'main_table.product_id =' . $tablePrefix . 'apptha_productsubscriptions.product_id AND ' . $tablePrefix . 'apptha_productsubscriptions.is_delete = 0', array (\n 'main_table.id as id',\n 'main_table.product_name as product_name',\n $tablePrefix . 'apptha_productsubscriptions.subscription_type as subscription_type' \n ) )->where ( 'main_table.is_subscription_only = ?', 1 );\n \n $collection = $manageSubscription;\n $this->setCollection ( $collection );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareCollection ();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('bs_worksheet/worksheet_collection');\n if ($this->getCurriculum()->getId()) {\n $constraint = 'related.curriculum_id='.$this->getCurriculum()->getId();\n } else {\n $constraint = 'related.curriculum_id=0';\n }\n $collection->getSelect()->joinLeft(\n array('related' => $collection->getTable('bs_worksheet/worksheet_curriculum')),\n 'related.worksheet_id=main_table.entity_id AND '.$constraint,\n array('position')\n );\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "protected function _prepareCollection()\n {\n /* @var $collection Scandi_MenuManager_Model_Resource_Item_Collection */\n $collection = Mage::getModel('scandi_menumanager/item')->getResourceCollection()\n ->addMenuFilter(Mage::registry('menumanager_menu'));\n if (!$this->getRequest()->getParam('sort')) { $collection->setPositionOrder(); }\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function collection()\n {\n $name = \"$this->db.$this->name.$this->gridFS\";\n if( ! isset(self::$collections[$name]))\n {\n $selectMethod = ($this->gridFS ? 'getGridFS' : 'selectCollection');\n self::$collections[$name] = $this->db()->db()->$selectMethod($this->name);\n }\n return self::$collections[$name];\n }", "protected function _prepareCollection()\n {\n $collection = $this->_createCollection()->addCustomerIdFilter($this->_getCustomer()->getId())\n ->resetSortOrder()\n ->addDaysInWishlist()\n ->addStoreData();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\t\t \n\t\t\n $collection = Mage::getModel('catalog/product')\n \t->getCollection()\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('price')\n \t->addAttributeToSelect('special_price')\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('manufacturer')\n \t->addFieldToFilter('type_id', array('in' => array(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL)))\n ->joinField('qty',\n 'cataloginventory/stock_item',\n 'qty',\n 'product_id=entity_id',\n '{{table}}.stock_id=1',\n 'left');\n \t;\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function getCollection()\n {\n $collection = $this->createDefaultCollection();\n\n // find the refer attribute and try to join these table.\n /*\n XXX: since some refer column does not have a relationship, we can not join \n the table correctly.\n $joined = array();\n foreach ($model->getSchema()->getColumns() as $column ) {\n if ($ref = $column->refer) {\n if ( isset($joined[$ref]) )\n continue;\n $joined[ $ref ] = true;\n $collection->join(new $ref, 'LEFT');\n }\n }\n */\n foreach( $this->_toolbarItems as $controller ) {\n $controller->handleCollection($collection);\n }\n\n # support for lang query,\n # make sure the model has defined lang column for I18N\n $this->kernel->event->trigger('phifty.crud.collection_filter',$this,$collection);\n\n\n if ($this->quicksearchFields) {\n if ( $q = $this->request->param('_q') ) {\n $w = $collection->where();\n $c = 0;\n foreach( $this->quicksearchFields as $field ) {\n if ( $c++ < 1 ) {\n $w = $w->like( $field , '%' . $q . '%' );\n } else {\n $w = $w->or()->like( $field , '%' . $q . '%' );\n }\n }\n }\n }\n $this->orderCollection($collection);\n return $collection;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('bs_docwise/docwisement_collection');\n\n if ($this->getExam()->getId()) {\n $constraint = 'related.exam_id='.$this->getExam()->getId();\n } else {\n $constraint = 'related.exam_id=0';\n }\n $collection->getSelect()->joinLeft(\n array('related' => $collection->getTable('bs_docwise/exam_docwisement')),\n 'related.docwisement_id = main_table.entity_id AND '.$constraint,\n array('position')\n );\n\n\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "public function getCollection()\r\n\t{\r\n\t\treturn $this\r\n\t\t\t->getDbConnection()\r\n\t\t\t->selectDatabase()\r\n\t\t\t->getGridFS([\r\n\t\t\t\t'bucketName' => $this->collectionPrefix()\r\n\t\t\t]);\r\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('name')\n ->addAttributeToSelect('type')\n ->addAttributeToSelect('status')\n ->addAttributeToSelect('visibility')\n ->addAttributeToSelect('sku');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function getCollection()\n {\n $collection = trim(str_replace('\\\\', '_', $this->collection), '_');\n return $this->$collection()\n ->setDatabase($this->database)\n ->setTable($this->table)\n ->setModel($this->model)\n ->set($this->getRows());\n }", "protected function _prepareCollection()\n {\n /* @var $collection Belvg_Storelocator_Model_Resource_Location_Collection */\n $collection = Mage::getModel('storelocator/location')->getResourceCollection();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _getCollection()\n\t{\n\t\t//Check collection\n\t\tif($this->_collection)\n\t\t\treturn $this->_collection;\n\n\t\t//Get collection\n\t\t$this->_collection = new \\Framework\\Database\\Drivers\\Mongo\\CDatabaseModelCollection($this, $this->execute());\n\t\treturn $this->_collection;\n\t}", "public function getCollection() {\n return $this->collection;\n }", "public function getCollection(){\n\t\treturn $this->_collection;\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('sales/order_shipment')->getCollection();\n $tableName = Mage::getSingleton('core/resource')->getTableName('sales_flat_order');\n\n $collection->getSelect()->joinLeft(array('o'=>$tableName), 'main_table.order_id=o.entity_id', array(\n 'order_increment_id'=>'o.increment_id',\n 'order_created_date'=>'o.created_at',\n 'o.shipping_description'));\n\n $collection->addFieldToFilter('o.shipping_description', array('like'=>'%canpar%'));\n $tableName = Mage::getSingleton('core/resource')->getTableName('ch_canpar_shipment');\n\n $collection->getSelect()->joinLeft(array('ch_shipment'=>$tableName), 'main_table.entity_id=ch_shipment.magento_shipment_id',array(\n 'canpar_shipment_id'=>'shipment_id',\n 'manifest_id'=>'manifest_id'));\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getCollection();", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('iparcel/log')->getCollection();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function getCollection(){\r\n\t\treturn $this->_collection;\r\n\t}", "protected function _prepareCollection()\n {\n\n\t\t\n\t\t$collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('sku')\n ->addAttributeToSelect('name');\n\t\t\t\n\t\t$collection->addAttributeToSelect('thumbnail');\n\t\t\n\t\t$collection->addAttributeToFilter('image', array('eq' => 'no_selection'));\n \n\t\t//$collection->joinAttribute('image', 'catalog_product/image', 'entity_id', null, 'left');\n\n\t\t$this->setCollection($collection);\n\t\treturn parent::_prepareCollection();\n }", "public function getCollection()\r\n {\r\n return $this->collection;\r\n }", "public function getCollection()\n {\n return $this->collection;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('solutionpartner/partner')->getCollection();\n $collection->getSelect()->joinLeft(\n array('order' => $collection->getTable('sales/order')),\n 'main_table.email = order.customer_email AND order.status = \"complete\"',\n array(\n 'order_id' => 'entity_id',\n 'order_status' => 'order.status',\n 'number_qtys' => 'count(order.entity_id)'\n ))\n ->group('main_table.solutionpartner_id');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->getSelect()->joinLeft(\n array('sfo' => 'sales_flat_order'),\n 'main_table.order_id = sfo.entity_id',\n array('increment_id')\n );\n\t\t$this->setCollection($collection);\n\n\t\treturn parent::_prepareCollection();\n\t}", "public function getCollection() {\n return $this->collection;\n }", "public function setCollection()\n {\n $cl = $this->nameCollection;\n $this->collection = self::$database->$cl;\n }", "protected function _prepareCollection()\r\n {\r\n $this->setCollection(Mage::getModel('dynamic_brand/brand')->getCollection());\r\n return parent::_prepareCollection();\r\n }", "public function load($collection = null);", "protected function _prepareCollection()\n {\n $baseQuery = $this->_getBaseSearchQuery();\n $productIds = $this->_getProductIdsFromSearchQuery($baseQuery);\n\n if (empty($productIds)) {\n $productIds = array(0);\n }\n\n $attributes = Mage::getModel('catalog/config')->getProductCollectionAttributes();\n\n /** @var Mage_Catalog_Model_Resource_Product_Collection $collection */\n $collection = Mage::getResourceModel('catalog/product_collection')\n ->addIdFilter($productIds)\n ->addAttributeToSelect($attributes);\n\n $storeIds = implode(\",\", array_unique(array_map(\"intval\", array(Mage_Core_Model_App::ADMIN_STORE_ID, $this->getStoreId()))));\n\n if ($this->getStoreId() != Mage_Core_Model_App::ADMIN_STORE_ID) {\n $collection->setStoreId($this->getStoreId());\n $joinCond = \"category_id = \" . (int) $this->getCategory()->getId() . \" AND store_id = {$this->getStoreId()}\";\n } else {\n $joinCond = \"category_id = \" . (int) $this->getCategory()->getId() . \" AND store_id IN ({$storeIds})\";\n }\n\n $collection->joinField(\n 'position',\n 'smile_virtualcategories/category_product_position',\n 'position',\n 'product_id = entity_id',\n $joinCond,\n 'left'\n );\n\n $collection->getSelect()->order(\n new Zend_Db_Expr(\"- position DESC\") // mimic a \"SORT BY #field NULL LAST\n );\n\n $entityIds = implode(\",\", $productIds);\n $collection->getSelect()->order(\n new Zend_Db_Expr(\"FIELD(e.entity_id, {$entityIds})\") // restore sort order given by ES\n );\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection() {\n $website_id = Mage::app()->getWebsite()->getId();\n $collection = Mage::getModel('inchoo_supportticket/ticket')\n ->getCollection();\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "public function getCollectionItem() {}", "abstract protected function collectionLoader();", "protected function getCollection($collection){\r\n return $this->{$this->db}->$collection;\r\n }", "protected function _prepareCollection() {\r\n $store = $this->_getStore();\r\n $collection = Mage::getModel('catalog/product')->getCollection()\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('attribute_set_id')\r\n ->addAttributeToSelect('type_id');\r\n\r\n if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {\r\n $collection->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left');\r\n }\r\n if ($store->getId()) {\r\n $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;\r\n $collection->addStoreFilter($store);\r\n $collection->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore);\r\n $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId());\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n } else {\r\n $collection->addAttributeToSelect('price');\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n }\r\n\r\n $this->setCollection($collection);\r\n\r\n parent::_prepareCollection();\r\n $this->getCollection()->addWebsiteNamesToResult();\r\n return $this;\r\n }", "protected function _prepareCollection()\r\n {\r\n\t\tif($this->getRequest()->getParam('store')){\r\n\t\t\t$store_id = $this->getRequest()->getParam('store');\r\n\t\t} else {\r\n\t\t\t$store_id = Mage::helper('items')-> getMlDefaultStoreId();\r\n\t\t}\r\n\t\t$attribute_id = '';\r\n\t\tif($this->getRequest()->getParam('attribute_id')!=''){\r\n\t\t\t$attribute_id = $this->getRequest()->getParam('attribute_id');\r\n\t\t} \r\n\t\t\r\n\t\t$category_id = 0;\r\n\t\tif($this->getRequest()->getParam('category_id')){\r\n\t\t\t$category_id = $this->getRequest()->getParam('category_id');\r\n\t\t}\r\n\t\t\r\n\t\t$collection = Mage::getModel('eav/entity_attribute_option')\r\n\t\t\t\t\t-> getCollection()\r\n\t\t\t\t\t-> setStoreFilter($store_id)\r\n\t\t\t\t\t-> join('attribute','attribute.attribute_id=main_table.attribute_id', 'attribute_code')\r\n\t\t\t\t\t-> addFieldToFilter('attribute.attribute_id',$attribute_id)\r\n\t\t\t\t\t-> addFieldToFilter('tsv.value', array('neq' => 'NULL' ));\t\t\t\r\n\t\t\t\t\t\r\n $collection -> getSelect()\r\n\t\t\t\t -> joinleft(array('mavm'=>'mercadolibre_attribute_value_mapping'), \" main_table.option_id = mavm.mage_attribute_option_id AND mavm.sort_order = '0' AND mavm.category_id = '\".$category_id.\"' AND mavm.store_id = '\".$store_id.\"'\",array('mavm.*'));\r\n\t\t \r\n\t\t\t\t \r\n\t\t\t\t \t\t\t\t\t\t\t\t\r\n\t $this->setCollection($collection);\r\n return parent::_prepareCollection();\r\n }", "public function prepareCollection()\n {\n $this->_reset();\n\n $this->addAttributeToSelect('*');\n\n // Select cart items\n $this->joinTable(\n array('qi' => 'sales/quote_item'),\n 'product_id = entity_id',\n array(\n 'product_name' => 'name',\n 'counts' => 'COUNT(1)',\n 'sum_qty' => \"SUM(CASE WHEN qip.product_type IN ('configurable', 'bundle') THEN qip.qty * qi.qty ELSE qi.qty END)\",\n 'total' => \"SUM(CASE WHEN qip.product_type='configurable' THEN qip.base_row_total ELSE qi.base_row_total END)\",\n 'product_type',\n 'quote_id' => 'quote_id',\n 'parent_item_id' => 'parent_item_id',\n 'item_created_at' => 'created_at'\n )\n );\n $this->addFilterToMap('parent_item_id', 'qi.parent_item_id');\n $this->addFilterToMap('product_type', 'qi.product_type');\n $this->addFilterToMap('item_created_at', 'item_created_at');\n\n // Retrieve base currency code from parent quote\n $this->joinTable(\n array('q' => 'sales/quote'),\n 'entity_id = quote_id',\n array('currency_code' => 'base_currency_code', 'store_id' => 'store_id')\n );\n\n // Select only cart items attached to a subscription\n $this->joinTable(\n array('s' => 'sheep_subscription/subscription'),\n 'quote_id = quote_id',\n array('subscription_created_at' => 'created_at',)\n );\n\n // re-join sales_flat_quote_item to retrieve parent info (if available)\n $this->joinTable(\n array('qip' => 'sales/quote_item'),\n 'item_id = parent_item_id',\n array('parent_product_type' => 'product_type', 'parent_qty' => 'qty'),\n null,\n 'left'\n );\n $this->addFilterToMap('parent_product_type', 'qip.product_type');\n $this->addFilterToMap('parent_qty', 'qip.qty');\n\n // Filter only cart items created during specified period\n $this->addFieldToFilter('item_created_at', array(\n 'from' => $this->_from,\n 'to' => $this->_to,\n 'datetime' => true\n ));\n\n $this->getSelect()->where(\n \"(qi.parent_item_id is null and qi.product_type NOT IN ('bundle', 'configurable')) OR\" .\n \"(qi.parent_item_id is not null and qip.product_type IN ('bundle', 'configurable'))\"\n );\n\n $this->getSelect()\n ->group('e.entity_id')\n ->order('counts ' . self::SORT_ORDER_DESC)\n ->having('COUNT(qi.product_id) > ?', 0);\n\n\n // Filter only quotes that were created in specified stores\n if ($this->_storeIds) {\n $this->addFieldToFilter('store_id', array('in' => $this->_storeIds));\n }\n }", "public static function collectionGridFS()\r\n {\r\n $item = new static;\r\n return $item->getDb()->getGridFS( $item->collectionNameGridFS() );\r\n }", "protected function _retrieveCollection() {\n $response = array ();\n $productArray = array ();\n // get website id from request\n $websiteId = ( int ) $this->getRequest ()->getParam ( static::WEBSITE_ID );\n if ($websiteId <= 0) {\n $websiteId = Mage::app ()->getWebsite ( 'base' )->getId ();\n }\n // get store id from request\n $storeId = ( int ) $this->getRequest ()->getParam ( static::STORE_ID );\n if ($storeId <= 0) {\n $storeId = Mage::app ()->getWebsite ( $websiteId )->getDefaultGroup ()->getDefaultStoreId ();\n }\n // get page from request\n $page = $this->getRequest ()->getParam ( 'page' );\n if ($page <= 0) {\n $page = 1;\n }\n // get page from request\n $limit = $this->getRequest ()->getParam ( 'limit' );\n if ($limit <= 0) {\n $limit = 10;\n }\n \n // get these type of products only\n $productType = array (\n \"simple\",\n \"configurable\" \n );\n \n // get city for filter products\n $city = ( int ) Mage::app ()->getRequest ()->getParam ( 'city' );\n \n /**\n *\n * @var $collection Mage_Catalog_Model_Resource_Product_Collection\n */\n $collection = Mage::getResourceModel ( 'catalog/product_collection' );\n $collection->addStoreFilter ( $storeId )->addPriceData ( $this->_getCustomerGroupId (), $websiteId )->addAttributeToSelect ( static::NAME, static::PRICE )->addAttributeToFilter ( static::VISIBILITY, array (\n 'neq' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE \n ) )->addAttributeToFilter ( static::STATUS, array (\n 'eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED \n ) )->addAttributeToFilter ( 'type_id', array (\n 'in' => $productType \n ) );\n // Filter products by city\n if ($city) {\n $collection->addFieldToFilter ( 'city', array (\n array (\n 'regexp' => $city \n ) \n ) );\n }\n \n $this->_applyCategoryFilter ( $collection );\n $this->_applyCollectionModifiers ( $collection );\n \n // sort and filetr product collection\n $collection = $this->_getProductByFilter ( $collection, $storeId );\n // get total products count\n $totalProducts = $collection->getSize ();\n $collection = $this->_getProductBySort ( $collection, $storeId );\n $products = $collection->load ();\n \n // get total pages with limit\n $last_page = ceil ( $totalProducts / $limit );\n if ($last_page < $page) {\n $productArray = array ();\n } else {\n $productArray = $this->getProductsList ( $products, $storeId );\n }\n $response ['success'] = 1;\n $response ['error'] = false;\n $response ['total_count'] = $totalProducts;\n $response ['result'] = $productArray;\n return json_encode ( $response );\n }", "private function createCollection()\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 }", "protected function getGridDataService() {}", "public function collection(ContentCollection $collection = null);", "protected function _prepareCollection($collection)\n {\n return $this;\n }", "protected function _setCollection(){\n $storeId = Mage::app()->getStore()->getId();\n $products = Mage::getResourceModel('reports/product_collection')\n ->addOrderedQty()\n ->addAttributeToSelect(array('name', 'price', 'small_image', 'short_description', 'description'))\n ->setStoreId($storeId)\n ->addStoreFilter($storeId)\n ->setPageSize($this->getProductsCount())\n ->setOrder('ordered_qty', 'desc');\n\n Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);\n Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);\n\n $this->_topsellerCollection = $products;\n }", "protected function getGridInstance()\n {\n return null;\n }", "function getCollection($name);", "function get_collection_for_item($item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n return $item->Collection;\n}", "protected function _prepareCollection() {\n $collection = Mage::getModel('vidtest/video')\n ->getCollection()\n ->addProductFilter($this->getProduct()->getId())\n ;\n\n if ($storeId = $this->getProduct()->getStoreId()) {\n $collection->addStoreFilter($storeId);\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function createCollection()\n {\n $model = $this->getModel();\n return $model->asCollection();\n }", "protected function _prepareCollection()\r\n {\r\n $collection = Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->getCollection();\r\n $giftCartAccount_data = array();\r\n foreach($collection as $key=>$item){\r\n $giftCartAccount_data[$item->getData('giftcardaccount_id')][0] = $item->getData();\r\n $collection->removeItemByKey($key);\r\n }\r\n\r\n $creat_collection = Mage::getModel('enterprise_giftcardaccount/history')->getCollection();\r\n $creat_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('giftcardaccount_id','generated_order_number' => 'additional_info', 'original_amount' => 'balance_delta'));\r\n $creat_collection->addFieldToFilter('action', 0);\r\n $creat_collection->setOrder('giftcardaccount_id', 'asc');\r\n $creat_collection->setOrder('updated_at', 'asc');\r\n $id = '';\r\n $i = 0;\r\n foreach($creat_collection as $item){\r\n $giftcardaccount_id = $item->getData('giftcardaccount_id');\r\n if($giftcardaccount_id == $id){\r\n $i++;\r\n }else{\r\n $id = $giftcardaccount_id;\r\n $i = 0;\r\n }\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['generated_order_number'] = $item->getData('generated_order_number');\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['original_amount'] = $item->getData('original_amount');\r\n }\r\n\r\n $use_collection = Mage::getModel('enterprise_giftcardaccount/history')->getCollection();\r\n $use_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('giftcardaccount_id','used_date' => 'updated_at', 'used_order_number' => 'additional_info', 'used_amount' => 'ABS(main_table.balance_delta)'));\r\n $use_collection->addFieldToFilter('action', 1);\r\n $use_collection->setOrder('giftcardaccount_id', 'asc');\r\n $use_collection->setOrder('updated_at', 'asc');\r\n $id = '';\r\n $i = 0;\r\n foreach($use_collection as $item){\r\n $giftcardaccount_id = $item->getData('giftcardaccount_id');\r\n if($giftcardaccount_id == $id){\r\n $i++;\r\n }else{\r\n $id = $giftcardaccount_id;\r\n $i = 0;\r\n }\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['used_date'] = $item->getData('used_date');\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['used_order_number'] = $item->getData('used_order_number');\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['used_amount'] = $item->getData('used_amount');\r\n }\r\n\r\n $send_collection = Mage::getModel('enterprise_giftcardaccount/history')->getCollection();\r\n $send_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('giftcardaccount_id','additional_info'));\r\n $send_collection->addFieldToFilter('action', 2);\r\n $send_collection->setOrder('giftcardaccount_id', 'asc');\r\n $send_collection->setOrder('updated_at', 'asc');\r\n $id = '';\r\n $i = 0;\r\n foreach($send_collection as $item){\r\n $giftcardaccount_id = $item->getData('giftcardaccount_id');\r\n if($giftcardaccount_id == $id){\r\n $i++;\r\n }else{\r\n $id = $giftcardaccount_id;\r\n $i = 0;\r\n }\r\n $additional_info = $item->getData('additional_info');\r\n preg_match ('/^Recipient: (.*?) <(.*?)>.(.*)$/', $additional_info, $param);\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['receptor_name'] = $param[1];\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['receptor_email']= $param[2];\r\n }\r\n\r\n $total_collection = Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->getCollection();\r\n $total_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('main_table.giftcardaccount_id'))\r\n ->joinLeft(\r\n array('history' => $collection->getTable('enterprise_giftcardaccount/history')),\r\n 'history.giftcardaccount_id = main_table.giftcardaccount_id and history.action = 1',\r\n array('total'=>'ABS(SUM(history.balance_delta))')\r\n )\r\n ->group('main_table.giftcardaccount_id');\r\n foreach($total_collection->getData() as $val){\r\n $giftCartAccount_data[$val['giftcardaccount_id']][0]['total_used_amount'] = $val['total']?$val['total']:'';\r\n }\r\n\r\n foreach($giftCartAccount_data as $value){\r\n foreach($value as $val){\r\n $item = $collection->getNewEmptyItem();\r\n $item->setData($val);\r\n $collection->addItem($item);\r\n }\r\n }\r\n $this->setCollection($collection);\r\n\r\n parent::_prepareCollection();\r\n return $this;\r\n }", "protected function _prepareCollection() {\n $collection = Config::get()->collectionTransaction();\n $asTrnx = 'main_table';\n $collection->addFieldToSelect(Transaction::ATTR_ID, self::AS_TRAN_ID);\n $collection->addFieldToSelect(Transaction::ATTR_DATE_APPLIED, self::AS_DATE_APPLIED);\n $collection->addFieldToSelect(Transaction::ATTR_VALUE, self::AS_VALUE);\n /* LEFT JOIN prxgt_bonus_operation oper ON trnx.operation_id = oper.id */\n $asOper = 'oper';\n $tbl = array( $asOper => Config::ENTITY_OPERATION );\n $cond = $asTrnx . '.' . Transaction::ATTR_OPERATION_ID . '=' . $asOper . '.' . Operation::ATTR_ID;\n $cols = array(\n self::AS_OPER_ID => Operation::ATTR_ID,\n self::AS_DATE_PERFORMED => Operation::ATTR_DATE_PERFORMED\n );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account credit ON trnx.credit_acc_id = credit.id */\n $asCredit = 'credit';\n $tbl = array( $asCredit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_CREDIT_ACC_ID . '=' . $asCredit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account debit ON trnx.debit_acc_id = debit.id */\n $asDebit = 'debit';\n $tbl = array( $asDebit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_DEBIT_ACC_ID . '=' . $asDebit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custCred ON credit.customer_id = custCred.entity_id */\n $asCreditCust = 'creditCust';\n $tbl = array( $asCreditCust => 'customer/entity' );\n $cond = $asCredit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asCreditCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_CREDIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custDeb ON debit.customer_id = custDeb.entity_id */\n $asDebitCust = 'debitCust';\n $tbl = array( $asDebitCust => 'customer/entity' );\n $cond = $asDebit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asDebitCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_DEBIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_asset asset ON credit.asset_id = asset.id */\n $asAsset = 'asset';\n $tbl = array( $asAsset => Config::ENTITY_TYPE_ASSET );\n $cond = $asCredit . '.' . Account::ATTR_ASSET_ID . '=' . $asAsset . '.' . TypeAsset::ATTR_ID;\n $cols = array( self::AS_ASSET_CODE => TypeAsset::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_oper operType ON oper.type_id = operType.id */\n $asOperType = 'operType';\n $tbl = array( $asOperType => Config::ENTITY_TYPE_OPER );\n $cond = $asOper . '.' . Operation::ATTR_TYPE_ID . '=' . $asOperType . '.' . TypeOper::ATTR_ID;\n $cols = array( self::AS_OPER_CODE => TypeOper::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* prepare collection */\n $sql = $collection->getSelectSql(true);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "public function getCollection($name) {}", "protected function _prepareCollection() {\r\n $collection = Mage::getResourceModel('zozoconcepts_brands/brand_collection');\r\n if ($this->getProduct()->getId()){\r\n $constraint = 'related.product_id='.$this->getProduct()->getId();\r\n }\r\n else{\r\n $constraint = 'related.product_id=0';\r\n }\r\n $collection->getSelect()->joinLeft(\r\n array('related'=>$collection->getTable('zozoconcepts_brands/brand_product')),\r\n 'related.brand_id=main_table.entity_id AND '.$constraint,\r\n array('position')\r\n );\r\n $this->setCollection($collection);\r\n parent::_prepareCollection();\r\n return $this;\r\n }", "public function getCollection(): array\n {\n return $this->collection;\n }", "public function getPreparedData($collection = null)\r\n {\r\n if (!$this->getData('prepared_data')){\r\n $data = array();\r\n foreach ($this->_getPredefinedKeys() as $dataKey => $dataPath){\r\n $is_default = true;\r\n $value = Mage::getStoreConfig($dataPath);\r\n foreach ($collection as $item){\r\n if ($item->getPath() == $dataPath){\r\n $value = $item->getValue();\r\n $is_default = false;\r\n }\r\n }\r\n $data[$dataKey] = $value;\r\n $data[$dataKey.'_use_default'] = $is_default;\r\n }\r\n\r\n if ($grid = $this->getGrid()){\r\n if ( count($options = $grid->getCustomOptionsRequired()) ){\r\n foreach ($options as $option){\r\n $value = $option['default'];\r\n if ( ( $savedValue = $this->getCustomConfig($option['id']) ) !== null){\r\n $value = $savedValue;\r\n }\r\n $data[$option['id']] = $value;\r\n }\r\n }\r\n }\r\n $this->setData('prepared_data', $data);\r\n }\r\n return $this->getData('prepared_data');\r\n }", "public function collection() {\n \t$db = $this->db;\n\t\t$sql = $this->sql();\n\t\t$rows = $db::execute($sql);\n\t\t$model = $this->model;\n\t\treturn new \\Collection($model::arrayFactoryFromRows($rows));\n\t}", "public function getItemCollection()\n {\n if ($this->_itemCollection === null) {\n $this->_itemCollection = Mage::getResourceModel('factfinder_campaigns/pushedproducts_collection');\n $this->_itemCollection->setHandler($this->_getHandler());\n }\n\n return $this->_itemCollection;\n }", "protected function _getCollection()\n {\n if (!$this->_collection) {\n $websiteId = Mage::app()->getWebsite()->getId();\n $this->_collection = Mage::getModel('gri_reward/reward_history')->getCollection()\n ->addCustomerFilter(Mage::getSingleton('customer/session')->getCustomerId())\n ->addWebsiteFilter($websiteId)\n ->setExpiryConfig(Mage::helper('gri_reward')->getExpiryConfig())\n ->addExpirationDate($websiteId)\n ->skipExpiredDuplicates()\n ->setDefaultOrder()\n ;\n }\n return $this->_collection;\n }", "protected function _createCollection()\n {\n return Mage::getModel('wishlist/item')->getCollection()\n ->setWebsiteId($this->_getCustomer()->getWebsiteId())\n ->setCustomerGroupId($this->_getCustomer()->getGroupId());\n }", "public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }", "public function getCollection()\n {\n if (is_null($this->_newsCollection)) {\n $this->_newsCollection = $this->_getCollection();\n $this->_newsCollection->prepareForList($this->getCurrentPage());\n }\n\n return $this->_newsCollection;\n }", "protected function _prepareCollection()\n {\n $collection = $this->_collectionFactory->create()->addVisibleFilter();\n $vendor_attrs = [];\n $vendor_id = $this->customerSession->getVendorId();\n if ($vendor_id) {\n $attr_model = $this->attribute->getProductAttributes($vendor_id)->getData();\n foreach ($attr_model as $key => $attr_id) {\n $vendor_attrs[] = $attr_id['attribute_id'];\n }\n $collection->addFieldToFilter('main_table.attribute_id', ['in' => $vendor_attrs]);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }\n return $this;\n }", "public function loadCollectionItems(Collection $collection): array;", "function productCollection()\n {\n return eZProductCollection::fetch( $this->attribute( 'productcollection_id' ) );\n }", "protected function _prepareCollection() {\n $session = Mage::getModel('core/session');\n $filterConditions = $session->getData('rp_conditions');\n if (!$filterConditions)\n $filterConditions = $this->_filterConditions;\n $posorderCollection = Mage::getModel('webpos/posorder')->getCollection();\n /* Jack - create an empty collection */\n $collection = $posorderCollection;\n foreach ($collection->getItems() as $key => $item) {\n $collection->removeItemByKey($key);\n }\n /**/\n\n /* Define variables and set default data */\n $totalsSalesByUser = array();\n $totalSales = 0;\n $incTimeStrings = array('1' => ' +1 week', '2' => ' +1 day', '3' => ' +1 month', '4' => ' +1 day', '5' => ' +1 day', '6' => ' +1 week', '7' => ' +1 week');\n $descTimeStrings = array('4' => ' -1 week', '5' => ' -1 week', '6' => ' -1 month', '7' => ' -1 month');\n $periodFormat = ($filterConditions['period'] == 3 || $filterConditions['period'] == 6 || $filterConditions['period'] == 7 ) ? \"Y-m-d\" : \"Y-m-d\";\n $specialPeriod = array('1', '2', '3', '4');\n $stringTimeFrom = array('1' => 'monday this week', '2' => 'monday last week', '3' => 'first day of this month', '4' => 'first day of previous month');\n $stringTimeTo = array('1' => 'sunday this week', '2' => 'sunday last week', '3' => 'last day of this month', '4' => 'last day of previous month');\n $thisFriday = date($periodFormat, strtotime('friday this week'));\n $today = date($periodFormat);\n $userIds = $this->userIds;\n if (($filterConditions['from'] == '' || $filterConditions['to'] == '' ) && in_array($filterConditions['period'], $specialPeriod) == false) {\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }\n\n $startTime = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeFrom[$filterConditions['range']]))) : date($periodFormat, strtotime($filterConditions['from']));\n $timeFrom = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeFrom[$filterConditions['range']]))) : date($periodFormat, strtotime($filterConditions['from']));\n $timeTo = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeTo[$filterConditions['range']]))) : date(\"Y-m-d\", strtotime($filterConditions['to']));\n if ($timeFrom && $timeTo) {\n while ($timeFrom <= $timeTo) {\n $i = 0;\n foreach ($this->userIds as $userId => $displayName) {\n $isSave = true;\n $totalSalesOfPeriod = 0;\n $isEmpty = true;\n if ($filterConditions['period'] == 1) {\n $endTime = $this->lastDayOf('year', new DateTime($timeFrom))->format('Y-m-d');\n } else if ($filterConditions['period'] == 3) {\n $endTime = $this->lastDayOf('month', new DateTime($timeFrom))->format('Y-m-d');\n } else\n $endTime = date('Y-m-d', strtotime($timeFrom . $incTimeStrings[$filterConditions['period']]));\n $endTime = (strtotime($endTime) < strtotime($timeTo)) ? $endTime : $timeTo;\n $itemDataObject = new Varien_Object();\n if ($i == 0) {\n if ($filterConditions['period'] == 1) {\n $exTimeFrom = explode('-', $timeFrom);\n $itemDataObject->setData('period', $exTimeFrom[0]);\n } else if ($filterConditions['period'] == 3) {\n $exTimeFrom = explode('-', $timeFrom);\n $itemDataObject->setData('period', $exTimeFrom[0] . '-' . $exTimeFrom[1]);\n } else\n $itemDataObject->setData('period', $timeFrom);\n } else\n $itemDataObject->setData('period', '');\n if ($itemDataObject->getData('period'))\n $itemDataObject->setData('period', date('F j, Y', strtotime($itemDataObject->getData('period'))));\n $webposOrderCollection = $this->getSalesCollection($timeFrom, $endTime, array('user_id' => $userId));\n $totalU = 0;\n if (count($webposOrderCollection) > 0) {\n foreach ($webposOrderCollection as $order) {\n $totalU += $order->getTotals();\n }\n }\n if (!$totalU && $filterConditions['rp_settings']['show_empty_result'] == 'false')\n $isSave = false;\n\n if ($isSave) {\n $itemDataObject->setData('user', $displayName);\n\n $itemDataObject->setData('totals_sales', ($totalU > 0) ? $totalU : '0.00');\n $collection->addItem($itemDataObject);\n }\n $i++;\n }\n if ($filterConditions['period'] == 1)\n $timeFrom = date('Y-m-d', strtotime($endTime));\n else\n $timeFrom = date($periodFormat, strtotime($timeFrom . $incTimeStrings[$filterConditions['period']]));\n }\n /* get last item data \n $i = 0;\n foreach($this->userIds as $userId => $displayName){\n $isSave = true;\n $beforeLastItem = new Varien_Object();\n if($i == 0){\n if($filterConditions['period'] == 1){\n $exTimeFrom = explode('-',$timeTo);\n $beforeLastItem->setData('period',$exTimeFrom[0]);\n }\n else if($filterConditions['period'] == 3){\n $exTimeFrom = explode('-',$timeTo);\n $beforeLastItem->setData('period',$exTimeFrom[0].'-'.$exTimeFrom[1]);\n }\n else\n $beforeLastItem->setData('period',$timeTo);\n }\n else\n $beforeLastItem->setData('period','');\n if($beforeLastItem->getData('period'))\n $beforeLastItem->setData('period',date('F j, Y', strtotime($beforeLastItem->getData('period'))));\n $webposOrderCollection = $this->getSalesCollection($timeTo,$timeTo,array('user_id' => $userId))->getFirstItem();\n if( !$webposOrderCollection->getTotals() && $filterConditions['rp_settings']['show_empty_result'] == 'false')\n $isSave = false;\n if($isSave){\n $beforeLastItem->setData('user',$displayName);\n $beforeLastItem->setData('totals_sales',$webposOrderCollection->getTotals()?$webposOrderCollection->getTotals():'0.00');\n $collection->addItem($beforeLastItem);\n }\n $i++;\n }\n end last item */\n }\n /* set data for totals row */\n $lastItemDataObject = new Varien_Object();\n $lastItemDataObject->setData('period', 'Totals:');\n $orders = $this->getSalesTotal($startTime, $endTime);\n\n $totalU = 0;\n if (count($orders) > 0) {\n foreach ($orders as $order) {\n $totalU += $order->getTotals();\n }\n }\n $lastItemDataObject->setData('totals_sales', $totalU);\n $collection->addItem($lastItemDataObject);\n $this->setCollection($collection);\n /* set session for chart */\n $sessionObject = new Varien_Object();\n foreach ($this->userIds as $userId => $username) {\n $orders = $this->getSalesTotal($startTime, $endTime, array('user_id' => $userId));\n\n\n $totalU = 0;\n if (count($orders) > 0) {\n foreach ($orders as $order) {\n $totalU += $order->getTotals();\n }\n }\n $sessionObject->setData($username, $totalU);\n }\n Mage::getSingleton('core/session')->setData('total_sales_by_user', $sessionObject->toArray());\n Mage::getSingleton('core/session')->setType('user');\n $this->setTotalRowByUser($sessionObject->toArray());\n return parent::_prepareCollection();\n }", "protected function buildColection() \n {\n $content_id = $this->getContentId();\n $origin_content_id = $this->getOriginContentId();\n $project_id = $this->getProjectId();\n $storeId = $this->getStoreId();\n \n try {\n $contentCollection = Mage::getModel('connector/content')->getCollection();\n $contentCollection->addFieldToFilter('filename', array('neq' => ''))\n ->addFieldToFilter('percent', array('lt' => '100'));\n\n if($content_id) { // identity field\n $contentCollection->addIndentifyToFilter($content_id);\n } elseif($origin_content_id && $project_id && $storeId) {\n $contentCollection->addUniqueByParams($origin_content_id, $project_id, $storeId);\n } else { // get all none updated records\n $contentCollection->setPageSize(500)\n ->setCurPage(1);\n }\n \n $contentCollection->joinAdditionalDetails();\n \n return $contentCollection;\n } catch (Exception $ex) {\n Mage::helper('connector')->log($ex->getMessage(), Zend_log::ERR);\n return false;\n }\n \n \n }", "public function __construct()\n {\n $this->_collection = new Collection();\n }", "public function __construct(){\r\n\t\t$this->collection = new Collection();\r\n\t}", "public static function getCollection()\n\t{\n\t\treturn static::getDb()->getFileCollection(static::collectionName());\n\t}", "public function collection(Collection $collection);", "protected function getGrid() {\n if ($this->grid === null) {\n try {\n $database = $this->getMongo()->selectDB($this->params['databaseName']);\n $this->grid = $database->getGridFS();\n } catch (MongoException $e) {\n throw new StorageException('Could not connect to database', 500, $e);\n }\n }\n\n return $this->grid;\n }", "function get_collection(){\n\t\t$parent_id = $this->request->post('parent_id');\n\t\t$team_obj = new Project($parent_id);\n\t\t$object_type = $this->request->post('object_type');\n\t\t\n\t\t$listing = array();\n\t\tswitch($object_type){\n\t\t\tcase 'milestone':\n\t\t\t\t//$listing = Milestones::findByProject($team_obj, $this->logged_user);\n\t\t\t\t$listing = Milestones::findActiveByProject_custom($team_obj);\n\t\t\t\tbreak;\n\t\t\tcase 'ticket':\n\t\t\t\t$listing = Tickets::findOpenByProjectByNameSort($team_obj, STATE_VISIBLE, $this->logged_user->getVisibility());\n\t\t\t\tbreak;\n\t\t\tcase 'page':\n\t\t\t\t$categories = Categories::findByModuleSection($team_obj, 'pages', 'pages');\n\t\t\t\t$listing = Pages::findByCategories($categories, STATE_VISIBLE, $this->logged_user->getVisibility());\n\t\t\t\t/*foreach($categories as $category){\n\t\t\t\t\t$listing = array_merge($listing, Pages::findByCategory($category, STATE_VISIBLE, $this->logged_user->getVisibility()));\n\t\t\t\t}*/\n\t\t\t\tbreak;\n\t\t}\n\t\t$this->smarty->assign('options', $listing);\n\t}", "public function isCollection()\n {\n return $this->is_collection;\n }", "public function getGridData()\n {\n if (! $this->getRepository()->createEntity() instanceof GridModelInterface) {\n throw new \\LogicException(\n sprintf('Model entity class %s must implements interface BrsZfBase\\Controller\\Plugin\\GridModelInterface', get_class($this->getRepository()->createEntity()))\n );\n }\n\n $rqParams = $this->getGridRequestParams();\n $setupConditions = function ($select) {\n if ($this->setupConditions) {\n $sc = $this->setupConditions;\n $sc($select);\n }\n return $select;\n };\n\n $collection = $this->getRepository()->fetch(function ($select) use ($rqParams, $setupConditions) {\n $select\n ->reset('order')\n // xxx daje możliwość sortowania po dowolnym polu, a nie tylko po tym zwracamym z modelu ::toJsModel()\n ->order(new \\BrsZfSloth\\Sql\\Order($rqParams['sidx'], $rqParams['sord']))\n ->limit($rqParams['limit'])\n ->offset($rqParams['limit'] * $rqParams['page'] - $rqParams['limit'])\n ;\n return $setupConditions($select);\n });\n\n $totalRecords = $this->getRepository()->select(function ($select) use ($rqParams, $setupConditions) {\n $select\n ->reset('order')\n ->reset('columns')\n ->columns(['num' => new \\Zend\\Db\\Sql\\Expression('COUNT(1)')])\n ;\n if ($this->setupConditions) {\n $sc = $this->setupConditions;\n $sc($select);\n }\n return $setupConditions($select);\n })[0]['num'];\n\n $total = $totalRecords > 0 ? (int) ceil($totalRecords / $rqParams['limit']) : 0;\n $page = $rqParams['page'] <= $total ? $rqParams['page'] : $total;\n\n return [\n 'rows' => array_map(function($m) { return $m->getGridData(); }, $collection->toArray()),\n 'records' => $totalRecords,\n 'total' => $total,\n 'page' => $page,\n ];\n }", "protected function _prepareCollection()\n {\n /** @var \\Mage_Catalog_Model_Resource_Product_Attribute_Collection $collection */\n $collection = Mage::getResourceModel('catalog/product_attribute_collection')\n ->addVisibleFilter();\n\n $store = $this->_getStore();\n// $prefix = Mage::getConfig()->getTablePrefix()->__toString();\n// $jobAttributeQuery = 'select a.`version`, a.`attribute_id` from `'.$prefix.'straker_job_attribute` as a\n// left join `'.$prefix.'straker_job` as b on a.`job_id`=b.`id`\n// where b.`store_id` ='.$store->getId().' and a.`version` =1\n// GROUP BY a.`attribute_id`';\n//\n// //join straker job product table to get version for each product\n// $collection->getSelect()->joinLeft(\n//\n// new Zend_Db_Expr('('.$jobAttributeQuery.')'),\n// 'main_table.attribute_id = t.attribute_id',\n// array('version')\n//\n// );\n /** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Attribute_Collection $strakerJobProductCollection */\n $strakerJobAttributeCollection = Mage::getModel('strakertranslations_easytranslationplatform/job_attribute')->getCollection();\n $strakerJobAttributeCollection->getSelect()\n ->reset(Zend_Db_Select::COLUMNS)\n ->joinLeft(\n ['b' => $strakerJobAttributeCollection->getTable('strakertranslations_easytranslationplatform/job')],\n '`main_table`.`job_id` = `b`.`id`',\n []\n )->where(\n '`b`.`store_id` = ?', $store->getId()\n )->where(\n '`main_table`.`version` = ?', 1\n )->group(\n 'main_table.attribute_id'\n )->columns(\n ['version' => 'version', 'attribute_id' => 'attribute_id']\n );\n\n $jobAttributeQuery = $strakerJobAttributeCollection->getSelect();\n\n $collection->getSelect()->joinLeft(\n $jobAttributeQuery,\n 'main_table.attribute_id = t.attribute_id',\n array('version')\n );\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection () {\n $collection\n = Mage::getResourceModel('mventory/carrier_volumerate_collection')\n ->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n $shippingTypes\n = Mage::getModel('mventory/system_config_source_allowedshippingtypes')\n ->toArray();\n\n foreach ($collection as $rate) {\n $name = $rate->getConditionName();\n\n if ($name == 'weight')\n $rate->setWeight($rate->getConditionValue());\n else if ($name == 'volume')\n $rate->setVolume($rate->getConditionValue());\n\n $shippingType = $rate->getShippingType();\n\n $shippingType = isset($shippingTypes[$shippingType])\n ? $shippingTypes[$shippingType]\n : '';\n\n $rate->setShippingType($shippingType);\n }\n\n return parent::_prepareCollection();\n }", "public function collection(){\n return $this->belongsTo(Collection::class, 'collection_id');\n }", "public function prepareGrid() {\n $this->setGridModel ( $this->_latestNews );\n return $this;\n }", "function removeCollection()\n {\n $collection = eZProductCollection::fetch( $this->attribute( 'productcollection_id' ) );\n $collection->remove();\n }", "protected function _preparePage(){\n if (!Mage::helper('easylife_gridenhancer/customer')->getIsDisabled()) {\n $collection = $this->getCollection();\n $settings = $this->_getAdminSettings();\n if ($settings->getId()){\n $configuration = $settings->getConfiguration();\n if (is_array($configuration)){\n foreach ($configuration as $attribute=>$position){\n $parts = explode('__', $attribute, 2);\n if (count($parts) != 2){\n continue;\n }\n if ($parts[0] == 'customer'){\n $collection->addAttributeToSelect($parts[1]);\n }\n elseif ($parts[0] == 'customer_address'){\n //check if attribute is already joined\n //again - ugly way of doing it\n //but I cannot access it in a different way\n $reflection = new ReflectionClass($collection);\n $property = $reflection->getProperty('_joinAttributes');\n $property->setAccessible(true);\n $value = $property->getValue($collection);\n if (!isset($value['billing_'.$parts[1]])){\n $collection->joinAttribute('billing_'.$parts[1], 'customer_address/'.$parts[1], 'default_billing', null, 'left');\n }\n }\n }\n }\n }\n }\n return parent::_preparePage();\n }", "public function getCollection()\n {\n /** @var string $collection */\n $collection = config('facematch.recognize.'.$this->getModelConfigArrayKey().'.collection');\n\n return $collection ?? $this->generateDefaultCollection();\n }", "public function getCollection($id);", "public function getCollection() {\n return $this->gateway->find(\n $this->getFilter(),\n $this->order,\n $this->relations,\n $this->pager,\n !$this->excludeRepo\n );\n }", "protected function getExportCollection()\n {\n // crea connessione mongodb\n $connectionString = 'mongodb://' . \n $this->mongoParam['username'] . ':' . $this->mongoParam['password'] . '@' .\n $this->mongoParam['server'] . '/' . $this->mongoParam['db'];\n $connection = new MongoClient($connectionString);\n // apre la collection\n $collection = $connection->selectCollection($this->mongoParam['db'], ChunkExportHandler::EXPORT_COLLECTION);\n \n return $collection;\n }", "public function getAllCollection() \n\n\t{\n\n\t\treturn $this->db->get('tb_collection')->result_array();\n\t}", "public function getItemCollection()\n {\n if($this->itemsCollection === null)\n {\n $this->_prepareData();\n }\n return $this->itemsCollection;\n }" ]
[ "0.7461303", "0.73689127", "0.71155685", "0.70272654", "0.70190823", "0.6976094", "0.68589103", "0.6827481", "0.6764097", "0.67248666", "0.6690725", "0.66770893", "0.66754335", "0.6650373", "0.65609366", "0.65134585", "0.64824253", "0.6472701", "0.6469998", "0.64632803", "0.64482814", "0.64363974", "0.64322394", "0.6417232", "0.6414949", "0.64130795", "0.6393206", "0.63888556", "0.63829535", "0.63829535", "0.63829535", "0.63829535", "0.637776", "0.6373031", "0.6372876", "0.63453144", "0.6314836", "0.6277883", "0.62611485", "0.62491834", "0.6241227", "0.6233777", "0.6207759", "0.6160197", "0.6160015", "0.6143098", "0.61405927", "0.61304593", "0.6090745", "0.60788804", "0.607374", "0.60722697", "0.6070651", "0.6045445", "0.5969014", "0.59677017", "0.59625643", "0.59584814", "0.5949729", "0.5929193", "0.59119254", "0.5903599", "0.58973217", "0.5890688", "0.58686596", "0.58648574", "0.583826", "0.5811551", "0.57930857", "0.57849115", "0.5777178", "0.57681143", "0.57648855", "0.5759539", "0.5751129", "0.5735194", "0.5722005", "0.5715377", "0.56386644", "0.56340724", "0.56231385", "0.56082475", "0.5604275", "0.5595073", "0.55802774", "0.55716926", "0.5560591", "0.55580443", "0.5553577", "0.5548155", "0.5513016", "0.5499819", "0.5499107", "0.549493", "0.5488218", "0.54855704", "0.54849976", "0.5481195", "0.5475693", "0.54693586" ]
0.61154675
48
Prepare versions grid columns
protected function _prepareColumns() { /* $this->addColumn('version_number', array( 'header' => Mage::helper('gri_cms')->__('Version #'), 'width' => 100, 'index' => 'version_number', 'type' => 'options', 'options' => Mage::helper('gri_cms')->getVersionsArray($this->getPage()) )); */ $this->addColumn('label', array( 'header' => Mage::helper('gri_cms')->__('Version Label'), 'index' => 'label', 'type' => 'options', 'options' => $this->getCollection() ->getAsArray('label', 'label') )); $this->addColumn('owner', array( 'header' => Mage::helper('gri_cms')->__('Owner'), 'index' => 'username', 'type' => 'options', 'options' => $this->getCollection()->getUsersArray(false), 'width' => 250 )); $this->addColumn('access_level', array( 'header' => Mage::helper('gri_cms')->__('Access Level'), 'index' => 'access_level', 'type' => 'options', 'width' => 100, 'options' => Mage::helper('gri_cms')->getVersionAccessLevels() )); $this->addColumn('revisions', array( 'header' => Mage::helper('gri_cms')->__('Revisions Qty'), 'index' => 'revisions_count', 'type' => 'number' )); $this->addColumn('created_at', array( 'width' => 150, 'header' => Mage::helper('gri_cms')->__('Created At'), 'index' => 'created_at', 'type' => 'datetime', )); return parent::_prepareColumns(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareColumns()\n {\n $this->addColumn($this->_productIdField, array(\n 'header' => $this->_getHelper()->__('ID'),\n 'sortable' => true,\n 'index' => $this->_productIdField,\n 'width' => 60,\n ));\n\n $this->addColumn('title', array(\n 'header' => $this->_getHelper()->__('Title'),\n 'index' => 'title'\n ));\n\n $this->addColumn('set_title', array(\n 'header' => $this->_getHelper()->__('Attachments Set'),\n 'index' => 'set_title',\n 'width' => 150,\n 'frame_callback' => array($this, 'prepareSetUrl')\n ));\n\n $this->addColumn('file_url', array(\n 'header' => $this->_getHelper()->__('Download'),\n 'index' => 'download',\n 'sortable' => false,\n 'filter' => false,\n 'width' => 150,\n 'frame_callback' => array($this, 'prepareFileUrl')\n ));\n\n $this->addColumn('type', array(\n 'header' => $this->_getHelper()->__('Type'),\n 'index' => 'type',\n 'filter' => false,\n 'width' => 50,\n 'frame_callback' => array($this, 'prepareType')\n ));\n\n $this->addColumn('updated_at', array(\n 'header' => $this->_getHelper()->__('Updated'),\n 'type' => 'date',\n 'index' => 'updated_at',\n 'width' => 150,\n ));\n\n return Mage_Adminhtml_Block_Widget_Grid::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('solutionpartner_id', array(\n 'header' => Mage::helper('solutionpartner')->__('ID'),\n 'align' =>'right',\n 'width' => '50px',\n 'index' => 'solutionpartner_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('solutionpartner')->__('Name'),\n 'align' =>'left',\n 'index' => 'name',\n ));\n\n $this->addColumn('email', array(\n 'header' => Mage::helper('solutionpartner')->__('Email'),\n 'align' =>'left',\n 'index' => 'email',\n 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_customer',\n ));\n\n $this->addColumn('website', array(\n 'header' => Mage::helper('solutionpartner')->__('Website'),\n 'align' => 'left',\n 'index' => 'website',\n 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_website',\n ));\n\n $this->addColumn('country', array(\n 'header' => Mage::helper('solutionpartner')->__('Country'),\n 'align' => 'left',\n 'index' => 'country',\n 'type' => 'options',\n 'options' => Mage::helper('solutionpartner')->getCountryList(),\n ));\n\n $this->addColumn('number_qtys', array(\n 'header' => Mage::helper('solutionpartner')->__('Order Qty'),\n 'align' => 'center',\n 'index' => 'number_qtys',\n 'filter_index' => 'count(order.entity_id)',\n 'type' => 'number',\n 'filter_condition_callback' => array($this, '_filterTotalProductsCallback'),\n // 'renderer' => 'partner/adminhtml_partner_renderer_orderquantity',\n ));\n\n// $this->addColumn('cumulative_amount', array(\n// 'header' => Mage::helper('solutionpartner')->__('Accumulated Revenue'),\n// 'type' => 'price',\n// 'index' => 'cumulative_amount',\n// 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n// ));\n//\n// $this->addColumn('cumulative_amount_history', array(\n// 'header' => Mage::helper('solutionpartner')->__('Revenue History'),\n// 'type' => 'price',\n// 'index' => 'cumulative_amount_history',\n// 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n// ));\n\n $this->addColumn('registered_date', array(\n 'header' => Mage::helper('solutionpartner')->__('Registered Date'),\n 'align' => 'left',\n 'index' => 'registered_date',\n 'type' => 'datetime'\n ));\n\n $this->addColumn('status', array(\n 'header' => Mage::helper('solutionpartner')->__('Status'),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'status',\n 'type' => 'options',\n 'options' => array(\n 1 => 'Enabled',\n 2 => 'Disabled',\n ),\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('solutionpartner')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('solutionpartner')->__('Edit'),\n 'url' => array('base'=> '*/*/edit'),\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('solutionpartner')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('solutionpartner')->__('XML'));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n\n $this->addColumn('attribute_code', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Code'),\n 'sortable'=>true,\n 'index'=>'attribute_code',\n 'width' => '22%'\n ));\n\n $this->addColumn('frontend_label', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Label'),\n 'sortable'=>true,\n 'index'=>'frontend_label',\n 'width' => '22%'\n ));\n\n $this->addColumn('translate_options', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Translate Attribute Options'),\n 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_TranslateOptions',\n 'align' => 'center',\n 'index' => 'frontend_input',\n 'sortable'=> false,\n 'type' => 'options',\n 'options' => [\n 'no' => Mage::helper('catalog')->__('No Options'),\n 'select' => Mage::helper('catalog')->__('Has Options')\n ],\n 'filter_condition_callback' => array($this, '_optionsFilter'),\n 'width' => '22%'\n ));\n\n $this->addColumn('is_visible', array(\n 'header'=>Mage::helper('catalog')->__('Visible'),\n 'sortable'=>true,\n 'index'=>'is_visible_on_front',\n 'type' => 'options',\n 'options' => array(\n '1' => Mage::helper('catalog')->__('Yes'),\n '0' => Mage::helper('catalog')->__('No'),\n ),\n 'align' => 'center',\n 'width' => '22%'\n ));\n\n $this->addColumn('version',\n array(\n 'header'=> Mage::helper('catalog')->__('Translated'),\n 'width' => '70px',\n 'index' => 'version',\n 'type' => 'options',\n 'options' => array(\n 'Translated' => Mage::helper('catalog')->__('Translated'),\n 'Not Translated' => Mage::helper('catalog')->__('Not Translated')\n ),\n 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Translated',\n 'filter_condition_callback' => array($this, '_versionFilter'),\n ));\n\n return $this;\n }", "protected function _prepareColumns()\n {\n $this->addColumn('ID',\n array(\n 'header'=> $this->__('ID'),\n 'width' => '50px',\n 'index' => 'ID'\n )\n );\n\n\n $this->addColumn('browser',\n array(\n 'header'=> $this->__('Browser Data'),\n 'width' => '50px',\n 'index' => 'browser',\n 'renderer' => 'Mage_Osc_Block_Renderers_Browser'\n )\n );\n\n\n $this->addColumn('quote_id',\n array(\n 'header'=> $this->__('ID do Carrinho'),\n 'width' => '50px',\n 'index' => 'quote_id'\n )\n );\n\n\n $this->addColumn('order_id',\n array(\n 'header'=> $this->__('ID do Pedido'),\n 'width' => '50px',\n 'index' => 'order_id',\n 'renderer' => 'Mage_Osc_Block_Renderers_Order'\n )\n );\n\n\n $this->addColumn('customer_id',\n array(\n 'header'=> $this->__('Cliente'),\n 'width' => '50px',\n 'index' => 'customer_id',\n 'renderer' => 'Mage_Osc_Block_Renderers_Customer'\n )\n );\n\n\n $this->addColumn('clickedfo',\n array(\n 'header'=> $this->__('Quantidade de Cliques'),\n 'width' => '50px',\n 'index' => 'clickedfo'\n )\n );\n\n\n $this->addColumn('payment_method',\n array(\n 'header'=> $this->__('Método de Pagamento'),\n 'width' => '50px',\n 'index' => 'payment_method'\n )\n );\n\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n\t{\n\t\t$this->addColumn('id',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('ID'),\n\t\t\t\t\t\t'align' =>'right',\n\t\t\t\t\t\t'width' => '50px',\n\t\t\t\t\t\t'index' => 'id'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\t$this->addColumn('name',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Name'),\n\t\t\t\t\t\t'index' => 'name'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('description',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Description'),\n\t\t\t\t\t\t'index' => 'description'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('percentage',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Percentage'),\n\t\t\t\t\t\t'index' => 'percentage'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\treturn parent::_prepareColumns();\n\t}", "protected function _prepareColumns()\n {\n $this->addColumn('hourbelt_id', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('ID'),\n 'width' => '50px',\n 'index' => 'hourbelt_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Nombre Franja'),\n 'index' => 'name',\n ));\n\n $this->addColumn('start', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Inicio'),\n 'index' => 'start',\n ));\n\n $this->addColumn('finish', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Fin'),\n 'index' => 'finish',\n ));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n if (Mage::helper('route')->canChangeOrderGrid()) {\n\n $this->addColumnAfter('route_is_insured', array(\n 'header'=> Mage::helper('sales')->__('Route Insurance'),\n 'width' => '80px',\n 'index' => 'route_is_insured',\n 'type' => 'options',\n 'renderer' => 'route/adminhtml_widget_grid_column_renderer_insured',\n 'options' => array(\n 1 => 'Yes',\n 0 => 'No',\n ),\n ),'status');\n\n $this->addColumnAfter('fee_amount', array(\n 'header'=> Mage::helper('sales')->__('Route Charge'),\n 'width' => '80px',\n 'filter' => false,\n 'sortable' => false,\n 'type' => 'currency',\n 'index' => 'fee_amount',\n 'currency' => 'order_currency_code',\n ),'route_is_insured');\n }\n parent::_prepareColumns();\n }", "protected function _prepareColumns() {\n /**\n * Add columa 'id','name'.\n */\n $this->addCustomColumn ( 'id' );\n $this->addCustomColumn ( 'name' );\n /**\n * Get the Collection of subscriptiontype\n */\n $subscriptionTitle = Mage::getModel ( 'airhotels/subscriptiontype' )->getCollection ();\n $data = $subscriptionTitle->getData ();\n $substitle = null;\n foreach ( $data as $value ) {\n $i = $value ['id'];\n $substitle [$i] = $value ['title'];\n }\n /**\n * When building a module always utilise the installation and\n * upgrade scripts so that any database additions or changes are automatically modified\n * on module installation.\n * There are a number of built in functions to these modules allowing you to add attributes,\n * create new tables etc.\n *\n * Add Column for subscription_type\n */\n $this->addColumn ( 'subscription_type', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Subscription Type' ),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'subscription_type',\n 'type' => 'options',\n 'options' => $substitle,\n 'renderer' => 'Apptha_Airhotels_Block_Adminhtml_Managesubscriptions_Grid_Renderer_Type' \n ) );\n /**\n * When building a module always utilise the installation and\n * upgrade scripts so that any database additions or changes are automatically modified\n * on module installation.\n * There are a number of built in functions to these modules allowing you to add attributes,\n * create new tables etc.\n *\n * Add Column for action\n */\n $this->addColumn ( 'action', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Action' ),\n 'filter' => false,\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId', \n 'index' => 'stores',\n 'actions' => array (\n array (\n 'caption' => Mage::helper ( 'airhotels' )->__ ( 'Edit' ),\n 'url' => array (\n 'base' => '*/*/edit'\n ),\n 'field' => 'id'\n )\n ),\n 'sortable' => false,\n 'is_system' => true \n ) );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareColumns ();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('increment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'increment_id',\n 'filter_index' => 'main_table.increment_id',\n 'type' => 'text',\n ));\n $this->addColumn('shipment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'entity_id',\n 'filter_index' => 'main_table.entity_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('canpar_shipment_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Shipment #'),\n 'index' => 'canpar_shipment_id',\n 'filter_index' => 'ch_shipment.shipment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('manifest_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Manifest #'),\n 'index' => 'manifest_id',\n 'renderer' => 'canparmodule/adminhtml_canparshipment_renderer_manifestId',\n 'filter_index' => 'ch_shipment.manifest_id',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Date Shipped'),\n 'index' => 'created_at',\n 'filter_index' =>'main_table.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('order_increment_id', array(\n 'header' => Mage::helper('sales')->__('Order #'),\n 'index' => 'order_increment_id',\n 'filter_index'=> 'o.increment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('order_created_date', array(\n 'header' => Mage::helper('sales')->__('Order Date'),\n 'index' => 'order_created_date',\n 'filter_index' =>'o.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('total_qty', array(\n 'header' => Mage::helper('sales')->__('Total Qty'),\n 'index' => 'total_qty',\n 'type' => 'number',\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('sales')->__('Action'),\n 'width' => '50px',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('sales')->__('View'),\n 'url' => array('base'=>'*/sales_shipment/view'),\n 'field' => 'shipment_id'\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'is_system' => true\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));\n $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n \t\n \t/*$this->addColumn('module',\n array(\n 'header' => 'SugarCRM Module Name',\n 'align' =>'left',\n 'index' => 'module',\n \t ));*/\n\t\t\n\t\t$this->addColumn('fields', array(\n 'header' => 'SugarCRM Field Name',\n 'align' =>'left',\n 'index' => 'wp_meta_label',\n \t \t ));\n\t\t\n\t\t/*$this->addColumn('fieldtype', array(\n 'header' => 'Field Type',\n 'align' =>'left',\n 'index' => 'field_type',\n \t\t ));*/\n\t\t\t\t \n\t\t$this->addColumn(\"magfield\", array(\n\t\t\t\t\t\"header\" \t=> Mage::helper(\"contact\")->__(\"Magento Field Names\"),\n\t\t\t\t\t'filter' => false,\n\t\t\t\t\t'sortable' => false,\n\t\t\t\t\t'align' =>'left',\n\t\t\t\t\t'width'\t\t=> '45%',\n\t\t\t\t\t'renderer' \t=> 'Offshoreevolution_Contact_Block_Adminhtml_Synctable_Grid_Renderer_Filter'\n\t\t\t\t )); \n\t\t\n\t\t$this->addColumn(\"actionButton\", array(\n\t\t\t\t\t\"header\" \t=> Mage::helper(\"contact\")->__(\"Action\"),\n\t\t\t\t\t'filter' => false,\n\t\t\t\t\t'sortable' => false,\n\t\t\t\t\t'align' =>'center',\n\t\t\t\t\t'width'\t\t=> '80',\n\t\t\t\t\t'renderer' \t=> 'Offshoreevolution_Contact_Block_Adminhtml_Synctable_Grid_Renderer_Button'\n\t\t\t\t )); \n\t\t//$this->addColumn('action',\n//\t\t\t\t\tarray(\n//\t\t\t\t\t'header' => Mage::helper('sugarcrm')->__('Action'),\n//\t\t\t\t\t'width' => '100',\n//\t\t\t\t\t'type' => 'action',\n//\t\t\t\t\t'getter' => 'getId',\n//\t\t\t\t\t'index' => 'pid',\n//\t\t\t\t\t'actions' => array(\n//\t\t\t\t\t\t\tarray(\n//\t\t\t\t\t\t\t\t\t'caption' => Mage::helper('sugarcrm')->__('Sync'),\n//\t\t\t\t\t\t\t\t\t'class'\t\t=> 'syncAction',\n//\t\t\t\t\t\t\t\t\t//'url' => array('base'=> '*/*/edit'),\n//\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t'field' => 'id'\n//\t\t\t\t\t\t\t)\n//\t\t\t\t\t),\n//\t\t\t\t\t'filter' => false,\n//\t\t\t\t\t'sortable' => false,\n//\t\t\t\t\t'index' => 'stores',\n//\t\t\t\t\t'is_system' => true,\n//\t\t));\n//\t\t$this->addColumn('id',\n// array(\n// 'header' => 'ID',\n// 'align' =>'right',\n// 'width' => '50px',\n// 'index' => 'pid',\n//\t\t\t\t\t'column_css_class'=>'no-display',\n// \t\t\t\t\t'header_css_class'=>'no-display'\n// \t ));\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('ticket_id', array(\n 'header' => Mage::helper('inchoo_supportticket')->__('ID'),\n 'width' => '80px',\n 'index' => 'ticket_id'\n ));\n $this->addColumn('subject', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Subject'),\n 'type'=> 'text',\n 'width' => '300px',\n 'index' => 'subject',\n 'escape' => true\n ));\n $this->addColumn('content', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Content'),\n 'type' => 'text',\n 'index' => 'content',\n 'escape' => true\n ));\n $this->addColumn('status', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Status'),\n 'type'=> 'text',\n 'width' => '200px',\n 'index' => 'status',\n 'escape' => true\n ));\n $this->addColumn('created_at', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Created at'),\n 'type' => 'text',\n 'width' => '170px',\n 'index' => 'created_at',\n ));\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n\n $this->addColumn(\n 'entity_id',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Id'),\n 'index' => 'entity_id',\n 'type' => 'number'\n )\n );\n\n $this->addColumn(\n 'in_docwisements',\n array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_docwisements',\n 'values'=> $this->_getSelectedDocwisements(),\n 'align' => 'center',\n 'index' => 'entity_id'\n )\n );\n\n $this->addColumn(\n 'doc_name',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Document Name'),\n 'align' => 'left',\n 'index' => 'doc_name',\n )\n );\n\n\n $this->addColumn(\n 'doc_type',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Document Type'),\n 'index' => 'doc_type',\n 'type' => 'options',\n 'options' => Mage::helper('bs_docwise')->convertOptions(\n Mage::getModel('bs_docwise/docwisement_attribute_source_doctype')->getAllOptions(false)\n )\n\n )\n );\n $this->addColumn(\n 'doc_date',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Date'),\n 'index' => 'doc_date',\n 'type'=> 'date',\n\n )\n );\n\n $this->addColumn(\n 'download',\n array(\n 'header' => Mage::helper('bs_docwise')->__('View/Download'),\n 'type' =>'text',\n 'renderer' => 'bs_docwise/adminhtml_helper_column_renderer_download',\n\n 'filter' => false,\n 'sortable' => false,\n )\n );\n\n $this->addColumn(\n 'position',\n array(\n 'header' => Mage::helper('catalog')->__('Position'),\n 'name' => 'position',\n 'width' => 60,\n 'type' => 'number',\n 'validate_class' => 'validate-number',\n 'index' => 'position',\n 'editable' => true,\n )\n );\n $this->addColumn(\n 'action',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('bs_docwise')->__('Edit'),\n 'url' => array('base'=> '*/docwise_docwisement/edit'),\n 'field' => 'id'\n )\n ),\n 'filter' => false,\n 'is_system' => true,\n 'sortable' => false,\n )\n );\n }", "protected function _prepareColumns()\n {\n $this->addColumn(\n 'in_worksheets',\n array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_worksheets',\n 'values'=> $this->_getSelectedWorksheets(),\n 'align' => 'center',\n 'index' => 'entity_id'\n )\n );\n $this->addColumn(\n 'ws_name',\n array(\n 'header' => Mage::helper('bs_worksheet')->__('Worksheet Name'),\n 'align' => 'left',\n 'index' => 'ws_name',\n 'renderer' => 'bs_worksheet/adminhtml_helper_column_renderer_relation',\n 'params' => array(\n 'id' => 'getId'\n ),\n 'base_link' => 'adminhtml/worksheet_worksheet/edit',\n )\n );\n $this->addColumn(\n 'ws_code',\n array(\n 'header' => Mage::helper('bs_worksheet')->__('Worksheet Code'),\n 'align' => 'left',\n 'index' => 'ws_code',\n )\n );\n $this->addColumn(\n 'position',\n array(\n 'header' => Mage::helper('bs_worksheet')->__('Position'),\n 'name' => 'position',\n 'width' => 60,\n 'type' => 'number',\n 'validate_class' => 'validate-number',\n 'index' => 'position',\n 'editable' => true,\n )\n );\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n if (!$this->getCategory()->getProductsReadonly()) {\n $this->addColumn('in_category', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_category',\n 'values' => $this->_getSelectedProducts(),\n 'align' => 'center',\n 'index' => 'entity_id',\n 'is_system' => true,\n ));\n }\n $this->addColumn('entity_id', array(\n 'header' => Mage::helper('catalog')->__('ID'),\n 'sortable' => true,\n 'width' => '60',\n 'index' => 'entity_id'\n ));\n $this->addColumn('name', array(\n 'header' => Mage::helper('catalog')->__('Name'),\n 'index' => 'name'\n ));\n $this->addColumn('sku', array(\n 'header' => Mage::helper('catalog')->__('SKU'),\n 'width' => '80',\n 'index' => 'sku'\n ));\n $this->addColumn('price', array(\n 'header' => Mage::helper('catalog')->__('Price'),\n 'type' => 'currency',\n 'width' => '1',\n 'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),\n 'index' => 'price'\n ));\n $this->addColumn('position', array(\n 'header' => Mage::helper('catalog')->__('Position'),\n 'width' => '1',\n 'type' => 'number',\n 'index' => 'position',\n 'editable' => !$this->getCategory()->getProductsReadonly(),\n //'renderer' => 'adminhtml/widget_grid_column_renderer_input'\n ));\n\n //Add export type for CSV\n $this->addExportType('*/*/exportCsv', Mage::helper('adminhtml')->__('CSV'));\n }", "protected function _prepareColumns()\n {\n $this->addColumn('grid_checkbox', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'index' => 'bannerslider_id',\n //'name' => 'grid_checkbox',\n 'align' => 'center',\n 'width' => '50px',\n 'values' => $this->_selectedId(),\n ));\n\n /*$this->addColumn('widget_banner_id', array(\n 'header' => Mage::helper('campaign')->__('ID'),\n 'align' =>'right',\n 'width' => '50px',\n 'index' => 'widget_banner_id',\n ));*/\n\n $this->addColumn('title', array(\n 'header' => Mage::helper('campaign')->__('Banner title'),\n 'align' => 'left',\n 'width' => '220px',\n 'index' => 'title',\n //'renderer' => 'Magestore_Campaign_Block_Adminhtml_Banner_Grid_Renderer_BannerType',\n //'filter' => false,\n ));\n\n /*$this->addColumn('in_widgets', array(\n 'header' => Mage::helper('campaign')->__('In Widgets'),\n 'index' => 'widget_selected_ids',\n //'width' => '220px',\n 'renderer' => 'Magestore_Campaign_Block_Adminhtml_Banner_Grid_Renderer_InWidgets',\n 'filter_condition_callback' => array($this, '_filterInWidgets'),\n ));*/\n\n $this->addColumn('in_campaign', array(\n 'header' => Mage::helper('campaign')->__('Added to Campaign'),\n 'index' => 'campaign_name',\n 'width' => '220px',\n 'filter_condition_callback' => array($this, '_filterInCampaign'),\n ));\n\n $this->addColumn('status', array(\n 'header' => Mage::helper('campaign')->__('Status'),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'status',\n 'filter_index'=>'main_table.status',\n 'type' => 'options',\n 'options' => Magestore_Campaign_Model_Sliderstatus::getOptionArray(),\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('campaign')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('campaign')->__('Edit'),\n 'url' => array('base'=> '*/adminhtml_bannerslider/edit'),\n //'onclick' => 'return saveAndContinueEdit();',\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addColumn('action_delete',\n array(\n 'header' => Mage::helper('campaign')->__('Disable Banner'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('campaign')->__('Disable'),\n 'url' => array('base'=> '*/adminhtml_bannerslider/disableSlider'),\n //'onclick' => 'return saveAndContinueEdit();',\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('campaign')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('campaign')->__('XML'));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns() {\n $video = Mage::getModel('vidtest/video');\n\n $this->addColumn('video_id', array(\n 'header' => $this->__('Id'),\n 'align' => 'left',\n 'index' => 'video_id',\n 'width' => 50,\n 'type' => 'number'\n ));\n\n if (!Mage::app()->isSingleStoreMode() && !$this->getProduct()->getStoreId()) {\n $this->addColumn('stores', array(\n 'header' => $this->__('Store View'),\n 'index' => 'stores',\n 'type' => 'store',\n 'store_all' => true,\n 'store_view' => true,\n 'sortable' => false,\n 'filter_condition_callback' => array($this, '_filterStoreCondition'),\n ));\n }\n\n $this->addColumn('title', array(\n 'header' => $this->__('Title'),\n 'index' => 'title',\n 'type' => 'text',\n ));\n\n $this->addColumn('author_name', array(\n 'header' => $this->__('Author Name'),\n 'index' => 'author_name',\n 'type' => 'text',\n ));\n\n $this->addColumn('author_email', array(\n 'header' => $this->__('Author Email'),\n 'index' => 'author_email',\n 'type' => 'text',\n ));\n\n $this->addColumn('rate', array(\n 'header' => $this->__('Rate'),\n 'index' => 'rate',\n 'type' => 'number',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Date'),\n 'index' => 'created_at',\n 'type' => 'datetime',\n 'width' => '100px',\n ));\n\n $this->addColumn('status', array(\n 'header' => $this->__('Status'),\n 'align' => 'left',\n 'width' => '160px',\n 'index' => 'status',\n 'type' => 'options',\n 'options' => $video->getStatusesArray(),\n ));\n\n\n $this->addColumn('action', array(\n 'header' => $this->__('Action'),\n 'width' => '80',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => $this->__('Edit'),\n 'url' => array('base' => 'vidtest_admin/admin_video/edit'),\n 'field' => 'id',\n ),\n array(\n 'caption' => $this->__('Enable'),\n 'url' => array('base' => 'vidtest_admin/admin_video/enable'),\n 'field' => 'id',\n ),\n array(\n 'caption' => $this->__('Disable'),\n 'url' => array('base' => 'vidtest_admin/admin_video/disable'),\n 'field' => 'id',\n ),\n array(\n 'caption' => $this->__('Delete testimonial'),\n 'url' => array('base' => 'vidtest_admin/admin_video/delete'),\n 'field' => 'id',\n 'confirm' => $this->__('Are you sure you want to delete testimonial?'),\n ),\n array(\n 'caption' => $this->__('Delete testimonial and video source'),\n 'url' => array('base' => 'vidtest_admin/admin_video/fulldelete'),\n 'field' => 'id',\n 'confirm' => $this->__('Are you sure you want to delete testimonial and video source?'),\n ),\n ),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('in_products', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'field_name' => 'in_products',\n 'values' => $this->_getSelectedProducts(),\n 'align' => 'center',\n 'index' => 'entity_id'\n ));\n\n /*$this->addColumn('entity_id',\n array(\n 'header'=> Mage::helper('catalog')->__('ID'),\n 'width' => 50,\n 'sortable' => true,\n 'type' => 'number',\n 'index' => 'entity_id',\n ));*/\n $this->addColumn('product_name',\n array(\n 'header'=> Mage::helper('catalog')->__('Name'),\n 'index' => 'name',\n ));\n\n $this->addColumn('type',\n array(\n 'header' => Mage::helper('catalog')->__('Type'),\n 'width' => 100,\n 'index' => 'type_id',\n 'type' => 'options',\n 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),\n ));\n\n $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')\n ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())\n ->load()\n ->toOptionHash();\n\n $this->addColumn('set_name',\n array(\n 'header' => Mage::helper('catalog')->__('Attrib. Set Name'),\n 'width' => 100,\n 'index' => 'attribute_set_id',\n 'type' => 'options',\n 'options' => $sets,\n ));\n\n $this->addColumn('sku',\n array(\n 'header'=> Mage::helper('catalog')->__('SKU'),\n 'width' => 80,\n 'index' => 'sku',\n ));\n\n $this->addColumn('price',\n array(\n 'header' => Mage::helper('catalog')->__('Price'),\n 'type' => 'price',\n 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n 'index' => 'price',\n ));\n\n $this->addColumn('visibility',\n array(\n 'header' => Mage::helper('catalog')->__('Visibility'),\n 'width' => 100,\n 'index' => 'visibility',\n 'type' => 'options',\n 'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),\n ));\n\n $this->addColumn('status',\n array(\n 'header' => Mage::helper('catalog')->__('Status'),\n 'width' => 70,\n 'index' => 'status',\n 'type' => 'options',\n 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),\n ));\n\n $this->addColumn('source_store',\n array(\n 'header'=> Mage::helper('catalog')->__('Source Store'),\n 'width' => '100px',\n 'sortable' => false,\n 'index' => 'source_store_view',\n 'type' => 'options',\n 'options' => Mage::getModel('unl_core/store_source_filter')->toOptionArray(),\n ));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n\t{\n\t\t$this->addColumn('id',\n\t\t\tarray(\n\t\t\t\t'header'=> $this->__('ID'),\n\t\t\t\t'align' =>'right',\n\t\t\t\t'width' => '50px',\n\t\t\t\t'index' => 'id'\n\t\t\t)\n\t\t);\n\n\t\t$this->addColumn('product_id',\n\t\t\tarray(\n\t\t\t\t'header'=> $this->__('Product ID'),\n\t\t\t\t'index' => 'product_id'\n\t\t\t)\n\t\t);\n\n\t\t$this->addColumn('increment_id',\n\t\t\tarray(\n\t\t\t\t'header'=> $this->__('Order ID'),\n\t\t\t\t'index' => 'increment_id'\n\t\t\t)\n\t\t);\n\n $this->addColumn('sfo.order_id',\n array(\n 'header' => Mage::helper('core')->__('View Order'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getOrderId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('core')->__('View'),\n 'url' => array('base'=> 'adminhtml/sales_order/view'),\n 'field' => 'order_id',\n 'target' => '_blank'\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true\n )\n );\n\n $this->addColumn('email',\n array(\n 'header'=> $this->__('Customer Email'),\n 'index' => 'email'\n )\n );\n\n $statusOptions = array(\n '0' => 'Working',\n '1' => 'Requested',\n '2' => 'Collected'\n );\n $this->addColumn('status',\n array(\n 'header'=> $this->__('Status (WORKING=0,REQUESTED=1,COLLECTED=2)'),\n 'index' => 'status',\n 'filter_index' => '`main_table`.`status`',\n 'type' => 'options',\n 'options' => $statusOptions,\n )\n );\n\n $this->addColumn('collect_date',\n array(\n 'header'=> $this->__('Collect Date'),\n 'index' => 'collect_date'\n )\n );\n\n\t\treturn parent::_prepareColumns();\n\t}", "protected function _prepareColumns(){\r\n $this->addColumn('in_brands', array(\r\n 'header_css_class' => 'a-center',\r\n 'type' => 'checkbox',\r\n 'name' => 'in_brands',\r\n 'values'=> $this->_getSelectedBrands(),\r\n 'align' => 'center',\r\n 'index' => 'entity_id'\r\n ));\r\n $this->addColumn('title', array(\r\n 'header'=> Mage::helper('zozoconcepts_brands')->__('Title'),\r\n 'align' => 'left',\r\n 'index' => 'title',\r\n ));\r\n $this->addColumn('position', array(\r\n 'header' => Mage::helper('zozoconcepts_brands')->__('Position'),\r\n 'name' => 'position',\r\n 'width' => 60,\r\n 'type' => 'number',\r\n 'validate_class'=> 'validate-number',\r\n 'index' => 'position',\r\n 'editable' => true,\r\n ));\r\n return parent::_prepareColumns();\r\n }", "protected function _prepareColumns() {\r\n $this->addColumn('entity_id', array(\r\n 'header' => Mage::helper('catalog')->__('ID'),\r\n 'width' => '50px',\r\n 'index' => 'entity_id',\r\n )); //Product Id\r\n $this->addColumn('name', array(\r\n 'header' => Mage::helper('catalog')->__('Name'),\r\n 'index' => 'name',\r\n )); //Product name\r\n\r\n $store = $this->_getStore();\r\n if ($store->getId()) {\r\n $this->addColumn('custom_name', array(\r\n 'header' => Mage::helper('catalog')->__('Name in %s', $store->getName()),\r\n 'index' => 'custom_name',\r\n ));\r\n }//Store Information \r\n\r\n $this->addColumn('type', array(\r\n 'header' => Mage::helper('catalog')->__('Type'),\r\n 'width' => '60px',\r\n 'index' => 'type_id',\r\n 'type' => 'options',\r\n 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),\r\n )); //Product Type\r\n\r\n $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')\r\n ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())\r\n ->load()\r\n ->toOptionHash();\r\n\r\n $this->addColumn('sku', array(\r\n 'header' => Mage::helper('catalog')->__('SKU'),\r\n 'width' => '80px',\r\n 'index' => 'sku',\r\n )); //Product unique id SKU\r\n\r\n $store = $this->_getStore();\r\n $this->addColumn('price', array(\r\n 'header' => Mage::helper('catalog')->__('Price'),\r\n 'type' => 'price',\r\n 'currency_code' => $store->getBaseCurrency()->getCode(),\r\n 'index' => 'price',\r\n )); //Product Price\r\n\r\n\r\n\r\n $this->addColumn('reqcoupon_status', array(\r\n 'header' => Mage::helper('catalog')->__('Request Coupon Status'),\r\n 'width' => '70px',\r\n 'index' => 'reqcoupon_status',\r\n 'type' => 'options',\r\n 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),\r\n )); //Status of the Product \r\n\r\n /**\r\n * To export the Grid date in XML / CSV file\r\n */\r\n $this->addExportType('*/*/exportCsv', Mage::helper('reqforcoupon')->__('CSV'));\r\n $this->addExportType('*/*/exportXml', Mage::helper('reqforcoupon')->__('XML'));\r\n\r\n return parent::_prepareColumns();\r\n }", "protected function _prepareColumns()\n {\n $this->addColumn('recipetype_id', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('ID'),\n 'width' => '50px',\n 'index' => 'recipetype_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Nombre Clasificación'),\n 'index' => 'name',\n ));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\r\n {\r\n\t\t$this->addColumn('brand_id', array(\r\n\t\t\t'header' => Mage::helper('dynamic_brand')->__('ID'),\r\n\t\t\t'index' => 'brand_id',\r\n\t\t));\r\n\t //echo \"<pre>\";print_r($this->getOptionArray());die;\r\n /*$this->addColumn('brand_position', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Position'),\r\n 'align' => 'right',\r\n 'width' => '50px',\r\n 'index' => 'brand_position',\r\n 'type' => 'number',\r\n ));*/\r\n\r\n $this->addColumn('brand_name', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Brand Name'),\r\n 'index' => 'brand_name',\r\n ));\r\n $this->addColumn('sort_order', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Sort Order'),\r\n 'align' => 'left',\r\n 'index' => 'sort_order',\r\n ));\r\n $this->addColumn('url', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('URL'),\r\n 'index' => 'url',\r\n ));\r\n $this->addColumn(\"image\", array(\r\n \"header\" => Mage::helper(\"dynamic_brand\")->__(\"Image\"),\r\n \"index\" => \"image\",\r\n \"renderer\" =>\"Dynamic_Brand_Block_Adminhtml_Renderer_Image\",\r\n ));\r\n\r\n \r\n /*$this->addColumn('brand_title', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Title'),\r\n 'align' => 'left',\r\n 'index' => 'brand_title',\r\n ));\r\n\t\t\r\n \r\n\r\n $this->addColumn('brand_text', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Text'),\r\n 'align' => 'left',\r\n 'index' => 'brand_text',\r\n ));\r\n $this->addColumn('store_id', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Store View'),\r\n 'index' => 'store_id',\r\n 'type' => 'store',\r\n 'store_all' => true,\r\n 'store_view' => true,\r\n 'sortable' => true,\r\n //'filter_condition_callback' => array($this, '_filterStoreCondition'),\r\n\r\n ));*/\r\n \r\n\t\t/*\r\n $this->addColumn('brand_status', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Status'),\r\n 'align' => 'center',\r\n\t\t\t'type' \t\t=> 'options',\r\n 'index' => 'brand_status',\r\n\t\t\t'options' => array(\r\n\t\t\t\t1 => 'Enabled',\r\n\t\t\t\t2 => 'Disabled',\r\n\t\t\t),\r\n ));*/\r\n\r\n /* $fieldset->addField('category', 'multiselect',\r\n array(\r\n 'label' => Mage::helper('dynamic_brand')->__('Category'),\r\n 'class' => 'required-entry',\r\n 'required' => true,\r\n 'values' => $this->getOptionArray(),\r\n 'name' => 'category',\r\n\r\n ));*/\r\n $this->addColumn('category', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Category'),\r\n 'width' => '180px',\r\n 'index' => 'category',\r\n \"renderer\" =>\"Dynamic_Brand_Block_Adminhtml_Renderer_Category\",\r\n\r\n ));\r\n\t\t$this->addColumn('action',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'header' => Mage::helper('dynamic_brand')->__('Action'),\r\n\t\t\t\t\t'width' => '80',\r\n\t\t\t\t\t'type' => 'action',\r\n\t\t\t\t\t'getter' => 'getId',\r\n\t\t\t\t\t'actions' => array(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'caption' => Mage::helper('dynamic_brand')->__('Edit'),\r\n\t\t\t\t\t\t\t'url' => array('base' => '*/*/edit'),\r\n\t\t\t\t\t\t\t'field' => 'id'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'filter' => false,\r\n\t\t\t\t\t'sortable' => false,\r\n\t\t\t\t\t'index' => 'stores',\r\n\t\t\t\t\t'is_system' => true,\r\n\t\t));\r\n\t\t$this->addExportType('*/*/exportCsv', Mage::helper('dynamic_brand')->__('CSV'));\r\n\t\t$this->addExportType('*/*/exportXml', Mage::helper('dynamic_brand')->__('XML'));\r\n\t\t\r\n return parent::_prepareColumns();\r\n }", "protected function _prepareColumns() {\n /**\n * Add columns\n * \n * @column id\n * @column country_code\n * @column currency_code\n * @column editaction\n * @column deleteaction\n */\n $this->addColumn ( 'id', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Id' ),'align' => 'left','index' => 'id' \n ) );\n /**\n * Add new column for country code\n */\n $this->addColumn ( 'country_code', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Country' ), 'align' => 'left',\n 'index' => 'country_code', 'renderer' => 'Apptha_Airhotels_Block_Adminhtml_Renderer_Countrylist') );\n /**\n * Add new column for currency_code\n */\n $this->addColumn ( 'currency_code', array ( 'header' => Mage::helper ( 'airhotels' )->__ ( 'Currency' ), 'align' => 'left', 'index' => 'country_code','renderer' => 'Apptha_Airhotels_Block_Adminhtml_Renderer_Currencylist') );\n /**\n * Add new column for created_at\n */\n $this->addColumn ( 'created_at', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Created' ),\n 'align' => 'left','index' => 'created_at', 'type' => 'datetime' ) );\n /**\n * Add new column for field_name\n */\n $this->addColumn ( 'field_name', array ( 'header' => Mage::helper ( 'airhotels' )->__ ( 'Field Name' ), 'align' => 'left', 'index' => 'field_name' ) );\n /**\n * Add new column for field_title\n */\n $this->addColumn ( 'field_title', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Field Title' ),\n 'align' => 'left','index' => 'field_title' \n ) );\n /**\n * Add new column for editaction\n */\n $this->addColumn ( 'editaction', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Edit Action' ), 'width' => '50px','type' => 'action', 'getter' => 'getId', 'actions' => array (\n array (\n 'caption' => Mage::helper ( 'airhotels' )->__ ( 'Edit' ), 'url' => array ( 'base' => 'airhotels/adminhtml_managebankdetails/edit/', 'params' => array (\n 'store' => $this->getRequest ()->getParam ( 'store' ) \n ) \n ),\n 'field' => 'id' \n ) \n ),\n 'filter' => false, 'sortable' => false,'index' => 'stores' \n ) );\n /**\n * Add new column form delete action\n */\n $this->addColumn ( 'deleteaction', array ( 'header' => Mage::helper ( 'airhotels' )->__ ( 'Delete Action' ), 'width' => '50px',\n 'type' => 'action','getter' => 'getId', 'actions' => array ( array ( 'caption' => Mage::helper ( 'airhotels' )->__ ( 'Delete' ), 'url' => array ( 'base' => 'airhotels/adminhtml_managebankdetails/delete/', 'params' => array ('store' => $this->getRequest ()->getParam ( 'store' ) ) ),'field' => 'id','confirm' => Mage::helper ( 'airhotels' )->__ ( 'Are you sure?' ) ) ), 'filter' => false, 'sortable' => false, 'index' => 'stores' ) );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareColumns ();\n }", "protected function _prepareColumns(): Product\r\n {\r\n parent::_prepareColumns();\r\n $this->addColumnAfter(\r\n 'image',\r\n [\r\n 'header' => __('Thumbnail'),\r\n 'index' => 'image',\r\n 'renderer' => Image::class,\r\n 'filter' => false,\r\n 'sortable' => false,\r\n 'column_css_class' => 'data-grid-thumbnail-cell'\r\n ],\r\n 'entity_id'\r\n );\r\n $this->addColumnAfter(\r\n 'url_key',\r\n [\r\n 'header' => __('Product Url'),\r\n 'index' => 'url_key' \r\n ],\r\n 'entity_id'\r\n );\r\n $this->addColumnAfter(\r\n 'meta_title',\r\n [\r\n 'header' => __('Meta Title'),\r\n 'index' => 'meta_title' \r\n ],\r\n 'entity_id'\r\n );\r\n $this->sortColumnsByOrder();\r\n \r\n return $this;\r\n }", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n $this->addColumn('attribute_code', array(\n 'header' => Mage::helper('eav')->__('Attribute Code'),\n 'sortable' => true,\n 'index' => 'attribute_code'\n ));\n\n $this->addColumn('frontend_label', array(\n 'header' => Mage::helper('eav')->__('Attribute Label'),\n 'sortable' => true,\n 'index' => 'frontend_label'\n ));\n }", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n $this->addColumnAfter(\n 'is_visible',\n [\n 'header' => __('Visible'),\n 'sortable' => true,\n 'index' => 'is_visible_on_front',\n 'type' => 'options',\n 'options' => ['1' => __('Yes'), '0' => __('No')],\n 'align' => 'center'\n ],\n 'frontend_label'\n );\n\n $this->addColumnAfter(\n 'is_global',\n [\n 'header' => __('Scope'),\n 'sortable' => true,\n 'index' => 'is_global',\n 'type' => 'options',\n 'options' => [\n \\Magento\\Eav\\Model\\Entity\\Attribute\\ScopedAttributeInterface::SCOPE_STORE => __('Store View'),\n \\Magento\\Eav\\Model\\Entity\\Attribute\\ScopedAttributeInterface::SCOPE_WEBSITE => __('Web Site'),\n \\Magento\\Eav\\Model\\Entity\\Attribute\\ScopedAttributeInterface::SCOPE_GLOBAL => __('Global'),\n ],\n 'align' => 'center'\n ],\n 'is_visible'\n );\n\n $this->addColumn(\n 'is_searchable',\n [\n 'header' => __('Searchable'),\n 'sortable' => true,\n 'index' => 'is_searchable',\n 'type' => 'options',\n 'options' => ['1' => __('Yes'), '0' => __('No')],\n 'align' => 'center'\n ]\n\n );\n\n $this->_eventManager->dispatch('product_attribute_grid_build', ['grid' => $this]);\n\n $this->addColumnAfter(\n 'is_comparable',\n [\n 'header' => __('Comparable'),\n 'sortable' => true,\n 'index' => 'is_comparable',\n 'type' => 'options',\n 'options' => ['1' => __('Yes'), '0' => __('No')],\n 'align' => 'center'\n ],\n 'is_filterable'\n );\n\n return $this;\n }", "protected function _prepareColumns()\n\t{\n\t\tparent::_prepareColumns();\n\t\t\n\t\t// remove old columns\n\t\t$this->removeColumn('gender'); // futureproof\n $this->removeColumn('lastname');\n $this->removeColumn('firstname');\n\t\t\n\t\t// add new columns\n\t\t$this->addColumnAfter('gender', array(\n\t\t\t'header' => Mage::helper('newsletter')->__('Gender'),\n 'index' => 'customer_gender',\n 'type' => 'options',\n 'options' => array(\n 1 => Mage::helper('newsletter')->__('Mr'),\n 2 => Mage::helper('newsletter')->__('Ms/Mrs')\n ),\n\t\t\t'renderer'\t=> 'Mediarocks_NewsletterExtended_Adminhtml_Block_Newsletter_Subscriber_Grid_Renderer_Gender'\n\t\t), 'type');\n\t\t\n\t\t$this->addColumnAfter('firstname', array(\n\t\t\t'header' => Mage::helper('newsletter')->__('Firstname'),\n 'index' => 'customer_firstname',\n\t\t\t'renderer'\t=> 'Mediarocks_NewsletterExtended_Adminhtml_Block_Newsletter_Subscriber_Grid_Renderer_Firstname'\n\t\t), 'gender');\n\t\t\n\t\t$this->addColumnAfter('lastname', array(\n\t\t\t'header' => Mage::helper('newsletter')->__('Lastname'),\n 'index' => 'customer_lastname',\n\t\t\t'renderer'\t=> 'Mediarocks_NewsletterExtended_Adminhtml_Block_Newsletter_Subscriber_Grid_Renderer_Lastname'\n\t\t), 'firstname');\n\n\t\t// manually sort again, that our custom order works\n\t\t$this->sortColumnsByOrder();\n\t\t\n return $this;\n }", "protected function _prepareColumns()\r\n {\r\n $this->addColumn('itemid', array(\r\n 'header' => Mage::helper('items')->__('Item ID'),\r\n 'align' =>'left',\r\n 'index' => 'itemid',\r\n ));\r\n $this->addColumn('question_id', array(\r\n 'header' => Mage::helper('items')->__('Question ID'),\r\n 'align' =>'left',\r\n 'index' => 'question_id',\r\n ));\r\n $this->addColumn('question', array(\r\n 'header' => Mage::helper('items')->__('Question'),\r\n 'align' =>'left',\r\n 'index' => 'question',\r\n ));\t\r\n $this->addColumn('question_date', array(\r\n 'header' => Mage::helper('items')->__('Question Date'),\r\n 'align' =>'left',\r\n\t\t 'width' => '20px',\r\n 'index' => 'question_date',\r\n ));\r\n /*$this->addColumn('buyer', array(\r\n 'header' => Mage::helper('items')->__('Buyer'),\r\n 'align' =>'left',\r\n 'index' => 'buyer',\r\n ));*/\r\n \r\n $this->addColumn('answer', array(\r\n 'header' => Mage::helper('items')->__('Answer'),\r\n 'align' =>'left',\r\n 'index' => 'answer',\r\n ));\r\n /*$this->addColumn('created_at', array(\r\n 'header' => Mage::helper('items')->__('Created at'),\r\n 'align' =>'left',\r\n 'index' => 'created_at',\r\n )); */\r\n\r\n $this->addColumn('status', array(\r\n 'header' => Mage::helper('items')->__('Status'),\r\n 'align' => 'left',\r\n 'width' => '80px',\r\n 'index' => 'status',\r\n 'type' => 'options',\r\n 'options' => array(\r\n 'ANSWERED' => 'ANSWERED',\r\n 'UNANSWERED' => 'UNANSWERED',\r\n ),\r\n ));\r\n\t \r\n\t $this->setFilterVisibility(false);\r\n $this->setPagerVisibility(false); \r\n\treturn parent::_prepareColumns();\r\n }", "function ou_df_grid_col($variables) {\n $cols = $variables['element']['#grid_cols'];\n return \"<article class=\\\"int-grid{$cols}\\\">\" . $variables['element']['#children'] . '</article>';\n}", "protected function _prepareColumns() {\n $this->addColumn('period', array(\n 'header' => Mage::helper('webpos')->__('Period'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'index' => 'period',\n 'width' => '100px',\n ));\n $this->addColumn('user', array(\n 'header' => Mage::helper('webpos')->__('User'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'index' => 'user',\n 'width' => '200px',\n ));\n $this->addColumn('totals_sales', array(\n 'header' => Mage::helper('webpos')->__('Sales Total'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'width' => '100px',\n 'index' => 'totals_sales',\n 'type' => 'price',\n 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n ));\n $this->addExportType('*/*/exportCsv', Mage::helper('webpos')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('webpos')->__('XML'));\n\n return parent::_prepareColumns();\n }", "function getColumnsDefinition($showPlatforms, $statusLbl, $labels, $platforms)\n{\n $colDef = array();\n\n $colDef[] = array('title_key' => 'test_plan', 'width' => 60, 'type' => 'text', 'sortType' => 'asText',\n 'filter' => 'string');\n\n $colDef[] = array('title_key' => 'build', 'width' => 60, 'type' => 'text', 'sortType' => 'asText',\n 'filter' => 'string');\n \n if ($showPlatforms)\n {\n $colDef[] = array('title_key' => 'platform', 'width' => 60, 'sortType' => 'asText',\n 'filter' => 'list', 'filterOptions' => $platforms);\n }\n\n $colDef[] = array('title_key' => 'th_active_tc', 'width' => 40, 'sortType' => 'asInt',\n 'filter' => 'numeric');\n \n // create 2 columns for each defined status\n foreach($statusLbl as $lbl)\n {\n $colDef[] = array('title_key' => $lbl, 'width' => 40, 'hidden' => true, 'type' => 'int',\n 'sortType' => 'asInt', 'filter' => 'numeric');\n \n $colDef[] = array('title' => lang_get($lbl) . \" \" . $labels['in_percent'], 'width' => 40,\n 'col_id' => 'id_'. $lbl .'_percent', 'type' => 'float', 'sortType' => 'asFloat',\n 'filter' => 'numeric');\n }\n \n $colDef[] = array('title_key' => 'progress', 'width' => 40, 'sortType' => 'asFloat', 'filter' => 'numeric');\n\n return $colDef;\n}", "private function prepareColumns()\n {\n $readOnlyAttribute = $this->readOnlyAttribute;\n\n $columns = [];\n if ($this->canMove) {\n $columns[] = [\n 'class' => MovingColumn::className(),\n 'movingDisabledAttribute' => $readOnlyAttribute,\n ];\n }\n foreach ($this->columns as $column) {\n if (is_string($column)) {\n $column = ['attribute' => $column];\n }\n\n if (empty($column['class'])) {\n $column['class'] = isset($column['items']) ? DropdownInputColumn::className() : TextInputColumn::className();\n }\n\n if ($this->itemClass === null && empty($column['label'])) {\n $column['label'] = Inflector::camel2words($column['attribute'], true);\n }\n\n $column = array_merge([\n 'readOnlyAttribute' => $readOnlyAttribute,\n ], $column);\n\n $columns[] = $column;\n }\n\n if ($this->canRemove) {\n $columns[] = [\n 'class' => 'smart\\grid\\ActionColumn',\n 'options' => ['style' => 'width: 25px;'],\n 'template' => '{remove}',\n 'buttons' => [\n 'remove' => function ($url, $model, $key) use ($readOnlyAttribute) {\n $readOnly = false;\n if ($readOnlyAttribute !== null) {\n $readOnly = ArrayHelper::getValue($model, $readOnlyAttribute);\n }\n\n if ($readOnly) {\n return '';\n }\n\n return Html::a('<span class=\"fas fa-remove\"></span>', '#', [\n 'class' => 'item-remove',\n 'title' => $this->removeLabel,\n ]);\n },\n ],\n ];\n }\n\n $this->_columns = $columns;\n }", "protected function _prepareColumns()\n {\n \t// Checkbox\n \t$checkboxColumnBody = new Lumia_DataGrid_Body_Checkbox('student_id[]');\n \t$checkboxColumnHeader = new Lumia_DataGrid_Header_Checkbox();\n $this->addColumn(new Lumia_DataGrid_Column($checkboxColumnBody, $checkboxColumnHeader));\n \n // Name\n $nameColumnBody = new Lumia_DataGrid_Body_Text('student_name');\n $nameColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Name');\n $this->addColumn(new Lumia_DataGrid_Column($nameColumnBody, $nameColumnHeader));\n \n // Code\n $codeColumnBody = new Lumia_DataGrid_Body_Text('student_code');\n $codeColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Code');\n $this->addColumn(new Lumia_DataGrid_Column($codeColumnBody, $codeColumnHeader));\n \n // Date of birth\n $dateColumnBody = new Lumia_DataGrid_Body_Date('student_birth');\n $dateColumnBody->setOptions(array('dateFormat' => 'dd/MM/yyyy'));\n $dateColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Date of birth');\n $this->addColumn(new Lumia_DataGrid_Column($dateColumnBody, $dateColumnHeader));\n \n // Gender\n $genderColumnBody = new Admin_DataGrid_Student_Body_Gender('student_gender');\n $genderColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Gender');\n $this->addColumn(new Lumia_DataGrid_Column($genderColumnBody, $genderColumnHeader));\n \n // Class\n $classColumnBody = new Lumia_DataGrid_Body_Text('class_department');\n $classColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Class/Department');\n $this->addColumn(new Lumia_DataGrid_Column($classColumnBody, $classColumnHeader));\n \n // Status\n $statusColumnBody = new Admin_DataGrid_Student_Body_Status('user_status');\n $statusColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Status');\n $this->addColumn(new Lumia_DataGrid_Column($statusColumnBody, $statusColumnHeader));\n \n // Action\n $actionColumnBody = new Admin_DataGrid_Student_Body_Action('actionColumn');\n $actionColumnHeader = new Lumia_DataGrid_Header_Text();\n $this->addColumn(new Lumia_DataGrid_Column($actionColumnBody, $actionColumnHeader));\n }", "function rovoko_archive_grid_col(){\n return apply_filters('rovoko_archive_grid_col','8');\n}", "function BH_gallery_subpannel_columns( $columns ) {\r\n\r\n\t$gallery_columns = array(\r\n\t\t'shortcode'\t=> 'Shortcode'\r\n\t);\r\n\r\n\t$columns = array_merge(\r\n\t\tarray_slice($columns, 0, -1),\t// before\r\n\t\t$gallery_columns,\t\t\t\t// inserted\r\n\t\tarray_slice($columns, -1)\t\t// after\r\n\t);\r\n\r\n\t// return\r\n\treturn $columns;\r\n\r\n}", "protected function initColumns()\n\t{\n\t\tif($this->columns===array())\n\t\t{\n\t\t\tif($this->dataProvider instanceof NActiveDataProvider)\n\t\t\t\t$this->columns=$this->dataProvider->model->attributeNames();\n\t\t\telse if($this->dataProvider instanceof IDataProvider)\n\t\t\t{\n\t\t\t\t// use the keys of the first row of data as the default columns\n\t\t\t\t$data=$this->dataProvider->getData();\n\t\t\t\tif(isset($data[0]) && is_array($data[0]))\n\t\t\t\t\t$this->columns=array_keys($data[0]);\n\t\t\t}\n\t\t}\n\t\t$id=$this->getId();\n\t\tforeach($this->columns as $i=>$column)\n\t\t{\n\t\t\tif ($column['name'] && (!isset($column['export']) || @$column['export']!=false)) {\n\t\t\t\tif(is_string($column))\n\t\t\t\t\t$column=$this->createDataColumn($column);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!isset($column['class']))\n\t\t\t\t\t\t$column['class']='NDataColumn';\n\t\t\t\t\t$column=Yii::createComponent($column, $this);\n\t\t\t\t}\n\t\t\t\tif(!$column->visible)\n\t\t\t\t{\n\t\t\t\t\tunset($this->columns[$i]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif($column->id===null)\n\t\t\t\t\t$column->id=$id.'_c'.$i;\n\t\t\t\t$this->columns[$i]=$column;\n\t\t\t} else {\n\t\t\t\tunset($this->columns[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tforeach($this->columns as $column)\n\t\t\t\t$column->init();\n\t}", "private function initColumns(){\n //Initialize our custom post type column management\n $this->cptWPDSCols = new Columns($this->wpdsPostType);\n \n //Remove our title\n $this->cptWPDSCols->removeColumn('title');\n \n //Add our content column\n $this->cptWPDSCols->addColumn('content', 'Content', 2);\n \n //Add our content column content\n $this->cptWPDSCols->addColumnPostContent('content');\n \n //Add our content column content\n $this->cptWPDSCols->addColumnOptionData('content', 'site_url');\n \n //Reposition column\n $this->cptWPDSCols->reorderColumn('content', 1);\n }", "function product_finder_columns( $columns ) {\n\t$new_columns = array();\n\tif ( isset( $columns['cb'] ) ) {\n\t\t$new_columns['cb'] = $columns['cb'];\n\t\tunset( $columns['cb'] );\n\t}\n\t$new_columns['pf_thumb'] = __( 'Image', 'woocommerce' );\n\t$columns = array_merge( $new_columns, $columns );\n\treturn $columns;\n}", "public function previewColumns();", "function hub_columns( $columns ) {\r\n $columns['hub_title'] = 'HUB Title';\r\n $columns['client'] = 'Client';\r\n\r\n unset( $columns['title'] );\r\n unset( $columns['date'] );\r\n\r\n $columns['date'] = 'Date';\r\n\r\n return $columns;\r\n }", "protected function afterConstruct() {\n\t\t$current = strtolower(Yii::app()->controller->id.'/'.Yii::app()->controller->action->id);\n\t\tif(count($this->defaultColumns) == 0) {\n\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t'header' => 'No',\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'\n\t\t\t);\n\t\t\t$this->defaultColumns[] = 'title';\n\t\t\t//$this->defaultColumns[] = 'alias_url';\n\t\t\t$this->defaultColumns[] = 'description';\n\t\t\t$this->defaultColumns[] = 'image';\n\t\t\t//$this->defaultColumns[] = 'image_position';\n\t\t\t$this->defaultColumns[] = 'published';\n\t\t\t$this->defaultColumns[] = 'ordering';\n\t\t\t//$this->defaultColumns[] = 'access';\n\t\t\t//$this->defaultColumns[] = 'params';\n\t\t}\n\t\tparent::afterConstruct();\n\t}", "function sb_slideshow_columns( $columns ) {\n\tunset( $columns['date'] ); // remove date column\n\t$columns['id'] = 'ID';\n\t$columns['shortcode'] = 'Shortcode';\n\t$columns['date'] = 'Date'; // add date column back, at the end\n\n\treturn $columns;\n}", "protected function afterConstruct() {\n\t\tif(count($this->defaultColumns) == 0) {\n\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t'header' => 'No',\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'\n\t\t\t);\n\t\t\t$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'complete_name';\n\t\t\t$this->defaultColumns[] = 'address';\n\t\t\t$this->defaultColumns[] = 'city_id';\n\t\t\t$this->defaultColumns[] = 'province_id';\n\t\t\t$this->defaultColumns[] = 'post_code';\n\t\t\t$this->defaultColumns[] = 'house_phone';\n\t\t\t$this->defaultColumns[] = 'mobile_phone';\n\t\t\t$this->defaultColumns[] = 'mobile_phone2';\n\t\t\t$this->defaultColumns[] = 'birth_place';\n\t\t\t$this->defaultColumns[] = 'birth_date';\n\t\t\t$this->defaultColumns[] = 'sex';\n\t\t\t$this->defaultColumns[] = 'religion';\n\t\t\t$this->defaultColumns[] = 'homepage';\n\t\t\t$this->defaultColumns[] = 'origin_status';\n\t\t\t$this->defaultColumns[] = 'origin_address';\n\t\t\t$this->defaultColumns[] = 'origin_city_id';\n\t\t\t$this->defaultColumns[] = 'origin_province_id';\n\t\t\t$this->defaultColumns[] = 'hobby';\n\t\t\t$this->defaultColumns[] = 'photo';\n\t\t\t$this->defaultColumns[] = 'status';\n\t\t\t$this->defaultColumns[] = 'child';\n\t\t\t$this->defaultColumns[] = 'is_data_changed';\n\t\t\t$this->defaultColumns[] = 'swt_users_id';\n\t\t}\n\t\tparent::afterConstruct();\n\t}", "protected function _prepareToRender()\n {\n $this->addColumn('gender', [\n 'label' => __('Gender/Age Group'),\n 'renderer' => $this->getGendersRenderer(),\n ]);\n $this->addColumn('categories', [\n 'label' => __('Categories'),\n 'renderer' => $this->getCategoriesRenderer(),\n 'extra_params' => 'multiple=\"multiple\"'\n ]);\n $this->_addAfter = false;\n $this->_addButtonLabel = __('Add');\n }", "protected function afterConstruct() {\r\n\t\tif(count($this->templateColumns) == 0) {\r\n\t\t\t$this->templateColumns['_option'] = array(\r\n\t\t\t\t'class' => 'CCheckBoxColumn',\r\n\t\t\t\t'name' => 'id',\r\n\t\t\t\t'selectableRows' => 2,\r\n\t\t\t\t'checkBoxHtmlOptions' => array('name' => 'trash_id[]')\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['_no'] = array(\r\n\t\t\t\t'header' => Yii::t('app', 'No'),\r\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['name'] = array(\r\n\t\t\t\t'name' => 'name',\r\n\t\t\t\t'value' => '$data->name ? $data->name : \\'-\\'',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['desc'] = array(\r\n\t\t\t\t'name' => 'desc',\r\n\t\t\t\t'value' => '$data->desc ? $data->desc : \\'-\\'',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['folder'] = array(\r\n\t\t\t\t'name' => 'folder',\r\n\t\t\t\t'value' => '$data->folder',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['parent_id'] = array(\r\n\t\t\t\t'name' => 'parent_id',\r\n\t\t\t\t'value' => '$data->parent_id ? $data->parent->folder : \\'-\\'',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['orders'] = array(\r\n\t\t\t\t'name' => 'orders',\r\n\t\t\t\t'value' => '$data->orders',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['model'] = array(\r\n\t\t\t\t'name' => 'model',\r\n\t\t\t\t'value' => '$data->model',\r\n\t\t\t);\r\n\t\t\tif(!Yii::app()->getRequest()->getParam('creation')) {\r\n\t\t\t\t$this->templateColumns['creation_search'] = array(\r\n\t\t\t\t\t'name' => 'creation_search',\r\n\t\t\t\t\t'value' => '$data->creation->displayname ? $data->creation->displayname : \\'-\\'',\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t$this->templateColumns['creation_date'] = array(\r\n\t\t\t\t'name' => 'creation_date',\r\n\t\t\t\t'value' => '!in_array($data->creation_date, array(\\'0000-00-00 00:00:00\\', \\'1970-01-01 00:00:00\\')) ? Utility::dateFormat($data->creation_date) : \\'-\\'',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter' => Yii::app()->controller->widget('application.libraries.core.components.system.CJuiDatePicker', array(\r\n\t\t\t\t\t'model'=>$this,\r\n\t\t\t\t\t'attribute'=>'creation_date',\r\n\t\t\t\t\t'language' => 'en',\r\n\t\t\t\t\t'i18nScriptFile' => 'jquery-ui-i18n.min.js',\r\n\t\t\t\t\t//'mode'=>'datetime',\r\n\t\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t\t'id' => 'creation_date_filter',\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'options'=>array(\r\n\t\t\t\t\t\t'showOn' => 'focus',\r\n\t\t\t\t\t\t'dateFormat' => 'dd-mm-yy',\r\n\t\t\t\t\t\t'showOtherMonths' => true,\r\n\t\t\t\t\t\t'selectOtherMonths' => true,\r\n\t\t\t\t\t\t'changeMonth' => true,\r\n\t\t\t\t\t\t'changeYear' => true,\r\n\t\t\t\t\t\t'showButtonPanel' => true,\r\n\t\t\t\t\t),\r\n\t\t\t\t), true),\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['modified_date'] = array(\r\n\t\t\t\t'name' => 'modified_date',\r\n\t\t\t\t'value' => '!in_array($data->modified_date, array(\\'0000-00-00 00:00:00\\', \\'1970-01-01 00:00:00\\')) ? Utility::dateFormat($data->modified_date) : \\'-\\'',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter' => Yii::app()->controller->widget('application.libraries.core.components.system.CJuiDatePicker', array(\r\n\t\t\t\t\t'model'=>$this,\r\n\t\t\t\t\t'attribute'=>'modified_date',\r\n\t\t\t\t\t'language' => 'en',\r\n\t\t\t\t\t'i18nScriptFile' => 'jquery-ui-i18n.min.js',\r\n\t\t\t\t\t//'mode'=>'datetime',\r\n\t\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t\t'id' => 'modified_date_filter',\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'options'=>array(\r\n\t\t\t\t\t\t'showOn' => 'focus',\r\n\t\t\t\t\t\t'dateFormat' => 'dd-mm-yy',\r\n\t\t\t\t\t\t'showOtherMonths' => true,\r\n\t\t\t\t\t\t'selectOtherMonths' => true,\r\n\t\t\t\t\t\t'changeMonth' => true,\r\n\t\t\t\t\t\t'changeYear' => true,\r\n\t\t\t\t\t\t'showButtonPanel' => true,\r\n\t\t\t\t\t),\r\n\t\t\t\t), true),\r\n\t\t\t);\r\n\t\t\tif(!Yii::app()->getRequest()->getParam('modified')) {\r\n\t\t\t\t$this->templateColumns['modified_search'] = array(\r\n\t\t\t\t\t'name' => 'modified_search',\r\n\t\t\t\t\t'value' => '$data->modified->displayname ? $data->modified->displayname : \\'-\\'',\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t$this->templateColumns['install'] = array(\r\n\t\t\t\t'name' => 'install',\r\n\t\t\t\t'value' => 'Utility::getPublish(Yii::app()->controller->createUrl(\\'install\\',array(\\'id\\'=>$data->plugin_id)), $data->install, \\'Install,Uninstall\\')',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter'=>array(\r\n\t\t\t\t\t1=>Yii::t('phrase', 'Yes'),\r\n\t\t\t\t\t0=>Yii::t('phrase', 'No'),\r\n\t\t\t\t),\r\n\t\t\t\t'type' => 'raw',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['actived'] = array(\r\n\t\t\t\t'name' => 'actived',\r\n\t\t\t\t'value' => '$data->install == 1 ? ($data->actived == 2 ? CHtml::image(Yii::app()->theme->baseUrl.\\'/images/icons/publish.png\\') : Utility::getPublish(Yii::app()->controller->createUrl(\\'active\\',array(\"id\"=>$data->plugin_id)), $data->actived, \\'Actived,Deactived\\')) : \"-\"',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter'=>array(\r\n\t\t\t\t\t1=>Yii::t('phrase', 'Yes'),\r\n\t\t\t\t\t0=>Yii::t('phrase', 'No'),\r\n\t\t\t\t),\r\n\t\t\t\t'type' => 'raw',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['search'] = array(\r\n\t\t\t\t'name' => 'search',\r\n\t\t\t\t'value' => '$data->search == 1 ? CHtml::image(Yii::app()->theme->baseUrl.\\'/images/icons/publish.png\\') : CHtml::image(Yii::app()->theme->baseUrl.\\'/images/icons/unpublish.png\\')',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter'=>array(\r\n\t\t\t\t\t1=>Yii::t('phrase', 'Yes'),\r\n\t\t\t\t\t0=>Yii::t('phrase', 'No'),\r\n\t\t\t\t),\r\n\t\t\t\t'type' => 'raw',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['default'] = array(\r\n\t\t\t\t'name' => 'default',\r\n\t\t\t\t'value' => '$data->install == 1 ? ($data->default == 1 ? CHtml::image(Yii::app()->theme->baseUrl.\\'/images/icons/publish.png\\') : Utility::getPublish(Yii::app()->controller->createUrl(\\'default\\',array(\"id\"=>$data->plugin_id)), $data->default)) : \"-\"',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter'=>array(\r\n\t\t\t\t\t1=>Yii::t('phrase', 'Yes'),\r\n\t\t\t\t\t0=>Yii::t('phrase', 'No'),\r\n\t\t\t\t),\r\n\t\t\t\t'type' => 'raw',\r\n\t\t\t);\r\n\t\t}\r\n\t\tparent::afterConstruct();\r\n\t}", "protected function setupGridClasses()\n {\n if ($this->grid) {\n $grid = $this->parseGrid();\n $this->offsetGridClass = \"offset-{$grid['breakpoint']}-{$grid['columns'][0]}\";\n $this->inputGridClass = \"col-{$grid['breakpoint']}-{$grid['columns'][1]}\";\n }\n }", "protected function _configureColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n $this->_sourceColumns = $this->columns;;\n\n $columnsByKey = [];\n foreach ($this->columns as $column) {\n $columnKey = $this->_getColumnKey($column);\n for ($j = 0; true; $j++) {\n $suffix = ($j) ? '_' . $j : '';\n $columnKey .= $suffix;\n if (!array_key_exists($columnKey, $columnsByKey)) {\n break;\n }\n }\n $columnsByKey[$columnKey] = $column;\n }\n\n $this->columns = $columnsByKey;\n }", "public function buildPreview(){\n\t\t//empty, every column needs to do this on there own.\n\t}", "public function getGridColumns()\n {\n return [\n 'id' => [\n 'attribute' => 'id',\n ],\n 'name' => [\n 'attribute' => 'name',\n ],\n 'surname' => [\n 'attribute' => 'surname',\n ],\n [\n 'attribute' => 'image_name',\n ],\n [\n 'attribute' => 'image_md5',\n ],\n [\n 'attribute' => 'image_extension',\n ],\n [\n 'filter' => false,\n 'format' => 'raw',\n 'header' => \\yii::t('execut/books', 'Preview'),\n 'value' => $this->getValueCallback(),\n ],\n [\n 'attribute' => 'image_mime_type',\n ],\n [\n 'attribute' => 'main_book_id',\n 'value' => 'mainBook.name',\n 'filter' => Select2::widget([\n 'model' => $this,\n 'attribute' => 'main_book_id',\n 'bsVersion' => 3,\n 'theme' => 'bootstrap',\n 'language' => 'ru',\n 'initValueText' => $this->mainBook ? $this->mainBook->name : null,\n 'pluginOptions' => [\n 'allowClear' => true,\n 'ajax' => [\n 'dataType' => 'json',\n 'url' => Url::to(['/booksNative/books']),\n 'data' =>\n new \\yii\\web\\JsExpression('function(params) {\n return {\n \"Book[name]\": params.term,\n page: params.page\n };\n }'),\n ],\n ],\n 'options' => [\n 'placeholder' => \\yii::t('execut/books', 'Main Book'),\n ],\n 'showToggleAll' => false,\n ]),\n ],\n 'actions' => [\n 'class' => ActionColumn::class,\n 'buttons' => [\n 'view' => function () {\n return false;\n },\n ],\n ]\n ];\n }", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n $this->allColumns[$i] = $column;\n continue;\n }\n $this->columns[$i] = $column;\n $this->allColumns[$i] = $column;\n }\n }", "function custom_edit_coupon_columns($columns) {\r\n\r\n $columns['coupon_type'] = esc_html__( 'Coupon', 'wp-coupon' );\r\n $columns['expires'] = esc_html__( 'Expires', 'wp-coupon' );\r\n $columns['stats'] = esc_html__( 'Votes / Clicks', 'wp-coupon' );\r\n\r\n\r\n //unset( $columns['author'] );\r\n // Move default columns to right\r\n if ( isset( $columns['comments'] ) ) {\r\n $title = $columns['comments'];\r\n unset( $columns['comments'] );\r\n $columns['comments'] = $title;\r\n }\r\n\r\n if ( isset( $columns['author'] ) ) {\r\n $title = $columns['author'];\r\n unset( $columns['author'] );\r\n $columns['author'] = $title;\r\n }\r\n\r\n if ( isset( $columns['date'] ) ) {\r\n $title = $columns['date'];\r\n unset( $columns['date'] );\r\n $columns['date'] = $title;\r\n }\r\n\r\n return $columns;\r\n }", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n continue;\n }\n $this->columns[$i] = $column;\n }\n }", "private function _setColumns()\n {\n $this->columns = new Pike_Grid_DataSource_Columns();\n\n foreach ($this->_query->getFields() as $field) {\n $this->columns->add($field, null, $field);\n }\n }", "function inox_add_thumbnail_columns( $columns ) {\n $columns = array(\n\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t'featured_thumb' => 'Thumbnail',\n\t\t'title' => 'Title',\n\t\t'author' => 'Author',\n\t\t'categories' => 'Categories',\n\t\t\"destination\" => \"Destination\",\n\t\t'tags' => 'Tags',\n\t\t'comments' => '<span class=\"vers\"><div title=\"Comments\" class=\"comment-grey-bubble\"></div></span>',\n\t\t'date' => 'Date'\n );\n return $columns;\n}", "protected function afterConstruct() {\n\t\tif(count($this->defaultColumns) == 0) {\n\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t'header' => 'No',\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'\n\t\t\t);\n\t\t\t//$this->defaultColumns[] = 'id';\n\t\t\t//$this->defaultColumns[] = 'bank_id';\n $this->defaultColumns[] = array(\n 'name' => 'bankName',\n 'value' => '$data->bank->bank_name',\n );\n\t\t\t$this->defaultColumns[] = 'account_number';\n\t\t\t$this->defaultColumns[] = 'owner_name_alias';\n\t\t\t/* $this->defaultColumns[] = array(\n\t\t\t\t'name' => 'publish',\n\t\t\t\t'value' => 'Utility::getPublish(Yii::app()->controller->createUrl(\"publish\",array(\"id\"=>$data->id)), $data->publish, 1)',\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'center',\n\t\t\t\t),\n\t\t\t\t'type' => 'raw',\n\t\t\t); */\n\n\t\t}\n\t\tparent::afterConstruct();\n\t}", "function nirvana_columns_output($columns, $count){\n\t$counter=0;\n\t$nirvanas = nirvana_get_theme_options(); ?>\n\t<div id=\"front-columns-box\">\n\t<div id=\"front-columns\" class=\"ppbox nirvana-custom-columns\">\n\t<?php if (!empty($nirvanas['nirvana_columnstitle'])) { ?> <h2> <?php echo do_shortcode($nirvanas['nirvana_columnstitle']) ?> </h2> <?php } ?>\n\t<?php\n\tforeach ($columns as $column):\n\t\tif($column['image']) :\n\t\t\t$counter++;\n\t\t\tif (!isset($column['blank'])) $column['blank'] = 0;\n\t\t\t$coldata = array(\n\t\t\t\t'colno' => (($counter%$count)?$counter%$count:$count),\n\t\t\t\t'counter' => $counter,\n\t\t\t\t'image' => esc_url($column['image']),\n\t\t\t\t'link' => esc_url($column['link']),\n\t\t\t\t'blank' => ($column['blank']?'target=\"_blank\"':''),\n\t\t\t\t'title' => $column['title'],\n\t\t\t\t'text' => $column['text'],\n\t\t\t);\n\t\t\tnirvana_singlecolumn_output($coldata); // defined in includes/widgets.php\n\t\tendif;\n\tendforeach; ?>\n</div> </div><?php\n}", "private function getGridColumns()\n\t{\n\t\treturn array(\n\t\t\t'submission_id' => array('field' => 'submission_id', 'sortable' => true, 'hidden' => true),\n\t\t\t'title' => array('field' => 'title', 'label' => 'Title', 'sortable' => true),\n\t\t\t'date' => array('field' => 'date', 'label' => 'Received', 'sortable' => true, 'modifier' => 'formatDate'),\n\t\t\t'organisation' => array('field' => 'organisation', 'label' => 'Organisation', 'sortable' => true),\n\t\t\t'fname' => array('field' => 'fname', 'label' => 'Fname', 'sortable' => true),\n\t\t\t'lname' => array('field' => 'lname', 'label' => 'Lname', 'sortable' => true),\n\t\t\t'email' => array('field' => 'email', 'label' => 'Email', 'sortable' => true),\n\t\t\t'file_id' => array('field' => 'file_id', 'label' => 'File', 'sortable' => true),\n\t\t\t'status' => array('field' => 'status', 'label' => 'Status', 'sortable' => true),\n\t\t\t'session_title' => array('field' => 'session_title', 'label' => 'Session', 'sortable' => true),\n\t\t\t'review_first' => array('field' => 'review_first', 'label' => 'Review first', 'sortable' => true),\n\t\t\t'review_last' => array('field' => 'review_last', 'label' => 'Review last', 'sortable' => true),\n\t\t\t'conference_id' => array('field' => 'conference_id', 'label' => 'Conference id', 'sortable' => true),\n\t\t\t'review_count' => array('field' => 'review_count', 'label' => 'Reviews', 'sortable' => true)\n\t\t);\n\n\t}", "function uc_group_columns( $columns ) {\n unset( $columns['date'] );\n $columns['school_year'] = __( 'School Year', UPTOWNCODE_PLUGIN_NAME );\n $columns['class'] = __( 'Class', UPTOWNCODE_PLUGIN_NAME );\n $columns['activity'] = __( 'Activity', UPTOWNCODE_PLUGIN_NAME );\n $columns['signup'] = __( 'Signup', UPTOWNCODE_PLUGIN_NAME );\n return $columns;\n}", "function ysg_edit_columns( $columns ) {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />',\n 'ysg_image' => __( 'Imagem do V&iacute;deo', 'youtube-simple-gallery' ),\n 'ysg_title' => __( 'T&iacute;tulo', 'youtube-simple-gallery' ),\n 'ysg_categories' => __(\"Categoria\", 'youtube-simple-gallery' ),\n 'ysg_url' => __( 'Link do V&iacute;deo', 'youtube-simple-gallery' )\n );\n\n return $columns;\n}", "protected function get_sortable_columns()\n {\n }", "protected function get_sortable_columns()\n {\n }", "protected function get_sortable_columns()\n {\n }", "function ReInitTableColumns()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ReInitTableColumns();\" . \"<HR>\";\n foreach ($this->form_fields as $prefix => $form) {\n foreach ($form as $i => $field) {\n foreach ($field as $param => $value) {\n //if found database parameters\n if (strpos($param, \"dbfield_\") !== false) {\n $columnparam = substr($param, strlen(\"dbfield_\"), strlen($param));\n $this->Storage->setColumnParameter($field[\"field_name\"], trim($columnparam), $value);\n }\n }\n }\n }\n }", "protected function grid()\n {\n $grid = new Grid(new Product);\n\n $grid->column('id', __('Id'));\n $grid->column('type.name', __('分类名称'));\n $grid->column('recommend.name', __('推荐名称'));\n $grid->column('name', __('产品名称'));\n $grid->column('description', __('产品描述'));\n $states = [\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n ];\n $grid->column('pop', __('推荐'))->switch($states);\n $grid->column('logo','logo图')->display(function (){\n if ($this->logo){\n return '<div class=\"pop\"><img src='.env('APP_URl').'/uploads/'.$this->logo.' style=\"width:100px;height:100px;\"></div>';\n }else{\n return ;\n }\n });\n $grid->column('price', __('价格'));\n $grid->column('updated_at', __('更新时间'));\n\n return $grid;\n }", "function js_custom_set_project_columns( $columns ) {\n\t$columns = array(\n\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t'thumbnail' => 'Image',\n\t\t// 'project_title' => __( 'Project Name' ),\n\t\t// 'at_a_glance' => __( 'at a glance' ),\n\t\t// 'raw_data' => __( 'raw' ),\n\t\t'signtypes' => __( 'Featured Signage' ),\n\t\t// 'has_featured_image' => __( 'img' ),\n\t\t// 'service-type' => __( 'Services' ),\n\t\t// 'expertise' => __( 'Expertise' ),\n\t\t// 'sign-types' => __( 'Featured Signage' ),\n\t);\n\t$checkbox = array_slice( $columns, 0, 4 );\n\t$added_columns['project_post_id'] = 'ID';\n\t$columns = array_merge( $checkbox, $added_columns );\n\treturn $columns;\n}", "function BH_event_subpannel_columns( $columns ) {\r\n\r\n\t$event_columns = array(\r\n\t\t'start_date'\t=> 'Start Date',\r\n\t\t'end_date'\t\t=> 'End Date'\r\n\t);\r\n\r\n\t$columns = array_merge(\r\n\t\tarray_slice($columns, 0, -1),\t// before\r\n\t\t$event_columns,\t\t\t\t\t// inserted\r\n\t\tarray_slice($columns, -1)\t\t// after\r\n\t);\r\n\r\n\t// return\r\n\treturn $columns;\r\n\r\n}", "protected function grid()\n {\n return Admin::grid(SitePackages::class, function (Grid $grid) {\n $grid->disableExport();\n $grid->column('title');\n $grid->column('price','Price( $ )');\n $grid->column('deadline')->display(function ($deadline)\n {\n $deadline = Carbon::parse($deadline);\n return $deadline->format(\"d M Y\");\n })->sortable();\n $grid->column('package_group_id','Package Group')->display(function ($groupid)\n {\n $groupid = SitePackageGroup::find($groupid);\n if ($groupid != null)\n {\n return $groupid->title;\n }\n else{\n return 'No group assigned';\n }\n });\n\n $grid->filter(function (Grid\\Filter $filter)\n {\n $filter->disableIdFilter();\n $filter->in('package_group_id','Package Group')->multipleSelect(SitePackageGroup::getAllPackageGroups());\n $filter->like('price');\n });\n });\n }", "function my_portfolio_columns($columns) {\r\n\t$columns = array(\r\n\t\t\"cb\" => \"<input type=\\\"checkbox\\\" />\",\r\n\t\t\"title\" => theme_locals(\"title\"),\r\n\t\t\"portfolio_categories\" => theme_locals(\"categories\"),\r\n\t\t\"portfolio_tags\" => theme_locals(\"tags\"),\r\n\t\t\"comments\" => \"<span><span class=\\\"vers\\\"><img src=\\\"\".get_admin_url().\"images/comment-grey-bubble.png\\\" alt=\\\"Comments\\\"></span></span>\",\r\n\t\t\"date\" => theme_locals(\"date\"),\r\n\t\t\"thumbnail\" => theme_locals(\"thumbnail\")\r\n\t);\r\n\treturn $columns;\r\n}", "function mp_thumbnail_columns( $columns ){\n $new_columns = array();\n\n foreach( $columns as $column_name => $column_info ){\n $new_columns[$column_name] = $column_info;\n if('cb' === $column_name ){\n $new_columns['thumb_img'] = __('Thumbnail');\n }\n }\n\n return $new_columns;\n}", "function extamus_screen_layout_columns($columns) {\n $columns['dashboard'] = 1;\n return $columns;\n }", "function reOrderColumnHeaders() {\n\n }", "public static function columns()\n {\n return filterColumnByRole([\n 'plot_ref' => trans('system.code'),\n 'plot_name' => trans_title('plots'),\n 'user.name' => trans_title('users'),\n 'city.city_name' => trans_title('cities'),\n 'plot_percent_cultivated_land' => sections('plots.cultivated_land'),\n 'plot_real_area' => sections('plots.real_area'),\n 'plot_start_date' => sections('plots.start_date'),\n 'plot_active' => trans('persona.contact.active'),\n 'plot_green_cover' => sections('plots.green_cover'),\n 'plot_pond' => sections('plots.pond'),\n 'plot_road' => sections('plots.road'),\n ],\n $roleFilter = Credentials::isAdmin(),\n $newColumns = ['client.client_name' => trans_title('clients')],//Admits multiple arrays\n $addInPosition = 3\n );\n }", "protected function _prepareCollection()\n {\n $userId = Mage::getSingleton('admin/session')->getUser()->getId();\n\n /* var $collection Gri_Cms_Model_Mysql4_Version_Collection */\n $collection = Mage::getModel('gri_cms/page_version')->getCollection()\n ->addPageFilter($this->getPage())\n ->addVisibilityFilter($userId,\n Mage::getSingleton('gri_cms/config')->getAllowedAccessLevel())\n ->addUserColumn()\n ->addUserNameColumn();\n\n if (!$this->getParam($this->getVarNameSort())) {\n $collection->addNumberSort();\n }\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "function get_columns() {\n\n return $columns= array(\n 'cb' => '<input type=\"checkbox\" onclick=\"jQuery(\\'.hypernews_checkbox\\').toggleCheckbox();\" />',\n 'status'=>'<img src=\"'.WP_PLUGIN_URL.'/hypernews/img/tag.png\" />',\n 'title'=>__('Headline', 'hypernews'),\n 'pubdate'=>__('Published', 'hypernews'),\n 'channel'=>__('Channel', 'hypernews'),\n 'source'=>__('Source', 'hypernews'),\n 'notes'=>__('Note', 'hypernews')\n );\n}", "protected function grid()\n {\n $grid=new Grid(new JudgeServer());\n\n $grid->column('jsid', 'JSID');\n $grid->column('scode', __('admin.judgeservers.scode'));\n $grid->column('name', __('admin.judgeservers.name'));\n $grid->column('host', __('admin.judgeservers.host'));\n $grid->column('port', __('admin.judgeservers.port'));\n $grid->column('token', __('admin.judgeservers.token'));\n $grid->column('available', __('admin.judgeservers.availability'))->display(function($available) {\n return $available ?__('admin.judgeservers.available') : __('admin.judgeservers.unavailable');\n });\n $grid->column('OJ', __('admin.judgeservers.oj'))->display(function() {\n return $this->oj->name;\n });\n $grid->column('usage', __('admin.judgeservers.usage'))->display(function($usage) {\n return blank($usage) ? \"-\" : \"$usage%\";\n });\n $grid->column('status', __('admin.judgeservers.status'))->display(function($status) {\n $status=JudgerModel::$status[$status];\n return '<i class=\"MDI '.$status['icon'].' '.$status['color'].'\"></i> '.$status['text'];\n });\n $grid->column('status_update_at', __('admin.judgeservers.status_update_at'));\n $grid->column('created_at', __('admin.created_at'));\n $grid->column('updated_at', __('admin.updated_at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new PrizesLog);\n // 禁用新增\n $grid->disableCreateButton();\n // 查询过滤\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n $filter->column(1/2, function($filter){\n $filter->between('id', 'ID');\n $filter->equal('user.username', '用户名');\n $filter->equal('user.mobile', '用户手机号');\n $filter->equal('prizes_group_id', '奖品组')->select('/selector/prizes-groups');\n $filter->equal('source', '来源')->radio([\n 'exchange' => '兑换/领取', 'lottery' => '抽奖',\n ]);\n });\n $filter->column(1/2, function ($filter) {\n $filter->equal('material_id', '物料')->select('/selector/materials');\n $filter->equal('material_code', '物料码');\n $filter->between('created_at', '中奖时间')->datetime();\n $filter->equal('status', '状态')->radio([\n 1 => '有效',\n 0 => '作废',\n ]);\n });\n });\n\n $grid->column('id', 'ID');\n $grid->column('prizes_group_id', '奖品组ID');\n $grid->column('group.title', '奖品组'); \n $grid->column('prize_id', '奖品ID');\n $grid->column('prize.name', '奖品');\n $grid->column('material_id', '物料ID');\n $grid->column('material.title', '物料名称');\n $grid->column('user_id', '用户ID');\n $grid->column('user.username', '用户名');\n $grid->column('status', '状态')->display(function($status) {\n $status_dic = [\n '0' => '<span style=\"color:red;\">作废</span>',\n '1' => '<span style=\"color:green;\">有效</span>',\n ];\n return Arr::get($status_dic, $status, '');\n });\n $grid->column('created_at', '中奖时间');\n\n // 去掉删除按钮\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->disableView();\n // $actions->disableEdit();\n });\n\n return $grid;\n }", "function gssettings_settings_layout_columns( $columns, $screen ) {\n global $_gssettings_settings_pagehook;\n if ( $screen == $_gssettings_settings_pagehook ) {\n $columns[$_gssettings_settings_pagehook] = 1;\n }\n return $columns;\n }", "protected function grid()\n {\n $grid = new Grid(new $this->currentModel);\n\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n //$filter->disableIdFilter();\n\n // 在这里添加字段过滤器\n $filter->like('title_designer_cn', '标题(设计师)');\n $filter->like('title_name_cn', '标题(项目名称)');\n $filter->like('title_intro_cn', '标题(项目介绍)');\n\n });\n\n $grid->id('ID')->sortable();\n $grid->title_designer_cn('标题(中)')->display(function () {\n return CurrentModel::formatTitle($this, 'cn');\n });\n $grid->title_designer_en('标题(英)')->display(function () {\n return CurrentModel::formatTitle($this, 'en');\n });\n $grid->article_status('状态')->display(function ($article_status) {\n switch ($article_status) {\n case '0' :\n $article_status = '草稿';\n break;\n case '1' :\n $article_status = '审核中';\n break;\n case '2' :\n $article_status = '已发布';\n break;\n }\n return $article_status;\n });\n $grid->release_time('发布时间')->sortable();\n \n // $grid->column('created_at', __('发布时间'));\n $grid->created_at('添加时间')->sortable();\n // $grid->column('updated_at', __('添加时间'));\n\n return $grid;\n }", "function set_custom_edit_badge_columns($columns) {\n $columns['badge_image'] = 'Image';\n return $columns;\n}", "function dunkdog_player_edit_columns($cols) { \n\t$cols = array('cb' => '<input type=\"checkbox\" />',\n\t\t'headshot' => 'Headshot',\n\t\t'title' => 'Title', \n\t\t'taxonomy-dd-class' => 'Class',\n \t\t'taxonomy-dd-height' => 'Height',\n \t\t'taxonomy-dd-weight' => 'Weight',\n \t\t'taxonomy-dd-position' => 'Player Position',\n \t\t'high_school' => 'High School',\n \t\t'travel_team' => 'Travel',\n \t\t'college_team' => 'College',\n \t\t'news' => 'News'\n \t\t);\n return $cols;\n}", "public function getColumns()\n {\n return [\n 'form' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['form'],\n 'exclude' => true,\n 'inputType' => 'select',\n 'foreignKey' => 'tl_form.title',\n 'eval' => [\n 'includeBlankOption' => true,\n 'style' => 'width:300px',\n 'chosen' => true,\n 'columnPos' => 'checkout',\n ],\n ],\n 'step' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['step'],\n 'inputType' => 'select',\n 'options_callback' => ['Isotope\\Backend\\Module\\OrderConditionFields', 'getSteps'],\n 'eval' => [\n 'decodeEntities' => true,\n 'includeBlankOption' => true,\n 'style' => 'width:300px',\n 'columnPos' => 'checkout',\n ],\n ],\n 'position' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['position'],\n 'default' => 'before',\n 'inputType' => 'select',\n 'options' => ['before', 'after'],\n 'reference' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['position'],\n 'eval' => [\n 'style' => 'width:300px',\n 'columnPos' => 'checkout',\n ],\n ],\n 'product_types' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['product_types'],\n 'inputType' => 'select',\n 'foreignKey' => 'tl_iso_producttype.name',\n 'eval' => [\n 'multiple' => true,\n 'style' => 'width:300px',\n 'columnPos' => 'product_type',\n ],\n ],\n 'product_types_condition' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['product_types_condition'],\n 'inputType' => 'select',\n 'options' => ['oneAvailable', 'allAvailable', 'onlyAvailable'],\n 'reference' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['product_types_condition'],\n 'eval' => [\n 'style' => 'width:300px',\n 'columnPos' => 'product_type',\n ],\n ],\n ];\n }", "protected function afterConstruct() {\n\t\tif(count($this->defaultColumns) == 0) {\n\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t'header' => 'No',\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'\n\t\t\t);\n\t\t\t//$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'subject';\n\t\t\t$this->defaultColumns[] = 'messege';\n\t\t\t//$this->defaultColumns[] = 'from_user_id';\n\t\t\t$this->defaultColumns[] = 'from_user_name';\n\t\t\t//$this->defaultColumns[] = 'to_user_id';\n\t\t\t$this->defaultColumns[] = 'to_user_name';\n\t\t\t//$this->defaultColumns[] = 'is_read';\n\t\t\t$this->defaultColumns[] = 'sent_time';\n\t\t\t//$this->defaultColumns[] = 'is_deleted_by_sender';\n\t\t\t//$this->defaultColumns[] = 'is_deleted_by_receiver';\n\t\t\t/* $this->defaultColumns[] = array(\n\t\t\t\t'name' => 'publish',\n\t\t\t\t'value' => 'Utility::getPublish(Yii::app()->controller->createUrl(\"publish\",array(\"id\"=>$data->id)), $data->publish, 1)',\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'center',\n\t\t\t\t),\n\t\t\t\t'type' => 'raw',\n\t\t\t); */\n\n\t\t}\n\t\tparent::afterConstruct();\n\t}", "function get_columns(){\n $columns = array(\n 'cb' \t\t=> '<input type=\"checkbox\" />', //Render a checkbox instead of text\n 'img' => __( 'Image', 'wp-lister-for-amazon' ),\n 'sku' => __( 'SKU', 'wp-lister-for-amazon' ),\n 'listing_title' \t=> __( 'Title', 'wp-lister-for-amazon' ),\n 'quantity'\t\t\t=> __( 'Stock', 'wp-lister-for-amazon' ),\n // 'quantity_sold'\t\t=> __( 'Sold', 'wp-lister-for-amazon' ),\n 'price' => __( 'Price', 'wp-lister-for-amazon' ),\n 'lowest_price' => str_replace(' ', '&nbsp;', __( 'Buy Box', 'wp-lister-for-amazon' ) ),\n 'loffer_price'\t\t=> __( 'Lowest Offer', 'wp-lister-for-amazon' ),\n // 'fees'\t\t\t\t=> __( 'Fees', 'wp-lister-for-amazon' ),\n 'date_published' => str_replace(' ', '&nbsp;', __( 'Created at', 'wp-lister-for-amazon' ) ),\n 'profile' => __( 'Profile', 'wp-lister-for-amazon' ),\n 'account' => __( 'Account', 'wp-lister-for-amazon' ),\n 'status'\t\t \t=> __( 'Status', 'wp-lister-for-amazon' )\n );\n\n // if ( ! get_option( 'wpla_enable_thumbs_column' ) )\n // unset( $columns['img'] );\n\n return $columns;\n }", "protected function grid()\n {\n $grid = new Grid(new Direction());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __(trans('hhx.name')));\n $grid->column('intro', __(trans('hhx.intro')));\n $grid->column('Img', __(trans('hhx.img')))->image();\n $grid->column('status', __(trans('hhx.status')))->using(config('hhx.status'));\n $grid->column('order_num', __(trans('hhx.order_num')));\n $grid->column('all_num', __(trans('hhx.all_num')));\n $grid->column('this_year', __(trans('hhx.this_year')));\n $grid->column('stock', __(trans('hhx.stock')));\n $grid->column('created_at', __(trans('hhx.created_at')));\n $grid->column('updated_at', __(trans('hhx.updated_at')));\n\n return $grid;\n }", "function vcex_get_grid_column_class( $atts ) {\n\tif ( isset( $atts['single_column_style'] ) && 'left_thumbs' === $atts['single_column_style'] ) {\n\t\treturn;\n\t}\n\t$return_class = '';\n\tif ( isset( $atts['columns'] ) ) {\n\t\t$return_class .= ' span_1_of_' . sanitize_html_class( $atts['columns'] );\n\t}\n\tif ( ! empty( $atts['columns_responsive_settings'] ) ) {\n\t\t$rs = vcex_parse_multi_attribute( $atts['columns_responsive_settings'], array() );\n\t\tforeach ( $rs as $key => $val ) {\n\t\t\tif ( $val ) {\n\t\t\t\t$return_class .= ' span_1_of_' . sanitize_html_class( $val ) . '_' . sanitize_html_class( $key );\n\t\t\t}\n\t\t}\n\t}\n\treturn trim( $return_class );\n}", "abstract protected function columns();", "function lbcb_add_swatch_column( $columns ){\n\t$columns = array( \"cb\" => '<input type=\"checkbox\" />',\n\t\t\t\"title\"=> \"Title\", \n\t\t\t\"swatches\" => \"Swatches\",\n\t\t\t\"tags\" => \"Tags\",\n\t\t\t\"type\" => \"Type\",\n\t\t\t\"link\" => \"Link\",\n\t\t\t\"comments\" => '<div class=\"vers\"><img alt=\"Comments\" src=\"' . site_url() . '/wp-admin/images/comment-grey-bubble.png\" /></div>',\n\t\t\t\"date\" => \"Date\" );\n\treturn $columns;\n}", "protected function grid()\n {\n return Admin::grid(QQAlbum::class, function (Grid $grid) {\n $grid->model()->orderBy('hot_num', 'desc');\n $grid->column('album_verpic', '封面')->display(function($album_verpic) {\n return \"<img src='$album_verpic' width='100px'>\";\n });\n $grid->column('album_name', '名称')->display(function() {\n $name = $this->album_name.\"[\".$this->type.\"]\";\n $name .= $this->en_name ? \"<br>\".$this->en_name : \"\";\n $name .= $this->alias_name ? \"<br>\".$this->alias_name : \"\";\n return $name;\n });\n $grid->column('genre', '类型')->display(function() {\n return $this->genre .\"<br>\". $this->sub_genre;\n });\n $grid->column('director', '演职员')->display(function() {\n $name = [];\n if($this->director) {\n array_push($name, $this->director);\n }\n if($this->actor) {\n array_push($name, $this->actor);\n }\n if($this->guests) {\n array_push($name, $this->guests);\n }\n return implode(\"<br>\", $name);\n });\n $grid->updated_at('更新时间');\n });\n }", "function add_columns( $columns ) {\n\t$columns['layout'] = 'Layout';\n\treturn $columns;\n}", "protected function grid()\n {\n $grid = new Grid(new Product());\n\n $grid->selector(function (Tools\\Selector $selector) {\n $selector->select('audit_status', '审核状态', [\n 0 => '未进行审核',\n 1 => '审核已通过',\n 2 => '审核未通过'\n ]);\n });\n $grid->id('ID')->sortable();\n $grid->product_core('商品编码');\n $grid->title('商品名称');\n $grid->bar_code('国条码');\n $grid->category_id('商品分类')->display(function ($category_id) {\n return Category::where('id', $category_id)->first()->name;\n });\n $grid->status('已上架')->display(function ($status) {\n return $status ? '是' : '否';\n });\n $grid->audit_status('审核状态')->display(function ($audit_status) {\n if ($audit_status == 1) {\n return '审核已通过';\n } elseif ($audit_status == 2) {\n return '审核未通过';\n } else {\n return '未进行审核';\n }\n// return $audit_status ? '审核通过' : '审核未通过';\n });\n $grid->shop_id('所属店铺')->display(function ($shop_id) {\n return Shop::where('id', $shop_id)->first()->name;\n });\n $grid->price('价格');\n $grid->rating('评分');\n $grid->sold_count('销量');\n $grid->review_count('评论数');\n $grid->actions(function ($actions) {\n $actions->disableView();\n $actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "public function setColumnsHeadData()\n\t{\n\t\tFileStorage::getInstance()->store([], 'league_table_columns_head');\n\t}", "protected function _prepareColumns()\n {\n $result = parent::_prepareColumns();\n $column = $this->getColumn('action');\n if (!$column) {\n return $result;\n }\n $data = $column->getData();\n $data['actions'][0]['url'] = array('base' => 'adminhtml/sales_order/view');\n $column->setData($data);\n return $result;\n }", "protected function grid()\n {\n return Admin::grid(VoteLog::class, function (Grid $grid) {\n $grid->disableCreation();\n $grid->model()->orderBy('id', 'desc');\n\n// $grid->column('user_id', '用户')->display(function ($id) {\n// return User::find($id)->name;\n// })->sortable();\n $grid->column('competition_id', '比赛')->display(function ($id) {\n return Competition::find($id)->title;\n })->sortable();\n $grid->column('votes', '投票')->display(function ($str) {\n $ids = json_decode($str);\n $str = '<ul>';\n foreach (Option::find($ids)->pluck('title')->toArray() as $item) {\n $str .= '<li>' . $item . '</li>';\n }\n $str .= '</ul>';\n return $str;\n })->sortable();\n $grid->column('ip', '用户')->display(function ($ip) {\n $str = '<strong>' . User::find($this->user_id)->name . '</strong>'\n . '<br>' . $ip\n . '<br>' . $this->country . $this->province . $this->city\n . '<hr>' . $this->comment;\n return $str;\n })->sortable();\n// $grid->column('header', 'User-Agent')->display(function ($str) {\n// $header = json_decode($str, true);\n// return join('<br>', $header['user-agent']);\n// });\n $grid->column('header', '请求头')->display(function ($value) {\n $header = json_decode($value);\n $str = '<dl class=\"dl-horizontal\">';\n foreach ($header as $k => $v) {\n if (in_array($k, ['user-agent', 'accept-language', 'cf-ray', 'cf-ipcountry']))\n $str .= '<dt>' . $k . '</dt><dd>' . (is_array($v) ? join(' ', $v) : $v) . '</dd>';\n }\n return $str . '</dl>';\n });\n //$grid->column('body', '请求体');\n $states = [\n 'on' => ['value' => true, 'text' => '有效', 'color' => 'success'],\n 'off' => ['value' => false, 'text' => '无效', 'color' => 'danger'],\n ];\n $grid->valid('有效票')->switch($states)->sortable();\n $grid->created_at('投票时间')->sortable();\n\n $grid->tools(function ($tools) {\n $tools->batch(function ($batch) {\n $batch->add('标记为有效票', new KanPiao(1));\n $batch->add('标记为无效票', new KanPiao(0));\n });\n });\n\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n\n $filter->where(function ($query) {\n $query->where('header', 'like', \"%{$this->input}%\");\n }, '请求');\n $filter->is('competition_id', '比赛')->select(Competition::all()->pluck('title', 'id'));\n $filter->is('valid', '有效')->select(['0' => '无效', '1' => '有效']);\n });\n });\n }", "function wpbm_columns_head( $columns ){\n $columns[ 'shortcodes' ] = __( 'Shortcodes', WPBM_TD );\n $columns[ 'template' ] = __( 'Template Include', WPBM_TD );\n return $columns;\n }", "protected function _prepareToRender()\n {\n $this->addColumn('step_name', [\n 'label' => __('Diagnostic Step'),\n 'class' => 'validate-select',\n 'renderer' => $this->getStepRenderer()\n ]);\n $this->addColumn('step_array_text', ['label' => __('Array Label'), 'class' => 'required-entry']);\n $this->addColumn('step_option_class_id', ['label' => __('Class/IDs'), 'class' => 'required-entry']);\n $this->addColumn('step_option_value', ['label' => __('Value'), 'class' => 'required-entry']);\n $this->_addAfter = false;\n $this->_addButtonLabel = __('Add');\n }", "function set_video_screen_columns( $columns ) {\n $columns['video'] = 1;\n return $columns;\n}", "function edit_procedures_columns($columns) {\r\n\t$columns =\tarray_slice($columns, 0, 1, true) +\r\n\t\t\t\t\t\t\tarray('cws_proc_thumb' => __('Pics', THEME_SLUG)) +\r\n\t\t\t\t\t\t\tarray_slice($columns, 1, NULL, true);\r\n\tunset($columns['posts']);\r\n\t$columns['url'] = __('Url', THEME_SLUG);\r\n\t$columns['slug'] = $columns['url'];\r\n\tunset($columns['slug']);\r\n\treturn $columns;\r\n}", "protected function addVirtualColumns()\n {\n \n }", "private function getGridColumns()\n\t{\n\t\treturn array(\n\t\t\t// presentation_id is hidden so I don't have to provide a label\n\t\t\t'presentation_id' => array('field' => 'presentation_id', 'sortable' => true, 'hidden' => true),\n\t\t\t'session_id' => array('field' => 'session_id', 'sortable' => false, 'hidden' => true),\n\t\t\t'presentation_title' => array('field' => 'presentation_title', 'label' => 'Title', 'sortable' => true),\n\t\t\t'email' => array('field' => 'email', 'label' => 'User', 'sortable' => true, 'resource' => 'session', 'privilege' => 'save'),\n\t\t\t'session_title' => array('field' => 'session_title', 'label' => 'Session', 'sortable' => true)\n\t\t);\n\n\t}" ]
[ "0.68166625", "0.6534416", "0.6474227", "0.64439", "0.63987565", "0.6329963", "0.6320145", "0.6261865", "0.6243724", "0.6200142", "0.61845225", "0.6182248", "0.61686033", "0.61641186", "0.6113857", "0.6098027", "0.60933", "0.6085767", "0.60359377", "0.603322", "0.5973311", "0.5957292", "0.59449816", "0.5943969", "0.59203476", "0.5917632", "0.58914316", "0.57581615", "0.57548", "0.5743339", "0.5726766", "0.5715161", "0.56545657", "0.56517166", "0.5635543", "0.5609931", "0.55893147", "0.55543035", "0.5530744", "0.547384", "0.5469742", "0.5465256", "0.5461366", "0.5418921", "0.5403692", "0.5387757", "0.538047", "0.5371385", "0.53639495", "0.5362404", "0.5340711", "0.5336127", "0.5331501", "0.5318723", "0.5300202", "0.5296653", "0.52888674", "0.527908", "0.52770406", "0.52589726", "0.52533084", "0.52525145", "0.52525145", "0.52465934", "0.52395815", "0.5226617", "0.5210517", "0.52095366", "0.52015567", "0.51988584", "0.5192731", "0.5191305", "0.5189009", "0.51709974", "0.5170793", "0.516806", "0.5159352", "0.51593095", "0.5159297", "0.51587385", "0.51474094", "0.5147366", "0.51427984", "0.5138048", "0.5137524", "0.5131107", "0.51216024", "0.51200473", "0.50957745", "0.50948554", "0.50938916", "0.508991", "0.50898194", "0.5089618", "0.5088056", "0.50826424", "0.508208", "0.5077872", "0.50766116", "0.5069086" ]
0.7365672
0
Prepare url for reload grid through ajax
public function getGridUrl() { return $this->getUrl('*/*/versions', array('_current'=>true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAjaxUri() {}", "protected function getAjaxUri() {}", "public function getGridUrl()\n {\n // it maybe nice for filter several grids on one page\n // if needed return false. it will allow multiple grid urls... till url max length reached\n return $this->getUrl('*/*/*', array('_current'=>true));\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/grid', array('_current'=>true));\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/grid', array('_current'=>true));\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/*', array('_current' => true));\n }", "public function getGridUrl() {\n $params = array(\n 'product_id' => $this->getProduct()->getId(),\n 'store' => $this->getRequest()->getParam('store', 0),\n );\n return $this->getUrl('vidtest_admin/admin_product/grid', $params);\n }", "public function ajax_url() {\n\t\treturn admin_url( 'admin-ajax.php', 'relative' );\n\t}", "private function prepareData(){\n $this->params['crud_url'] = '/'.trim($this->params['crud_url'],'/');\n }", "public function getAjaxURL()\n {\n return AJAX_URL;\n }", "public function getStatusUrl()\n {\n return Mage::helper('oro_ajax')->getAjaxStatusUrl($this->_urlParams);\n }", "public function getAjaxUrl()\n {\n $token = $this->getApiKey();\n if ($token) {\n $token = $this->encryptor->decrypt($token);\n $apiUrl = $this->getBaseUrl().\"/v1/site.drivenjson?apiKey=\".$token;\n return $apiUrl;\n }\n return false;\n }", "protected function prepareUrl()\n {\n return 'http://'.$this->_host.'/service/v'.$this->_apiVersion.'/rest.php';\n }", "public function grid () {\n\n\t\t$path = $_GET['path'];\n\t\t$tags = $_GET['tags'];\n\t\t\n\t\t// This will store the tag set that we want to ask the API for\n\t\t$query = explode(',', urldecode($tags));\n\t\tarray_walk($query, array($this, 'map_tags'));\n\t\t\n\t\t// Grab collection of videos\n\t\t$collection = $this->videos->search_by_tags($query);\n\t\t\n\t\t// Replace the ajax/grid path with the active uri\n\t\tforeach ($collection->videos as $video) {\n\t\t\t$video->uri = str_replace('ajax/grid', urldecode($path), $video->uri);\n\t\t}\n\t\t\n\t\t$this->data['videos'] = $collection->videos; \n\t\t$this->data['total_count'] = $collection->total_count;\n\t\t\n\t\t// build pagination\n\t\t$this->pagination->set($this->config->item('page')-1, $this->config->item('sort'), $this->config->item('filter'), '', $this->data['total_count'], $this->data['base_url'] . $this->uri->uri_string());\n\t\t$pagination_data = '<div class=\"bar bc_pagination\">';\n\t\t$pagination_data .= str_replace('#/','',$this->pagination->create_links());\n\t\t$pagination_data .= $this->nav->get_pagination_summary($this->config->item('page'), $this->data['total_count']); \n\t\t$pagination_data .= '</div>';\n\t\t$this->data['pagination'] = $pagination_data;\n\n\t\t//$this->loadViews(array('player', 'grid','lineup','featuredproviders'), $this->data);\n\t\t$output = $this->load->view('grid-only', $this->data);\n\n\t}", "function medigroup_mikado_set_ajax_url() {\n echo '<script type=\"application/javascript\">var MikadoAjaxUrl = \"'.admin_url('admin-ajax.php').'\"</script>';\n }", "function voyage_mikado_set_ajax_url() {\n echo '<script type=\"application/javascript\">var MikadofAjaxUrl = \"'.admin_url('admin-ajax.php').'\"</script>';\n }", "public function company_addUrl() {\n $this->layout = \"ajax\";\n if (isset($_POST['child'])) {\n $child = $_POST['child'] + 1;\n $this->set('child', $child);\n }\n }", "function process_wpdrs_admin_ajax()\n\t\t{\n\t\t\tif(isset($_REQUEST['page']) && $_REQUEST['page'] == 'process_wpdrs_admin_ajax')\n\t\t\t{\n\t\t\t\t$url = admin_url().'?page=wpdrs';\n\t\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\twindow.location.reload(\"<?php echo $url;?>\");\n\t\t\t\t</script>\n\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t}", "private static function getReloadPath () {\n $reload = data_entry_helper::get_reload_link_parts();\n $reloadPath = $reload['path'];\n if(count($reload['params'])) {\n // decode params prior to encoding to prevent double encoding.\n foreach ($reload['params'] as $key => $param) {\n $reload['params'][$key] = urldecode($param);\n }\n $reloadPath .= '?'.http_build_query($reload['params']);\n }\n return $reloadPath;\n }", "public function getAjaxBaseUrl() {\r\n\t\treturn admin_url(\"admin-ajax.php\");\r\n\t}", "public function preRenderUrl()\n {\n\n if (!$this->context->element)\n $this->context->element = $this->getIdKey();\n\n $this->defUrl = $this->context->toUrlExt();\n $this->defAction = $this->context->toActionExt();\n\n }", "function url_admin_ajax(): string\n{\n return \\admin_url('admin-ajax.php');\n}", "protected function grid()\n {\n Admin::script('$(\".price_submit\").on(\"click\", function () {\n var values = []; \n var keys = [] \n var closest_div = $(this).closest(\".price_input\");\n closest_div.find(\"input[id^=\\'price_\\']\").each(function() {\n values.push($(this).val());\n keys.push($(this).data(\"id\"));\n });\n\n $.ajax({\n url: \"/admin/store/menu_item/ajax\",\n type: \"POST\",\n dataType : \"json\",\n data: {key: keys, val: values},\n cache: false,\n headers: { \"X-CSRF-Token\" : $(\"#csrf_token\").val() },\n success: function(data) {\n toastr.success(data.message);\n },\n error: function() {\n alert(\"error !\");\n }\n });\n \n return false;});'\n );\n\n return Admin::grid(MenuItem::class, function (Grid $grid) {\n\n $grid->tools(function ($tools) {\n $tools->append('<input type=\"hidden\" id=\"csrf_token\" name=\"csrf_token\" value=\"' . csrf_token() . '\" />\n <a href=\"/admin/store/menu_import\" id=\"import_data\" type=\"button\" \n class=\"btn btn-sm btn-primary pull-right\"><i class=\"fa fa-cutlery\" aria-hidden=\"true\"></i>&nbsp;&nbsp;匯入餐點</a>');\n });\n\n $company_id = Session::get('company_id');\n $store_id = Session::get('store_id');\n\n $grid->model()->where('company_id', $company_id)\n ->where('store_id', $store_id)\n ->orWhere(function ($query) use ($company_id) {\n $query->where('company_id', '=', $company_id)\n ->where('store_id', 0);\n })->orderby('sort_by', 'asc');\n\n $grid->column('group_id', trans('idelivery.cuisine.group.name'))->display(function () {\n return CuisineGroup::getGroupName($this->group_id);\n });\n\n $grid->column('name', trans('idelivery.cuisine.item.name'))->editable();\n $grid->column('intro', '簡介')->display(function () {\n return empty($this->intro) ? '' : $this->intro;\n });\n\n $grid->column('picture', '圖片')->display(function () {\n $result = '';\n if (!empty($this->picture)) {\n $result = '<img src=\"'.env('ADMIN_UPLOAD_URL', '').$this->picture.'\" width = \"50px\">';\n }\n\n return $result;\n });\n \n $grid->column('size', '份量/價格')->style(\"max-width:100px\")->display(function () {\n\n $result = $this->size;\n\n if (!empty($result)) {\n $str = '<form class=\"form-group\" style=\"text-align: left\">';\n $str .= '<input type=\"hidden\" id=\"csrf_token\" name=\"csrf_token\" value=\"' . csrf_token() . '\" />';\n $str .= '<div class=\"price_input\">';\n foreach ($result as $row) {\n if (!empty($row->size_name)) {\n if (!empty($row->price)) {\n $str .= '<div class=\"row\">'\n .'<div class=\"col-xs-4\">'\n .'<span class=\"label label-success\">'.$row->size_name.'</span>'\n .'</div>'\n .'<div class=\"col-xs-8\">'\n .'<input type=\"text\" id=\"price_'.$row->id.'\" data-id='.$row->id.' name=\"price_'.$row->id.'\" value=\"'.$row->price.'\" class=\"form-control\" placeholder=\"限數字\" />'\n .'</div>'\n .'</div>';\n } else {\n $str .= '<div class=\"row\">'\n .'<div class=\"col-xs-12\">'\n .'<span class=\"label label-success\">'.$row->size_name.'</span>'\n .'</div>'\n .'</div>';\n }\n } else {\n if (!empty($row->price)) {\n $str .= '<div class=\"row\">'\n .'<div class=\"col-xs-12\">'\n .'<input type=\"text\" id=\"price_'.$row->id.'\" data-id='.$row->id.' name=\"price_'.$row->id.'\" value=\"'.$row->price.'\" class=\"form-control\" placeholder=\"限數字\" />'\n .'</div>'\n .'</div>';\n }\n }\n }\n }\n\n $str .= '<p></p><button type=\"submit\" class=\"btn btn-info btn-xs pull-left price_submit\"><i class=\"fa fa-save\"></i>&nbsp;保存'\n .'</button><button type=\"reset\" class=\"btn btn-warning btn-xs pull-left\" style=\"margin-left:10px;\">'\n .'<i class=\"fa fa-trash\"></i>&nbsp;復原</button></div></form>';\n\n return $str;\n });\n\n $grid->unit(trans('idelivery.cuisine.unit.title'))->pluck('unit_name')->label();\n $grid->column('points', trans('idelivery.cuisine.item.points'));\n $grid->column('store_item_status', '狀態')->switch($this->status_arr);\n $grid->sort_by('順序')->orderable();\n\n $grid->disableFilter();\n $grid->disableRowSelector();\n });\n }", "public function getUrlProcessNewMail() {\r\n return $this->getUrl('*/*/GetNewMailsAjax');\r\n }", "public function loadAjax() {\n\t \n\t\t$this->classificationFacade->loadAjax($_GET);\n\t\t\n\t}", "public function ajaxListAction() {\n $oTable = new \\Commun\\Grid\\GuildesGrid($this->getServiceLocator(), $this->getPluginManager());\n $oTable->setAdapter($this->getAdapter())\n ->setSource($this->getTableGuilde()->getBaseQuery())\n ->setParamAdapter($this->getRequest()->getPost());\n return $this->htmlResponse($oTable->render());\n }", "function get_url($column){\r\n\r\n\t\tif(strpos($this->sort_url,'#COLUMN_ID#')!==false){\r\n\r\n\t\t\treturn str_replace('#COLUMN_ID#',$column,$this->sort_url);\r\n\r\n\t\t}else{\r\n\r\n\t\t\treturn $this->sort_url.(strpos($this->sort_url,'?')!==false ? '&' : '?').'sort='.$this->sort;\r\n\t\t}\r\n\r\n\t}", "public function ajaxAction(){\n \t$em = $this->getDoctrine()->getManager();\n \t\n \t$page = $_GET['page']; // get the requested page\n \t$limit = $_GET['rows']; // get how many rows we want to have into the grid\n \t$sidx = $_GET['sidx']; // get index row - i.e. user click to sort\n \t$sord = $_GET['sord']; // get the direction\n \n \t$criteria = array();\n \tif(isset($_GET['numDossier'])) $criteria['numDossier']=$_GET['numDossier'];\n// $statutRefuse = $em->getRepository('PenderieDefaultBundle:StatutDossier')->find(Dossier::STATUT_REFUSE_AUTOMATIQUE);\n \n// \t$criteria['statut']=$statutRefuse;\n \t// TODO : ajouter la selection par date du jour plus utilisateur connecté\n// \t$criteria['dateRefus']=array((new \\DateTime('2014-07-16'))->format('Y-m-d'));\n \n \t$count = $em->getRepository('PenderieDefaultBundle:Dossier')->getNbResultatsRefus($criteria, $this->getUser());\n \t$entities = $em->getRepository('PenderieDefaultBundle:Dossier')->getSearchRefus($criteria, $this->getUser(), array($sidx=>$sord), $limit, $page);\n \tif( $count >0 ) {\n \t\t$total_pages = ceil($count/$limit);\n \t} else {\n \t\t$total_pages = 0;\n \t}\n \tif ($page > $total_pages) $page=$total_pages;\n \t$start = $limit*$page - $limit; // do not put $limit*($page - 1)\n \n \t$responce = new \\stdClass();\n \t$responce->page = $page;\n \t$responce->total = $total_pages;\n \t$responce->records = $count;\n \t$i=0;\n \tforeach ($entities as $dossier) {\n \t\t$responce->rows[$i]['id']=$dossier->getId();\n \t\t$responce->rows[$i]['cell']=array(\n \t\t\t\t$dossier->getNumDossier(),\n \t\t\t\t$dossier->getStatut()->getLibelle(),\n \t\t\t\t($dossier->getDateRefus())?$dossier->getDateRefus()->format('d/m/Y'):\"\",\n \t\t);\n \t\t$i++;\n \t}\n \treturn new JsonResponse($responce);\n }", "public static function getAjaxURL()\r\n\t{\r\n\t\tif (!JLanguageMultilang::isEnabled())\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n \r\n\t\t$lang = JFactory::getLanguage()->getTag();\r\n\t\t$app = JFactory::getApplication();\r\n\t\t$sitemenu= $app->getMenu();\r\n\t\t$thismenuitem = $sitemenu->getActive();\r\n\r\n\t\t// if we haven't got an active menuitem, or we're currently on a menuitem \r\n\t\t// with view=category or note = \"Ajax\", then just stay on it\r\n\t\tif (!$thismenuitem || strpos($thismenuitem->link, \"view=category\") !== false || $thismenuitem->note == \"Ajax\")\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t// look for a menuitem with the right language, and a note field of \"Ajax\"\r\n\t\t$menuitem = $sitemenu->getItems(array('language','note'), array($lang, \"Ajax\"));\r\n\t\tif ($menuitem)\r\n\t\t{\r\n\t\t\t$itemid = $menuitem[0]->id; \r\n\t\t\t$url = JRoute::_(\"index.php?Itemid=$itemid&view=helloworld&format=json\");\r\n\t\t\treturn $url;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public function url()\n {\n return backpack_url(\"/page/{$this->id}/edit\");\n }", "static function wck_fep_print_ajax_url() {\n\t\t/* ajax url for frontend */\n\t\techo '<script type=\"text/javascript\">var wckAjaxurl = \"'. admin_url('admin-ajax.php') .'\";</script>';\n\t}", "public function url()\n {\n return backpack_url(\"/page-template/{$this->id}/edit\");\n }", "abstract public function get_url_update();", "public function grid()\n\t{\n\t\t$this->load->library('grid');\n\t\t$this->load->config($this->uri->segments[1].'/'.$this->session->grid);\n\t\t$grid = $this->config->item('grid');\n\n\t\tif(isset($grid['session']))\n\t\t{\n\t\t\t$sess = explode('-',$grid['session']);\n\t\t\t$val = explode('_',$this->input->post($grid['session']));\n\t\t\tforeach($sess as $k=>$v)\n\t\t\t{\n\t\t\t\t$this->session->set_userdata($v,$val[$k]);\n\t\t\t\t$this->data[$v] = $val[$k];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->load->model('BaseModel');\n\n\t\t$grid['controller'] = $this->uri->segments[1];\n\t\tif(isset($grid['dir']))\n\t\t{\n\t\t\t$path = DATA . $grid['dir'];\n\t\t\t$grid['target'] = $grid['dir'];\n\t\t\t$this->session->set_userdata('location',$path);\t \t\n\t\t\t\n\t\t\tif(!file_exists($path))\n\t\t\t{\n\t\t\t\tmkdir($path, 0777);\n\t\t\t\t@fopen($path . \"/index.html\", \"w\");\n\t\t\t}\n\n\t\t}\n\t\t$grid['content'] = $this->BaseModel->execute($grid['arguments'],isset($grid['param'])?$grid['param']:[])->result();\n\n\t\tif(isset($grid['cell']) && is_array($grid['cell']))\n\t\t{\n\t\t\tforeach($grid['cell'] as $key => $val)\n\t\t\t{\n\t\t\t\tif(isset($val['option']))\n\t\t\t\t{\n\t\t\t\t\t$grid['cell'][$key]['option'] = $val['option']['helper']($this->BaseModel->execute($val['option']['arguments'],[], $this->data)->result(), $val['option']['field'], $val['option']['label']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->viewGrid($grid);\n\t}", "private function getUrl() {\r\n if(!$this->markActive)\r\n return '';\r\n $mid = Yii::$app->controller->module->id == Yii::$app->id ? '' : Yii::$app->controller->module->id;\r\n $cid = Yii::$app->controller->id;\r\n $aid = Yii::$app->controller->action->id;\r\n $id = isset($_GET['slug']) ? $_GET['slug'] : (isset($_GET['id']) ? $_GET['id'] : '');\r\n $rubric = isset($_GET['rubric']) ? $_GET['rubric'] : '';\r\n $tag = isset($_GET['tag']) ? $_GET['tag'] : '';\r\n return ($mid ? $mid. '/' : '') . \r\n $cid . '/' . \r\n ($aid == 'index' \r\n ? ($rubric \r\n ? 'rubric/' . $rubric . ($tag \r\n ? '/tag/' . $tag \r\n : '') \r\n : 'index') \r\n : ($aid == 'view' ? $id : $aid)\r\n );\r\n }", "protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}", "protected function getNonAjaxRedirectUrl()\n {\n return Yii::app()->createUrl('/' . $this->moduleId . '/default/details',\n array( 'id' => $this->params['relationModel']->id));\n }", "public function getRowUrl($row) {\n return $this->getUrl ( '*/*/edit', array (\n \n 'id' => $row->getId () \n ) );\n }", "public function getAjaxUrl()\n {\n return $this->getUrl('authnetcim/system_config/initWebhooks');\n }", "public function getURL()\n {\n return $this->site->getURL() . 'unl_progress/edit/';\n\n }", "public function actionAjaxLoad()\r\n {\r\n \treturn $this->render('ajax-load');\r\n }", "function set_ajax_url()\n{\n if (!isset($_POST['action'])):\n ?>\n <script>\n var ajax_url = \"<?php echo admin_url('admin-ajax.php'); ?>\";\n </script>\n <?php\n endif;\n}", "public function getAjaxCheckUrl()\n {\n return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_atwixtweaks/check');\n }", "public function getRowUrl($row)\n {\n return '';//$this->getUrl('*/*/detail', array('id' => $row->getId()));\n }", "public function ajax_GridOutRequest() {\n $sessid = $this->session->userdata('usergroup');\n $method = $this->uri->segment('2');\n $accesdata = $this->Menu_mdl->get_menusetting2($sessid, $method);\n if ($this->input->post('sSearch') == 'ReqTypeName') {\n $param_ = 'param_';\n } else {\n $param_ = $this->input->post('sSearch');\n }\n $icolumn = array('Direktory_PR', 'RequestID', 'DivisionCode', 'DeleteDate', 'Is_trash', 'Jenis_periode_sewa', 'Jangka_waktu', 'Termin_sewa', 'BudgetCOA', 'CreateDate', 'Status', 'ReqCategoryName', 'ReqTypeName', 'EmployeeName', 'DivisionName', 'BranchCode', 'BranchName', 'RktName', 'param_');\n $iwhere = array(\n $param_ => $_POST['search']['value']\n );\n\n $iorder = array('RequestID' => 'asc');\n $list = $this->datatables_custom->get_datatables('vw_pr_out_request', $icolumn, $iorder, $iwhere);\n\n $data = array();\n $no = $_POST['start'];\n foreach ($list as $idatatables) {\n\n $jenisperiode = $idatatables->Jenis_periode_sewa;\n if ($jenisperiode == '1') {\n $jenisperiode_ket = \"[ Harian ]\";\n $add_ket = \"Hari\";\n } elseif ($jenisperiode == '2') {\n $jenisperiode_ket = \"[ Bulanan ]\";\n $add_ket = \"Bulan\";\n } elseif ($jenisperiode == '3') {\n $jenisperiode_ket = \"[ Tahunan ]\";\n $add_ket = \"Tahun\";\n } else {\n $jenisperiode_ket = \"\";\n $add_ket = \"Month\";\n }\n\n $direktoriUpload = $idatatables->Direktory_PR;\n $jangkawaktu = $idatatables->Jangka_waktu;\n $terminsewa = $idatatables->Termin_sewa;\n\n $format = 'Y-m-d H:i:s.u';\n $date = DateTime::createFromFormat($format, $idatatables->CreateDate);\n $date_del = DateTime::createFromFormat($format, $idatatables->DeleteDate);\n if ($idatatables->Status == 0) {\n $st = \"<p class='warning'>Waiting Approval</p>\";\n } else if ($idatatables->Status == 1) {\n $st = \"<p class='success'>Set PO</p>\";\n } else if ($idatatables->Status == 2) {\n $st = \"<p class='warning'>Set Termin</p>\";\n } else if ($idatatables->Status == 3) {\n $st = \"<p class='warning'>Upload IAS</p>\";\n } else if ($idatatables->Status == 4) {\n $st = \"<p class='warning'>Payment(Closing)</p>\";\n } elseif ($idatatables->Status == 5) {\n $st = \"<p class='danger'>Rejected</p>\";\n }\n// \n// if ($row->Is_trash == 1) {\n// $style = \"class='danger' \";\n// $st = \"<td>Tanggal Hapus :<br>\" . $date_del->format('d-m-Y H:i:s') . \"</td>\";\n// } else {\n// $style = \"\";\n// }\n\n\n $no++;\n $row = array();\n $row[] = $no;\n\n $row[] = $idatatables->BudgetCOA;\n $row[] = 'PR-' . $idatatables->DivisionCode . '-' . sprintf('%03u', $idatatables->RequestID);\n if ($idatatables->RktName == null || $idatatables->RktName == '') {\n $row[] = '<b>' . $idatatables->ReqTypeName . ' ' . $jenisperiode_ket . '</b> -' . $idatatables->ReqCategoryName;\n } else {\n $row[] = $idatatables->ReqTypeName . '-' . $idatatables->ReqCategoryName . ' (' . $idatatables->RktName . ')';\n }\n $row[] = $idatatables->ReqCategoryName . ' (' . $idatatables->RktName . ')';\n $row[] = $idatatables->EmployeeName . ' (' . $idatatables->BranchName . ')';\n $row[] = $date->format('d-m-Y H:i:s');\n $row[] = $st;\n if ($idatatables->Is_trash == 1) {\n $row[] = '<a><button class=\"btn btn-success btn-xs disabled\" onclick=\"set_reqid( ' . $idatatables->RequestID . ')\" type=\"button\">Upload PR</button></a>';\n } else {\n if ($direktoriUpload == 'kosong' || $direktoriUpload == '' || $direktoriUpload == 'NULL') {\n\n $row[] = '<a data-toggle=\"modal\" data-target=\"#myUploadPR\" data-id=\"' . $idatatables->RequestID . '\"><button class=\"btn btn-success btn-xs\" onclick=\"set_reqid(' . $idatatables->RequestID . ')\" type=\"button\">Upload PR</button></a>';\n } else {\n $row[] = 'Sudah Upload PR';\n }\n }\n\n if ($idatatables->Is_trash != 1) {\n $subrow = '<a href=\"' . base_url() . 'procurement/purchase_request/cetak/' . $idatatables->RequestID . '\" class=\"btn green fa fa-print\" target=\"_blank\"></a>'\n . '<a data-toggle=\"modal\" data-target=\"#mdl_DetailOR\" ><button class=\"btn btn-primary btn-xs\" type=\"button\" onclick=\"detailOR(' . $idatatables->RequestID . ')\">Detail</button></a>';\n// if ($accesdata[0]->is_delete == 1 && $idatatables->Status != 5) {\n if ($idatatables->Status != 5) {\n $chekapproval = $this->Requestproc_mdl->cheking_aproval($idatatables->RequestID);\n $chekpay = $this->Requestproc_mdl->cheking_paytermin($idatatables->RequestID);\n if (empty($chekpay)) {\n $subrow.= '<a data-toggle=\"modal\" data-target=\"#mdl_delete\" data-id=\"' . $idatatables->RequestID . '\"><button class=\"btn btn-primary btn-xs\" onclick=\"set_req(' . $idatatables->RequestID . ')\" type=\"button\">Delete</button></a>';\n }\n }\n $row[] = $subrow;\n } else {\n $row[] = '<a data-toggle=\"modal\" data-target=\"#mdl_DetailOR\"><button class=\"btn btn-primary btn-xs\" type=\"button\" onclick=\"detailOR(' . $idatatables->RequestID . ')\">Detail</button></a>';\n }\n $row[]=$idatatables->Is_trash;\n \n $data[] = $row;\n }\n\n $output = array(\n \"draw\" => $_POST['draw'],\n \"recordsTotal\" => $this->datatables_custom->count_all(),\n \"recordsFiltered\" => $this->datatables_custom->count_filtered(),\n \"data\" => $data,\n );\n //output to json format\n echo json_encode($output);\n }", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "public function getRowUrl($row) {\n return $this->getUrl ( '*/*/edit', array (\n 'id' => $row->getId () \n ) );\n }", "function wck_print_ajax_url(){\r\n\t\techo '<script type=\"text/javascript\">var wppbWckAjaxurl = \"'. apply_filters( 'wck_ajax_url', admin_url('admin-ajax.php') ) .'\";</script>';\r\n\t}", "public function editUrl() {}", "function AjaxRefreshSearch($titulo, $id_column, $grid_id, $values_string,$focus_name)\r\n{\r\n$values = split(\"value_separator_grid\", $values_string);\r\nif($titulo==\"Reservas\"){\r\n\t\r\n\t$search_value0 = $values[0];//nombre\r\n\t$search_value1 = $values[1];//apellido1\r\n\t$search_value2 = $values[2];//fecha_inicio\r\n\t$search_value3 = $values[3];//fecha_fin\r\n\t$search_value4 = $values[4];//imp_pagado\r\n\t$_SESSION[$grid_id]->search_focus=$focus_name;\r\n\t$_SESSION[$grid_id]->SetSearchStrings($search_value0,$search_value1,$search_value2,$search_value3,$search_value4);\r\n\t//$_SESSION[$grid_id]->SetSqlSelect('Id_cliente, nombre, apellido1, apellido2, pasaporte','cliente', 'apellido1 like \"'.$search_value1.'%\" and apellido2 like \"'.$search_value2.'%\" and nombre like \"'.$search_value0.'%\" and pasaporte like \"'.$search_value3.'%\"');\r\n\t$_SESSION[\"grid\"]->SetSqlSelect('reserva.Id_res, nombre as Nombre, apellido1 as Apellido, fec_ini as \"Fecha_Inicio\", fec_fin as \"Fecha_Fin\", imp_pagado as Pagado','reserva LEFT JOIN cliente ON reserva.Id_cliente=cliente.Id_cliente', 'apellido1 like \"'.$search_value1.'%\" and fec_ini like \"'.$search_value2.'%\" and fec_fin like \"'.$search_value3.'%\" and imp_pagado like \"'.$search_value4.'%\" and nombre like \"'.$search_value0.'%\" and not exists (Select * from checkin where checkin.Id_res=reserva.Id_res)');\r\n\t$_SESSION[\"grid\"]->SetUniqueDatabaseColumn(\"Id_res\", false); \r\n}\r\nelse{\t\r\n\t$search_value0 = $values[0];//firstname\r\n\t$search_value1 = $values[1];//apellido1\r\n\t$search_value2 = $values[2];//apellido2\r\n\t$search_value3 = $values[3];//pasaporte\r\n\t$_SESSION[$grid_id]->search_focus=$focus_name;\r\n\t$_SESSION[$grid_id]->SetSearchStrings($search_value0,$search_value1,$search_value2,$search_value3);\r\n\t$_SESSION[$grid_id]->SetSqlSelect('Id_cliente, nombre as Nombre, apellido1 as Apellido_1, apellido2 as Apellido_2, pasaporte as Pasaporte','cliente', 'apellido1 like \"'.$search_value1.'%\" and apellido2 like \"'.$search_value2.'%\" and nombre like \"'.$search_value0.'%\" and pasaporte like \"'.$search_value3.'%\"');\r\n\t$_SESSION[$grid_id]->SetUniqueDatabaseColumn(\"Id_cliente\", false); \r\n\r\n}\r\n\t$_SESSION[$grid_id]->GoToPage(1);\r\n\treturn ($_SESSION[$grid_id]->CreateGrid());\r\n\t\r\n\t//$_SESSION[$grid_id]->SetSqlSelect('p.id as id, p.firstname AS Vorname, p.surename AS Nachname, c.name AS Unternehmen, con.name AS Land', 'person p LEFT JOIN company c ON c.ID=p.company_id LEFT JOIN countries con ON p.country_id=con.ID', 'p.surename!=\"\" and p.surename like \"'.$search_value1.'%\" and p.firstname like \"'.$search_value0.'%\" and c.name like \"'.$search_value2.'%\" and con.name like \"'.$search_value3.'%\"');\r\n}", "public static function getRewriteAjaxUrl($class = '', $method = '')\n {\n $basic = trailingslashit(home_url()) . self::getRewriteAPIPrefix() . '/' . $class;\n if (!empty($method)) {\n $basic = $basic . '/' . $method;\n }\n\n return $basic;\n }", "protected function initCurrentUrl() {}", "protected function initCurrentUrl() {}", "public function sourcinggridAction() {\n\t\t\n\t\t$this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->toHtml();\n\t\t$this->loadLayout()->renderLayout();\n\t\t\n\t}", "public function updateGrid($gridModel) {\n // Sending the model the datalayer\n $this->gridDB->updateGrid($gridModel);\n\n // Sending user to grid page\n header(\"Location: grid\");\n }", "function modify_url($mod) { \n $url = \"http://\" .$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; \n $query = explode(\"&\", $_SERVER['QUERY_STRING']); \n // modify/delete data \n foreach($query as $q) { \n @list($key, $value) = explode(\"=\", $q); \n if(array_key_exists($key, $mod)) \n { \n if($mod[$key]) \n { \n $url = preg_replace('/' .$key. '=' .$value. '/', $key. '=' .$mod[$key], $url); \n } \n else \n { \n $url = preg_replace('/&?'.$key.'='.$value.'/', '', $url); \n } \n } \n } \n // add new data \n foreach($mod as $key => $value) { \n if($value && !preg_match('/' .$key. '=/', $url)) \n { \n $url .= '&' .$key. '=' .$value; \n } \n }\n \n \tfor ($i=0; $_SERVER['QUERY_STRING'] == \"\" && $i != 1; $i++)\n \t$url = str_replace(\"&\", \"?\", $url);\n \n \n return $url; \n}", "public function getReinitUrl()\n {\n return $this->urlBuilder->getUrl('walleycheckout/reinit');\n }", "protected function grid($url_type)\n {\n return Admin::grid(SuperGoods::class, function (Grid $grid)use($url_type) {\n $grid -> model() -> where('url_type',$url_type);\n $grid -> model() -> where('flag',0);\n $grid->disableRowSelector();\n $grid->actions(function ($actions) {\n $id = $actions->getKey();\n $actions->disableDelete();\n });\n $grid->disableExport();\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n $filter->where(function ($query) {\n\n $query -> where('product_id','like',\"{$this->input}\");\n }, '商品id');\n $filter->where(function ($query) {\n\n $query -> where('product_name','like',\"%{$this->input}%\");\n }, '商品名称');\n\n\n });\n $grid->disableCreateButton();\n $grid->id('ID')->sortable();\n $grid->product_no('商品id');\n $grid->product_name('商品名称');\n $grid->weight('商品重量');\n $grid->image('图片')->image(url('/').'/uploads/');\n $grid->price_a('a');\n $grid->price_b('b');\n $grid->price_c('c');\n $grid->price_d('d');\n $grid -> status('是否上架') -> display(function($value){\n if($value){\n return '上架';\n } else{\n return '未上架';\n }\n });\n\n $grid->tools(function ($tools)use($url_type) {\n $tools->append(new \\App\\Admin\\Extensions\\SuperGoods($url_type));\n });\n\n $grid->updated_at('修改时间')->display(function($value){\n return date('Y-m-d H:i',$value);\n });\n $grid->actions(function ($actions)use($url_type) {\n $id = $actions->getKey();\n //$actions->disableDelete();\n $actions->disableEdit();\n $actions->append('<a href=\"'.admin_url('mergeGoods').'?url_type='.$url_type.'&merge_goods_id='.$id.'\" style=\"margin-left:10px;\" ><i class=\"fa fa-eye\"></i></a>');\n\n //$actions -> append(new MergeDelete($id));\n //$actions->disableDelete();\n });\n });\n }", "function getJS(){\n \n // prepare for jqgrid\n $conf = $this->conf[$this->conf['key'].'.'];\n $conf['url'] = 'index.php?id='.$this->cObj->data['pid'].'&type='.$conf['typeNum'].'&tskey='.$this->conf['key'];\n $conf['pager'] = '#jqgrid-'.$this->uid.'-pager';\n $conf['datatype'] = 'xml';\n $conf['mtype'] = 'GET';\n $conf['rowList'] = explode(',',$conf['rowList']);\n \n $pagerOpts = $conf['pager.'];\n $pagerOptsEdit = $pagerOpts['edit.'];\n $pagerOptsAdd = $pagerOpts['add.'];\n $pagerOptsDel = $pagerOpts['del.'];\n $pagerOptsSearch = $pagerOpts['search.'];\n $pagerOptsView = $pagerOpts['view.'];\n \n // columns\n foreach($conf['columns.'] as $pos => $field) $conf['colModel'][] = array_diff_key($field,array('stdWrap.'=>0));\n \n // tx_jqgrid_pi1 onlys\n unset($conf['table']);\n unset($conf['table.']);\n unset($conf['typeNum']);\n unset($conf['pager.']);\n unset($conf['columns.']);\n unset($pagerOpts['edit.']);\n unset($pagerOpts['add.']);\n unset($pagerOpts['del.']);\n unset($pagerOpts['search.']);\n unset($pagerOpts['view.']);\n \n $jqGridID = \"#jqgrid-\".$this->uid.\"-list\";\n $jqGridParameters = self::array_js($conf,' ');\n $navGridParameters = implode(',',array(\n\t\t\t\"'\".$conf['pager'].\"'\",\n self::array_js($pagerOpts ,' '),\n self::array_js($pagerOptsEdit ,' '),\n self::array_js($pagerOptsAdd ,' '),\n self::array_js($pagerOptsDel ,' '),\n self::array_js($pagerOptsSearch ,' '),\n self::array_js($pagerOptsView ,' '),\n ));\n \n // transform to js\n $jscode = \"jQuery(document).ready(function(){\\n\";\n $jscode .= \" jQuery('\".$jqGridID.\"').jqGrid(\".$jqGridParameters.\").navGrid(\".$navGridParameters.\");\\n\";\n $jscode .= \"});\\n\";\n \n return $jscode;\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 wc_ajaxurl() {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar ajaxurl =\t\"<?php echo admin_url('admin-ajax.php'); ?>\";\n\t\t\tvar wpurl =\t\t\"<?php bloginfo('template_directory'); ?>\";\n\t\t</script>\n\t\t<?php\n\t}", "function wpsl_get_ajax_url() {\n\n $i18n = new WPSL_i18n();\n\n $param = '';\n\n if ( $i18n->wpml_exists() && defined( 'ICL_LANGUAGE_CODE' ) ) {\n $param = '?lang=' . ICL_LANGUAGE_CODE;\n }\n\n $ajax_url = admin_url( 'admin-ajax.php' . $param );\n\n return $ajax_url;\n}", "protected function set_url_this_view($val){ $this->input ['table_url'] = $val ; }", "public function getRowUrl($row)\n {\n return false;//$this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row) {\n return $this->getUrl(\"*/*/edit\", array('ticket_id' => $row->getTicketId()));\n }", "private function loadAjax(): void {\n // ID på tabellen skal være sat enten i $_GET eller $_POST\n if (isset($_POST['RCMSTable']) || isset($_GET['RCMSTable'])) {\n $id = $_POST['RCMSTable'] ?? $_GET['RCMSTable'];\n } else {\n return;\n }\n\n if (!isset($this->table[$id])) {\n return;\n }\n\n ob_get_clean();\n ob_start();\n header(\"Content-Type: application/json\");\n\n $table = $this->table[$id];\n $columns = $this->columns[$id];\n $where = $this->where[$id];\n $order = $this->order[$id];\n $settings = $this->settings[$id];\n\n if (isset($_POST['pageNum'])) {\n $settings['pageNum'] = $_POST['pageNum'];\n }\n\n if (isset($_POST['searchTxt'])) {\n $settings['searchTxt'] = $_POST['searchTxt'];\n }\n\n if (isset($_POST['sortKey'])) {\n $settings['sortKey'] = $_POST['sortKey'];\n }\n\n if (isset($_POST['sortDir'])) {\n $settings['sortDir'] = $_POST['sortDir'];\n }\n\n $this->settings[$id] = $settings;\n\n $rows = $this->retrieveData($table, $columns, $where, $order, $settings);\n\n $this->buildRows($id, $rows);\n\n exit;\n }", "protected function get_url_this_view(){ return $this->input ['table_url'] ;}", "public function getRowUrl($row)\n\t{\n\t\treturn $this->getUrl('*/*/edit', array('id' => $row->getId()));\n\t}", "public function editUrl() {\n\t\treturn str_replace('/page/edit/',\n '/lab_charger/lab_charge_items/edit/',\n parent::editUrl());\n\t}", "public function getTaxRateLoadUrl()\n {\n return $this->getUrl('tax/rate/ajaxLoad/');\n }", "public function compAjaxUpdate() {\r\n $req = $this->input->post('req');\r\n updateComponentDetails($req);\r\n }", "public function getCreateRecordUrl() {\n\t\treturn 'javascript:Settings_SMSNotifier_List_Js.triggerEdit(event, \"index.php?module='.$this->getName().'&parent='.$this->getParentName().'&view=Edit\")';\n\t}", "function index($action = '') {\r\n\t\t$grid = new Grid;\t\t\r\n\t\t$grid->setTitle('List UPD Komparator');\t\t\r\n\t\t$grid->setTable('dossier.dossier_upd');\t\t\r\n\t\t$grid->setUrl('browse_upd_komparator');\r\n\t\t$grid->addList('pilih','vUpd_no','vNama_usulan','itemas.C_ITENO','itemas.C_ITNAM','tabmas02.c_nmlisen','cNip_pengusul','plc2_upb_team.vteam');\r\n\t\t$grid->setSortBy('vUpd_no');\r\n\t\t$grid->setSortOrder('DESC');\r\n\t\t$grid->setWidth('vUpd_no', '70');\r\n\t\t$grid->setWidth('itemas.C_ITENO', '70');\r\n\t\t$grid->setWidth('plc2_upb_team.vteam', '150');\r\n\t\t$grid->setWidth('pilih', '50');\r\n\r\n\t\r\n\t\t$grid->setLabel('vUpd_no', 'No Dossier');\r\n\t\t$grid->setLabel('vNama_usulan', 'Nama Usulan');\r\n\t\t$grid->setLabel('itemas.C_ITENO', 'Kode Produk');\r\n\t\t$grid->setLabel('cNip_pengusul', 'NIP Pengusul');\r\n\t\t$grid->setLabel('plc2_upb_team.vteam', 'Team Andev');\r\n\t\t$grid->setLabel('itemas.C_ITNAM', 'Nama Produk');\r\n\t\t$grid->setLabel('tabmas02.c_nmlisen', 'Lisensi');\r\n\r\n\t\t$grid->setAlign('pilih', 'center');\r\n\r\n\t\t$grid->setInputGet('field',$this->_field);\r\n\t\t$grid->hideTitleCol('pilih');\r\n\t\t$grid->notSortCol('pilih');\r\n\t\t$grid->setSearch('vUpd_no','vNama_usulan');\r\n\t\t$grid->setJoinTable('plc2.plc2_upb_team', 'plc2.plc2_upb_team.iteam_id = dossier.dossier_upd.iTeam_andev', 'inner');\r\n\t\t$grid->setJoinTable('plc2.itemas','dossier_upd.iupb_id=itemas.C_ITENO','inner');\r\n\t\t$grid->setJoinTable('plc2.tabmas02', 'tabmas02.c_lisensi = itemas.c_lisensi', 'inner');\t\r\n\t\t$grid->setQuery('dossier_upd.ihold', 0);\r\n\t\t$grid->setQuery('dossier_upd.lDeleted', 0);\r\n\r\n\t\t$nip=$this->user->gNIP;\r\n\t\tif($this->auth->is_manager()){\r\n\t\t\t$x=$this->auth->dept();\r\n\t\t\t$manager=$x['manager'];\r\n\t\t\tif(in_array('AD', $manager)){\r\n\t\t\t\t$type='AD';\r\n\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN ('.$this->auth->my_teams().')', null);\r\n\t\t\t}elseif(in_array('TD', $manager)){\r\n\t\t\t\t$type='TD';\r\n\t\t\t\t$sqlcek='select * from plc2.plc2_upb_team te where te.vnip=\"'.$nip.'\" and vtipe=\"TD\"';\r\n\t\t\t\t$r=$this->dbset->query($sql);\r\n\t\t\t\tif($r->num_rows>=1){\r\n\t\t\t\t\t$d=$r->row_array();\r\n\t\t\t\t\tif($d['iteam_id']==81){\r\n\t\t\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN (17)', null);\r\n\t\t\t\t\t}elseif ($d['iteam_id']==83) {\r\n\t\t\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN (40)', null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{$type='';}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$x=$this->auth->dept();\r\n\t\t\t$team=$x['team'];\r\n\t\t\tif(in_array('AD', $team)){\r\n\t\t\t\t$type='AD';\r\n\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN ('.$this->auth->my_teams().')', null);\r\n\t\t\t}elseif(in_array('TD', $manager)){\r\n\t\t\t\t$type='TD';\r\n\t\t\t\t$sqlcek='select * from plc2.plc2_upb_team_item ite\r\n\t\t\t\t\tjoin plc2.plc2_upb_team te on te.iteam_id=ite.iteam_id\r\n\t\t\t\t\twhere ite.ldeleted=0 and te.ldeleted=0 and te.vtipe=\"TD\" and ite.vnip=\"'.$nip.'\"';\r\n\t\t\t\t$r=$this->dbset->query($sql);\r\n\t\t\t\tif($r->num_rows>=1){\r\n\t\t\t\t\t$d=$r->row_array();\r\n\t\t\t\t\tif($d['iteam_id']==81){\r\n\t\t\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN (17)', null);\r\n\t\t\t\t\t}elseif ($d['iteam_id']==83) {\r\n\t\t\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN (40)', null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{$type='';}\r\n\t\t}\r\n\t\t//Tidak muncul jika sudah di input di komparator\r\n\t\t$grid->setQuery('dossier_upd.idossier_upd_id not in (select kom.idossier_upd_id from dossier.dossier_komparator kom where kom.lDeleted=0)',NULL);\r\n\r\n\t\t//Approval review_dokumen\r\n\t\t$grid->setQuery('dossier_upd.idossier_upd_id in (select rev.idossier_upd_id from dossier.dossier_review rev where rev.lDeleted=0 and rev.iApprove_review=2)',NULL);\r\n\r\n\t\t$grid->setGridView('grid');\r\n\r\n\t\tswitch ($action) {\r\n\t\t\tcase 'json':\r\n\t\t\t\t$grid->getJsonData();\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\t$grid->render_grid();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n }", "function rebuildURL($remove){\n\t\t$curl = preg_replace('/\\?.*/', '', curPageURL()); //get current URL and remove the query string\n\t\t$query = constructQuery(removeURLQuery($remove));\n\t\treturn $curl.$query;\n\t\t\n\t\t\n\t}", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "public function getEditRegisterst(){\n\t\treturn base_url(route_to('editsettig', $this->cod_estado.'/2'));\n\t}", "public function getRowUrl($row) {\n $params = array(\n 'id' => $row->getId(),\n AW_Vidtest_Block_Adminhtml_Video_Grid::RETURN_FROM_KEY => AW_Vidtest_Block_Adminhtml_Video_Grid::RETURN_FROM_PRODUCT,\n 'product_id' => $this->getProduct()->getId(),\n 'store' => $this->getRequest()->getParam('store', 0),\n );\n return $this->getUrl('vidtest_admin/admin_video/edit', $params);\n }", "protected function renderCurrentUrl() {}", "protected function renderCurrentUrl() {}", "public function editUrl() {\n\t\treturn str_replace('/page/edit/',\n '/lab_scheduler/lab_tools/edit/',\n parent::editUrl());\n\t}", "public function onDispatch(MvcEvent $e) {\n $this->baseUrl=$this->getRequest()->getBasePath();\n \n parent::onDispatch($e);\n }", "public function recordsperpageAction() {\n\t\t$this->_helper->ajaxgrid->setRowNum ();\n\t}", "public function recordsperpageAction() {\n\t\t$this->_helper->ajaxgrid->setRowNum ();\n\t}", "public function getRowUrl($row) {\r\n $customer_id = $row->getCustomer()->getId();\r\n return $this->getUrl('CrmTicket/Admin_Ticket/Edit', array('ticket_id' => $row->getct_id(), 'customer_id' => $customer_id));\r\n }", "public function getEditRegisterserv(){\n\t\treturn base_url(route_to('editsettig', $this->id_area.'/4'));\n\t}", "function getUrl()\n {\n return partial_url($this->getNodeType(), $this->m_action, $this->m_partial, $this->m_params, $this->m_sessionStatus);\n }", "function PageContent() {\r\n\r\n $api_url = \"api_controller.php?obj=user&operation=userlist\";\r\n\r\n echo(\"<a href='$api_url'>\".$api_url.\"</a><br/>\");\r\n echo '<div id=\"dgUserList\"></div>';\r\n \r\n echo '<div id=\"quickGrid\" style=\"margin-top:20px\"></div>';\r\n \r\n}", "public function getRouteRefreshTable() {\n\t\treturn \"/refreshTable\";\n\t}", "function ajax_process($urut=TRUE,$tbl_name='',$field=array(),$id_column='',$method_link=array(),$method_delimiter='',$icon_src=array()){\n\t\t$CI =& get_instance();\n\t\tif($CI->input->is_ajax_request()){\n\t\t\t\n\t\t\t/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\t\t\t * Easy set variables\n\t\t\t */\n\t\t\t\n\t\t\t/* Array of database columns which should be read and sent back to DataTables. Use a space where\n\t\t\t * you want to insert a non-database field (for example a counter or static image)\n\t\t\t */\n\t\t\t$aColumns = $field;\n\t\t\t\n\t\t\t/* Indexed column (used for fast and accurate table cardinality) */\n\t\t\t$sIndexColumn = $id_column;\n\t\t\t\n\t\t\t/* DB table to use */\n\t\t\t$sTable = $tbl_name;\n\t\t\t\n\t\t\t/* \n\t\t\t * Paging\n\t\t\t */\n\t\t\t$sLimit = \"\";\n\t\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t\t{\n\t\t\t\t$sLimit = \"LIMIT \".mysql_real_escape_string( $_GET['iDisplayStart'] ).\", \".\n\t\t\t\t\tmysql_real_escape_string( $_GET['iDisplayLength'] );\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t * Ordering\n\t\t\t */\n\t\t\t$sOrder = \"\";\n\t\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t\t{\n\t\t\t\t$sOrder = \"ORDER BY \";\n\t\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t\t{\n\t\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sOrder .= \"`\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\"` \".\n\t\t\t\t\t\t\tmysql_real_escape_string( $_GET['sSortDir_'.$i] ) .\", \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t/* \n\t\t\t * Filtering\n\t\t\t * NOTE this does not match the built-in DataTables filtering which does it\n\t\t\t * word by word on any field. It's possible to do here, but concerned about efficiency\n\t\t\t * on very large tables, and MySQL's regex functionality is very limited\n\t\t\t */\n\t\t\t$sWhere = \"\";\n\t\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t\t{\n\t\t\t\t$sWhere = \"WHERE (\";\n\t\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t\t{\n\t\t\t\t\t$sWhere .= \"`\".$aColumns[$i].\"` LIKE '%\".mysql_real_escape_string( $_GET['sSearch'] ).\"%' OR \";\n\t\t\t\t}\n\t\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t\t$sWhere .= ')';\n\t\t\t}\n\t\t\t\n\t\t\t/* Individual column filtering */\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"WHERE \";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"`\".$aColumns[$i].\"` LIKE '%\".mysql_real_escape_string($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t * SQL queries\n\t\t\t * Get data to display\n\t\t\t */\n\t\t\t$sQuery = \"\n\t\t\t\tSELECT SQL_CALC_FOUND_ROWS `\".str_replace(\" , \", \" \", implode(\"`, `\", $aColumns)).\"`\n\t\t\t\tFROM $sTable\n\t\t\t\t$sWhere\n\t\t\t\t$sOrder\n\t\t\t\t$sLimit\n\t\t\t\t\";\n\t\t\t//echo $sQuery;die();\n\t\t\t$rResult = $CI->db->query($sQuery)->result_array();\n\t\t\t//print_r($rResult);die();\n\t\t\t/* Data set length after filtering */\n\t\t\t$sQuery = \"\n\t\t\t\tSELECT FOUND_ROWS() as row_found\n\t\t\t\";\n\t\t\t$rResultFilterTotal = $CI->db->query($sQuery)->result_array();\n\t\t\t//print_r($rResultFilterTotal);die();\n\t\t\t//$aResultFilterTotal = count($rResultFilterTotal);\n\t\t\t//$iFilteredTotal = $aResultFilterTotal[0];\n\t\t\t$iFilteredTotal = $rResultFilterTotal[0]['row_found'];\n\t\t\t\n\t\t\t\n\t\t\t/* Total data set length */\n\t\t\t$sQuery = \"\n\t\t\t\tSELECT COUNT(`\".$sIndexColumn.\"`) as row_all\n\t\t\t\tFROM $sTable\n\t\t\t\";\n\t\t\t$rResultTotal = $CI->db->query($sQuery)->result_array();\n\t\t\t//$aResultTotal = count($rResultTotal);\n\t\t\t//$iTotal = $aResultTotal[0];\n\t\t\t$iTotal = $rResultTotal[0]['row_all'];\n\t\t\t\n\t\t\t/*\n\t\t\t * Output\n\t\t\t */\n\t\t\tif(!isset($_GET['sEcho'])){\n\t\t\t\t$_GET['sEcho'] = '1';\n\t\t\t}\n\t\t\t\n\t\t\t$output = array(\n\t\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\t\"aaData\" => array()\n\t\t\t);\n\t\t\t\n\t\t\tif($urut){\n\t\t\t\t$hit = '1';\n\t\t\t}\n\t\t\t//while ( $aRow = mysql_fetch_array( $rResult ) )\n\t\t\tforeach($rResult as $aRow)\n\t\t\t{\n\t\t\t\t$row = array();\n\t\t\t\t//Add content for \"No.\" Column\n\t\t\t\tif($urut){\n\t\t\t\t\t$row[] = $hit;\t\t\t\t\n\t\t\t\t\t$hit++;\n\t\t\t\t}\n\t\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t\t{\n\t\t\t\t\tif ( $aColumns[$i] == \"version\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Special output formatting for 'version' column */\n\t\t\t\t\t\t$row[] = ($aRow[ $aColumns[$i] ]==\"0\") ? '-' : $aRow[ $aColumns[$i] ];\n\t\t\t\t\t}\n\t\t\t\t\telse if ( $aColumns[$i] != ' ' )\n\t\t\t\t\t{\n\t\t\t\t\t\t/* General output */\n\t\t\t\t\t\t$row[] = $aRow[ $aColumns[$i] ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Add content for \"Action\" Column\n\t\t\t\tif(!empty($method_link)){\n\t\t\t\t\t$full_action_link = '';\n\t\t\t\t\tforeach($method_link as $action_type=>$action_link){\n\t\t\t\t\t\t$create_action = '<a rel=\"tooltip-top\" href=\"'.$action_link.$method_delimiter.'\" original-title=\"'.$action_type.'\"><img src=\"'.$icon_src[$action_type].'\"></a>';\n\t\t\t\t\t\t$full_action_link .= $create_action;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$row[] = $full_action_link;\n\t\t\t\t$output['aaData'][] = $row;\n\t\t\t}\t\n\t\t\techo json_encode( $output );\n\t\t} else {\n\t\t\t$CI->menu_handler->throw_error();\n\t\t}\n\t}", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n\t{\n\t\t//return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n\t\treturn false;\n\t}", "function getURLView(){return \"/report/\".$this->getId();}", "protected function get_admin_url() {\n\t\t$pagenow = str_replace( '_', '-', $this->request_type );\n\n\t\tif ( 'remove-personal-data' === $pagenow ) {\n\t\t\t$pagenow = 'erase-personal-data';\n\t\t}\n\n\t\treturn admin_url( $pagenow . '.php' );\n\t}", "public function getGridSortingUrl(Grid $grid, Column $column): string\n {\n $order = 'asc';\n if ($column->isSorted()) {\n $order = $column->getOrder() === 'asc' ? 'desc' : 'asc';\n }\n\n return $grid->getRouteUrl(\n [$grid->getHash() => [Grid::REQUEST_QUERY_ORDER => $column->getId() . '|' . $order]]\n );\n }", "function bu($url='')\n{\n static $baseUrl;\n $baseUrl=Yii::app()->request->baseUrl;\n $baseUrl .= $baseUrl.'/'.ltrim($url,'/');\n if(param('root_control'))\n {\n $baseUrl = \"/\" . param('root_control') . $baseUrl;\n }\n return $baseUrl; \n}" ]
[ "0.65143496", "0.65143496", "0.6348461", "0.6215794", "0.6215794", "0.5963063", "0.5895657", "0.584234", "0.58048886", "0.5592645", "0.55399686", "0.5475966", "0.5453371", "0.54317445", "0.5427924", "0.54267704", "0.54234546", "0.5419744", "0.5400334", "0.5395389", "0.5373748", "0.5362672", "0.5357441", "0.52820563", "0.52787465", "0.52721196", "0.5263131", "0.5261939", "0.5253744", "0.52427125", "0.52376884", "0.5227648", "0.52023846", "0.5188893", "0.5186056", "0.5185225", "0.5157211", "0.5156009", "0.51542026", "0.5142504", "0.5123359", "0.5119462", "0.5116142", "0.51121753", "0.5100947", "0.50700974", "0.50700736", "0.50684756", "0.5066926", "0.5063367", "0.50604266", "0.50505346", "0.50505346", "0.5045415", "0.502563", "0.50003284", "0.49981594", "0.49907234", "0.49789727", "0.4974794", "0.49669024", "0.49589178", "0.49581337", "0.49407676", "0.49161363", "0.49158314", "0.49119332", "0.49085385", "0.49052042", "0.49037066", "0.4891536", "0.48826572", "0.48806518", "0.4874835", "0.48735723", "0.486676", "0.48590624", "0.48585722", "0.48585722", "0.48552704", "0.4846975", "0.48439887", "0.48439887", "0.48437518", "0.48419115", "0.48388806", "0.48190054", "0.48177505", "0.48176673", "0.48149273", "0.48149273", "0.48149273", "0.48149273", "0.48149273", "0.48149273", "0.4810963", "0.4809811", "0.48092434", "0.47993225", "0.47967023" ]
0.60089153
5
Returns cms page object from registry
public function getPage() { return Mage::registry('cms_page'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSysPage() {}", "function cmsPage($mIdSlug): ?Resource\\Page\n {\n /** @var Model\\Page $oModel */\n $oModel = Factory::model('Page', Constants::MODULE_SLUG);\n return $oModel->getByIdOrSlug($mIdSlug);\n }", "public function get_page();", "protected function _getCmsPage()\n {\n if (!$this->_cmsPage) {\n $this->_cmsPage = $this->_objectManager->create(\\Magento\\Cms\\Model\\Page::class);\n $cmsPageId = (int)$this->getRequest()->getParam('cms_page', 0);\n $urlRewrite = $this->_getUrlRewrite();\n if (!$cmsPageId && $urlRewrite->getId() && $urlRewrite->getEntityType() === self::ENTITY_TYPE_CMS_PAGE) {\n $cmsPageId = $this->_getUrlRewrite()->getEntityId();\n }\n if ($cmsPageId) {\n $this->_cmsPage->load($cmsPageId);\n }\n }\n return $this->_cmsPage;\n }", "public function getPage()\n {\n if ($this->page) {\n return $this->page;\n }\n\n // Remove original page\n $this->app->page_object->destroy(false);\n\n $this->page = $this->app->add(\n $this->page_class,\n $this->name,\n null,\n $this->page_template\n );\n /** @type Page $this->page */\n $this->app->page_object = $this->page;\n $this->app->stickyGET($this->name);\n\n return $this->page;\n }", "public static function getInstance() {\r\n if (is_null(self::$_instance)) {\r\n self::$_instance = new Page();\r\n }\r\n return self::$_instance;\r\n }", "public function getPage() {\n \t\n \t// Return our page instance\n \treturn $this->oPage;\n }", "public static function getPage()\n {\n return self::$page;\n }", "public function getPagesManager() {\n\t\treturn $this->wire('lab_charge_items');\n\t}", "public function page(){\n\t\t$pageLoader = $this->plugin->library('Page');\n\t\t$pageLoader->load('admin/settings');\n\t}", "protected function getPage() {}", "protected function getPage() {}", "public function get_page() {\n\t\t$p\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (isset($_GET['p']))? preg_replace('@[^a-zA-Z0-9_]@', '', $_GET['p']) : $this->conf('default_page');\n\t\t$this->p\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $p;\n\t\t\n\t\t# Determine the file to include from the content directory\n\t\t$dir\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= dirname(dirname(dirname(__FILE__))) .\"/content/\";\n\t\t$p\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $dir . $p . \".php\";\n\t\t$p\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (file_exists($p))? $p : $dir . \"error.php\";\n\t\t\n\t\t# Include the content file and create a page object\n\t\tinclude_once($p);\n\t\t$page\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= new Page();\n\t\t\n\t\t# Return Page\n\t\treturn $page;\n\t}", "public static function Store() : PageStore\n {\n return PageStore::load();\n }", "protected function getPageRepository()\n {\n return $GLOBALS['TSFE']->sys_page;\n }", "protected function getPageRepository()\n {\n return $GLOBALS['TSFE']->sys_page;\n }", "public function getPage() {\n return $this->_page;\n }", "public function getPage() {}", "public function getPage() {}", "public function get_page( $name ) {\n\t\treturn $name ? $this->get_object( $name, 'page' ) : null;\n\t}", "public function page(): Repository\n {\n return $this->belongsTo('Neoflow\\\\CMS\\\\Model\\\\PageModel', 'page_id');\n }", "static protected function getPageCache()\n {\n return GeneralUtility::makeInstance(CacheManager::class)->getCache('pages');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Page');\n }", "public function getPage()\n {\n if ($this->page === null)\n {\n $this->page = PageTable::getInstance()->findOneByContentGroupId($this->ContentGroup->id);\n\n if (!$this->page)\n {\n throw new sfException(\"Missing a page\");\n }\n }\n\n return $this->page;\n }", "public function getPage() {\n\t\treturn $this->_page;\n\t}", "protected function _initAction(): Page\n {\n $resultPage = $this->resultPageFactory->create();\n $resultPage->setActiveMenu(self::CURBSIDE_MENU_ID);\n $resultPage->addBreadcrumb(__('Sales'), __('Sales'));\n $resultPage->addBreadcrumb(__('Curbside Orders'), __('Curbside Orders'));\n\n return $resultPage;\n }", "public function getPage()\n {\n return $this->_page;\n }", "public function getPage() {\n\t\treturn $this->page;\n\t}", "function get()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage(){\n return $this->page;\n }", "function PageByCurrentLocale($pageURL) {\n\t\tif($pg = Translatable::get_one_by_locale('Page', Translatable::default_locale(), \"URLSegment = '{$pageURL}'\")) return $pg->getTranslation(Translatable::get_current_locale());\n\t\t\n\t\treturn null;\n\t}", "public function getPage()\n\t{\n\t\treturn $this->page;\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PluginPageContent');\n }", "public function getPage();", "public function getPage() {\n return $this->page;\n }", "private function getPage() {\r\n $page = self::DEFAULT_PAGE;\r\n $this->module = self::DEFAULT_MODULE;\r\n //Check get for page to load, if page exists set page\r\n if (array_key_exists('page', $_GET)) {\r\n $page = $_GET['page'];\r\n }\r\n //Check get for module to load, if module exists set module\r\n if (array_key_exists('module', $_GET)) {\r\n $this->module = $_GET['module'];\r\n }\r\n return $this->checkPage($page);\r\n }", "abstract protected function getPage() ;", "protected function loadPageObject()\n\t{\n\t\treturn $this->PoObj->run();\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PluginStaticPage');\n }", "public function loadCurrentPage()\n\t{\n\t\treturn $this->getPage($this->getCurrentPage());\n\t}", "public static function create()\n {\n $page = new Page();\n $page->site_id = \\Bazalt\\Site::getId();\n if (!\\Bazalt\\Auth::getUser()->isGuest()) {\n $page->user_id = \\Bazalt\\Auth::getUser()->id;\n }\n return $page;\n }", "function &GetRegisteredObject($name) {\n return $this->_smarty->get_registered_object($name);\n }", "public function page($page)\n {\n \n $content = Content::where('page', $page)->get()->first();\n \n return new ContentResource($content);\n\n }", "public function getPagesManager() {\n\t\treturn $this->wire('lab_tools');\n\t}", "static public function createPage() {\n $session = Application::getInstance(\"session\");\n $config = Application::getConfig();\n\n if (isset($config[\"system\"][\"customPageClass\"])) {\n require $config[\"system\"][\"pages-folder\"] . \"/\" . $config[\"system\"][\"customPageClass\"] . \".php\";\n }\n\n include_once $config[\"system\"][\"pages-folder\"] . \"/\" . $session->currentPage . \".page.php\";\n $pageClass = $config[\"system\"][\"namespace\"] . \"\\\\pages\\\\Page\" . ucfirst($session->currentPage);\n\n\n $page = new $pageClass();\n\n Application::setInstance(\"page\", $page);\n }", "public function get_instance_pages() {\n\n\t\t\t$base_path = $this->component_path( 'pages/' );\n\n\t\t\treturn array(\n\t\t\t\t'Jet_Engine_Relations_Page_List' => $base_path . 'list.php',\n\t\t\t\t'Jet_Engine_Relations_Page_Edit' => $base_path . 'edit.php',\n\t\t\t);\n\t\t}", "public function getPage() {\r\n\t\t//TODO: Check if user may look at the pages.\r\n\t\t\r\n\r\n\t\tif (isset ( $_POST ['page'] )) {\r\n\t\t\tswitch ($_POST ['page']) {\r\n\t\t\t\tcase 'getPlugins' :\r\n\t\t\t\t\t$this->pageGetPlugins ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'enabled' :\r\n\t\t\t\t\t$this->pageEnabled ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'priority' :\r\n\t\t\t\t\t//Change the priority of a plugin\n\t\t\t\t\t//Should not be possible to change using the GUI\n\t\t\t\t\t//Install/uninstall classes should change plugin priority.\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'uninstall' :\r\n\t\t\t\t\t$this->pageUninstall ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'install' :\r\n\t\t\t\t\t$this->pageInstall ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault :\r\n\t\t\t\t\tthrow new Exception ( \"page request not valid\" );\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthrow new Exception ( \"page request not valid\" );\r\n\t\t}\r\n\t}", "public static function newPageInstance()\n {\n $model = new static();\n $model->setAttribute('type', static::PAGE);\n\n return $model;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('DynamicPage');\n }", "function __construct()\n {\n $xml = new XmlParser;\n $xml->Parse(PARLANCE_PATH . \"/config/app-pages.xml\");\n $pages = $xml->GetNodeByPath(\"APP/PAGES\");\n\n $this->registry = array();\n if(isset($pages) && !empty($pages['child'])) :\n foreach($pages['child'] as $page) :\n $this->registry[($page['attrs']['ID'])] = $page;\n endforeach;\n endif;\n }", "public function page($pageName)\n {\n return $this->page->get($pageName);\n }", "public function testComDayCqWcmCoreImplPagePageInfoAggregatorImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.wcm.core.impl.page.PageInfoAggregatorImpl';\n\n $crawler = $client->request('POST', $path);\n }", "public function get_page_by_url($url)\n {\n $page = $this->orm->cms_pages(array(\n 'where' => array('url', '=', $url),\n 'amount' => 1\n ));\n return $page;\n }", "public static function getInstance()\r\n\t{\r\n\t\tif ( empty( self::$instance ) )\r\n\t\t{\r\n\t\t\tself::$instance = new Registry();\r\n\t\t\t$object = self::$instance;\r\n\t\t\t$object->init();\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$instance;\r\n\t}", "function get_page($id)\r\n\t{\r\n\t\t$query = $this->db->select('id, title, content, icon, user_id, date, status, welcome_enable')\r\n\t\t ->from(\"custom_page\")\r\n\t\t ->where(array('id' => $id))\r\n\t\t ->get();\r\n\t\t \r\n\t\treturn $query->row();\r\n\t}", "public function getPage() {\n return $this->_strPage;\n }", "function get(){\n\t$temp = $this->page;\n\t$this->addFooter();\n\t//restore the page for next call for\n\t$page= $this->page;\n\t$this->page = $temp;\n\n return $this->page;\n}", "function AssignPage($subpage = 0)\n\t{\treturn new AdminPageContent($subpage);\n\t}", "public function _getById($id)\n {\n $resultDb = $this->database->table('page')->get($id);\n return $this->getPage($resultDb);\n }", "public function get() {\n $temp = $this->page;\n $this->addFooter();\n //Restore $page for the next call to get\n $page = $this->page;\n $this->page = $temp;\n return $page;\n //if not needed, use $this->addFooter(); return $this->page;\n }", "public function get_object_page() {\n\t\tglobal $wp_query;\n\t\t$searchQuery = apply_filters(self::GENERATE_SINGLE_OBJECT_SOLR_QUERY, isset($_GET['guid'])?self::escapeSolrValue($_GET['guid']):null);\n\n\t\tif($searchQuery) {\n\t\t\t$accesspoint = current_user_can(WPDKA::PUBLISH_STATE_CAPABILITY) ? false : null;\n\t\t\ttry {\n\t\t\t\t$serviceResult = self::instance()->Object()->Get(\n\t\t\t\t\t$searchQuery,\t// Search query\n\t\t\t\t\tnull,\t// Sort\n\t\t\t\t\t$accesspoint,\t// AccessPoint given by settings.\n\t\t\t\t\t0,\t\t// pageIndex\n\t\t\t\t\t1,\t\t// pageSize\n\t\t\t\t\ttrue,\t// includeMetadata\n\t\t\t\t\ttrue,\t// includeFiles\n\t\t\t\t\ttrue\t// includeObjectRelations\n\t\t\t\t);\n\t\t\t} catch(\\CHAOSException $e) {\n\t\t\t\t// Do nothing but log it.\n\t\t\t\terror_log('CHAOS Error when calling get_object_page: '.$e->getMessage());\n\t\t\t}\n\n\t\t\t// No need for a 404 page - as the template is just not applied if the\n\t\t\tif(isset($serviceResult) && $serviceResult && $serviceResult->MCM()->TotalCount() >= 1) {\n\t\t\t\t// TODO: Consider if this prevents caching.\n\t\t\t\tstatus_header(200);\n\t\t\t\tglobal $wp_query, $page, $paged;\n\t\t\t\t$wp_query->is_404 = false;\n\t\t\t\t$wp_query->is_page = false;\n\t\t\t\t$page = $paged = 1;\n\n\t\t\t\tif($serviceResult->MCM()->TotalCount() > 1) {\n\t\t\t\t\terror_log('CHAOS returned more than 1 (actually '.$serviceResult->MCM()->TotalCount().') results for the single object page (search query was '. $searchQuery .').');\n\t\t\t\t}\n\t\t\t\t$objects = $serviceResult->MCM()->Results();\n\t\t\t\t$object = new WPChaosDataObject($objects[0]);\n\t\t\t\tself::set_object($object);\n\n\t\t\t\t// Call this by reference.\n\t\t\t\ttry {\n\t\t\t\t\tdo_action(self::GET_OBJECT_PAGE_BEFORE_TEMPLATE_ACTION, self::get_object());\n\t\t\t\t} catch (Exception $e) {}\n\n\t\t\t\t//Remove meta and add a dynamic canonical for better seo\n\t\t\t\tremove_action('wp_head', 'rel_canonical');\n\t\t\t\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10,0);\n\n\t\t\t\tadd_action('wp_head', function() {\n\t\t\t\t\t$link = WPChaosClient::get_object()->url;\n\t\t\t\t\techo '<link rel=\"canonical\" href=\"'.$link.'\" />'.\"\\n\";\n\t\t\t\t});\n\n\t\t\t\t$template = apply_filters('chaos-object-template', 'chaos-object-page');\n\n\t\t\t\t//Look in theme dir and include if found\n\t\t\t\t$include = locate_template('templates/'.$template.'.php', false);\n\t\t\t\tif($include == \"\") {\n\t\t\t\t\t//Include from plugin template\n\t\t\t\t\t$include = plugin_dir_path(__FILE__).\"/templates/object-page.php\";\n\t\t\t\t}\n\t\t\t\trequire($include);\n\t\t\t\tself::reset_object();\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// If we get to this point, and guid was a query parameter - we didn't get what we were looking for.\n\t\t\tif(array_key_exists('guid', $_GET)) {\n\t\t\t\t// The user specifically asked for an object of a particular GUID.\n\t\t\t\tstatus_header(400);\n\t\t\t\tglobal $wp_query;\n\t\t\t\t$wp_query->set_404();\n\t\t\t}\n\t\t}\n\t}", "public function getPage($slug)\n { \n $data = StaticPage::where('page_slug',$slug)->first();\n return $data;\n }", "public function page()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Pages\\Models\\Page');\n }", "static public function getInstance(){\r\n if(self::$_instance === NULL){\r\n self::$_instance = new Registry;\r\n }\r\n return self::$_instance;\r\n }", "function culturefeed_get_search_page($search_type) {\n $pages = &drupal_static(__FUNCTION__);\n $class_name = $search_type['class_name'];\n if (!isset($pages[$class_name])) {\n $pages[$class_name] = new $search_type['class_name']();\n $pages[$class_name]->setResultsPerPage(variable_get('culturefeed_search_ui_pager_items_per_page', CULTUREFEED_SEARCH_UI_PAGER_ITEMS_PER_PAGE));\n $pages[$class_name]->setDefaultSort($search_type['sort_default']);\n $pages[$class_name]->setGroup(variable_get('culturefeed_search_group', 'event_production'));\n $pages[$class_name]->initialize();\n }\n return $pages[$class_name];\n}", "public function getPageById($page_id) {\n $sql = \"SELECT * from pgcontent p\n where p.id = :page_id\";\n $stmt = $this->db->prepare($sql);\n $result = $stmt->execute([\"page_id\" => $page_id]);\n\n if($result) {\n return new PageEntity($stmt->fetch());\n }\n }", "public function page(): ?Page\n {\n if (empty($this->page) && !empty($this->page_id)) {\n\n /** @var \\Nails\\Cms\\Model\\Menu\\Item $oModel */\n $oModel = Factory::model('MenuItem', Constants::MODULE_SLUG);\n $oItem = $oModel->getById($this->id, [new Expand('page')]);\n\n $this->page = $oItem->page;\n }\n\n return $this->page;\n }", "public function page($slg){\n\t\t$data = array();\n\t\t$data['cms_page_content']= $this->cms_model->get_cms_page_content($slg);\n\t\tif(empty($data['cms_page_content'])){\n\t\t\texit('No Page found!');\n\t\t}\n\t\t$data['location_arr']=$this->lm->getcities();\n\t\t$data['title'] = \"SMARTWORKS-\".$data['cms_page_content']['title']; \n\t\t$data['meta_key'] = $data['cms_page_content']['meta_keywords'];\n\t\t$this->load->view('cms_page',$data);\n\t}", "public static function get_instance(): WP_Sentry_Admin_Page {\n\t\treturn self::$instance ?: self::$instance = new self;\n\t}", "public function page() {\n\t\t$this->page = $this->plugin->factory->adminPage;\n\t\t$this->page->show();\n\t}", "public static function retrievePage($search)\n {\n $myDataAccess = aDataAccess::getInstance();\n $myDataAccess->connectToDB();\n\n $myDataAccess->selectsearchPages($search);\n\n $row = $myDataAccess->fetchPage();\n\n {\n\n $currentPage = new self($myDataAccess->fetchPageName($row),$myDataAccess->fetchPageMenuName($row));\n\n $currentPage->m_Pageid = $myDataAccess->fetchPageID($row);\n $currentPage->m_visible = $myDataAccess->fetchPageVisible($row);\n\n $pageObject = $currentPage;\n }\n\n $myDataAccess->closeDB();\n\n\n //There should only be 1 page object to return.\n return $pageObject;\n }", "public function load_page($pageid) {\n if (!array_key_exists($pageid, $this->pages)) {\n $manager = languagelesson_page_type_manager::get($this);\n $this->pages[$pageid] = $manager->load_page($pageid, $this);\n }\n return $this->pages[$pageid];\n }", "protected function discoverPage()\n {\n $this->page = $this->website->pages()\n ->activated()\n ->bySlug($this->getSlug())\n ->firstOrFail();\n\n return $this;\n }", "function randomPageObject()\n\t{\n\t\t$this->checkPermission(\"read\");\n\t\t\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPage.php\");\n\t\t$page = ilWikiPage::getRandomPage($this->object->getId());\n\t\t$this->gotoPageObject($page);\n\t}", "public function page() {\n\t\t$key = md5( __CLASS__ . $this->post->ID );\n\t\tif ( false == ( $page = wp_cache_get( $key ) ) ) {\n\t\t\t$page[] = $this->post_content();\n\t\t\tif ( $this->coming_soon || $this->cf || true === $this->free ) {\n\n\t\t\t}else{\n\t\t\t\t$page[] = $this->feature_section();\n\t\t\t}\n\t\t\t\n\t\t\t$page[] = $this->testimonials_section();\n\t\t\tif ( false === $this->free ) {\n\t\t\t\t$page[] = $this->price_table();\n\t\t\t}\n\n\t\t\t$page[] = $this->contact_section();\n\t\t\tif ( ! $this->coming_soon ) {\n\t\t\t\t$page[] = $this->docs();\n\t\t\t}\n\t\t\t$page = implode( '', $page );\n\t\t\twp_cache_set( $key, $page, '', 399 );\n\t\t}\n\n\t\treturn $page;\n\n\t}", "public function get_admin_pages() {\n\t\treturn apply_filters( 'pslug_admin_pages_object', array(\n\t\t\t'settings' => array(\n\t\t\t\t'general',\n\t\t\t),\n\t\t) );\n\t}", "public static function init() {\n\t\tif (self::$_initialized) {\n\t\t\treturn;\n\t\t}\n\t\tparent::setInstance(new Page());\n\t\tself::$_initialized = true;\n\t}", "public function getPage() {\n return $this->getValueOrDefault('Page');\n }", "public function GetPageImage()\n {\n $imageID = $this->GetImageFromPageTable();\n if (is_null($imageID)) {\n $imageID = $this->GetImageFromDivisionTable();\n }\n\n $oImage = null;\n if (!is_null($imageID)) {\n /** @var $oImage TCMSImage */\n $oImage = new TCMSImage();\n $oImage->Load($imageID);\n }\n\n return $oImage;\n }", "private function load()\n\t{\n\t\tglobal $mediaWiki;\n\t\t\n\t\t$title = Title::newFromText( $this->title );\n\t\t \n\t\t// Can't load page if title is invalid.\n\t\tif ($title == null)\n\t\t\treturn;\n\t\t\n\t\t$article = $mediaWiki->articleFromTitle($title);\n\t\t\n\t\t// Also, if article can't be found, bail out.\n\t\tif ($article == null )\n\t\t\treturn;\n\t\t\n\t\t// Let's try fetching the page content.\n\t\t$article->loadContent();\n\t\t\n\t\t// V1.3 security feature.\n\t\t// At this point, the page's restriction\n\t\t// is loaded. Get 'edit' protection state.\n\t\t$state = $title->getRestrictions('edit');\n $this->protectState = false;\n $state = $title->getRestrictions('edit');\n foreach ($state as $index => $group )\n if ( $group == 'sysop' )\n $this->protectState = true;\n\t\t\n\t\tif (! $this->protectState)\n\t\t\treturn; \n\t\t\n\t\t# if no page or an empty one\n\t\tif (!$article->mDataLoaded)\n\t\t\treturn;\n\t\t \n\t\t$this->content = $article->mContent;\n\t\t$this->raw = $article->mContent;\n\t\t\n\t\t// Now, let's analyse the page\n\t\t// to determine things like page type.\n\t\t$this->analyse();\n\t}", "public static function registry()\n {\n\t\tif ( empty(self::$registry) ){\n\t\t\tself::$registry = new Registry();\n\t\t}\n\t\treturn self::$registry;\n\n }", "public function newPage($title,$content,$publish = true) {\n $page = array(\n\t\t\t'post_status' \t\t=> $publish === true ? 'publish' : 'pending',\n\t\t\t'post_type' \t\t=> 'page',\n\t\t\t'post_author' \t\t=> 1,\n\t\t\t'post_name' \t\t=> $this->createSlug($title),\n\t\t\t'post_title' \t\t=> $title,\n\t\t\t'post_content' \t\t=> $content,\n\t\t\t'post_parent' \t\t=> 0,\n\t\t\t'comment_status' \t=> 'closed'\n\t\t);\n return $page;\n }", "public function newPage($title,$content,$publish = true) {\n $page = array(\n\t\t\t'post_status' \t\t=> $publish === true ? 'publish' : 'pending',\n\t\t\t'post_type' \t\t=> 'page',\n\t\t\t'post_author' \t\t=> 1,\n\t\t\t'post_name' \t\t=> $this->createSlug($title),\n\t\t\t'post_title' \t\t=> $title,\n\t\t\t'post_content' \t\t=> $content,\n\t\t\t'post_parent' \t\t=> 0,\n\t\t\t'comment_status' \t=> 'closed'\n\t\t);\n return $page;\n }", "public function getPageBaseObject() {\n if (!(isset($this->_pageBaseObject) && is_object($this->_pageBaseObject))) {\n include_once(dirname(__FILE__).'/ReaderPage/Base.php');\n $this->_pageBaseObject = new RssReaderPageBase($this);\n $this->_pageBaseObject->setConfiguration($this->papaya()->options);\n }\n return $this->_pageBaseObject;\n }", "public function pageActionGet($route) : object\n {\n $page = $this->app->page;\n $title = \"Page: ${route}\";\n $db = $this->app->db;\n $filter = new MyTextFilter();\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS modified_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS modified\nFROM content\nWHERE\n path = ?\n AND type = ?\n AND (deleted IS NULL OR deleted > NOW())\n AND published <= NOW()\n;\nEOD;\n $content = $db->executeFetch($sql, [$route, \"page\"]);\n if ($content->filter) {\n $text = $content->data;\n $filters = explode(\",\", $content->filter);\n $filteredText = $filter->parse($text, $filters);\n $content->data = $filteredText;\n }\n $page->add(\"cms/page\", [\n \"content\" => $content\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "public function resolvePagesRootObject($create = false) {}", "public function publishedPage()\n\t{\n\t\treturn $this->hasOne(Page::class, 'revision_id')->where('version', Page::STATE_PUBLISHED);\n\t}", "public function getPage($id) {\r\n\t\t$file = stream_resolve_include_path($this->name . '/pages/' . $id .'.' .\\app::$config['dev']['serialization']) ;\r\n\t\tif ($file) \r\n\t\t\t\treturn \\tools::unserialize(substr($file,0,-4));\r\n\t\telse\r\n\t\t\tthrow new \\Exception(t('Page doesn\\'t exist', FALSE) . ' ,' . $this->name . ' : ' . $id);\r\n }", "public static function create()\n\t{\n\t\t$page = \"Main\";\n\n\t\t// check the requested page title for safety and sanity\n\t\t\n\t\t$pathinfo = explode('/', WebRequest::pathInfo());\n\t\t$pathinfo = array_values(array_filter($pathinfo));\n\t\tif(\n\t\t\tcount($pathinfo) >= 1 &&\n\t\t\t$pathinfo[0] != \"\" && // not empty\n\t\t\t(!ereg(\"[^a-zA-Z0-9]\", $pathinfo[0])) // contains only alphanumeric chars\n\t\t)\n\t\t{\n\t\t\t$page = $pathinfo[0];\n\t\t}\n\t\t\n\t\t// okay, the page title should be reasonably safe now, let's try and make the page\n\t\t\n\t\t$pagename = \"Page\" . $page;\n\t\t\n\t\tglobal $cIncludePath;\n\t\t$filepath = $cIncludePath . \"/Page/\" . $pagename . \".php\";\n\t\t\n\t\tif(file_exists($filepath))\n\t\t{\n\t\t\trequire_once($filepath);\n\t\t}\n\t\telse\n\t\t{\t// oops, couldn't find the requested page, let's fail gracefully.\n\t\t\t$pagename = \"Page404\";\n\t\t\t$filepath = $cIncludePath . \"/Page/\" . $pagename . \".php\";\n\t\t\trequire_once($filepath);\n\t\t}\t\n\n\t\tif(class_exists($pagename))\n\t\t{\n\t\t\t$pageobject = new $pagename;\n\t\t\t\n\t\t\tif(get_parent_class($pageobject) == \"PageBase\")\n\t\t\t{\n\t\t\t\tHooks::run(\"CreatePage\", array($pageobject));\n\t\t\t\t\n\t\t\t\treturn $pageobject;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// defined, but doesn't inherit properly, so we can't guarentee stuff will work.\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// file exists, but the class \"within\" doesn't, this is a problem as stuff isn't where it should be.\n\t\t\tthrow new Exception();\n\t\t}\n\t}", "public function getPageContent() {\n\t\tif ($this->url) {\n\t\t\t// Get content\n\t\t\t$sql = \"\n\t\t\tSELECT *\n\t\t\tFROM VContent\n\t\t\tWHERE\n\t\t\t type = 'page' AND\n\t\t\t url = ? AND\n\t\t\t published <= NOW(); AND\n\t\t\t deleted IS NULL;\n\t\t\t\";\n\t\t\t$res = $this->getContent($sql, array($this->url));\n\n\t\t\tif ($res[0]) {\n\t\t\t\t$c = $res[0];\n\t\t\t\t// Filter content before using it.\n\t\t\t\t$c->data = $this->textfilter->doFilter($c->data, \"{$c->filter},purify,typography\");\n\t\t\t\t\n\t\t\t\treturn array('id' => $c->id,\n\t\t\t\t\t\t'title' => $c->title,\n\t\t\t\t\t\t'data' => $c->data,\n\t\t\t\t\t\t'link' => $c->link,\n\t\t\t\t\t\t'name' => $c->UserName,\n\t\t\t\t\t'acronym' => $this->acronym);\n\t\t\t} else {\n\t\t\t\treturn $this->emptypage;\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->emptypage;\n\t\t}\n\t}" ]
[ "0.64567137", "0.6277547", "0.61937696", "0.61836565", "0.61607987", "0.61378074", "0.61110777", "0.6043241", "0.58693063", "0.5865872", "0.5865237", "0.58647454", "0.5799545", "0.5711115", "0.5706911", "0.5706911", "0.5692583", "0.56707066", "0.56707066", "0.56530803", "0.56257164", "0.56163496", "0.56089926", "0.55932987", "0.5591748", "0.55907595", "0.55846816", "0.55654526", "0.5559859", "0.55522275", "0.55522275", "0.55522275", "0.55522275", "0.55522275", "0.55522275", "0.55522275", "0.55522275", "0.55522275", "0.5540701", "0.5536282", "0.5533111", "0.5514208", "0.55009913", "0.5497882", "0.54937595", "0.5460166", "0.54545516", "0.5453073", "0.54225004", "0.54153985", "0.53984076", "0.5396295", "0.53958166", "0.5390645", "0.5390439", "0.53838557", "0.53834975", "0.53705716", "0.5338568", "0.5321022", "0.5318646", "0.53145975", "0.53119206", "0.5308594", "0.5292585", "0.52822155", "0.5280211", "0.5273798", "0.5272722", "0.527039", "0.5268139", "0.5267272", "0.52482134", "0.52424836", "0.52394605", "0.5237168", "0.52356756", "0.5224208", "0.521863", "0.5202994", "0.5192002", "0.5190268", "0.51892567", "0.51888555", "0.51827663", "0.5182337", "0.5173287", "0.5173196", "0.51685846", "0.51639295", "0.5163372", "0.5163372", "0.515989", "0.5151912", "0.51436067", "0.51435727", "0.51410574", "0.5140573", "0.51390654" ]
0.7732683
1
Prepare label for tab
public function getTabLabel() { return Mage::helper('gri_cms')->__('Versions'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTabLabel()\r\n {\r\n return Mage::helper('slideshow')->__('Slide Information');\r\n }", "public function getTabLabel()\n {\n return __('Slider Information');\n }", "public function getTabLabel()\n {\n return __('Slider Details');\n }", "public function getTabLabel()\n {\n return Mage::helper('lavi_news')->__('News Info');\n }", "public function getTabLabel()\r\n\t{\r\n\t\treturn Mage::helper('slider')->__('Banner Info');\r\n\t}", "public function getTabLabel()\r\n {\r\n return Mage::helper('attributeSplash')->__('Conditions');\r\n }", "public function getTabLabel()\n {\n return __('Content and Design');\n }", "public function getTabLabel()\r\n {\r\n return __('Conditions');\r\n }", "public function getTabLabel()\r\n {\r\n return __('Template Information');\r\n }", "public function getTabLabel()\n {\n return __('Staff Profile');\n }", "public function getTabLabel()\n {\n return Mage::helper('magna_news')->__('Content');\n }", "public function getTabLabel()\n {\n return Mage::helper('temando')->__('General');\n }", "public function getTabLabel() {\r\n return Mage::helper('amlanding')->__('Links');\r\n }", "public function getTabLabel()\r\n {\r\n return __('Designer Information');\r\n }", "public function getTabLabel()\n {\n return __('Import Categories');\n }", "public function getTabLabel()\n {\n return Mage::helper('cms')->__('CSS & JS');\n }", "public function getTabLabel()\n {\n return __('Home Page Banners');\n }", "public function getTabLabel()\n {\n return __('Meta');\n }", "public function getTabLabel()\n {\n return __('Single Page Details');\n }", "public function getTabLabel()\r\n {\r\n return __('Design');\r\n }", "public function getTabLabel()\n {\n return __('Events');\n }", "public function getTabLabel()\n\t{\n\t\treturn __('Qa Info');\n\t}", "public function getTabLabel()\n {\n return Mage::helper('recomiendo_recipes')->__('Ingredientes');\n }", "public function getTabLabel()\n {\n return Mage::helper('catalogrule')->__('Conditions');\n }", "public function setLabel();", "public function getTabLabel()\n {\n return __('Entities');\n }", "public function getTabLabel()\n {\n return __('Paypal Payment Information');\n }", "public function getTabLabel()\n {\n return __('Configuration');\n }", "public function getTabLabel()\n {\n return __('Subscription Information');\n }", "public function getTabLabel()\n {\n return Mage::helper('sc_cmsblockmanagement')->__('Versions');\n }", "public function getTabLabel()\n {\n return __('General information');\n }", "public function getTabLabel()\n {\n return $this->_getHelper()->__('General Information');\n }", "public function getTabTitle()\n {\n return __('Slider Information');\n }", "public function getTabTitle()\r\n {\r\n return Mage::helper('slideshow')->__('Slide Information');\r\n }", "public function getTabLabel()\r\n {\r\n return __('General Group');\r\n }", "public function getTabLabel()\n {\n return __('General Information');\n }", "public function getTabLabel()\n {\n return __('General Information');\n }", "public function getTabLabel()\n {\n return __('Store Information');\n }", "public function setLabel() {\n }", "public function getTabLabel()\n {\n return Mage::helper('blog')->__('Comment Information');\n }", "function label() {\n return \"<label>\".$this->label.\": </label>\";\n }", "public function label() { }", "function getLabel()\n\t{\n\t\treturn '';\n\t}", "public function getTabLabel()\n {\n return __('General');\n }", "public function getTabLabel()\n {\n return __('Stores Integrated with Extend');\n }", "public function getTabTitle()\n {\n return __('Slider Details');\n }", "abstract function add_label();", "public function get_label();", "public function get_label();", "public function getTabTitle()\r\n\t{\r\n\t\treturn Mage::helper('slider')->__('Banner Info');\r\n\t}", "public function getTabLabel()\n {\n return __('Message');\n }", "public function getTabTitle()\r\n {\r\n return __('Designer Information');\r\n }", "private function titleTab($title = \"\"){\n \t$title .= \"\";\n \treturn $title;\n }", "public function getTabTitle()\r\n {\r\n return __('Template Information');\r\n }", "public function getTabTitle() {\n return $this->__('Click here for GlobalLink Translation');\n }", "public function getTabTitle() {\r\n return Mage::helper('amlanding')->__('Links');\r\n }", "public function getTabTitle()\n {\n return Mage::helper('lavi_news')->__('News Info');\n }", "public function getTabTitle()\r\n {\r\n return __('Conditions');\r\n }", "public function getTabTitle()\r\n {\r\n return Mage::helper('attributeSplash')->__('Conditions');\r\n }", "public function getTabTitle()\n {\n return Mage::helper('temando')->__('General');\n }", "public function getTabLabel() {\n return $this->__('GlobalLink Translation');\n }", "public function getTabLabel()\n {\n return $this->__('Hot Offers');\n }", "function ihf_node_type_tabs_title($tab, $node) {\n $text = '';\n switch ($tab) {\n case 'type':\n $type = node_type_load($node->type);\n $text = 'Manage '. $type->name;\n break;\n case 'fields':\n $text = 'Manage Fields';\n break;\n case 'display':\n $text = 'Manage Display';\n break;\n }\n return t($text);\n}", "public function getTabTitle()\n {\n return __('Staff Profile');\n }", "public function getTabTitle()\n {\n return Mage::helper('recomiendo_recipes')->__('Ingredients');\n }", "public function getLabel() {}", "public function getLabel() {}", "public function getTabTitle()\n {\n return Mage::helper('gri_cms')->__('Versions');\n }", "public function get_title()\n {\n return __('Vertical Tabs', 'hslanding-elementor');\n }", "public function getLabel() {\n\t}", "public function getTabTitle()\n {\n return Mage::helper('cms')->__('CSS & JS');\n }", "public function beginLabelSheet ()\r\n {\r\n $this->label_column = 1;\r\n $this->label_row = 1;\r\n return '\r\n <div class=\"labelpage\">\r\n <div class=\"labelrow\">\r\n <div class=\"labelbody\">';\r\n }", "function getLabelField() \n {\n return \"label_label\";\n }", "public function getTabTitle()\n {\n return Mage::helper('magna_news')->__('Content');\n }", "public function getFrontendLabel();", "public function getTabTitle()\n {\n return __('Paypal Payment Information');\n }", "public function advanceLabel ()\r\n {\r\n $return = '\r\n </div>';\r\n if (++$this->label_column > $this->number_of_columns)\r\n {\r\n $this->label_column = 1;\r\n $return .= '\r\n </div>';\r\n if (++$this->label_row > $this->number_of_rows)\r\n {\r\n $this->label_row =1;\r\n ++$this->label_page;\r\n $return .= '\r\n </div>\r\n <div class=\"labelpage\">';\r\n }\r\n $return .= '\r\n <div class=\"labelrow\">';\r\n }\r\n $return .= '\r\n <div class=\"labelbody\">';\r\n return $return;\r\n }", "public function getTabTitle()\n {\n return $this->__('Click here to view data of supplier subscribtion plans');\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return Mage::helper('catalogrule')->__('Conditions');\n }", "public function getLabel()\n {\n }", "public function getLabel()\n {\n }", "public abstract function printLabel($label);", "function setLabel($value){\r\n\t\t$this->label = $value;\r\n\t}", "function setLabelTemplateLastNameFirstName()\n { \n $this->setLabelTemplate( 'person_lname,person_fname','[person_lname], [person_fname]');\n }", "public function get_tab_name(): string {\n\t\t\treturn LearnDash_Custom_Label::get_label( 'lessons' );\n\t\t}", "public function getTabTitle()\n {\n return __('Home Page Banners');\n }", "public function setLabel($newLabel);", "public function getTabLabel() {\r\n return $this->__('Membership settings');\r\n }", "public function getTabTitle()\n\t{\n\t\treturn __('Qa Info');\n\t}", "function setLabelTemplateLastNameFirstNameID()\n { \n $this->setLabelTemplate( 'person_lname,person_fname,person_id','[person_lname], [person_fname] - [person_id]');\n }", "public function getTabTitle()\r\n {\r\n return __('General Group');\r\n }", "public function autoLabelNeeded();", "public function GetLabel();" ]
[ "0.7114453", "0.7101027", "0.7090905", "0.6968536", "0.68892276", "0.68884677", "0.6873799", "0.68513906", "0.6840325", "0.6794355", "0.6792117", "0.678392", "0.67825663", "0.67771375", "0.6761354", "0.6700937", "0.6695219", "0.6684862", "0.6639534", "0.6633968", "0.66217077", "0.659517", "0.65646166", "0.65455025", "0.65450794", "0.6542507", "0.65412664", "0.65406334", "0.6538753", "0.65167457", "0.6471513", "0.6442286", "0.6423887", "0.64206105", "0.6405618", "0.63999087", "0.63999087", "0.6371306", "0.63563204", "0.63562363", "0.6346698", "0.63431644", "0.6340009", "0.6339166", "0.6331432", "0.63222194", "0.6315845", "0.6311046", "0.6311046", "0.62838215", "0.62736285", "0.6267562", "0.625226", "0.62430215", "0.62308687", "0.6217489", "0.62070155", "0.6193788", "0.61842877", "0.615422", "0.6127025", "0.6121726", "0.61092657", "0.6106253", "0.60723644", "0.60689837", "0.60689837", "0.6054386", "0.60531104", "0.60426253", "0.6040332", "0.60332966", "0.60305005", "0.6020245", "0.60185915", "0.6018134", "0.6014958", "0.6011862", "0.6005857", "0.6005857", "0.6005857", "0.6005857", "0.6005857", "0.6005857", "0.6005857", "0.6003744", "0.60012263", "0.60012263", "0.5998349", "0.5989486", "0.5984054", "0.59822756", "0.59745085", "0.59709615", "0.59641147", "0.596208", "0.5959765", "0.5954364", "0.59493864", "0.5948014" ]
0.6723177
15
Prepare title for tab
public function getTabTitle() { return Mage::helper('gri_cms')->__('Versions'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function titleTab($title = \"\"){\n \t$title .= \"\";\n \treturn $title;\n }", "public function getTabTitle()\r\n {\r\n return Mage::helper('slideshow')->__('Slide Information');\r\n }", "public function getTabTitle()\n {\n return Mage::helper('lavi_news')->__('News Info');\n }", "public function getTabTitle()\n {\n return Mage::helper('magna_news')->__('Content');\n }", "public function getTabTitle()\n {\n return __('Slider Details');\n }", "public function get_title()\n {\n return __('Vertical Tabs', 'hslanding-elementor');\n }", "public function getTabTitle()\n {\n return __('Slider Information');\n }", "public function getTabTitle()\r\n\t{\r\n\t\treturn Mage::helper('slider')->__('Banner Info');\r\n\t}", "public function getTabTitle()\n {\n return __('Single Page Details');\n }", "function makeTab($title,$content) {\n\t\t$placeholders = array(\n\t\t\t\"[+title+]\" => $title,\n\t\t\t\"[+tab_content+]\" => $content,\n\t\t);\n\t\treturn str_replace( array_keys( $placeholders ), array_values( $placeholders ), $this->templates[\"tab\"]);\n\t}", "public function getTabTitle()\r\n {\r\n return Mage::helper('attributeSplash')->__('Conditions');\r\n }", "public function getTabTitle()\n {\n return __('Home Page Banners');\n }", "public function getTabTitle()\n {\n return Mage::helper('cms')->__('CSS & JS');\n }", "function parse_title($title='')\n\t\t{\n\t\t\t$this->t->set_block('run_activity', 'block_title_zone', 'title_zone');\n\t\t\t\n\t\t\tif (($this->conf['use_automatic_parsing']) && ($this->conf['show_activity_title']))\n\t\t\t{\n\t\t\t\t$this->t->set_var(array('activity_title'=> $title));\n\t\t\t\t$this->t->parse('title_zone', 'block_title_zone', true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->t->set_var(array( 'title_zone' => ''));\n\t\t\t}\n\t\t}", "public function getTabTitle() {\r\n return Mage::helper('amlanding')->__('Links');\r\n }", "public function getTabTitle()\n {\n return Mage::helper('temando')->__('General');\n }", "public function getTabTitle()\n {\n return __('Staff Profile');\n }", "protected function renderPageTitle() {}", "public function getTabTitle()\r\n {\r\n return __('Template Information');\r\n }", "public function adaptPageTitle(&$title)\n {}", "public function getTabTitle()\n\t{\n\t\treturn __('Qa Info');\n\t}", "public function getTabTitle()\r\n {\r\n return __('Designer Information');\r\n }", "public function getTabTitle()\r\n {\r\n return __('Design');\r\n }", "public function getTabTitle()\n {\n return __('EVENTS');\n }", "function title($title, $tabs = 2)\n{\n /**\n * Add a title into the html file.\n *\n * Args:\n * $title (str): the title to add\n * $tabs (int): number of tabs for indentation, default is 2\n */\n start_tag('title', Tab($tabs), false) ;\n echo $title ;\n close_tag('title', '', true) ;\n}", "public function getTabTitle()\r\n {\r\n return __('Conditions');\r\n }", "public function getTabTitle()\n {\n return Mage::helper('recomiendo_recipes')->__('Ingredients');\n }", "public static function title();", "public function getTabTitle() {\n return $this->__('Click here for GlobalLink Translation');\n }", "function setup_title() {\n\t\tglobal $bp;\n\n\t\tif ( bp_is_messages_component() ) {\n\t\t\tif ( bp_is_my_profile() ) {\n\t\t\t\t$bp->bp_options_title = __( 'My Messages', 'buddypress' );\n\t\t\t} else {\n\t\t\t\t$bp->bp_options_avatar = bp_core_fetch_avatar( array(\n\t\t\t\t\t'item_id' => bp_displayed_user_id(),\n\t\t\t\t\t'type' => 'thumb',\n\t\t\t\t\t'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )\n\t\t\t\t) );\n\t\t\t\t$bp->bp_options_title = bp_get_displayed_user_fullname();\n\t\t\t}\n\t\t}\n\n\t\tparent::setup_title();\n\t}", "private function generate_title()\r\n\t\t{\r\n\t\t\treturn $this->c_title;\r\n\t\t}", "protected function makeTitle()\n {\n $this->setY($this->layout['titleMarginTop']);\n $this->setFont('', 'B', $this->layout['titleFontSize']);\n $this->write($this->layout['titleCellHeight'], $this->content['title']);\n $this->setFont('', '', $this->layout['fontSize']);\n }", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "public function getTabTitle()\n {\n return $this->_getHelper()->__('General Information');\n }", "function od_set_page_title($orig_title) {\n\t\treturn \"Map | \"; // set the page title (could be improved, eg based on filters. Might be something the user wants to set\n\t}", "protected function regeneratePageTitle() {}", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->__('Click here to view data of supplier subscribtion plans');\n }", "public function getTabTitle()\n {\n return __('General information');\n }", "private function _getTitle()\r\n\t{\r\n\t\t$input\t= dunloader( 'input', true );\r\n\t\t$action\t= $input->getVar( 'action', 'themes' );\r\n\t\t$task\t= $input->getVar( 'task', null );\r\n\t\t\r\n\t\treturn '<h1>' . t( 'themer.admin.module.title', t( 'themer.admin.module.title.' . $action . ( $task ? '.' . $task : '' ) ) ) . '</h1>';\r\n\t}", "public function getTabTitle()\n {\n return Mage::helper('sc_cmsblockmanagement')->__('Versions');\n }", "public function getTabTitle()\n {\n return Mage::helper('blog')->__('Comment Information');\n }", "private function setTitle()\n {\n $this->title = $this->start_date;\n\n if ($this->start_date != $this->end_date) {\n $this->title .= ' - '.$this->end_date;\n }\n }", "public function getTabTitle()\n {\n return Mage::helper('catalogrule')->__('Conditions');\n }", "function MyApp_Interface_HEAD_Title()\n {\n $comps=preg_split('/::/',parent::MyApp_Interface_HEAD_Title());\n $keys=array(\"Initials\",\"Name\",\"Title\");\n \n $unit=$this->Unit();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($unit,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n \n $event=$this->Event();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($event,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n\n return join(\"::\",array_reverse($comps)); \n }", "public function getTabTitle()\n {\n return __('Subscription Information');\n }", "private function renderTitle()\n\t{\n\t\treturn '<h1 class=\"block-new-title\">' . $this->title . '</h1>';\n\t}", "function title() {\n parent::title();\n\n if (Session::haveRight('internet', UPDATE)\n && Session::canViewAllEntities()) {\n\n echo \"<div class='spaced' id='tabsbody'>\";\n echo \"<table class='tab_cadre_fixe'>\";\n\n echo \"<tr><td class='center'>\";\n Html::showSimpleForm(IPNetwork::getFormURL(), 'reinit_network',\n __('Reinit the network topology'));\n\n echo \"</td></tr>\";\n\n echo \"</table>\";\n echo \"</div>\";\n }\n }", "public function getTabTitle()\n {\n return __('General Information');\n }", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "function getTitle() ;", "function rename_tab( $tabs ) \n{\n\t$tabs['additional_information']['title'] = __( 'O Produto' );\n\treturn $tabs;\n}", "function title(){\n\t\t\techo $mytitle= \"Profile. Car Parking Website\";\n\t\t\t\n\t\t}", "function get_title()\n {\n }", "public function title(){\n if (func_num_args() > 0){\n $this->title = func_get_arg(0);\n }\n \n return $this->title;\n }", "protected function _buildTitle()\n\t{\n\t\tif ($this->_task)\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER_' . strtoupper($this->_task));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER');\n\t\t}\n\t\t\\Document::setTitle($title);\n\t}", "public function getTabTitle()\n {\n return $this->__('Hot Offers');\n }", "public function title(){\r\n\r\n echo ISSET($this->pageSettings->page_title)?$this->pageSettings->page_title:'';\r\n\r\n }", "function wpvideocoach_custom_support_title()\r\n{\r\n\tglobal $wpvideocoach_help_tabs_title;\r\n\treturn $wpvideocoach_help_tabs_title;\r\n}", "public function buildTitle()\r\n\t{\r\n\t\t$data\t= '<h1>' . t( 'intouch.admin.title', t( 'intouch.admin.title.' . $this->action . '.' . $this->task ) ) . '</h1>';\r\n\t\treturn $data;\r\n\t}", "public function getTabTitle()\n {\n return __('Paypal Payment Information');\n }", "public function getTabTitle()\n {\n return __('General');\n }", "public function getTabTitle()\n {\n return __('Configuration');\n }", "function setTitle( $title )\n {\n $title = trim( $title );\n $this->properties['TITLE'] = $title;\n }", "private static final function getPageTitle () {\r\n // Execute the <title tag> .tp file;\r\n $webHeaderString = new FileContent (FORM_TP_DIR . _S . 'frm_web_header_title.tp');\r\n return $webHeaderString->doToken ('[%TITLE_REPLACE_STRING%]',\r\n implode (_DCSP, ((self::$objPageTitleBackward->toInt () == 1) ? (self::$objPageTitle->arrayReverse ()->toArray ()) :\r\n self::$objPageTitle->toArray ())));\r\n }", "function prepend_title($title){\r\n\t\t$this->_title = \"{$title} - {$this->_title}\";\r\n\t}", "public function restoration_title($title) {\n\t\techo '<h2>'.$title.'</h2>';\n\t}", "public function title();", "public function title();", "protected function _buildTitle()\n\t{\n\t\tif (!$this->_title)\n\t\t{\n\t\t\t$this->_title = Lang::txt(strtoupper($this->_option));\n\t\t\tif ($this->_task)\n\t\t\t{\n\t\t\t\tswitch ($this->_task)\n\t\t\t\t{\n\t\t\t\t\tcase 'browse':\n\t\t\t\t\tcase 'submit':\n\t\t\t\t\tcase 'start':\n\t\t\t\t\tcase 'intro':\n\t\t\t\t\t\tif ($this->_task_title)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_title .= ': ' . $this->_task_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'serve':\n\t\t\t\t\tcase 'wiki':\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt('COM_PUBLICATIONS_SERVING_CONTENT');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt(strtoupper($this->_option . '_' . $this->_task));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tDocument::setTitle($this->_title);\n\t}", "function tsk_title_placeholder_text ( $title ) {\n\t\tif ( get_post_type() == 'project' ) {\n\t\t\t$title = __( 'Project Name' );\n\t\t} else if ( get_post_type() == 'piece' ) {\n\t $title = __( 'Piece Name' );\n\t\t}\n\t\treturn $title;\n\t}", "function page_title($title = ''){\r\n\tglobal $eqdkp, $user;\r\n\t$pt_prefix\t\t= (defined('IN_ADMIN')) ? $user->lang['admin_title_prefix'] : $user->lang['title_prefix'];\r\n\t$main_title\t\t= sprintf($pt_prefix, $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']);\r\n\treturn sanitize((( $title != '' ) ? $title.' - ' : '').$main_title, TAG);\r\n}", "function title($title) {\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn $title;\r\n\t\t}\r\n\r\n\t\t$season = Uwr1resultsController::season();\r\n\t\t$season = $season.'/'.($season+1); // TODO: make a function for that\r\n\r\n\t\t$view = Uwr1resultsController::WhichView();\r\n\t\tif ('index' == $view) {\r\n\t\t\t$title = 'Unterwasserrugby Liga Ergebnisse der Saison '.$season;\r\n\t\t} else if ('league' == $view) {\r\n\t\t\t$title = 'Ergebnisse der ' . Uwr1resultsModelLeague::instance()->name() . ' (Saison ' . $season . ')';\r\n\t\t} else if ('tournament' == $view) {\r\n\t\t\t$title = 'Ergebnisse des UWR Turniers ' . Uwr1resultsModelLeague::instance()->name();\r\n\t\t}\r\n\t\treturn $title;\r\n\t}", "abstract protected function getTitle();", "public function getTabTitle()\n {\n return Mage::helper('chirpify_seller')->__('Product');\n }", "private function _generateTitle()\n {\n $title = '';\n foreach ($this->_contents as $content)\n {\n $title = ('' == $title) ? $content->myGetSeoTitleTag() : $content->myGetSeoTitleTag().' | '.$title;\n }\n return $title;\n }", "public function computedTitle();", "public function getTabTitle()\n {\n return __('Message');\n }", "public static function setTitle(string $title) {}", "private function makeCalendarTitle()\n\t{\n\t\tif(strlen($this->headerTitle) > 0) {\n\t\t\t$this->calWeekDays .= \"\\t<tr>\\n\\t\\t<th class=\\\"headerTitle\\\" colspan=\\\"7\\\">\".$this->headerTitle.\"</th>\\n\\t</tr>\";\n\t\t\t$this->outArray['title'] = $this->headerTitle;\n\t\t}\n\t}", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();" ]
[ "0.81280273", "0.72819954", "0.7275596", "0.718621", "0.7168587", "0.7132194", "0.71102154", "0.70983636", "0.70758915", "0.70720655", "0.7054877", "0.7045234", "0.70391387", "0.70316243", "0.70116305", "0.6996202", "0.6975736", "0.69642615", "0.69376856", "0.6929819", "0.69027853", "0.6889834", "0.6887165", "0.68244785", "0.6815642", "0.6813814", "0.68121815", "0.680729", "0.68064654", "0.68002796", "0.6798673", "0.67972463", "0.6794331", "0.6794331", "0.6794331", "0.6793337", "0.6787132", "0.6758815", "0.67587966", "0.67587966", "0.67587966", "0.67587966", "0.67587966", "0.67587966", "0.67587966", "0.675385", "0.67499167", "0.67325413", "0.67264134", "0.6723474", "0.67202806", "0.67106557", "0.6705268", "0.66849375", "0.6664104", "0.66636366", "0.66589576", "0.6652693", "0.6652693", "0.6652693", "0.6652693", "0.6652693", "0.6652693", "0.6652693", "0.6651294", "0.6640773", "0.66348904", "0.6634739", "0.66334975", "0.66268873", "0.660854", "0.66061306", "0.6592255", "0.6585009", "0.65816396", "0.65778285", "0.65747404", "0.6559504", "0.6557401", "0.6549274", "0.6547366", "0.65471977", "0.65471977", "0.6536069", "0.65337026", "0.65271974", "0.6521834", "0.65214384", "0.65111405", "0.65093446", "0.65067065", "0.6498686", "0.64886236", "0.64817005", "0.6481613", "0.647384", "0.647384", "0.647384", "0.647384", "0.647384" ]
0.69777715
16
Returns status flag about this tab can be shown or not
public function canShowTab() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canShowTab() {\r\n return true;\r\n }", "public function canShowTab() {\r\n return true;\r\n }", "public function canShowTab()\r\n {\r\n return true;\r\n }", "public function canShowTab()\r\n {\r\n return true;\r\n }", "public function canShowTab()\r\n {\r\n return true;\r\n }", "public function canShowTab() {\n return true;\n }", "public function canShowTab() {\n return true;\n }", "public function canShowTab()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function canShowTab() {\n return true;\n }", "public function canShowTab()\n {\n return $this->_getCurrentTheme()->isVirtual() && $this->_getCurrentTheme()->getId();\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 canShowTab()\n {\n if ($this->_scopeConfig->getValue('brainacts_storelocator/item/separate_page')) {\n return true;\n }\n return false;\n }", "public function canShowTab()\n {\n $customer = Mage::registry('current_customer');\n return $customer->getId()&& Mage::helper('storecreditpro')->moduleEnabled();\n }", "protected function _canBeShown()\n {\n if (!Mage::helper('factfinder_campaigns')->getIsResultListingPage()) {\n return false;\n }\n\n return (bool) Mage::helper('factfinder')->isEnabled('campaigns');\n }", "public function isVisible(): bool\n {\n return $this->scopeConfig->getValue('helloworld/general/enable');\n }", "public function canShowTab()\n {\n if (!$this->getPage()->getId()\n || !Mage::helper('gri_cms/hierarchy')->isEnabled()\n || !Mage::getSingleton('admin/session')->isAllowed('cms/hierarchy'))\n {\n return false;\n }\n return true;\n }", "protected static function showTab($name) {\n\t\t\n\t\t$show_tab_setting = elgg_get_plugin_setting(\"group_listing_{$name}_available\", 'group_tools');\n\t\t\n\t\treturn ($show_tab_setting !== '0');\n\t}", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && $this->isEnabled();\n }", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && !parent::isEnabled();\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}", "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}", "public function is_visible() {\n\t\treturn true;\n\t}", "public function canShowInfo() {}", "function visible () {\n\t\treturn isadmin();\n\t}", "function is_visible()\n\t{\n\t\treturn $this->visible;\n\t}", "public function getVisible() {\r\n return $this->bVisible;\r\n }", "public function is_active(): bool;", "function isVisible() {\n return ($this->entry->staff_id || $this->entry->user_id)\n && $this->entry->type != 'R' && $this->isEnabled();\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 function getFunctionCanShow();", "public function displayInAdmin()\n {\n return self::_enabled();\n }", "public function isVisible()\n {\n return $this->attribute('state') != self::STATUS_MODERATED;\n }", "public function isEnabled()\n {\n\t\tif($this->actif == 1) return true;\n \telse return false;\n }", "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 show_in_admin_bar()\n\t{\n\t\treturn !( self::const_value( 'DEVDEBUG_NO_ADMIN_BAR' ) );\n\t}", "public function is_active();", "public function getIsRunning();", "public function isShowActions()\n {\n return $this->isShowActions;\n }", "public function getTab()\n {\n if ($this->_auth->hasIdentity()) {\n return ' Authorized';\n } else {\n return ' Not Authorized';\n }\n }", "static public function isVisible(): bool\n {\n return static::$visible;\n }", "public function canShowOnDemand () {\n return true;\n }", "public function is_visible() {\n\t\treturn isset( $this->data['visible'] ) && $this->data['visible'];\n\t}", "function isVisible() {\n return $this->entry->flags & ThreadEntry::FLAG_EDITED;\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}", "public function hasTabContent(): bool\n {\n return $this->hasTabContent;\n }", "public function showInMenu()\n {\n $ctrs = PageCom::ctrs();\n return $ctrs && (count($ctrs) > 1);\n }", "public function isInformationVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_OPTIONS_DISPLAY_INFORMATION);\n }", "public function isVisible()\n {\n return $this->visible;\n }", "public function isVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function isInformation() {\n return (1 === $this->getStatusClass());\n }", "public function alwaysShown()\n {\n \treturn $this->alwaysShown;\n }", "function wpvideocoach_hide_help_tabs() {\r\n\tglobal $wpvideocoach_help_tabs;\r\n\tif($wpvideocoach_help_tabs == 1){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "public function isInvisible(): bool\n {\n return $this->bIsInvisible;\n }", "public function isStatus()\n {\n return $this->getStatus();\n }", "public function isViewable(): bool\n\t{\n\t\treturn self::STATUS_ACTIVE === $this->get('status') && self::USER_VISIBLE === $this->get('visible');\n\t}", "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 isVisible() : bool\n {\n return $this->visible;\n }", "function isActive(){\n\t\treturn $this->getSessionID() == $this->getUser()->getShift() && $this->getStatus() == '1' ? true : false;\n\t}", "function is_visible() {\n\t\tif ($this->visibility=='hidden') return false;\n\t\tif ($this->visibility=='visible') return true;\n\t\tif ($this->visibility=='search' && is_search()) return true;\n\t\tif ($this->visibility=='search' && !is_search()) return false;\n\t\tif ($this->visibility=='catalog' && is_search()) return false;\n\t\tif ($this->visibility=='catalog' && !is_search()) return true;\n\t}", "public function canShow()\n {\n return $this->_authSession->isFirstPageAfterLogin() && $this->_getLatestItem();\n }", "public function hasStatus(){\n return $this->_has(10);\n }", "public function is_inactive(): bool;", "protected function isAllowedStatusUsed()\n\t{\n\t\treturn $this->use_allowed_status;\n\t}", "function getVisible() { return $this->readVisible(); }", "public function hasStatus(){\n return $this->_has(19);\n }", "public function isEnabled(){\n return $this->activo;\n }", "public function isVisible()\n {\n return true;\n }", "public function tab_indexes_enabled() {\n\t\t\n\t\treturn $this->render_tab_indexes;\n\t\t\n\t}", "public function hasShowDisplay()\n {\n return $this->show_display !== null;\n }", "public function IsActive()\n {\n return true;\n }", "function getVisible() { return $this->readVisible(); }", "function getIsActive() ;", "public function isActive()\n\t{\n\t\treturn $this->status;\n\t}", "public function get_status() {\n\t\t//Returns true or false. Values are set in their object ($switches, $thermometers, etc)\n\t\treturn $this->_get_status();\n\t}", "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}" ]
[ "0.76013005", "0.76013005", "0.76001817", "0.76001817", "0.76001817", "0.7557656", "0.7557656", "0.754918", "0.7525714", "0.74338806", "0.7263546", "0.70641536", "0.7019773", "0.6736499", "0.66958994", "0.66497284", "0.6640016", "0.65316844", "0.65166664", "0.6505718", "0.6496495", "0.6493771", "0.6433854", "0.64220846", "0.63523453", "0.63403386", "0.63125014", "0.6310068", "0.6303796", "0.62985903", "0.6296298", "0.6253656", "0.62116885", "0.61963964", "0.61877126", "0.6182209", "0.61741245", "0.6158958", "0.6158813", "0.61499685", "0.61380833", "0.613464", "0.6126996", "0.6123155", "0.6120762", "0.6120121", "0.6113814", "0.61134255", "0.61134255", "0.61048514", "0.61048514", "0.61048514", "0.61048514", "0.61048514", "0.61048514", "0.60818446", "0.60752386", "0.6071317", "0.604076", "0.60358703", "0.60295445", "0.601866", "0.6010815", "0.6010464", "0.60045904", "0.60038495", "0.5970586", "0.5968119", "0.5964889", "0.59617734", "0.59480596", "0.59476787", "0.59438187", "0.59426206", "0.59415966", "0.5932222", "0.5916538", "0.59155303", "0.59111667", "0.5906795", "0.59033936" ]
0.75238234
27
Returns status flag about this tab hidden or not
public function isHidden() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHiddenFlag() {}", "public function isHidden()\n {\n return $this->is_hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "public function getHidden(): bool;", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function getHidden()\n {\n return isset($this->hidden) ? $this->hidden : false;\n }", "public function getInvisibleFlag() {}", "public function getVisible() {\r\n return $this->bVisible;\r\n }", "public function isHidden(): bool\n {\n return false;\n }", "public function isHidden() {\r\n return false;\r\n }", "public function isHidden() {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "function isHidden()\n {\n return $this->_hidden;\n }", "function isHidden();", "protected function getHidden()\n {\n return $this->hidden;\n }", "public function isHidden() {\n return false;\n }", "public function isHidden(): bool\n {\n return $this->hidden;\n }", "public function isHidden(): bool\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function isHidden()\n {\n return false;\n }", "public function getHidden()\n\t{\n\t\treturn $this->hidden;\n\t}", "public function getHidden() {\n\t\treturn $this->hidden;\n\t}", "public function getHidden() {\n\t\treturn $this->hidden;\n\t}", "public function isHidden()\n\t{\n\t\treturn (bool)$this->_hidden;\n\t}", "public function isHidden()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public static function isHidden(): bool\n {\n return !empty(static::HIDDEN);\n }", "public function getOpac_hide()\n {\n return $this->opac_hide;\n }", "public function getHidden(){\n return $this->_hidden;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getIsLabelHidden(): bool;", "public static function isWindowHidden() : bool {}", "public function getInvisible()\n\t{\n\t\treturn $this->invisible;\n\t}", "public function is_inactive(): bool;", "public function getHidden()\n {\n $this->parseDocBlock();\n return $this->hasAnnotation('hidden');\n }", "function is_hidden_status( $user_id ) {\n\t\t$_hide_online_status = get_user_meta( $user_id, '_hide_online_status', true );\n\t\tif ( $_hide_online_status == 1 || ( isset( $_hide_online_status[0] ) && $_hide_online_status[0] == 'no' ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isHidden()\n\t{\n\t\t$hiddenModules = array('servermanager','serverclient','users','groups','modules','postfixadmin');\n\t\treturn in_array($this->name, $hiddenModules);\n\t}", "public function isHidden() {\n\t\tif ($this->displayCondition == null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !$this->displayCondition->isOk();\n\t}", "public function isHidden() {\n\t\tif ($this->displayCondition == null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !$this->displayCondition->isOk();\n\t}", "public function is_visible() {\n\t\treturn true;\n\t}", "function wpvideocoach_hide_help_tabs() {\r\n\tglobal $wpvideocoach_help_tabs;\r\n\tif($wpvideocoach_help_tabs == 1){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "function is_visible()\n\t{\n\t\treturn $this->visible;\n\t}", "public function isVisible()\n {\n return $this->visible;\n }", "public function isVisible()\n {\n return $this->visible;\n }", "function isVisible() {\n return $this->entry->flags & ThreadEntry::FLAG_EDITED;\n }", "public function isVisible()\n {\n return $this->attribute('state') != self::STATUS_MODERATED;\n }", "public function getVisibility()\n {\n return $this->visibility;\n }", "public function getVisibility()\n {\n return $this->visibility;\n }", "public function getVisibility()\n {\n return $this->visibility;\n }", "function getVisible() { return $this->readVisible(); }", "public function isInvisible(): bool\n {\n return $this->bIsInvisible;\n }", "public function get_visibility()\n {\n }", "function wiki_shown_hidden($post){\n\t\t\n\t\t$status = get_post_meta($post->ID,'wiki-contributons-status',true);\n\t\t\n\t?>\t\n\t\tTo hide the table check the box &nbsp;\n\t\t\n\t\t<input type=\"checkbox\" value=\"hide\" name=\"wiki-tabel-shownorhide\" <?php checked('hide',$status); ?> /> \n\t\n\t<?php\t\n\t}", "public function isInvisible() {\n return !$this->isVisible();\n }", "function getVisible() { return $this->readVisible(); }", "function getVisibility() {\n if($this->visibility === false) {\n $this->visibility = $this->canSeePrivate() ? VISIBILITY_PRIVATE : VISIBILITY_NORMAL;\n } // if\n return $this->visibility;\n }", "public function isVisible() {\n\t\tif ($this->hidden === TRUE) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function is_visible() {\n\t\tif ($this->visibility=='hidden') return false;\n\t\tif ($this->visibility=='visible') return true;\n\t\tif ($this->visibility=='search' && is_search()) return true;\n\t\tif ($this->visibility=='search' && !is_search()) return false;\n\t\tif ($this->visibility=='catalog' && is_search()) return false;\n\t\tif ($this->visibility=='catalog' && !is_search()) return true;\n\t}", "public function isVisible() {\n return ($this->visible && $this->state != \"unavailable\");\n }", "function getVisible() {return $this->readVisible();}", "public function isHidden()\n {\n $isHidden = false;\n if ($this->forumNode()->IsHidden)\n {\n $isHidden = true;\n }\n \n return $isHidden;\n }", "static public function isVisible(): bool\n {\n return static::$visible;\n }", "public function canShowTab()\r\n {\r\n return true;\r\n }", "public function canShowTab()\r\n {\r\n return true;\r\n }", "public function canShowTab()\r\n {\r\n return true;\r\n }", "public function canShowTab() {\r\n return true;\r\n }", "public function canShowTab() {\r\n return true;\r\n }", "public static function hidden()\n {\n return [];\n }", "public function canShowTab()\n {\n return $this->_getCurrentTheme()->isVirtual() && $this->_getCurrentTheme()->getId();\n }" ]
[ "0.7192623", "0.6858757", "0.6857589", "0.6857589", "0.6857589", "0.68056065", "0.67297375", "0.67297375", "0.67297375", "0.67297375", "0.66529703", "0.6642841", "0.66410697", "0.66243756", "0.66203606", "0.66203606", "0.66001964", "0.66001964", "0.66001964", "0.6594459", "0.6565998", "0.65652037", "0.65539926", "0.65517247", "0.65517247", "0.6546903", "0.6546903", "0.6546903", "0.6546903", "0.65457064", "0.653438", "0.65079814", "0.65079814", "0.6500992", "0.64994025", "0.639256", "0.63903713", "0.63794184", "0.6242123", "0.6242123", "0.6242123", "0.6242123", "0.6242123", "0.6242123", "0.6228362", "0.6216441", "0.62131405", "0.61971194", "0.61893624", "0.61867756", "0.6155576", "0.61302525", "0.61302525", "0.61254245", "0.61194915", "0.6066462", "0.6048055", "0.6048055", "0.60467076", "0.60451776", "0.6038842", "0.6038842", "0.6038842", "0.60283846", "0.60276073", "0.6005038", "0.59909284", "0.5990083", "0.5986914", "0.59789324", "0.59689265", "0.59560966", "0.5861437", "0.58578914", "0.58327943", "0.58280265", "0.58243364", "0.58243364", "0.58243364", "0.58215874", "0.58215874", "0.5798116", "0.57978344" ]
0.652848
48
Prepare massactions for this grid. For now it is only ability to remove versions
protected function _prepareMassaction() { if (Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion()) { $this->setMassactionIdField('version_id'); $this->getMassactionBlock()->setFormFieldName('version'); $this->getMassactionBlock()->addItem('delete', array( 'label' => Mage::helper('gri_cms')->__('Delete'), 'url' => $this->getUrl('*/*/massDeleteVersions', array('_current' => true)), 'confirm' => Mage::helper('gri_cms')->__('Are you sure?'), 'selected' => true, )); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareMassaction()\n {\n $this->setMassactionIdField('solutionpartner_id');\n $this->getMassactionBlock()->setFormFieldName('solutionpartner');\n\n $this->getMassactionBlock()->addItem('delete', array(\n 'label' => Mage::helper('solutionpartner')->__('Delete'),\n 'url' => $this->getUrl('*/*/massDelete'),\n 'confirm' => Mage::helper('solutionpartner')->__('Are you sure?')\n ));\n\n $statuses = Mage::getSingleton('solutionpartner/status')->getOptionArray();\n\n array_unshift($statuses, array('label'=>'', 'value'=>''));\n $this->getMassactionBlock()->addItem('status', array(\n 'label'=> Mage::helper('solutionpartner')->__('Change status'),\n 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),\n 'additional' => array(\n 'visibility' => array(\n 'name' => 'status',\n 'type' => 'select',\n 'class' => 'required-entry',\n 'label' => Mage::helper('solutionpartner')->__('Status'),\n 'values'=> $statuses\n ))\n ));\n return $this;\n }", "protected function _prepareMassAction()\n {\n parent::_prepareMassaction();\n $this->setMassactionIdField('customer_name');\n $this->getMassactionBlock()->setFormFieldName('order');\n $this->getMassactionBlock()->addItem('oggetto_oneclick', array(\n 'label' => Mage::helper('oggetto_oneclick')->__('Delete'),\n 'url' => $this->getUrl('*/*/massDelete'),\n 'confirm' => Mage::helper('oggetto_oneclick')->__('Are you sure?')\n )\n );\n }", "protected function _prepareMassaction() {\r\n\r\n $this->setMassactionIdField('entity_id');\r\n $this->getMassactionBlock()->setFormFieldName('TicketsList');\r\n\r\n $helper = Mage::helper('CrmTicket');\r\n\r\n $this->getMassactionBlock()->addItem('category', array(\r\n 'label' => $helper->__('Assign to a category'),\r\n 'url' => $this->getUrl('*/*/MassTickets/category/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'categories',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('Category'),\r\n 'values' => $this->getCategoryMenuForMassAction()\r\n )\r\n )\r\n ));\r\n\r\n $this->getMassactionBlock()->addItem('status', array(\r\n 'label' => $helper->__('Change status'),\r\n 'url' => $this->getUrl('*/*/MassTickets/status/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'statuses',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('Status'),\r\n 'values' => mage::getModel('CrmTicket/Ticket')->getStatuses()\r\n )\r\n )\r\n ));\r\n\r\n $this->getMassactionBlock()->addItem('user', array(\r\n 'label' => $helper->__('Change user'),\r\n 'url' => $this->getUrl('*/*/MassTickets/user/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'users',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('User'),\r\n 'values' => $this->getUsersMenuForMassAction()\r\n )\r\n )\r\n ));\r\n\r\n $this->getMassactionBlock()->addItem('tag', array(\r\n 'label' => $helper->__('Add tag'),\r\n 'url' => $this->getUrl('*/*/MassTickets/tag/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'tags',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('Tags'),\r\n 'values' => mage::helper('CrmTicket/Tag')->getAllTags()\r\n )\r\n )\r\n ));\r\n\r\n $this->getMassactionBlock()->addItem('spam', array(\r\n 'label' => $helper->__('Mark as spam '),\r\n 'url' => $this->getUrl('*/*/MassTickets/spam/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'spam',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('Spam'),\r\n 'values' => mage::getModel('CrmTicket/EmailSpam')->getSpamActions()\r\n )\r\n )\r\n ));\r\n\r\n if (Mage::getStoreConfig('crmticket/ticket_grid/mass_delete_ticket')) {\r\n $this->getMassactionBlock()->addItem('delete', array(\r\n 'label' => $helper->__('Delete ticket'),\r\n 'url' => $this->getUrl('*/*/MassDeleteTickets/', array('_current' => true))\r\n ));\r\n }\r\n\r\n return $this;\r\n }", "protected function _prepareMassaction()\n {\n $this->setMassactionIdField('entity_id');\n $this->getMassactionBlock()->setFormFieldName('shipment_ids');\n $this->getMassactionBlock()->setUseSelectAll(false);\n\n $this->getMassactionBlock()->addItem('create_shipment', array(\n 'label'=> Mage::helper('sales')->__('Create Canpar Shipments'),\n 'url' => $this->getUrl('*/canparshipment/massCreate'),\n ));\n\n $this->getMassactionBlock()->addItem('void_shipment', array(\n 'label'=> Mage::helper('sales')->__('Void Canpar Shipments'),\n 'url' => $this->getUrl('*/canparshipment/massVoid'),\n ));\n\n $this->getMassactionBlock()->addItem('get_label', array(\n 'label'=> Mage::helper('sales')->__('Print Labels'),\n 'url' => $this->getUrl('*/canparshipment/massLabels'),\n ));\n\n $this->getMassactionBlock()->addItem('get_tlabel', array(\n 'label'=> Mage::helper('sales')->__('Print Thermal Labels'),\n 'url' => $this->getUrl('*/canparshipment/massLabels', array('_thermal' => true)),\n ));\n\n return $this;\n }", "protected function _prepareMassaction() {\n /**\n * Set massaction id\n * Set massaction name\n */\n $this->setMassactionIdField ( 'id' );\n $this->getMassactionBlock ()->setFormFieldName ( 'country_code' );\n /**\n * Add delete mass action \n */ \n $this->getMassactionBlock ()->addItem ( 'delete', array (\n 'label' => Mage::helper ( 'airhotels' )->__ ( 'Delete' ),\n 'url' => $this->getUrl ( '*/*/massDelete' ),\n 'confirm' => Mage::helper ( 'airhotels' )->__ ( 'Are you sure?' ) \n ) );\n return $this;\n }", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "protected function _prepareMassaction(){\r\n return $this;\r\n }", "protected function _prepareMassaction() {\r\n //entity_id is unique identifier \r\n $this->setMassactionIdField('entity_id');\r\n //Form field name\r\n $this->getMassactionBlock()->setFormFieldName('product');\r\n //status enable/disable\r\n $this->getMassactionBlock()->addItem('status', array(\r\n 'label' => Mage::helper('catalog')->__('Enable Coupon Request '),\r\n 'url' => $this->getUrl('*/*/massEnable', array('_current' => true)),\r\n ))\r\n ->addItem('status1', array(\r\n 'label' => Mage::helper('catalog')->__('Disable Coupon Request'),\r\n 'url' => $this->getUrl('*/*/massDisable', array('_current' => true)),\r\n ));\r\n\r\n\r\n return $this;\r\n }", "protected function _prepareMassaction()\n {\n return $this;\n }", "protected function _prepareMassaction()\n {\n return $this;\n }", "protected function _addMassactions()\r\n {\r\n// $this\r\n// ->_addMassaction('delete', [\r\n// 'label' => Lang::get('general.delete'),\r\n// 'url' => URL::route('users.mass-delete'),\r\n// 'confirm' => Lang::get('general.are_you_sure'),\r\n// ]);\r\n }", "protected function _prepareMassAction()\n {\n\tparent::_prepareMassAction();\n\t$this->getMassActionBlock()->setUseSelectAll(true);\n\treturn $this;\n }", "private function prepareColumns()\n {\n $readOnlyAttribute = $this->readOnlyAttribute;\n\n $columns = [];\n if ($this->canMove) {\n $columns[] = [\n 'class' => MovingColumn::className(),\n 'movingDisabledAttribute' => $readOnlyAttribute,\n ];\n }\n foreach ($this->columns as $column) {\n if (is_string($column)) {\n $column = ['attribute' => $column];\n }\n\n if (empty($column['class'])) {\n $column['class'] = isset($column['items']) ? DropdownInputColumn::className() : TextInputColumn::className();\n }\n\n if ($this->itemClass === null && empty($column['label'])) {\n $column['label'] = Inflector::camel2words($column['attribute'], true);\n }\n\n $column = array_merge([\n 'readOnlyAttribute' => $readOnlyAttribute,\n ], $column);\n\n $columns[] = $column;\n }\n\n if ($this->canRemove) {\n $columns[] = [\n 'class' => 'smart\\grid\\ActionColumn',\n 'options' => ['style' => 'width: 25px;'],\n 'template' => '{remove}',\n 'buttons' => [\n 'remove' => function ($url, $model, $key) use ($readOnlyAttribute) {\n $readOnly = false;\n if ($readOnlyAttribute !== null) {\n $readOnly = ArrayHelper::getValue($model, $readOnlyAttribute);\n }\n\n if ($readOnly) {\n return '';\n }\n\n return Html::a('<span class=\"fas fa-remove\"></span>', '#', [\n 'class' => 'item-remove',\n 'title' => $this->removeLabel,\n ]);\n },\n ],\n ];\n }\n\n $this->_columns = $columns;\n }", "protected function _prepareColumns()\n {\n $result = parent::_prepareColumns();\n $column = $this->getColumn('action');\n if (!$column) {\n return $result;\n }\n $data = $column->getData();\n $data['actions'][0]['url'] = array('base' => 'adminhtml/sales_order/view');\n $column->setData($data);\n return $result;\n }", "protected function _prepareColumns()\n {\n \t\n \t/*$this->addColumn('module',\n array(\n 'header' => 'SugarCRM Module Name',\n 'align' =>'left',\n 'index' => 'module',\n \t ));*/\n\t\t\n\t\t$this->addColumn('fields', array(\n 'header' => 'SugarCRM Field Name',\n 'align' =>'left',\n 'index' => 'wp_meta_label',\n \t \t ));\n\t\t\n\t\t/*$this->addColumn('fieldtype', array(\n 'header' => 'Field Type',\n 'align' =>'left',\n 'index' => 'field_type',\n \t\t ));*/\n\t\t\t\t \n\t\t$this->addColumn(\"magfield\", array(\n\t\t\t\t\t\"header\" \t=> Mage::helper(\"contact\")->__(\"Magento Field Names\"),\n\t\t\t\t\t'filter' => false,\n\t\t\t\t\t'sortable' => false,\n\t\t\t\t\t'align' =>'left',\n\t\t\t\t\t'width'\t\t=> '45%',\n\t\t\t\t\t'renderer' \t=> 'Offshoreevolution_Contact_Block_Adminhtml_Synctable_Grid_Renderer_Filter'\n\t\t\t\t )); \n\t\t\n\t\t$this->addColumn(\"actionButton\", array(\n\t\t\t\t\t\"header\" \t=> Mage::helper(\"contact\")->__(\"Action\"),\n\t\t\t\t\t'filter' => false,\n\t\t\t\t\t'sortable' => false,\n\t\t\t\t\t'align' =>'center',\n\t\t\t\t\t'width'\t\t=> '80',\n\t\t\t\t\t'renderer' \t=> 'Offshoreevolution_Contact_Block_Adminhtml_Synctable_Grid_Renderer_Button'\n\t\t\t\t )); \n\t\t//$this->addColumn('action',\n//\t\t\t\t\tarray(\n//\t\t\t\t\t'header' => Mage::helper('sugarcrm')->__('Action'),\n//\t\t\t\t\t'width' => '100',\n//\t\t\t\t\t'type' => 'action',\n//\t\t\t\t\t'getter' => 'getId',\n//\t\t\t\t\t'index' => 'pid',\n//\t\t\t\t\t'actions' => array(\n//\t\t\t\t\t\t\tarray(\n//\t\t\t\t\t\t\t\t\t'caption' => Mage::helper('sugarcrm')->__('Sync'),\n//\t\t\t\t\t\t\t\t\t'class'\t\t=> 'syncAction',\n//\t\t\t\t\t\t\t\t\t//'url' => array('base'=> '*/*/edit'),\n//\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t'field' => 'id'\n//\t\t\t\t\t\t\t)\n//\t\t\t\t\t),\n//\t\t\t\t\t'filter' => false,\n//\t\t\t\t\t'sortable' => false,\n//\t\t\t\t\t'index' => 'stores',\n//\t\t\t\t\t'is_system' => true,\n//\t\t));\n//\t\t$this->addColumn('id',\n// array(\n// 'header' => 'ID',\n// 'align' =>'right',\n// 'width' => '50px',\n// 'index' => 'pid',\n//\t\t\t\t\t'column_css_class'=>'no-display',\n// \t\t\t\t\t'header_css_class'=>'no-display'\n// \t ));\n return parent::_prepareColumns();\n }", "protected function _changeActions(Mage_Index_Block_Adminhtml_Process_Grid $grid)\n {\n $grid->getColumn('action')->setActions(array(\n array(\n 'caption' => Mage::helper('index')->__('Reindex Data'),\n 'url' => array('base' => '*/*/reindexProcess'),\n 'field' => 'process'\n ),\n array(\n 'caption' => Mage::helper('index')->__('Schedule Reindex'),\n 'url' => array('base' => 'adminhtml/asyncindex/index'),\n 'params' => array('_current' => true, '_secure' => false),\n 'field' => 'process'\n ),\n array(\n 'caption' => Mage::helper('index')->__('Schedule partial index'),\n 'url' => array('base' => 'adminhtml/asyncindex/schedulePartial'),\n 'params' => array('_current' => true, '_secure' => false),\n 'field' => 'process'\n ),\n ));\n return $this;\n }", "public function prepare()\n {\n parent::prepare();\n\n $this->_data['config']['actions'] = [\n [\n 'actionName' => 'reset',\n 'targetName' => '${ $.name }',\n 'params' => [\n json_encode($this->getRobotsDefaultCustomInstructions())\n ]\n ]\n ];\n }", "public function addShipmentGridMassActionAndColumns(Varien_Event_Observer $observer)\n {\n /** @var Mage_Adminhtml_Block_Sales_Shipment_Grid $block */\n $block = $observer->getBlock();\n if ($this->config->isEnabled()\n && $block instanceof Mage_Adminhtml_Block_Sales_Shipment_Grid\n && Mage::getSingleton('admin/session')->isAllowed('sales/shipment/create_hermes_shipments')\n ) {\n $block->getMassactionBlock()->addItem('cancelHermesParcels', array(\n 'label' => Mage::helper('hermes')->__('Cancel Hermes shipments'),\n 'url' => $block->getUrl('adminhtml/parcel/massCancel'),\n )\n );\n\n $logo = '<img src=\"' . $block->getSkinUrl('images/hermes/logo_small.png') .\n '\" alt=\"Hermes\" title=\"Hermes\" height=\"12\" align=\"top\" id=\"hermes_logo_small\" />';\n\n $block->addColumn('status_code', array(\n 'header' => $logo . Mage::helper('hermes')->__('Hermes Status'),\n 'index' => 'status_code',\n 'type' => 'options',\n 'options' => Mage::getSingleton('hermes/parcel')->getStatusCodes(),\n 'sortable' => true,\n 'is_system' => false,\n ));\n\n }\n return $this;\n }", "public function prepare_items() {\n\t\t/** Process bulk action */\n\t\t$this->process_bulk_action();\n\n\t\t$columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $this->_column_headers = array($columns, $hidden, $sortable);\n\n\t\t$per_page = $this->get_items_per_page( 'posts_per_page', 20 );\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = self::record_count();\n\n\t\t$this->set_pagination_args( [\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page //WE have to determine how many items to show on a page\n\t\t] );\n\n\t\t$this->items = self::get_posts( $per_page, $current_page );\n\t}", "public function prepare_items()\n {\n $columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $data = $this->table_data();\n usort( $data, array( &$this, 'sort_data' ) );\n $perPage = 10;\n $currentPage = $this->get_pagenum();\n $totalItems = count($data);\n $this->set_pagination_args( array(\n 'total_items' => $totalItems,\n 'per_page' => $perPage\n ) );\n $data = array_slice($data,(($currentPage-1)*$perPage),$perPage);\n $this->_column_headers = array($columns, $hidden, $sortable);\n $this->process_bulk_action();\n $this->items = $data;\n }", "public function prepare_items()\r\n {\r\n if( !count( $this->columns ) )\r\n $this->set_columns();\r\n\r\n $per_page = 20;\r\n\r\n $columns = $this->get_columns();\r\n $hidden = array();\r\n $sortable = $this->get_sortable_columns();\r\n\r\n $this->_column_headers = array( $columns, $hidden, $sortable );\r\n\r\n $this->process_bulk_action();\r\n\r\n $data = $this->values;\r\n\r\n usort( $data, array( $this, 'usort_reorder' ) );\r\n\r\n $current_page = $this->get_pagenum();\r\n\r\n $total_items = count( $data );\r\n\r\n $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );\r\n\r\n $this->items = $data;\r\n\r\n if( $total_items > $per_page ) {\r\n $this->set_pagination_args( array(\r\n 'total_items' => $total_items,\r\n 'per_page' => $per_page,\r\n 'total_pages' => ceil( $total_items / $per_page ),\r\n ) );\r\n }\r\n }", "public function addMassactionToProductGrid($observer)\n\t{\n\t\t$block = $observer->getBlock();\n\t\t\n\t\tif($block instanceof Mage_Adminhtml_Block_Catalog_Product_Grid){\n\t\t\t\n\t\t\t$sets = Mage::getResourceModel('eav/entity_attribute_set_collection')\n\t\t\t\t->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())\n\t\t\t\t->load()\n\t\t\t\t->toOptionHash();\n\t\t\n\t\t\t$block->getMassactionBlock()->addItem('flagbit_changeattributeset', array(\n\t\t\t\t'label'=> Mage::helper('catalog')->__('Change attribute set'),\n\t\t\t\t'url' => $block->getUrl('*/*/changeattributeset', array('_current'=>true)),\n\t\t\t\t'additional' => array(\n\t\t\t\t\t'visibility' => array(\n\t\t\t\t\t\t'name' => 'attribute_set',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'class' => 'required-entry',\n\t\t\t\t\t\t'label' => Mage::helper('catalog')->__('Attribute Set'),\n\t\t\t\t\t\t'values' => $sets\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)); \t\t\t\n\t\t}\n\t}", "public function prepare_items()\r\n {\r\n $columns = $this->get_columns();\r\n $hidden = $this->get_hidden_columns();\r\n $sortable = $this->get_sortable_columns();\r\n\r\n /** Process bulk action */\r\n $this->process_bulk_action();\r\n\r\n $data = $this->table_data();\r\n usort($data, array(&$this, 'sort_data'));\r\n $perPage = 30;\r\n $currentPage = $this->get_pagenum();\r\n $totalItems = count($data);\r\n $this->set_pagination_args(array(\r\n 'total_items' => $totalItems,\r\n 'per_page' => $perPage\r\n ));\r\n $data = array_slice($data, (($currentPage - 1) * $perPage), $perPage);\r\n // var_dump($data);\r\n // die();\r\n $this->_column_headers = array($columns, $hidden, $sortable);\r\n $this->items = $data;\r\n }", "function admin_bulk_action(){\n\t\t\n\t\t$this->layout = \"\";\n\t\t$this->autoRender = false;\n\t\tif(isset($this->data['Model']['id']) && count($this->data['Model']['id'])>0 && isset($this->data['Model']['action'])){\n\t\t\t\n\t\t\t$infected_records = array();\n\t\t\tforeach($this->data['Model']['id'] as $ids){\n\t\t\t\t$infected_records[] = DECRYPT_DATA($ids);\n\t\t\t}\n\t\t\t$model_name = $this->data['Model']['model_name'];\n\t\t\t$action = $this->data['Model']['action'];\n\t\t\tApp::import(\"Model\",$model_name);\n\t\t\t$this->$model_name = new $model_name();\n\t\t\tif($action == 0){//Activate Status\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_active\"=>\"'1'\"),array(\"$model_name.id\"=>$infected_records));\n\t\t\t $this->Session->setFlash(RECORD_ACTIVATED, 'message/green');\n\t\t\t}\n\t\t\telse if($action == 1){//Inactivate Status\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_active\"=>\"'0'\"),array(\"$model_name.id\"=>$infected_records));\n\t\t\t $this->Session->setFlash(RECORD_DEACTIVATED, 'message/green');\n\t\t\t}else if($action == 2){//Delete selected records\n\t\t\t\t\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_deleted\"=>\"'1'\"),array(\"$model_name.id\"=>$infected_records));\n\t\t\t if($model_name == \"Vendor\"){\n\t\t\t\tApp::import(\"Model\",\"Product\");\n\t\t\t\t$this->Product = new Product();\n\t\t\t\t$this->Product->updateAll(array(\"Product.is_deleted\"=>\"'1'\"),array(\"Product.vendor_id\"=>$infected_records));\n\t\t\t\tApp::import(\"Model\",\"Coupon\");\n\t\t\t\t$this->Coupon = new Coupon();\n\t\t\t\t$this->Coupon->updateAll(array(\"Coupon.is_deleted\"=>\"'1'\"),array(\"Coupon.vendor_id\"=>$infected_records));\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t $this->Session->setFlash(RECORD_DELETED, 'message/green');\n\t\t\t}\n\t\t\t$this->redirect($this->referer());exit();\t\n\t\t}\n\t}", "public function __prepare()\n {\n $this->objectManager->create('Mage\\CatalogRule\\Test\\TestStep\\DeleteAllCatalogRulesStep')->run();\n }", "public function prepare_items() {\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = get_hidden_columns( $this->screen );\n \t\t$sortable = $this->get_sortable_columns();\n \t\t$this->_column_headers = array($columns, $hidden, $sortable);\n \t\t//$this->_column_headers = $this->get_column_info();\n\t\t/** Process bulk action */\n\t\t$this->process_bulk_action();\n\n\t\t$per_page = $this->get_items_per_page( 'transactions_per_page', 10 );\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = self::record_count();\n\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page //WE have to determine how many items to show on a page\n\t\t));\n\n\t\t$this->items = self::get_customers( $per_page, $current_page );\n\t}", "protected function _prepareColumns() {\n /**\n * Add columa 'id','name'.\n */\n $this->addCustomColumn ( 'id' );\n $this->addCustomColumn ( 'name' );\n /**\n * Get the Collection of subscriptiontype\n */\n $subscriptionTitle = Mage::getModel ( 'airhotels/subscriptiontype' )->getCollection ();\n $data = $subscriptionTitle->getData ();\n $substitle = null;\n foreach ( $data as $value ) {\n $i = $value ['id'];\n $substitle [$i] = $value ['title'];\n }\n /**\n * When building a module always utilise the installation and\n * upgrade scripts so that any database additions or changes are automatically modified\n * on module installation.\n * There are a number of built in functions to these modules allowing you to add attributes,\n * create new tables etc.\n *\n * Add Column for subscription_type\n */\n $this->addColumn ( 'subscription_type', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Subscription Type' ),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'subscription_type',\n 'type' => 'options',\n 'options' => $substitle,\n 'renderer' => 'Apptha_Airhotels_Block_Adminhtml_Managesubscriptions_Grid_Renderer_Type' \n ) );\n /**\n * When building a module always utilise the installation and\n * upgrade scripts so that any database additions or changes are automatically modified\n * on module installation.\n * There are a number of built in functions to these modules allowing you to add attributes,\n * create new tables etc.\n *\n * Add Column for action\n */\n $this->addColumn ( 'action', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Action' ),\n 'filter' => false,\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId', \n 'index' => 'stores',\n 'actions' => array (\n array (\n 'caption' => Mage::helper ( 'airhotels' )->__ ( 'Edit' ),\n 'url' => array (\n 'base' => '*/*/edit'\n ),\n 'field' => 'id'\n )\n ),\n 'sortable' => false,\n 'is_system' => true \n ) );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareColumns ();\n }", "public function prepare_items() {\n\n\t\t\t$columns = $this->get_columns();\n\n\t\t\t$hidden = array(); // No hidden columns\n\n\t\t\t$sortable = $this->get_sortable_columns();\n\n\t\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\n\n\n\t\t\t// Process bulk action\n\n\t\t\t$this->process_bulk_action();\n\n\n\n\t\t\t$current_page = $this->get_pagenum();\n\n\t\t\t$total_items = self::record_count();\n\n\n\n\t\t\t$this->items = self::get_topics( 20, $current_page );\n\n\n\n\t\t\t$this->set_pagination_args( [\n\n\t\t\t\t'total_items' => $total_items,\n\n\t\t\t\t'per_page' => 20\n\n\t\t\t] );\n\n\t\t}", "public function bulkAction() {\n\t\t$this->_helper->ajaxgrid->massActions ();\n\t}", "public function bulkAction() {\n\t\t$this->_helper->ajaxgrid->massActions ();\n\t}", "protected function prepareItemActions()\n {\n if (!empty($this->_actions)) {\n return;\n }\n \n $currentType = FormUtil::getPassedValue('type', 'user', 'GETPOST', FILTER_SANITIZE_STRING);\n $currentFunc = FormUtil::getPassedValue('func', 'main', 'GETPOST', FILTER_SANITIZE_STRING);\n $dom = ZLanguage::getModuleDomain('MUTicket');\n if ($currentType == 'admin') {\n if (in_array($currentFunc, array('main', 'view'))) {\n /* $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'preview',\n 'linkTitle' => __('Open preview page', $dom),\n 'linkText' => __('Preview', $dom)\n );*/\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this['title']),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'MUTicket:CurrentState:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n /* $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );*/\n }\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_DELETE)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'delete', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'delete',\n 'linkTitle' => __('Delete', $dom),\n 'linkText' => __('Delete', $dom)\n );\n }\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'view', 'arguments' => array('ot' => 'currentState')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n if ($currentType == 'user') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this['title']),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'MUTicket:CurrentState:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n /* $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );*/\n }\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_DELETE)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'delete', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'delete',\n 'linkTitle' => __('Delete', $dom),\n 'linkText' => __('Delete', $dom)\n );\n }\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'view', 'arguments' => array('ot' => 'currentState')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n }", "protected function _prepareColumns()\n {\n $this->addColumn($this->_productIdField, array(\n 'header' => $this->_getHelper()->__('ID'),\n 'sortable' => true,\n 'index' => $this->_productIdField,\n 'width' => 60,\n ));\n\n $this->addColumn('title', array(\n 'header' => $this->_getHelper()->__('Title'),\n 'index' => 'title'\n ));\n\n $this->addColumn('set_title', array(\n 'header' => $this->_getHelper()->__('Attachments Set'),\n 'index' => 'set_title',\n 'width' => 150,\n 'frame_callback' => array($this, 'prepareSetUrl')\n ));\n\n $this->addColumn('file_url', array(\n 'header' => $this->_getHelper()->__('Download'),\n 'index' => 'download',\n 'sortable' => false,\n 'filter' => false,\n 'width' => 150,\n 'frame_callback' => array($this, 'prepareFileUrl')\n ));\n\n $this->addColumn('type', array(\n 'header' => $this->_getHelper()->__('Type'),\n 'index' => 'type',\n 'filter' => false,\n 'width' => 50,\n 'frame_callback' => array($this, 'prepareType')\n ));\n\n $this->addColumn('updated_at', array(\n 'header' => $this->_getHelper()->__('Updated'),\n 'type' => 'date',\n 'index' => 'updated_at',\n 'width' => 150,\n ));\n\n return Mage_Adminhtml_Block_Widget_Grid::_prepareColumns();\n }", "protected function resetDeckPrepare()\n {\n // only symbolic functionality... rest is handled below\n $this->result()\n ->changeRequest('toggle_edit_show', true)\n ->setCurrent('Decks_edit');\n }", "protected function _prepareColumns()\n {\n/*\n $this->addColumn('version_number', array(\n 'header' => Mage::helper('gri_cms')->__('Version #'),\n 'width' => 100,\n 'index' => 'version_number',\n 'type' => 'options',\n 'options' => Mage::helper('gri_cms')->getVersionsArray($this->getPage())\n ));\n*/\n $this->addColumn('label', array(\n 'header' => Mage::helper('gri_cms')->__('Version Label'),\n 'index' => 'label',\n 'type' => 'options',\n 'options' => $this->getCollection()\n ->getAsArray('label', 'label')\n ));\n\n $this->addColumn('owner', array(\n 'header' => Mage::helper('gri_cms')->__('Owner'),\n 'index' => 'username',\n 'type' => 'options',\n 'options' => $this->getCollection()->getUsersArray(false),\n 'width' => 250\n ));\n\n $this->addColumn('access_level', array(\n 'header' => Mage::helper('gri_cms')->__('Access Level'),\n 'index' => 'access_level',\n 'type' => 'options',\n 'width' => 100,\n 'options' => Mage::helper('gri_cms')->getVersionAccessLevels()\n ));\n\n $this->addColumn('revisions', array(\n 'header' => Mage::helper('gri_cms')->__('Revisions Qty'),\n 'index' => 'revisions_count',\n 'type' => 'number'\n ));\n\n $this->addColumn('created_at', array(\n 'width' => 150,\n 'header' => Mage::helper('gri_cms')->__('Created At'),\n 'index' => 'created_at',\n 'type' => 'datetime',\n ));\n\n return parent::_prepareColumns();\n }", "public function prepare_items() {\n\n\t\t// Roll out each part.\n\t\t$columns = $this->get_columns();\n\t\t$hidden = $this->get_hidden_columns();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t$dataset = $this->table_data();\n\n\t\t// Check for the action key value to filter.\n\t\tif ( ! empty( $_REQUEST['wbr-review-filter'] ) ) { // WPCS: CSRF ok.\n\t\t\t$dataset = $this->maybe_filter_dataset( $dataset );\n\t\t}\n\n\t\t// Handle our sorting.\n\t\tusort( $dataset, array( $this, 'sort_data' ) );\n\n\t\t// Load up the pagination settings.\n\t\t$paginate = 20;\n\t\t$item_count = count( $dataset );\n\t\t$current = $this->get_pagenum();\n\n\t\t// Set my pagination args.\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $item_count,\n\t\t\t'per_page' => $paginate,\n\t\t\t'total_pages' => ceil( $item_count / $paginate ),\n\t\t));\n\n\t\t// Slice up our dataset.\n\t\t$dataset = array_slice( $dataset, ( ( $current - 1 ) * $paginate ), $paginate );\n\n\t\t// Do the column headers.\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\n\t\t// Make sure we have the single action running.\n\t\t$this->process_single_action();\n\n\t\t// Make sure we have the bulk action running.\n\t\t$this->process_bulk_action();\n\n\t\t// Make sure we have the status change.\n\t\t$this->process_status_change();\n\n\t\t// And the result.\n\t\t$this->items = $dataset;\n\t}", "protected function _prepareRowsAction() {\n \n }", "function Prepare()\r\n\t{\r\n\t\tif (!$this->Active) return;\r\n\r\n\t\t$act = Server::GetState($this->Name.'_action');\r\n\r\n\t\tif ($this->sorting == ED_SORT_TABLE)\r\n\t\t\t$this->sort = array(Server::GetVar('sort', $this->ds->id) =>\r\n\t\t\t\tServer::GetVar('order', 'ASC'));\r\n\r\n\t\t$this->state = $act == 'edit' ? STATE_EDIT : STATE_CREATE;\r\n\r\n\t\tif ($act == 'Cancel') $this->Reset();\r\n\r\n\t\tif ($act == 'Create')\r\n\t\t{\r\n\t\t\t$insert = array();\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = isset($child_id) ? $this->ds->children[$child_id] : $this;\r\n\r\n\t\t\t$fields = $context->ds->FieldInputs;\r\n\t\t\tforeach ($fields as $col => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in))\r\n\t\t\t\t{\r\n\t\t\t\t\t$value = Server::GetVar($this->Name.'_'.$col);\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'date')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$insert[$col] = date('Y-m-d', strtotime($value));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if($in->attr('TYPE') == 'datetime')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($value[5][0] == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//time is in PM\r\n\t\t\t\t\t\t\tif($value[3][0] != 12) $value[3][0] += 12;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$time_portion = \" {$value[3][0]}:{$value[4][0]}:00\";\r\n\t\t\t\t\t\t$insert[$col] = $value[2].'-'.$value[0].'-'.$value[1].$time_portion;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'password' && strlen($value) > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$insert[$col] = md5($value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (empty($value['tmp_name'])) continue;\r\n\t\t\t\t\t\t$ext = strrchr($value['name'], '.');\r\n\r\n\t\t\t\t\t\t# We move files later because we do not have enough\r\n\t\t\t\t\t\t# data to decide where to put them or what to name them.\r\n\r\n\t\t\t\t\t\t$files[] = array(\r\n\t\t\t\t\t\t\t'src' => $value['tmp_name'],\r\n\t\t\t\t\t\t\t'dst' => $in->attr('VALUE')\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t//$insert[$col] = $ext;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'selects') $insert[$col] = $value;\r\n\t\t\t\t\telse $insert[$col] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse if (is_numeric($col)) continue;\r\n\t\t\t\telse $insert[$col] = Database::SqlUnquote($in);\r\n\t\t\t\t//I just changed this to 'else' (check the history), because a\r\n\t\t\t\t//numeric value with a string column would not go in eg. 5\r\n\t\t\t\t//instead of '5', if this ends up conflicting, we'll need to\r\n\t\t\t\t//come up with a different solution.\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t{\r\n\t\t\t\tif (!$handler->Create($this, $insert)) { $this->Reset(); return; }\r\n\t\t\t}\r\n\r\n\t\t\t$parent = Server::GetVar('parent');\r\n\r\n\t\t\tif (isset($parent))\r\n\t\t\t{\r\n\t\t\t\t$child = $this->ds->children[Server::GetVar('child')];\r\n\t\t\t\t$insert[$child->child_key] = $parent;\r\n\t\t\t}\r\n\r\n\t\t\t$id = $context->ds->Add($insert);\r\n\t\t\t$insert[$context->ds->id] = $id;\r\n\r\n\t\t\t# Handle all uploads\r\n\r\n\t\t\tif (!empty($files))\r\n\t\t\t{\r\n\t\t\t\t$vp = new VarParser();\r\n\t\t\t\tforeach ($files as $file)\r\n\t\t\t\t{\r\n\t\t\t\t\t# Handler associated\r\n\t\t\t\t\tif (is_object($file['dst']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$file['dst']->Create($file['src'], $insert);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse # Move uploaded file\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$dst = $vp->ParseVars($file['dst'], $insert);\r\n\t\t\t\t\t\tmove_uploaded_file($file['src'], $dst);\r\n\t\t\t\t\t\tchmod($dst, 0777);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t$handler->Created($this, $id, $insert);\r\n\r\n\t\t\t$this->Reset();\r\n\t\t}\r\n\r\n\t\telse if ($act == 'Update')\r\n\t\t{\r\n\t\t\t$ci = Server::GetVar('ci');\r\n\r\n\t\t\tif ($this->type == CONTROL_SIMPLE)\r\n\t\t\t{\r\n\t\t\t\tforeach (array_keys($this->ds->FieldInputs) as $name)\r\n\t\t\t\t{\r\n\t\t\t\t\t$vals[$name] = Server::GetVar($name);\r\n\t\t\t\t}\r\n\t\t\t\t$fp = fopen($ci, 'w+');\r\n\t\t\t\tfwrite($fp, serialize($vals));\r\n\t\t\t\tfclose($fp);\r\n\t\t\t}\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = $child_id != null ? $this->ds->children[$child_id] : $this;\r\n\t\t\t$update = array();\r\n\t\t\tforeach ($context->ds->FieldInputs as $col => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (get_class($in) == 'FieldInput' && $in->type == 'label') continue;\r\n\r\n\t\t\t\t\t$value = Server::GetVar($this->Name.'_'.$col);\r\n\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'date')\r\n\t\t\t\t\t\t$update[$col] = date('Y-m-d', strtotime($value));\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'datetime')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($value[5][0] == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//time is in PM\r\n\t\t\t\t\t\t\tif ($value[3][0] != 12) $value[3][0] += 12;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$time_portion = \" {$value[3][0]}:{$value[4][0]}:00\";\r\n\t\t\t\t\t\t$update[$col] = $value[2].'-'.$value[0].'-'.$value[1].$time_portion;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'label')\r\n\t\t\t\t\t\tunset($update[$col]);\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'password')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!empty($value)) $update[$col] = md5($value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'checkbox')\r\n\t\t\t\t\t\t$update[$col] = ($value == 1) ? 1 : 0;\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'selects')\r\n\t\t\t\t\t\t$update[$col] = $value;\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!empty($value['tmp_name']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$vp = new VarParser();\r\n\t\t\t\t\t\t\t$src = $value['tmp_name'];\r\n\t\t\t\t\t\t\t$vars = $update;\r\n\t\t\t\t\t\t\t$vars[$this->ds->id] = $ci;\r\n\t\t\t\t\t\t\t$val = $in->attr('VALUE');\r\n\r\n\t\t\t\t\t\t\t# File Handler\r\n\t\t\t\t\t\t\tif (is_object($val)) $val->Update($src, $vars);\r\n\t\t\t\t\t\t\telse # String Based\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$dst = $vp->ParseVars($val, $vars);\r\n\t\t\t\t\t\t\t\tmove_uploaded_file($src, $dst);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tunset($update[$col]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse $update[$col] = $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (count($this->handlers) > 0)\r\n\t\t\t{\r\n\t\t\t\t$q['match'][$this->ds->id] = $ci;\r\n\t\t\t\t$data = $this->ds->GetOne($q);\r\n\t\t\t\t$update[$this->ds->id] = $ci;\r\n\t\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t{\r\n\t\t\t\t\t$res = $handler->Update($this, $ci, $data, $update);\r\n\t\t\t\t\t// Returns false, simple failure.\r\n\t\t\t\t\tif (!$res) { $this->Reset(); return; }\r\n\t\t\t\t\t// Returns an array of errors.\r\n\t\t\t\t\tif (is_array($res))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->state = STATE_EDIT;\r\n\t\t\t\t\t\t$this->Errors = $res;\r\n\t\t\t\t\t\treturn;\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 ($this->type == CONTROL_BOUND)\r\n\t\t\t\t$context->ds->Update(array($context->ds->id => $ci), $update);\r\n\r\n\t\t\t$this->Reset();\r\n\t\t}\r\n\r\n\t\telse if ($act == 'delete')\r\n\t\t{\r\n\t\t\t$ci = Server::GetState($this->Name.'_ci');\r\n\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = isset($child_id) ? $this->ds->children[$child_id] : $this;\r\n\r\n\t\t\t$data = $context->ds->GetOne(array($context->ds->id => $ci));\r\n\r\n\t\t\tif (count($this->handlers) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$handler->Delete($this, $ci, $data)) return;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!empty($context->ds->FieldInputs))\r\n\t\t\tforeach ($context->ds->FieldInputs as $name => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in) && strtolower(get_class($in)) == 'forminput')\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$vp = new VarParser();\r\n\t\t\t\t\t\t$val = $in->attr('VALUE');\r\n\t\t\t\t\t\t# File handler\r\n\t\t\t\t\t\tif (is_object($val))\r\n\t\t\t\t\t\t\t$val->Delete($data);\r\n\t\t\t\t\t\telse # Regular string file\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$files = glob($vp->ParseVars($val, $data).\".*\");\r\n\t\t\t\t\t\t\tforeach ($files as $file) unlink($file);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$context->ds->Remove(array($context->ds->id => $ci));\r\n\t\t}\r\n\r\n\t\tif ($this->type == CONTROL_SIMPLE)\r\n\t\t{\r\n\t\t\t$ci = Server::GetState($this->Name.'_ci');\r\n\r\n\t\t\tif (file_exists($ci))\r\n\t\t\t\t$this->values = unserialize(file_get_contents($ci));\r\n\t\t\telse\r\n\t\t\t\t$this->values = array();\r\n\t\t}\r\n\t}", "public function prepare()\r\n\t{\r\n\t\t$this->sort();\r\n\r\n\t\t// prepare urls\r\n\t\tforeach ($this->items as $mpoz)\r\n\t\t{\r\n\t\t\tif (empty($mpoz->url))\r\n\t\t\t{\r\n\t\t\t\t$mpoz->url = $this->getModuleUrl($mpoz->moduleName);\r\n\t\t\t}\r\n\t\t\t// one-level submenu\r\n\t\t\tif (!empty($mpoz->submenu))\r\n\t\t\t{\r\n\t\t\t\tforeach ($mpoz->submenu as &$subpoz)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (empty($subpoz['url']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$subpoz['url'] = $this->getModuleUrl($mpoz->moduleName, $subpoz['action']);\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}", "function reset(){\n\t\t$this->__columns = array();\n\t\t$this->__actions = array();\n\t}", "abstract protected function prepareModels();", "public function prepare_deployment() {\n if ( wpsho_fr()->is__premium_only() ) {\n\n $this->clear_file_list();\n\n $this->create_s3_deployment_list(\n $this->_archiveName,\n $this->_archiveName,\n $this->_remotePath\n );\n\n echo 'SUCCESS';\n }\n }", "protected function prepareItemActions()\n {\n if (!empty($this->_actions)) {\n return;\n }\n \n $currentType = FormUtil::getPassedValue('type', 'user', 'GETPOST', FILTER_SANITIZE_STRING);\n $currentFunc = FormUtil::getPassedValue('func', 'main', 'GETPOST', FILTER_SANITIZE_STRING);\n $dom = ZLanguage::getModuleDomain('SurveyManager');\n if ($currentType == 'admin') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'survey', 'id' => $this['id'], 'slug' => $this->slug)),\n 'icon' => 'preview',\n 'linkTitle' => __('Open preview page', $dom),\n 'linkText' => __('Preview', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'SurveyManager:Survey:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'survey', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'survey', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );\n }\n }\n \n // more actions for adding new related items\n $authAdmin = SecurityUtil::checkPermission($component, $instance, ACCESS_ADMIN);\n \n $uid = UserUtil::getVar('uid');\n if ($authAdmin || (isset($uid) && isset($this->createdUserId) && $this->createdUserId == $uid)) {\n \n $urlArgs = array('ot' => 'page',\n 'survey' => $this->id);\n if ($currentFunc == 'view') {\n $urlArgs['returnTo'] = 'adminViewSurvey';\n } elseif ($currentFunc == 'display') {\n $urlArgs['returnTo'] = 'adminDisplaySurvey';\n }\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => $urlArgs),\n 'icon' => 'add',\n 'linkTitle' => __('Create page', $dom),\n 'linkText' => __('Create page', $dom)\n );\n \n $urlArgs = array('ot' => 'response',\n 'survey' => $this->id);\n if ($currentFunc == 'view') {\n $urlArgs['returnTo'] = 'adminViewSurvey';\n } elseif ($currentFunc == 'display') {\n $urlArgs['returnTo'] = 'adminDisplaySurvey';\n }\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => $urlArgs),\n 'icon' => 'add',\n 'linkTitle' => __('Create response', $dom),\n 'linkText' => __('Create response', $dom)\n );\n }\n }\n if ($currentType == 'user') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'survey', 'id' => $this['id'], 'slug' => $this->slug)),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this->getTitleFromDisplayPattern()),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'view', 'arguments' => array('ot' => 'survey')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n }", "protected function _prepareColumns() {\r\n $this->addColumn('entity_id', array(\r\n 'header' => Mage::helper('catalog')->__('ID'),\r\n 'width' => '50px',\r\n 'index' => 'entity_id',\r\n )); //Product Id\r\n $this->addColumn('name', array(\r\n 'header' => Mage::helper('catalog')->__('Name'),\r\n 'index' => 'name',\r\n )); //Product name\r\n\r\n $store = $this->_getStore();\r\n if ($store->getId()) {\r\n $this->addColumn('custom_name', array(\r\n 'header' => Mage::helper('catalog')->__('Name in %s', $store->getName()),\r\n 'index' => 'custom_name',\r\n ));\r\n }//Store Information \r\n\r\n $this->addColumn('type', array(\r\n 'header' => Mage::helper('catalog')->__('Type'),\r\n 'width' => '60px',\r\n 'index' => 'type_id',\r\n 'type' => 'options',\r\n 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),\r\n )); //Product Type\r\n\r\n $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')\r\n ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())\r\n ->load()\r\n ->toOptionHash();\r\n\r\n $this->addColumn('sku', array(\r\n 'header' => Mage::helper('catalog')->__('SKU'),\r\n 'width' => '80px',\r\n 'index' => 'sku',\r\n )); //Product unique id SKU\r\n\r\n $store = $this->_getStore();\r\n $this->addColumn('price', array(\r\n 'header' => Mage::helper('catalog')->__('Price'),\r\n 'type' => 'price',\r\n 'currency_code' => $store->getBaseCurrency()->getCode(),\r\n 'index' => 'price',\r\n )); //Product Price\r\n\r\n\r\n\r\n $this->addColumn('reqcoupon_status', array(\r\n 'header' => Mage::helper('catalog')->__('Request Coupon Status'),\r\n 'width' => '70px',\r\n 'index' => 'reqcoupon_status',\r\n 'type' => 'options',\r\n 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),\r\n )); //Status of the Product \r\n\r\n /**\r\n * To export the Grid date in XML / CSV file\r\n */\r\n $this->addExportType('*/*/exportCsv', Mage::helper('reqforcoupon')->__('CSV'));\r\n $this->addExportType('*/*/exportXml', Mage::helper('reqforcoupon')->__('XML'));\r\n\r\n return parent::_prepareColumns();\r\n }", "function wc_tab_manager_edit_product_tab_bulk_actions( $actions ) {\n\n\tunset( $actions['edit'] );\n\n\t// Remove the date filter dropdown as well.\n\tadd_filter( 'disable_months_dropdown', '__return_true' );\n\n\treturn $actions;\n}", "protected function _prepareColumns()\n\t{\n\t\t$this->addColumn('id',\n\t\t\tarray(\n\t\t\t\t'header'=> $this->__('ID'),\n\t\t\t\t'align' =>'right',\n\t\t\t\t'width' => '50px',\n\t\t\t\t'index' => 'id'\n\t\t\t)\n\t\t);\n\n\t\t$this->addColumn('product_id',\n\t\t\tarray(\n\t\t\t\t'header'=> $this->__('Product ID'),\n\t\t\t\t'index' => 'product_id'\n\t\t\t)\n\t\t);\n\n\t\t$this->addColumn('increment_id',\n\t\t\tarray(\n\t\t\t\t'header'=> $this->__('Order ID'),\n\t\t\t\t'index' => 'increment_id'\n\t\t\t)\n\t\t);\n\n $this->addColumn('sfo.order_id',\n array(\n 'header' => Mage::helper('core')->__('View Order'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getOrderId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('core')->__('View'),\n 'url' => array('base'=> 'adminhtml/sales_order/view'),\n 'field' => 'order_id',\n 'target' => '_blank'\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true\n )\n );\n\n $this->addColumn('email',\n array(\n 'header'=> $this->__('Customer Email'),\n 'index' => 'email'\n )\n );\n\n $statusOptions = array(\n '0' => 'Working',\n '1' => 'Requested',\n '2' => 'Collected'\n );\n $this->addColumn('status',\n array(\n 'header'=> $this->__('Status (WORKING=0,REQUESTED=1,COLLECTED=2)'),\n 'index' => 'status',\n 'filter_index' => '`main_table`.`status`',\n 'type' => 'options',\n 'options' => $statusOptions,\n )\n );\n\n $this->addColumn('collect_date',\n array(\n 'header'=> $this->__('Collect Date'),\n 'index' => 'collect_date'\n )\n );\n\n\t\treturn parent::_prepareColumns();\n\t}", "public function migrate()\n {\n $this->syncRepository();\n $this->copyVariables();\n $this->copyDeployKeys();\n $this->reEnableBuilds();\n }", "public function setup_actions() {}", "protected function _prepareColumns()\n {\n $this->addColumn('increment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'increment_id',\n 'filter_index' => 'main_table.increment_id',\n 'type' => 'text',\n ));\n $this->addColumn('shipment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'entity_id',\n 'filter_index' => 'main_table.entity_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('canpar_shipment_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Shipment #'),\n 'index' => 'canpar_shipment_id',\n 'filter_index' => 'ch_shipment.shipment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('manifest_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Manifest #'),\n 'index' => 'manifest_id',\n 'renderer' => 'canparmodule/adminhtml_canparshipment_renderer_manifestId',\n 'filter_index' => 'ch_shipment.manifest_id',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Date Shipped'),\n 'index' => 'created_at',\n 'filter_index' =>'main_table.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('order_increment_id', array(\n 'header' => Mage::helper('sales')->__('Order #'),\n 'index' => 'order_increment_id',\n 'filter_index'=> 'o.increment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('order_created_date', array(\n 'header' => Mage::helper('sales')->__('Order Date'),\n 'index' => 'order_created_date',\n 'filter_index' =>'o.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('total_qty', array(\n 'header' => Mage::helper('sales')->__('Total Qty'),\n 'index' => 'total_qty',\n 'type' => 'number',\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('sales')->__('Action'),\n 'width' => '50px',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('sales')->__('View'),\n 'url' => array('base'=>'*/sales_shipment/view'),\n 'field' => 'shipment_id'\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'is_system' => true\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));\n $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));\n\n return parent::_prepareColumns();\n }", "private function _update_package_to_version_141()\n {\n $this->EE->db->delete('actions',\n array('class' => ucfirst($this->get_package_name())));\n }", "public function prepare_items()\r\r\n {\r\r\n\r\r\n $this->_column_headers = $this->get_column_info();\r\r\n\r\r\n /** Process bulk action */\r\r\n //\t$this->process_bulk_action();\r\r\n $per_page = $this->get_items_per_page('data_logs_per_page', 5);\r\r\n $current_page = $this->get_pagenum();\r\r\n $total_items = self::record_count();\r\r\n $this->set_pagination_args(array(\r\r\n 'total_items' => $total_items,\r\r\n 'per_page' => $per_page,\r\r\n ));\r\r\n\r\r\n $this->items = self::get_Data($per_page, $current_page);\r\r\n }", "public function migrate()\n {\n $this->prepareWizardsTable();\n\n $this->processProcessing();\n $this->processLogs();\n $this->processConfigData();\n\n $this->prepareOrdersTables();\n $this->prepareOrdersConfigTable();\n $this->processOrdersData();\n }", "public function prepare_items() {\r\n\t\t$this->_column_headers = $this->get_column_info();\r\n\r\n\t\t/** Process bulk action */\r\n\t\t$this->process_bulk_action();\r\n\r\n\t\t$per_page = $this->get_items_per_page( 'customers_per_page', 5 );\r\n\t\t$current_page = $this->get_pagenum();\r\n\t\t$total_items = self::record_count();\r\n\r\n\t\t$this->set_pagination_args( [\r\n\t\t\t'total_items' => $total_items,\r\n\t\t\t'per_page' => $per_page\r\n\t\t] );\r\n\r\n\t\t$this->items = self::get_customers( $per_page, $current_page );\r\n\t}", "public function bulk_actions(){\n\t\t$this->autoRender = false;\n\t\t$this->layout = false;\n\t\t\n\t\tif(!$this->_checkSession()){\n\t\t\t$this->Session->setFlash(__(\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">Acess Denied!</div>\"), 'flash_custom');\n\t\t\t$this->redirect(array('action'=>'login'));\n\t\t}\n\t\t\n\t\tif(!$this->request->is('post')){\n\t\t\tdie(\"Access denied!\");\n\t\t}\n\t\t$process_action = $this->request->data['process_action'];\n\t\t$process_model = $this->request->data['process_model'];\n\t\t\n\t\tswitch($process_action){\n\t\t\tcase 'delete':\n\t\t\t\t\t\tif(isset($this->request->data['item_id']) && !empty($this->request->data['item_id'])){\n\t\t\t\t\t\t\tforeach($this->request->data['item_id'] as $item_id){\n\t\t\t\t\t\t\t\t$this->$process_model->id = $item_id;\n\t\t\t\t\t\t\t\t$this->$process_model->delete();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->Session->setFlash(__('<div class=\"alert alert-success\" role=\"alert\">Records deleted successfully!</div>'), 'flash_custom');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\t\n\t\t}\n\t\t\t\n\t\t$this->redirect($this->referer());\n\t}", "public function prepare_items() {\n\t\t$column = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\n\t\t$this->_column_headers = array( $column, $hidden, $sortable );\n\n\t\t$per_page = 20;\n\t\t$current_page = $this->get_pagenum();\n\t\t$offset = ( $current_page - 1 ) * $per_page;\n\n\t\t$args = array(\n\t\t\t'number' => $per_page,\n\t\t\t'offset' => $offset,\n\t\t);\n\n\t\tif ( isset( $_REQUEST['orderby'] ) && isset( $_REQUEST['order'] ) ) {\n\t\t\t$args['orderby'] = $_REQUEST['orderby'];\n\t\t\t$args['order'] = $_REQUEST['order'];\n\t\t}\n\n\t\t$this->items = Persistence::get( $args );\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => Persistence::count(),\n\t\t\t\t'per_page' => $per_page,\n\t\t\t)\n\t\t);\n\t}", "protected function _prepareColumns() {\n $video = Mage::getModel('vidtest/video');\n\n $this->addColumn('video_id', array(\n 'header' => $this->__('Id'),\n 'align' => 'left',\n 'index' => 'video_id',\n 'width' => 50,\n 'type' => 'number'\n ));\n\n if (!Mage::app()->isSingleStoreMode() && !$this->getProduct()->getStoreId()) {\n $this->addColumn('stores', array(\n 'header' => $this->__('Store View'),\n 'index' => 'stores',\n 'type' => 'store',\n 'store_all' => true,\n 'store_view' => true,\n 'sortable' => false,\n 'filter_condition_callback' => array($this, '_filterStoreCondition'),\n ));\n }\n\n $this->addColumn('title', array(\n 'header' => $this->__('Title'),\n 'index' => 'title',\n 'type' => 'text',\n ));\n\n $this->addColumn('author_name', array(\n 'header' => $this->__('Author Name'),\n 'index' => 'author_name',\n 'type' => 'text',\n ));\n\n $this->addColumn('author_email', array(\n 'header' => $this->__('Author Email'),\n 'index' => 'author_email',\n 'type' => 'text',\n ));\n\n $this->addColumn('rate', array(\n 'header' => $this->__('Rate'),\n 'index' => 'rate',\n 'type' => 'number',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Date'),\n 'index' => 'created_at',\n 'type' => 'datetime',\n 'width' => '100px',\n ));\n\n $this->addColumn('status', array(\n 'header' => $this->__('Status'),\n 'align' => 'left',\n 'width' => '160px',\n 'index' => 'status',\n 'type' => 'options',\n 'options' => $video->getStatusesArray(),\n ));\n\n\n $this->addColumn('action', array(\n 'header' => $this->__('Action'),\n 'width' => '80',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => $this->__('Edit'),\n 'url' => array('base' => 'vidtest_admin/admin_video/edit'),\n 'field' => 'id',\n ),\n array(\n 'caption' => $this->__('Enable'),\n 'url' => array('base' => 'vidtest_admin/admin_video/enable'),\n 'field' => 'id',\n ),\n array(\n 'caption' => $this->__('Disable'),\n 'url' => array('base' => 'vidtest_admin/admin_video/disable'),\n 'field' => 'id',\n ),\n array(\n 'caption' => $this->__('Delete testimonial'),\n 'url' => array('base' => 'vidtest_admin/admin_video/delete'),\n 'field' => 'id',\n 'confirm' => $this->__('Are you sure you want to delete testimonial?'),\n ),\n array(\n 'caption' => $this->__('Delete testimonial and video source'),\n 'url' => array('base' => 'vidtest_admin/admin_video/fulldelete'),\n 'field' => 'id',\n 'confirm' => $this->__('Are you sure you want to delete testimonial and video source?'),\n ),\n ),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n return parent::_prepareColumns();\n }", "abstract public function mass_remove();", "public function migrate() \n {\n\n Masteryl_Migration::createOrUpdateDir(MASTERYL_MIGRATIONS_PATH, $this);\n\n if(!empty($this->modules)) {\n foreach($this->modules as $mod) {\n $dir = $mod['path'].'migrations';\n \n if(file_exists($dir))\n Masteryl_Migration::createOrUpdateDir($dir, $this);\n }\n }\n\n }", "protected function get_bulk_actions()\n {\n }", "protected function get_bulk_actions()\n {\n }", "public function getBatchActions()\n {\n $actions = parent::getBatchActions();\n // check user permissions\n if ($this->hasRoute('edit') && $this->isGranted('EDIT')) {\n $actions['clonePromotion'] = [\n 'label' => $this->trans('Clone', array(), 'SonataAdminBundle'),\n 'ask_confirmation' => true // If true, a confirmation will be asked before performing the action\n ];\n }\n return $actions;\n }", "protected function prepareForPresentation()\n {\n if ($this->prepared) {\n return;\n }\n\n $this->permissionGroups = new Collection;\n $this->ungroupedPermissions = [];\n $this->groupedPermissionIndex = [];\n\n $this->loadPermissionsFromModules()\n ->loadCustomPermissions()\n ->loadCustomPermissionGroups()\n ->addUngroupedPermissionGroup()\n ->filterEmptyGroups();\n }", "private function setup_actions() {\n\n\t\tadd_action( 'load-post.php', array( self::$instance, 'action_load_customizations' ) );\n\t\tadd_action( 'load-post-new.php', array( self::$instance, 'action_load_customizations' ) );\n\t\tadd_action( 'added_post_meta', array( self::$instance, 'update_schedule' ), 10, 4 );\n\t\tadd_action( 'updated_post_meta', array( self::$instance, 'update_schedule' ), 10, 4 );\n\t\tadd_action( 'deleted_post_meta', array( self::$instance, 'remove_schedule' ), 10, 3 );\n\t\tadd_action( 'trashed_post', array( self::$instance, 'unschedule_unpublish' ) );\n\t\tadd_action( 'untrashed_post', array( self::$instance, 'reschedule_unpublish' ) );\n\t\tadd_action( self::$cron_key, array( self::$instance, 'unpublish_post' ) );\n\t\tadd_filter( 'is_protected_meta', array( self::$instance, 'protect_meta_key' ), 10, 3 );\n\n\t\tif ( wp_next_scheduled( self::$deprecated_cron_key ) ) {\n\t\t\tadd_action( self::$deprecated_cron_key, array( self::$instance, 'unpublish_content' ) );\n\t\t}\n\t}", "public function massaction($observer)\n {\n if (!Mage::helper('simple_relevance')->enabled()) {\n return $this;\n }\n\n $block = $observer->getEvent()->getBlock();\n $action = $block->getRequest()->getControllerName();\n\n if (get_class($block) == 'Mage_Adminhtml_Block_Widget_Grid_Massaction') {\n $this->_block = $block;\n\n switch ($action) {\n case 'customer':\n $this->_addMassItem('massCustomer');\n break;\n case 'catalog_product':\n $this->_addMassItem('massInventory');\n break;\n case 'sales_order':\n $this->_addMassItem('massOrder');\n break;\n }\n }\n\n return $observer;\n }", "function finalizeModuleUpgrade() {\n $modules_table = TABLE_PREFIX . 'modules';\n $config_options_table = TABLE_PREFIX . 'config_options';\n\n try {\n\n // Remove merged modules\n DB::execute(\"DELETE FROM $modules_table WHERE name IN (?)\", array('incoming_mail', 'milestones', 'mobile_access', 'resources'));\n\n // Update incoming mail related settings\n DB::execute(\"UPDATE $config_options_table SET module = ? WHERE module = ?\", 'system', 'incoming_mail');\n\n // Uninstall backup module\n DB::execute(\"DELETE FROM $modules_table WHERE name = ?\", 'backup');\n DB::execute(\"DELETE FROM $config_options_table WHERE module = ?\", 'backup');\n\n // Enable only first party modules\n DB::execute(\"DELETE FROM $modules_table WHERE name NOT IN (?)\", array('system', 'discussions', 'milestones', 'files', 'todo', 'calendar', 'notebooks', 'tasks', 'tracking', 'project_exporter', 'status', 'documents', 'source', 'invoicing'));\n DB::execute(\"UPDATE $modules_table SET is_enabled = ?\", true);\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function setMilestones(){\n\n //Unset all the milestones that already exist\n foreach($this->milestones as $milestone){\n foreach($this->all_milestones as $aM){\n if($aM->Id == $milestone->Id) {\n array_push($this->thisMilestones, $this->rowMilestone($milestone, $aM));\n unset($this->all_milestones[(int)$aM->Id]);\n break;\n }\n }\n }\n }", "protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }", "private function resetnsAction(){\n\t\t\n\t\t$this -> adminNS -> __unset('bikeAds');\n\t\t$this -> adminNS -> __unset('bikePhoto');\n\t\t$this -> adminNS -> __unset('bikeInsert');\t\t\n\t}", "public function prepareImport();", "public function admin_table_bulk_actions($actions)\n {\n }", "private function setup_actions() {\n\n add_action( 'init', [ $this, 'action_init_register_rewrites' ] );\n add_action( 'widgets_init', [ $this, 'action_widgets_init' ], 11 );\n\n add_action( 'draft_to_publish', [ $this, 'handle_post_notifications' ] );\n add_action( 'draft_to_publish', [ $this, 'handle_set_post_pedestal_version' ] );\n add_action( 'future_to_publish', [ $this, 'handle_post_notifications' ] );\n add_action( 'future_to_publish', [ $this, 'handle_set_post_pedestal_version' ] );\n\n /**\n * Modify what appears in the admin bar menu\n */\n add_action( 'wp_before_admin_bar_render', function () {\n global $wp_admin_bar;\n\n // Remove comments because we don't have comments\n $wp_admin_bar->remove_menu( 'comments' );\n\n // Remove the New Post link from the My Sites admin bar menu becuase\n // we don't have Posts\n foreach ( $wp_admin_bar->get_nodes() as $node ) {\n if ( $node->title == 'New Post' || $node->title == 'Manage Comments' ) {\n $wp_admin_bar->remove_node( $node->id );\n }\n }\n }, 999 );\n }", "public function prepare()\n\t{\n\t\tcreateToken('admin-ssc');\n\t\t$this->adapter->prepare();\n\t}", "public function cleanTestActivities()\n {\n\n $this->collectCurrentTestUsers();\n $this->cleanExerciseUploadPictures();\n $this->cleanDeviceUploadPictures();\n $this->resetDatabase();\n }", "protected function preparePrep()\n {\n $this->prepList = [];\n $this->invalidList = [];\n $this->rewind();\n if (array_key_exists('SellerSKUList.Id.1', $this->options)) {\n $this->options['Action'] = 'GetPrepInstructionsForSKU';\n $this->resetASINs();\n } elseif (array_key_exists('ASINList.Id.1', $this->options)) {\n $this->options['Action'] = 'GetPrepInstructionsForASIN';\n $this->resetSKUs();\n }\n }", "public function run()\n {\n// \\DB::statement('DELETE FROM users WHERE id > 500100');\\DB::statement('ALTER TABLE `users` AUTO_INCREMENT=1');\n// \\DB::statement('DELETE FROM __groups WHERE id > 501100');\\DB::statement('ALTER TABLE `__groups` AUTO_INCREMENT=1');\n// \\DB::statement('DELETE FROM __group_users WHERE id > 502100');\\DB::statement('ALTER TABLE `__group_users` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __roles WHERE id > 503100');\\DB::statement('ALTER TABLE `__roles` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __group_roles WHERE id > 504100');\\DB::statement('ALTER TABLE `__group_roles` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resources WHERE id > 505100');\\DB::statement('ALTER TABLE `__resources` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_roles WHERE id > 506100');\\DB::statement('ALTER TABLE `__resource_roles` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_scopes WHERE id > 507100');\\DB::statement('ALTER TABLE `__resource_scopes` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_relations WHERE id > 508100');\\DB::statement('ALTER TABLE `__resource_relations` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_forms WHERE id > 509100');\\DB::statement('ALTER TABLE `__resource_forms` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_fields WHERE id > 510100');\\DB::statement('ALTER TABLE `__resource_form_fields` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_field_data WHERE id > 511100');\\DB::statement('ALTER TABLE `__resource_form_field_data` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_field_options WHERE id > 512100');\\DB::statement('ALTER TABLE `__resource_form_field_options` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_field_attrs WHERE id > 513100');\\DB::statement('ALTER TABLE `__resource_form_field_attrs` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_field_dynamic WHERE id > 514100');\\DB::statement('ALTER TABLE `__resource_form_field_dynamic` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_field_validations WHERE id > 515100');\\DB::statement('ALTER TABLE `__resource_form_field_validations` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_field_depends WHERE id > 516100');\\DB::statement('ALTER TABLE `__resource_form_field_depends` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_layout WHERE id > 517100');\\DB::statement('ALTER TABLE `__resource_form_layout` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_data_map WHERE id > 518100');\\DB::statement('ALTER TABLE `__resource_form_data_map` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_defaults WHERE id > 519100');\\DB::statement('ALTER TABLE `__resource_form_defaults` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_collection WHERE id > 520100');\\DB::statement('ALTER TABLE `__resource_form_collection` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_form_upload WHERE id > 521100');\\DB::statement('ALTER TABLE `__resource_form_upload` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_lists WHERE id > 522100');\\DB::statement('ALTER TABLE `__resource_lists` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_list_scopes WHERE id > 523100');\\DB::statement('ALTER TABLE `__resource_list_scopes` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_list_relations WHERE id > 524100');\\DB::statement('ALTER TABLE `__resource_list_relations` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_list_layout WHERE id > 525100');\\DB::statement('ALTER TABLE `__resource_list_layout` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_list_search WHERE id > 526100');\\DB::statement('ALTER TABLE `__resource_list_search` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_data WHERE id > 527100');\\DB::statement('ALTER TABLE `__resource_data` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_data_scopes WHERE id > 528100');\\DB::statement('ALTER TABLE `__resource_data_scopes` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_data_relations WHERE id > 529100');\\DB::statement('ALTER TABLE `__resource_data_relations` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_data_view_sections WHERE id > 530100');\\DB::statement('ALTER TABLE `__resource_data_view_sections` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_data_view_section_items WHERE id > 531100');\\DB::statement('ALTER TABLE `__resource_data_view_section_items` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_actions WHERE id > 532100');\\DB::statement('ALTER TABLE `__resource_actions` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_action_methods WHERE id > 533100');\\DB::statement('ALTER TABLE `__resource_action_methods` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_action_attrs WHERE id > 534100');\\DB::statement('ALTER TABLE `__resource_action_attrs` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_action_lists WHERE id > 535100');\\DB::statement('ALTER TABLE `__resource_action_lists` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_action_data WHERE id > 536100');\\DB::statement('ALTER TABLE `__resource_action_data` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_defaults WHERE id > 537100');\\DB::statement('ALTER TABLE `__resource_defaults` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_metrics WHERE id > 538100');\\DB::statement('ALTER TABLE `__resource_metrics` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_dashboard WHERE id > 539100');\\DB::statement('ALTER TABLE `__resource_dashboard` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_dashboard_sections WHERE id > 540100');\\DB::statement('ALTER TABLE `__resource_dashboard_sections` AUTO_INCREMENT=1');\n \\DB::statement('DELETE FROM __resource_dashboard_section_items WHERE id > 541100');\\DB::statement('ALTER TABLE `__resource_dashboard_section_items` AUTO_INCREMENT=1');\n// \\DB::statement('ALTER TABLE `users` AUTO_INCREMENT=500101');\n// \\DB::statement('ALTER TABLE `__groups` AUTO_INCREMENT=501101');\n// \\DB::statement('ALTER TABLE `__group_users` AUTO_INCREMENT=502101');\n \\DB::statement('ALTER TABLE `__roles` AUTO_INCREMENT=503101');\n \\DB::statement('ALTER TABLE `__group_roles` AUTO_INCREMENT=504101');\n \\DB::statement('ALTER TABLE `__resources` AUTO_INCREMENT=505101');\n \\DB::statement('ALTER TABLE `__resource_roles` AUTO_INCREMENT=506101');\n \\DB::statement('ALTER TABLE `__resource_scopes` AUTO_INCREMENT=507101');\n \\DB::statement('ALTER TABLE `__resource_relations` AUTO_INCREMENT=508101');\n \\DB::statement('ALTER TABLE `__resource_forms` AUTO_INCREMENT=509101');\n \\DB::statement('ALTER TABLE `__resource_form_fields` AUTO_INCREMENT=510101');\n \\DB::statement('ALTER TABLE `__resource_form_field_data` AUTO_INCREMENT=511101');\n \\DB::statement('ALTER TABLE `__resource_form_field_options` AUTO_INCREMENT=512101');\n \\DB::statement('ALTER TABLE `__resource_form_field_attrs` AUTO_INCREMENT=513101');\n \\DB::statement('ALTER TABLE `__resource_form_field_dynamic` AUTO_INCREMENT=514101');\n \\DB::statement('ALTER TABLE `__resource_form_field_validations` AUTO_INCREMENT=515101');\n \\DB::statement('ALTER TABLE `__resource_form_field_depends` AUTO_INCREMENT=516101');\n \\DB::statement('ALTER TABLE `__resource_form_layout` AUTO_INCREMENT=517101');\n \\DB::statement('ALTER TABLE `__resource_form_data_map` AUTO_INCREMENT=518101');\n \\DB::statement('ALTER TABLE `__resource_form_defaults` AUTO_INCREMENT=519101');\n \\DB::statement('ALTER TABLE `__resource_form_collection` AUTO_INCREMENT=520101');\n \\DB::statement('ALTER TABLE `__resource_form_upload` AUTO_INCREMENT=521101');\n \\DB::statement('ALTER TABLE `__resource_lists` AUTO_INCREMENT=522101');\n \\DB::statement('ALTER TABLE `__resource_list_scopes` AUTO_INCREMENT=523101');\n \\DB::statement('ALTER TABLE `__resource_list_relations` AUTO_INCREMENT=524101');\n \\DB::statement('ALTER TABLE `__resource_list_layout` AUTO_INCREMENT=525101');\n \\DB::statement('ALTER TABLE `__resource_list_search` AUTO_INCREMENT=526101');\n \\DB::statement('ALTER TABLE `__resource_data` AUTO_INCREMENT=527101');\n \\DB::statement('ALTER TABLE `__resource_data_scopes` AUTO_INCREMENT=528101');\n \\DB::statement('ALTER TABLE `__resource_data_relations` AUTO_INCREMENT=529101');\n \\DB::statement('ALTER TABLE `__resource_data_view_sections` AUTO_INCREMENT=530101');\n \\DB::statement('ALTER TABLE `__resource_data_view_section_items` AUTO_INCREMENT=531101');\n \\DB::statement('ALTER TABLE `__resource_actions` AUTO_INCREMENT=532101');\n \\DB::statement('ALTER TABLE `__resource_action_methods` AUTO_INCREMENT=533101');\n \\DB::statement('ALTER TABLE `__resource_action_attrs` AUTO_INCREMENT=534101');\n \\DB::statement('ALTER TABLE `__resource_action_lists` AUTO_INCREMENT=535101');\n \\DB::statement('ALTER TABLE `__resource_action_data` AUTO_INCREMENT=536101');\n \\DB::statement('ALTER TABLE `__resource_defaults` AUTO_INCREMENT=537101');\n \\DB::statement('ALTER TABLE `__resource_metrics` AUTO_INCREMENT=538101');\n \\DB::statement('ALTER TABLE `__resource_dashboard` AUTO_INCREMENT=539101');\n \\DB::statement('ALTER TABLE `__resource_dashboard_sections` AUTO_INCREMENT=540101');\n \\DB::statement('ALTER TABLE `__resource_dashboard_section_items` AUTO_INCREMENT=541101');\n $this->call([\n CategoryTableSeeder::class,\n UserCategoryTableSeeder::class,\n CounterTableSeeder::class,\n CounterUserTableSeeder::class,\n CustomerTableSeeder::class,\n TokenTableSeeder::class,\n TokenCounterTableSeeder::class,\n ]);\n }", "public function prepareMyUpgrades() {\n\t\t\n\t\t$query = sprintf(\"SELECT `machine_upgrade_linker`.`upgrade_id` FROM `hmi_plc_mgr`.`customer_machine_upgrade`, `hmi_plc_mgr`.`machine_upgrade_linker` WHERE `customer_machine_upgrade`.`machine_type` = '%s' AND `machine_upgrade_linker`.`customer_id` = '%s' AND `customer_machine_upgrade`.`id` =`machine_upgrade_linker`.`upgrade_id` ORDER BY `customer_machine_upgrade`.`id` %s\", mysql_real_escape_string($this->machine_type), mysql_real_escape_string($this->customer_id), mysql_real_escape_string($this->sort));\n\n\t\t//echo $query;\n\t\t$result = mysql_query($query);\n\t\twhile ($row = mysql_fetch_assoc($result)) {\n\t\t $this->my_upgrade_id[] = $row['upgrade_id']; \n\t\t //$this->my_created_by[] = $row['created_by']; \n\t\t //$this->my_created_on[] = $row['created_on']; \n\t\t //$this->my_time_added[] = $row['timeAdded']; \n\t\t //$this->my_upgrade_subject[] = $row['upgrade_subject'];\n\t\t //$this->my_upgrade[] = $row['upgrade'];\t\t\n\t\t}\t\t\t\n\t}", "protected function _prepareColumns()\n\t{\n\t\tparent::_prepareColumns();\n\t\t\n\t\t// remove old columns\n\t\t$this->removeColumn('gender'); // futureproof\n $this->removeColumn('lastname');\n $this->removeColumn('firstname');\n\t\t\n\t\t// add new columns\n\t\t$this->addColumnAfter('gender', array(\n\t\t\t'header' => Mage::helper('newsletter')->__('Gender'),\n 'index' => 'customer_gender',\n 'type' => 'options',\n 'options' => array(\n 1 => Mage::helper('newsletter')->__('Mr'),\n 2 => Mage::helper('newsletter')->__('Ms/Mrs')\n ),\n\t\t\t'renderer'\t=> 'Mediarocks_NewsletterExtended_Adminhtml_Block_Newsletter_Subscriber_Grid_Renderer_Gender'\n\t\t), 'type');\n\t\t\n\t\t$this->addColumnAfter('firstname', array(\n\t\t\t'header' => Mage::helper('newsletter')->__('Firstname'),\n 'index' => 'customer_firstname',\n\t\t\t'renderer'\t=> 'Mediarocks_NewsletterExtended_Adminhtml_Block_Newsletter_Subscriber_Grid_Renderer_Firstname'\n\t\t), 'gender');\n\t\t\n\t\t$this->addColumnAfter('lastname', array(\n\t\t\t'header' => Mage::helper('newsletter')->__('Lastname'),\n 'index' => 'customer_lastname',\n\t\t\t'renderer'\t=> 'Mediarocks_NewsletterExtended_Adminhtml_Block_Newsletter_Subscriber_Grid_Renderer_Lastname'\n\t\t), 'firstname');\n\n\t\t// manually sort again, that our custom order works\n\t\t$this->sortColumnsByOrder();\n\t\t\n return $this;\n }", "protected function _prepareColumns()\n {\n if (!$this->getCategory()->getProductsReadonly()) {\n $this->addColumn('in_category', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_category',\n 'values' => $this->_getSelectedProducts(),\n 'align' => 'center',\n 'index' => 'entity_id',\n 'is_system' => true,\n ));\n }\n $this->addColumn('entity_id', array(\n 'header' => Mage::helper('catalog')->__('ID'),\n 'sortable' => true,\n 'width' => '60',\n 'index' => 'entity_id'\n ));\n $this->addColumn('name', array(\n 'header' => Mage::helper('catalog')->__('Name'),\n 'index' => 'name'\n ));\n $this->addColumn('sku', array(\n 'header' => Mage::helper('catalog')->__('SKU'),\n 'width' => '80',\n 'index' => 'sku'\n ));\n $this->addColumn('price', array(\n 'header' => Mage::helper('catalog')->__('Price'),\n 'type' => 'currency',\n 'width' => '1',\n 'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),\n 'index' => 'price'\n ));\n $this->addColumn('position', array(\n 'header' => Mage::helper('catalog')->__('Position'),\n 'width' => '1',\n 'type' => 'number',\n 'index' => 'position',\n 'editable' => !$this->getCategory()->getProductsReadonly(),\n //'renderer' => 'adminhtml/widget_grid_column_renderer_input'\n ));\n\n //Add export type for CSV\n $this->addExportType('*/*/exportCsv', Mage::helper('adminhtml')->__('CSV'));\n }", "protected function _prepareColumns()\n\t{\n\t\t$this->addColumn('id',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('ID'),\n\t\t\t\t\t\t'align' =>'right',\n\t\t\t\t\t\t'width' => '50px',\n\t\t\t\t\t\t'index' => 'id'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\t$this->addColumn('name',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Name'),\n\t\t\t\t\t\t'index' => 'name'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('description',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Description'),\n\t\t\t\t\t\t'index' => 'description'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('percentage',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Percentage'),\n\t\t\t\t\t\t'index' => 'percentage'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\treturn parent::_prepareColumns();\n\t}", "protected function _prepareColumns()\n {\n if (Mage::helper('route')->canChangeOrderGrid()) {\n\n $this->addColumnAfter('route_is_insured', array(\n 'header'=> Mage::helper('sales')->__('Route Insurance'),\n 'width' => '80px',\n 'index' => 'route_is_insured',\n 'type' => 'options',\n 'renderer' => 'route/adminhtml_widget_grid_column_renderer_insured',\n 'options' => array(\n 1 => 'Yes',\n 0 => 'No',\n ),\n ),'status');\n\n $this->addColumnAfter('fee_amount', array(\n 'header'=> Mage::helper('sales')->__('Route Charge'),\n 'width' => '80px',\n 'filter' => false,\n 'sortable' => false,\n 'type' => 'currency',\n 'index' => 'fee_amount',\n 'currency' => 'order_currency_code',\n ),'route_is_insured');\n }\n parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('ticket_id', array(\n 'header' => Mage::helper('inchoo_supportticket')->__('ID'),\n 'width' => '80px',\n 'index' => 'ticket_id'\n ));\n $this->addColumn('subject', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Subject'),\n 'type'=> 'text',\n 'width' => '300px',\n 'index' => 'subject',\n 'escape' => true\n ));\n $this->addColumn('content', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Content'),\n 'type' => 'text',\n 'index' => 'content',\n 'escape' => true\n ));\n $this->addColumn('status', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Status'),\n 'type'=> 'text',\n 'width' => '200px',\n 'index' => 'status',\n 'escape' => true\n ));\n $this->addColumn('created_at', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Created at'),\n 'type' => 'text',\n 'width' => '170px',\n 'index' => 'created_at',\n ));\n return parent::_prepareColumns();\n }", "function set_actions_data( $raw_actions_data ) {\n\t\t$actions_data = array_map( [ $this, 'sanitize_action_fields' ], $raw_actions_data );\n\t\t// remove empty values from actions array\n\t\t$actions_data = array_filter( $actions_data );\n\t\t$this->update_meta( 'actions', $actions_data );\n\t\tunset( $this->actions );\n\t}", "public function prepare_items() {\n \n /**\n * Set how many records per page to show\n */\n $_iItemsPerPage = 20;\n \n /**\n * Define our column headers. \n */\n $this->_column_headers = array( \n $this->get_columns(), // $aColumns\n array(), // $aHidden\n $this->get_sortable_columns() // $aSortable\n );\n \n \n /**\n * Process bulk actions.\n */\n // $this->process_bulk_action(); // in our case, it is dealt before the header is sent. ( with the Admin page class )\n \n /**\n * Variables\n */\n $_aData = $this->aData;\n \n \n /**\n * Sort the array.\n */\n usort( $_aData, array( $this, 'usort_reorder' ) );\n \n \n /**\n * For pagination.\n */\n $_iCurrentPageNumber = $this->get_pagenum();\n $_iTotalItems = count( $_aData );\n $this->set_pagination_args( \n array(\n 'total_items' => $_iTotalItems, // calculate the total number of items\n 'per_page' => $_iItemsPerPage, // determine how many items to show on a page\n 'total_pages' => ceil( $_iTotalItems / $_iItemsPerPage ) // calculate the total number of pages\n )\n );\n $_aData = array_slice( \n $_aData, \n ( ( $_iCurrentPageNumber -1 ) * $_iItemsPerPage ), \n $_iItemsPerPage \n );\n \n /*\n * Set data\n * */\n $this->items = $_aData;\n \n }", "public function prepare_items( $where=array( '1=1' ) ) \n\t{\n\t\t$class = $this->activeRecordClass;\n\t\t\n\t\t/**\n\t\t * REQUIRED. Now we need to define our column headers. This includes a complete\n\t\t * array of columns to be displayed (slugs & titles), a list of columns\n\t\t * to keep hidden, and a list of columns that are sortable. Each of these\n\t\t * can be defined in another method (as we've done here) before being\n\t\t * used to build the value for our _column_headers property.\n\t\t */\n\t\t$columns = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t\n\t\t/**\n\t\t * REQUIRED. Finally, we build an array to be used by the class for column \n\t\t * headers. The $this->_column_headers property takes an array which contains\n\t\t * 3 other arrays. One for all columns, one for hidden columns, and one\n\t\t * for sortable columns.\n\t\t */\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\t\t\n\t\t/**\n\t\t * Optional. You can handle your bulk actions however you see fit. In this\n\t\t * case, we'll handle them within our package just to keep things clean.\n\t\t */\n\t\t$this->process_bulk_action();\n\t\t\n\t\t/**\n\t\t * REQUIRED for pagination. Let's figure out what page the user is currently \n\t\t * looking at. We'll need this later, so you should always include it in \n\t\t * your own package classes.\n\t\t */\n\t\t$current_page = $this->get_pagenum();\n\t\t\n\t\t/**\n\t\t * REQUIRED. Build the query and fetch the database results\n\t\t */\n\t\t$db = Framework::instance()->db();\n\t\t\n\t\t$sortBy = isset( $this->sortBy ) ? $this->sortBy : $class::$prefix . $class::$key;\n\t\t$sortOrder = $this->sortOrder;\n\t\t$compiled = $class::compileWhereClause( $where );\n\t\t$per_page = $this->perPage;\n\t\t$start_at = $current_page > 0 ? ( $current_page - 1 ) * $per_page : 0;\n\t\t\n\t\t$query = \"SELECT * FROM {$db->prefix}{$class::$table} WHERE {$compiled['where']}\";\n\t\t$prepared_query = ! empty( $compiled[ 'params' ] ) ? $db->prepare( $query, $compiled[ 'params' ] ) : $query;\n\t\t\n\t\t\n\t\t$total_items = $db->get_var( str_replace( 'SELECT * ', 'SELECT COUNT(*) ', $prepared_query ) );\n\t\t$this->items = $db->get_results( $prepared_query . \" ORDER BY {$sortBy} {$sortOrder} LIMIT {$start_at}, {$per_page}\", ARRAY_A );\n\t\t\n\t\t/**\n\t\t * Register our pagination options & calculations.\n\t\t */\n\t\t$this->set_pagination_args( array\n\t\t(\n\t\t\t'total_items' => $total_items,\n\t\t\t'per_page' => $this->perPage,\n\t\t\t'total_pages' => ceil( $total_items / $per_page ),\n\t\t) );\n\t}", "public function process_bulk_action()\n {\n if ('update' === $this->current_action()) {\n wp_die('Items deleted (or they would be if we had items to delete)!');\n }\n }", "function _prepare() {\n\t\tif (!in_array($this->action, $this->unprotected_actions) && !isset($_SESSION['admin'])) {\n\t\t\t$this->session('return_to', $this->route);\n\t\t\t$this->redirect('admin/index');\n\t\t}\n\t}", "public function prepare_items()\n {\n $per_page = 100;\n\n // define column headers\n $columns = $this->get_columns();\n $hidden = [];\n $sortable = $this->get_sortable_columns();\n $this->_column_headers = [$columns, $hidden, $sortable];\n\n // retrieve data\n $data = \\Podlove\\Model\\EpisodeAsset::all('ORDER BY position ASC');\n\n // get current page\n $current_page = $this->get_pagenum();\n // get total items\n $total_items = count($data);\n // extrage page for current page only\n $data = array_slice($data, ($current_page - 1) * $per_page, $per_page);\n // add items to table\n $this->items = $data;\n\n // register pagination options & calculations\n $this->set_pagination_args([\n 'total_items' => $total_items,\n 'per_page' => $per_page,\n 'total_pages' => ceil($total_items / $per_page),\n ]);\n }", "protected function _prepareColumns()\n {\n $this->addColumn('in_products', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'field_name' => 'in_products',\n 'values' => $this->_getSelectedProducts(),\n 'align' => 'center',\n 'index' => 'entity_id'\n ));\n\n /*$this->addColumn('entity_id',\n array(\n 'header'=> Mage::helper('catalog')->__('ID'),\n 'width' => 50,\n 'sortable' => true,\n 'type' => 'number',\n 'index' => 'entity_id',\n ));*/\n $this->addColumn('product_name',\n array(\n 'header'=> Mage::helper('catalog')->__('Name'),\n 'index' => 'name',\n ));\n\n $this->addColumn('type',\n array(\n 'header' => Mage::helper('catalog')->__('Type'),\n 'width' => 100,\n 'index' => 'type_id',\n 'type' => 'options',\n 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),\n ));\n\n $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')\n ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())\n ->load()\n ->toOptionHash();\n\n $this->addColumn('set_name',\n array(\n 'header' => Mage::helper('catalog')->__('Attrib. Set Name'),\n 'width' => 100,\n 'index' => 'attribute_set_id',\n 'type' => 'options',\n 'options' => $sets,\n ));\n\n $this->addColumn('sku',\n array(\n 'header'=> Mage::helper('catalog')->__('SKU'),\n 'width' => 80,\n 'index' => 'sku',\n ));\n\n $this->addColumn('price',\n array(\n 'header' => Mage::helper('catalog')->__('Price'),\n 'type' => 'price',\n 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n 'index' => 'price',\n ));\n\n $this->addColumn('visibility',\n array(\n 'header' => Mage::helper('catalog')->__('Visibility'),\n 'width' => 100,\n 'index' => 'visibility',\n 'type' => 'options',\n 'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),\n ));\n\n $this->addColumn('status',\n array(\n 'header' => Mage::helper('catalog')->__('Status'),\n 'width' => 70,\n 'index' => 'status',\n 'type' => 'options',\n 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),\n ));\n\n $this->addColumn('source_store',\n array(\n 'header'=> Mage::helper('catalog')->__('Source Store'),\n 'width' => '100px',\n 'sortable' => false,\n 'index' => 'source_store_view',\n 'type' => 'options',\n 'options' => Mage::getModel('unl_core/store_source_filter')->toOptionArray(),\n ));\n\n return parent::_prepareColumns();\n }", "private function installActions()\n {\n $actions = array(\n array(\n 'class' => RETS_RABBIT_V2_NAME,\n 'method' => 'run_search'\n ),\n );\n\n ee()->db->insert_batch('actions', $actions);\n }", "protected function _prepareColumns()\n {\n $this->addColumn('solutionpartner_id', array(\n 'header' => Mage::helper('solutionpartner')->__('ID'),\n 'align' =>'right',\n 'width' => '50px',\n 'index' => 'solutionpartner_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('solutionpartner')->__('Name'),\n 'align' =>'left',\n 'index' => 'name',\n ));\n\n $this->addColumn('email', array(\n 'header' => Mage::helper('solutionpartner')->__('Email'),\n 'align' =>'left',\n 'index' => 'email',\n 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_customer',\n ));\n\n $this->addColumn('website', array(\n 'header' => Mage::helper('solutionpartner')->__('Website'),\n 'align' => 'left',\n 'index' => 'website',\n 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_website',\n ));\n\n $this->addColumn('country', array(\n 'header' => Mage::helper('solutionpartner')->__('Country'),\n 'align' => 'left',\n 'index' => 'country',\n 'type' => 'options',\n 'options' => Mage::helper('solutionpartner')->getCountryList(),\n ));\n\n $this->addColumn('number_qtys', array(\n 'header' => Mage::helper('solutionpartner')->__('Order Qty'),\n 'align' => 'center',\n 'index' => 'number_qtys',\n 'filter_index' => 'count(order.entity_id)',\n 'type' => 'number',\n 'filter_condition_callback' => array($this, '_filterTotalProductsCallback'),\n // 'renderer' => 'partner/adminhtml_partner_renderer_orderquantity',\n ));\n\n// $this->addColumn('cumulative_amount', array(\n// 'header' => Mage::helper('solutionpartner')->__('Accumulated Revenue'),\n// 'type' => 'price',\n// 'index' => 'cumulative_amount',\n// 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n// ));\n//\n// $this->addColumn('cumulative_amount_history', array(\n// 'header' => Mage::helper('solutionpartner')->__('Revenue History'),\n// 'type' => 'price',\n// 'index' => 'cumulative_amount_history',\n// 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n// ));\n\n $this->addColumn('registered_date', array(\n 'header' => Mage::helper('solutionpartner')->__('Registered Date'),\n 'align' => 'left',\n 'index' => 'registered_date',\n 'type' => 'datetime'\n ));\n\n $this->addColumn('status', array(\n 'header' => Mage::helper('solutionpartner')->__('Status'),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'status',\n 'type' => 'options',\n 'options' => array(\n 1 => 'Enabled',\n 2 => 'Disabled',\n ),\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('solutionpartner')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('solutionpartner')->__('Edit'),\n 'url' => array('base'=> '*/*/edit'),\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('solutionpartner')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('solutionpartner')->__('XML'));\n\n return parent::_prepareColumns();\n }", "protected function prepare()\n\t{\n\t}", "public function setup_batch_processes() {\n\n\t\t// Handle deleting our storify stories.\n\t\tregister_batch_process( array(\n\t\t\t'name' => 'Delete Storify Stories',\n\t\t\t'type' => 'post',\n\t\t\t'args' => array(\n\t\t\t\t'post_type' => 'storify-stories',\n\t\t\t\t'post_status' => 'any',\n\t\t\t),\n\t\t\t'callback' => array( $this, 'delete_storify_stories' ),\n\t\t));\n\n\t\t// Delete all the individual elements.\n\t\tregister_batch_process( array(\n\t\t\t'name' => 'Delete Storify Elements',\n\t\t\t'type' => 'comment',\n\t\t\t'args' => array(\n\t\t\t\t'type' => 'storify-element',\n\t\t\t\t'status' => 'approve',\n\t\t\t),\n\t\t\t'callback' => array( $this, 'delete_storify_elements' ),\n\t\t));\n\t}", "function workflow_reset()\n{\n\tglobal $db;\n\t\n\t$columns['status']\t= 'ready';\n\t$columns['request'] = 'done';\n\t$db->update(\"station\",$columns);\n}", "protected function _prepareLayout() {\n $this->_removeButton('reset'); // Remove unused buttons\n $this->_removeButton('delete');\n $this->_removeButton('save');\n\n return parent::_prepareLayout();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('grid_checkbox', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'index' => 'bannerslider_id',\n //'name' => 'grid_checkbox',\n 'align' => 'center',\n 'width' => '50px',\n 'values' => $this->_selectedId(),\n ));\n\n /*$this->addColumn('widget_banner_id', array(\n 'header' => Mage::helper('campaign')->__('ID'),\n 'align' =>'right',\n 'width' => '50px',\n 'index' => 'widget_banner_id',\n ));*/\n\n $this->addColumn('title', array(\n 'header' => Mage::helper('campaign')->__('Banner title'),\n 'align' => 'left',\n 'width' => '220px',\n 'index' => 'title',\n //'renderer' => 'Magestore_Campaign_Block_Adminhtml_Banner_Grid_Renderer_BannerType',\n //'filter' => false,\n ));\n\n /*$this->addColumn('in_widgets', array(\n 'header' => Mage::helper('campaign')->__('In Widgets'),\n 'index' => 'widget_selected_ids',\n //'width' => '220px',\n 'renderer' => 'Magestore_Campaign_Block_Adminhtml_Banner_Grid_Renderer_InWidgets',\n 'filter_condition_callback' => array($this, '_filterInWidgets'),\n ));*/\n\n $this->addColumn('in_campaign', array(\n 'header' => Mage::helper('campaign')->__('Added to Campaign'),\n 'index' => 'campaign_name',\n 'width' => '220px',\n 'filter_condition_callback' => array($this, '_filterInCampaign'),\n ));\n\n $this->addColumn('status', array(\n 'header' => Mage::helper('campaign')->__('Status'),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'status',\n 'filter_index'=>'main_table.status',\n 'type' => 'options',\n 'options' => Magestore_Campaign_Model_Sliderstatus::getOptionArray(),\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('campaign')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('campaign')->__('Edit'),\n 'url' => array('base'=> '*/adminhtml_bannerslider/edit'),\n //'onclick' => 'return saveAndContinueEdit();',\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addColumn('action_delete',\n array(\n 'header' => Mage::helper('campaign')->__('Disable Banner'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('campaign')->__('Disable'),\n 'url' => array('base'=> '*/adminhtml_bannerslider/disableSlider'),\n //'onclick' => 'return saveAndContinueEdit();',\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('campaign')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('campaign')->__('XML'));\n\n return parent::_prepareColumns();\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function onPrepareModuleList(&$modules)\n {\n foreach($modules as $id => $module) {\n if(MageBridgeTemplateHelper::allowPosition($module->position) == false) {\n unset($modules[$id]);\n continue;\n } \n }\n }" ]
[ "0.67482316", "0.6480594", "0.63527924", "0.6326775", "0.6303686", "0.6262982", "0.61600107", "0.61495", "0.61059076", "0.61059076", "0.60438865", "0.58189034", "0.57156974", "0.55584246", "0.55391014", "0.5524157", "0.5488082", "0.54672104", "0.5418279", "0.53279924", "0.531623", "0.5280619", "0.5265839", "0.52613133", "0.52434313", "0.52324903", "0.5227498", "0.5222557", "0.5159206", "0.5159206", "0.51482195", "0.514628", "0.5145111", "0.5143373", "0.51365745", "0.50984246", "0.5092938", "0.50895405", "0.5085365", "0.5036788", "0.5028616", "0.5021682", "0.5003687", "0.49782473", "0.49778268", "0.49633208", "0.4961382", "0.4955409", "0.49478662", "0.49446034", "0.49344388", "0.49210644", "0.49138206", "0.49061093", "0.49038744", "0.48937765", "0.48825112", "0.486893", "0.48688078", "0.48615852", "0.4848367", "0.48456424", "0.48222828", "0.48126742", "0.48120046", "0.47932497", "0.47844452", "0.4778096", "0.47778913", "0.4771657", "0.4761203", "0.47579768", "0.4754728", "0.47544143", "0.47450694", "0.47425276", "0.47374985", "0.47358823", "0.4729679", "0.47279543", "0.47254682", "0.4724927", "0.4723337", "0.47163272", "0.47122192", "0.47103226", "0.4701049", "0.46984205", "0.46983013", "0.46954298", "0.46942353", "0.4687218", "0.46719426", "0.46610054", "0.46589738", "0.4657892", "0.4657163", "0.4657163", "0.4657163", "0.46571463" ]
0.6743586
1
Grid row event edit url
public function getRowUrl($row) { return $this->getUrl('*/cms_page_version/edit', array('page_id' => $row->getPageId(), 'version_id' => $row->getVersionId())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRowUrl($row) {\n return $this->getUrl ( '*/*/edit', array (\n \n 'id' => $row->getId () \n ) );\n }", "public function getRowUrl($row) {\n return $this->getUrl ( '*/*/edit', array (\n 'id' => $row->getId () \n ) );\n }", "public function getRowUrl($row) {\n return $this->getUrl(\"*/*/edit\", array('ticket_id' => $row->getTicketId()));\n }", "public function getRowUrl($row)\n\t{\n\t\treturn $this->getUrl('*/*/edit', array('id' => $row->getId()));\n\t}", "public function editUrl() {}", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row)\n {\n return false;//$this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getRowUrl($row) {\r\n $customer_id = $row->getCustomer()->getId();\r\n return $this->getUrl('CrmTicket/Admin_Ticket/Edit', array('ticket_id' => $row->getct_id(), 'customer_id' => $customer_id));\r\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/catalog_product/edit', array('id' => $row->getProductId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('attribute_id' => $row->getAttributeId()));\n }", "public function getEditUrl() { }", "public function editUrl() {\n\t\treturn str_replace('/page/edit/',\n '/lab_charger/lab_charge_items/edit/',\n parent::editUrl());\n\t}", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', ['attribute_code' => $row->getAttributeCode()]);\n }", "public function getRowUrl($row)\n\t{\n\t\t//return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n\t\treturn false;\n\t}", "public function get_edit_url() {\n\t\treturn $this->edit_link();\n\t}", "public function getRowUrl($row) {\n $params = array(\n 'id' => $row->getId(),\n AW_Vidtest_Block_Adminhtml_Video_Grid::RETURN_FROM_KEY => AW_Vidtest_Block_Adminhtml_Video_Grid::RETURN_FROM_PRODUCT,\n 'product_id' => $this->getProduct()->getId(),\n 'store' => $this->getRequest()->getParam('store', 0),\n );\n return $this->getUrl('vidtest_admin/admin_video/edit', $params);\n }", "function url_event_edit(string $eventid): string\n{\n return \\admin_url(\"admin.php?page=bc_events&action=edit&eventid=$eventid\");\n}", "public function editUrl() {\n\t\treturn str_replace('/page/edit/',\n '/lab_scheduler/lab_tools/edit/',\n parent::editUrl());\n\t}", "public function getRowUrl($row)\n {\n return $this->getUrl('adminhtml/productreviews/edit', array(\n 'id'=>$row->getId(),\n 'productId' => $this->getProductId(),\n 'customerId' => $this->getCustomerId(),\n ));\n }", "public function getEditViewUrl()\n\t{\n\t\treturn 'index.php?module=TreesManager&parent=Settings&view=Edit&record=' . $this->getId();\n\t}", "public function getRowUrl($row)\n {\n return '';//$this->getUrl('*/*/detail', array('id' => $row->getId()));\n }", "protected function get_url_this_edit(){ return $this->input ['edit_url'] ;}", "public function getRowUrl($item)\n {\n return $this->getUrl('*/*/edit', ['todo_id' => $item->getId()]);\n }", "public function getRowUrl($row)\n {\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/view', array('id' => $row->getId()));\n }", "public function getEditViewUrl()\n\t{\n\t\treturn 'index.php?module=' . $this->getName() . '&parent=Settings&view=Edit';\n\t}", "public function getEditUrl()\r\n {\r\n if (empty(parent::getEditUrl())) {\r\n return \"\";\r\n }\r\n\r\n if ($this->contentObject instanceof File) {\r\n return $this->contentObject->content->container->createUrl($this->editRoute, ['id' => $this->contentObject->getItemId(), 'fromWall' => true]);\r\n }\r\n\r\n return \"\";\r\n }", "function getEditUrl() {\n return assemble_url('people_company_edit', array('company_id' => $this->getId())); \n }", "function edit_row_actions_view($post, $name){\n \n return '<a href=\"' . admin_url(\"admin.php?page={$name}\") . '\">' . __('View') . '</a>';\n \n }", "function getEditUri() {\n\t\treturn $this->getData('editUri');\n\t}", "public function url()\n {\n return backpack_url(\"/page-template/{$this->id}/edit\");\n }", "public function url()\n {\n return backpack_url(\"/page/{$this->id}/edit\");\n }", "public function getEditUrl()\n {\n return $this->_urlBuilder->getUrl('*/*/edit', ['id' => $this->getSubscription()->getId()]);\n }", "public function getEditlink(){\n return sprintf(\"<a href=\\\"/administration_company_edit/index/companyid/%s\\\">%s</a>\", $this->getId(), $this->getName()); \n }", "public function editAction() {}", "protected function set_url_this_edit($val){ $this->input ['edit_url'] = $val ; }", "public function getRowUrl($row)\n {\n if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/shipment')) {\n return false;\n }\n\n return $this->getUrl('*/sales_shipment/view',\n array(\n 'shipment_id'=> $row->getEntityId(),\n )\n );\n }", "public function getEditLink()\n {\n return $this->get('EditLink');\n }", "public function getEditLink()\n {\n return $this->get('EditLink');\n }", "public function getEditLink()\n {\n return $this->get('EditLink');\n }", "function editrow()\r\n {\r\n $c=$this->connector();\r\n $r='';\r\n $r.=$this->logout();\r\n $db=$_GET['db'];\r\n $tbl=$_GET['table'];\r\n $val=$_GET['val'];\r\n $col=$_GET['col'];\r\n $r.=\"<div id='isi'>\r\n <center><a href='?act=showtable&db=$db'>Show Tables </a></center><br />\";\r\n $r.=\"<form method='post' action='?act=showcon&db=$db&table=$tbl&col=$col&val=$val'>\";\r\n $r.=\"<table width=100% align='center' cellspacing=0 class='xpltab'>\";\r\n \r\n $cols=array();\r\n $iml=mysql_query(\"SHOW COLUMNS FROM $db.$tbl\");\r\n $query=mysql_query(\"SELECT * FROM $db.$tbl WHERE $col='$val'\");\r\n \r\n while($colom=mysql_fetch_assoc($iml))$cols[]=$colom['Field'];\r\n $data=mysql_fetch_assoc($query);\r\n for($i=0;$i<count($cols);$i++)\r\n {\r\n $pt=$cols[$i];\r\n $r.=\"<tr><td style='border:none'>\".$pt.\"</td><td style='border:none'>\".' : <input id=\"sqlbox\" type=\"text\" name=\"'.$cols[$i].'\" value=\"'.$data[$pt].'\"></td></tr>';\r\n\r\n }\r\n $r.=\"</table><input type='hidden' name='action' value='updaterow'><input id='but' type='submit' value='update'></form></div>\";\r\n return $r;\r\n $this->free();\r\n }", "public function getCpEditUrl()\n {\n return UrlHelper::cpUrl('simple-forms/submissions/edit/'.$this->id);\n }", "public function admin_edit_url()\n {\n return route('admin.page-edit', [$this->wrappedObject->id]);\n }", "function get_link_to_edit($link)\n {\n }", "public function getEditLink($entity)\n {\n return '?action=load&sampleId=' . $entity->getSampleId();\n }", "public function edit() {\n\t\t\t\n\t\t}", "protected function get_url_this_view(){ return $this->input ['table_url'] ;}", "public function EditSourceLink() {\n\t\treturn \"organisation/\" . $this->ID . \"/view\";\n\t}", "public function linkEditContent($str, $row)\n {\n if ($this->doEdit && $this->getBackendUser()->recordEditAccessInternals('tt_content', $row)) {\n $urlParameters = [\n 'edit' => [\n 'tt_content' => [\n $row['uid'] => 'edit'\n ]\n ],\n 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') . '#element-tt_content-' . $row['uid']\n ];\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);\n // Return link\n return '<a href=\"' . htmlspecialchars($url) . '\" title=\"' . htmlspecialchars($this->getLanguageService()->getLL('edit')) . '\">' . $str . '</a>';\n }\n return $str;\n }", "public function getEditLink()\n {\n if(empty($this->id)){\n return $this->getCreateLink();\n }\n\n $params = array(\n 'id' => $this->id,\n );\n $link = Globals::getRouter()->assemble($params, $this->_editRoute, true);\n return $link;\n }", "function getEditUrl()\r\n\t{\r\n\t\tglobal $config;\r\n\r\n\t\t// need full url for links placed inside email messages\r\n\t\t$link = \"http://\". $config[\"http_host\"] . \"/survey_response_form?survey_id={$this->survey_id}\";\r\n\t\tif($this->token)\r\n\t\t\t$link .= \"&token={$this->token}\";\r\n\t\t\t\r\n\t\treturn $link;\r\n\t}", "protected function set_url_this_view($val){ $this->input ['table_url'] = $val ; }", "public function setEditUrl($url)\n {\n $this->_editUrl = $url;\n }", "function getEditUrl($locale = null) {\n $params = array(\n 'module_name' => $this->getModule(),\n 'template_name' => $this->getName(),\n );\n \n if($locale) {\n $params['locale'] = $locale;\n } // if\n \n \treturn assemble_url('admin_settings_email_template_edit', $params);\n }", "abstract protected function renderEdit();", "public function edit( )\r\n {\r\n //\r\n }", "public function editRecipeListClicked($sender, $param)/*\n Module: editRecipeListClicked\n Parameters:\n * $sender -- Page that sent request\n * $param -- Tcontrol that sent request\n Author Name(s): Ashley Prasad\n Date Created: 12/7/2010\n Purpose: Allows user to preform an \"edit\" on List Name, changes row\n * where Edit was clicked to have \"Update/Cancel\" and Textbox in place\n * of the \"Edit\" and List name.\n */{\n $this->RecipeUserListGrid->EditItemIndex = $param->Item->ItemIndex;\n self::UserListRebind($this->User->getUserId());\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function actionEditRow()\n {\n // data to update\n $postData = array();\n if (isset($_POST['UMailSendingRole'])) {\n $postData['UMailSendingRole'] = $_POST['UMailSendingRole'];\n }\n\n // primary key\n $pk['u_person_id'] = $_GET['u_person_id'];\n $pk['u_mail_template_id'] = $_GET['u_mail_template_id'];\n $pk['u_mail_send_role_id'] = $_GET['u_mail_send_role_id'];\n\n // data\n $data = $this->_loadEditModels($pk);\n\n // related data\n $relatedData = array();\n $relatedData['UMailTemplate[id]'] = array(\n '' => Unitkit::t('unitkit', 'input_select')\n ) + UHtml::listDataComboBox('UMailTemplate', array(\n 'id',\n 'id'\n ));\n\n // save models\n $isSaved = ! empty($postData) ? $this->_saveEditModels($data, $postData) : false;\n\n if (! $isSaved) {\n // render view\n $html = $this->bRenderPartial('list/_tbodyRowEdit', array(\n 'dataView' => new MailSendingRoleEditRowDataView($data, $relatedData, $pk, $isSaved)\n ), true);\n } else {\n // update the primary key\n $pk['u_person_id'] = $data['UMailSendingRole']->u_person_id;\n $pk['u_mail_template_id'] = $data['UMailSendingRole']->u_mail_template_id;\n $pk['u_mail_send_role_id'] = $data['UMailSendingRole']->u_mail_send_role_id;\n\n // refresh the row\n $html = $this->_refreshRow($pk);\n }\n echo CJSON::encode(array(\n 'html' => $html,\n 'refreshRow' => $isSaved\n ));\n Yii::app()->end();\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function getCreateRecordUrl() {\n\t\treturn 'javascript:Settings_SMSNotifier_List_Js.triggerEdit(event, \"index.php?module='.$this->getName().'&parent='.$this->getParentName().'&view=Edit\")';\n\t}", "public function getEditUrl() {\n return $this->getUrl('customer/cardmanagement/editcard');\n }", "public function getRouteEdit() {\n\t\treturn \"/edit\";\n\t}", "public function getGridUrl()\n {\n return $this->getUrl('*/*/grid', array('_current'=>true));\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/grid', array('_current'=>true));\n }", "public function getCpEditUrl()\n\t{\n\t\treturn false;\n\t}", "function edit_table($table_name){\n\t\t\t$link = 'index.php?module=extends&view=tables&task=edit&tablename='.\t$table_name;\n\t\t\treturn '<a href=\"'.$link.'\" target=\"_blink\">Sửa bảng</a>';\t\t\n\t\t}", "function editEvent($req, &$t) {\n\n\t\t$t['picForm'] = $this->_loadPictureForm();\n\t}", "public function edit()\n\t{\n\t\t\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_link() {\n\t\tif ( $this->can_edit() ) {\n\t\t\treturn get_edit_post_link($this->ID);\n\t\t}\n\t}", "public function edit_record()\n {\n \t$id = $this->uri->segment(4);\n $table = CMS_TABLE.' as u';\n\t\t$fields = array('u.*');\n\t\t$match = array('u.cms_id' => $id);\n\t\t$result \t = $this->general_model->get_records($table,$fields,'','',$match);\n\t\t$data['editRecord'] = $result;\n\t\t$data['main_content'] = $this->type.'/'.$this->viewname.'/add';\n\t $this->load->view($this->type.'/assets/template',$data);\n }", "public function edit(tbl_project $tbl_project)\n {\n //\n }", "public function editAction()\r\n {\r\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/versions', array('_current'=>true));\n }", "public function getRowUrl()\n {\n return $this->rowUrl;\n }", "function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// model_id\n\t\t\t$this->model_id->SetDbValueDef($rsnew, $this->model_id->CurrentValue, 0, $this->model_id->ReadOnly);\n\n\t\t\t// title\n\t\t\t$this->title->SetDbValueDef($rsnew, $this->title->CurrentValue, NULL, $this->title->ReadOnly);\n\n\t\t\t// description\n\t\t\t$this->description->SetDbValueDef($rsnew, $this->description->CurrentValue, NULL, $this->description->ReadOnly);\n\n\t\t\t// s_order\n\t\t\t$this->s_order->SetDbValueDef($rsnew, $this->s_order->CurrentValue, 0, $this->s_order->ReadOnly);\n\n\t\t\t// status\n\t\t\t$this->status->SetDbValueDef($rsnew, $this->status->CurrentValue, 0, $this->status->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "public function getEditRegister(){\n\t\treturn base_url(route_to('escuela_edit', $this->id_escuela));\n\t}", "public function edit() {\n\t\t$data['pagetitle'] = 'Dashboard - Edit Posts';\n\n\t\t$data['postid'] = $viewmodel->getPostById($postid['id'] );\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/edit/index.php\") ;\n\t}", "public function get_edit_link() {\n return get_edit_post_link( $this->get_id() );\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }" ]
[ "0.77756494", "0.7595632", "0.74366987", "0.73675007", "0.73006755", "0.7292583", "0.7292583", "0.7292583", "0.7292583", "0.7292583", "0.7292583", "0.72425824", "0.72406065", "0.71924025", "0.708086", "0.7024718", "0.70159477", "0.69848776", "0.6961451", "0.68409365", "0.6822963", "0.67260134", "0.672498", "0.6698765", "0.6636504", "0.66143274", "0.65708613", "0.6538475", "0.6460086", "0.6411356", "0.64012736", "0.63338566", "0.63293684", "0.6317108", "0.63136995", "0.63054675", "0.6301498", "0.62699866", "0.62424266", "0.62205833", "0.6209636", "0.6204714", "0.6175417", "0.6175113", "0.6175113", "0.61654747", "0.6131287", "0.608535", "0.60315496", "0.6029226", "0.6026001", "0.6024358", "0.60206455", "0.6010604", "0.60000515", "0.5997183", "0.59866464", "0.5979511", "0.59656537", "0.5963144", "0.595654", "0.5913067", "0.5912954", "0.59082866", "0.5903407", "0.5903407", "0.58947814", "0.58947814", "0.58947814", "0.58947814", "0.58947814", "0.5891361", "0.58873665", "0.5885451", "0.5882648", "0.5882648", "0.58756316", "0.5874199", "0.58658427", "0.5861495", "0.58573884", "0.58469296", "0.58301497", "0.5826348", "0.5820003", "0.581052", "0.5807072", "0.58061767", "0.58046657", "0.5804645", "0.57956195", "0.57893205", "0.57893205", "0.57893205", "0.57893205", "0.57893205", "0.57893205", "0.57893205", "0.57893205", "0.57893205" ]
0.67821455
21
Store currently rendered status messages.
public function setMessages(array $messages) { $this->messages = $messages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }", "function statusMessagesOn()\n\t{\n\t\t$this->bStatusMessages = true;\n\t}", "public function statusAction()\n {\n // enforce permissions.\n $this->acl->check('content', 'manage');\n\n // set context\n $this->contextSwitch->initContext('json');\n\n $processId = $this->getRequest()->getParam('processId');\n $statusFile = sys_get_temp_dir() . '/' . static::STATUS_FILE . $processId;\n\n if (!file_exists($statusFile) ) {\n $status = array(\n 'label' => 'no status',\n 'message' => 'No current status file.',\n 'done' => true\n );\n $this->view->status = $status;\n return;\n }\n\n $this->view->status = $this->_readStatusFile($processId);\n }", "protected function messagesToSession() {\n\t\t$_SESSION['messages'] = $this->messages;\n\t\t$_SESSION['fieldMessages'] = $this->fieldMessages;\n\t}", "function save_messages( $messages ) {\n\t\tglobal $post, $post_ID;\n\n\t\t$messages['bbp_notice'] = array(\n\t\t\t1 => __( 'Notice updated.', 'bbpress-notices' ),\n\t\t\t4 => __( 'Notice updated.', 'bbpress-notices' ),\n\t\t\t6 => __( 'Notice published.', 'bbpress-notices' ),\n\t\t\t7 => __( 'Notice saved.', 'bbpress-notices' ),\n\t\t\t8 => __( 'Notice submitted.', 'bbpress-notices' )\n\t\t);\n\n\t\treturn $messages;\n\t}", "function _showStatus() {\r\n $okMessage = implode('<br />', $this->_okMessage);\r\n $errMessage = implode('<br />', $this->_errMessage);\r\n\r\n if (!empty($errMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_ERROR_MESSAGE', $errMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('errormsg');\r\n }\r\n\r\n if (!empty($okMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_OK_MESSAGE', $okMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('okmsg');\r\n }\r\n }", "public function updateStatus(): void\n {\n $data = json_encode($this->getStatus(), JSON_PRETTY_PRINT);\n File::put(public_path(self::STATUS_FILE_NAME), $data);\n }", "function setMessage($message, $status) {\n\t$_SESSION['message']['content'] = $message;\n\t$_SESSION['message']['status'] = $status;\n}", "public function getStatusLogMessages() {\n foreach($this->statusLogs as $log) {\n $log = explode(\",\", $log);\n $logMessage = &$log[0];\n $logTimestamp = &$log[1];\n $this->statusLogMessages[] = array($this->statusTemplates[ $logMessage ], date(\"Y:m:d h:i:s\", $logTimestamp));\n }\n\n return $this->statusLogMessages;\n }", "private function manageStatus()\n {\n $this->updateStatus();\n $this->checkStatus();\n }", "protected function renderFlashMessages() {}", "function odd_admin_preprocess_status_messages(&$variables) {\n $variables['message_classes'] = [];\n $variables['message_icons'] = [];\n\n // Set the message classes and icons.\n foreach ($variables['message_list'] as $type => $messages) {\n $variables['message_classes'][$type] = $type;\n\n switch ($type) {\n case 'status':\n $variables['message_classes'][$type] = 'success';\n $variables['message_icons'][$type] = 'info circle icon';\n break;\n\n case 'error':\n $variables['message_icons'][$type] = 'remove circle icon';\n break;\n\n case 'warning':\n $variables['message_icons'][$type] = 'warning circle icon';\n break;\n\n default:\n $variables['message_icons'][$type] = 'announcement icon';\n }\n }\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}", "public function saveState() {\n return array('lastItem'=>$this->curPos, 'itemCount'=>$this->count,'message'=>\"done $this->curPos of $this->count\");\n }", "public function save()\n {\n return $this->_messages;\n }", "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}", "function getMessages() {\n\t\t$pre= $this->code;\n\t\tif (defined('CACHE_IDENTIFIER')) {\n\t\t\t$pre= CACHE_IDENTIFIER;\n\t\t}\n\n\t\tif (function_exists('apc_fetch') && (DEBUG < 1)) {\n\t\t\t$temp= apc_fetch($pre.'_lang_'.$this->code);\n\t\t\tif (false != $temp) {\n\t\t\t\t$this->messages= & $temp;\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\t//TODO eaccellerator? cacheutil?\n\t\t}\n\n\t\t$messages= array ();\n\t\tinclude (ROOT.'controllers'.DS.'lang'.DS.$this->code.'.php');\n\t\t$this->messages= & $messages;\n\n\t\tif (function_exists('apc_store') && (DEBUG < 1)) {\n\t\t\tapc_store($pre.'lang_'.$this->code, $this->messages, 300);\n\t\t} else {\n\t\t\t//TODO eaccellerator? cacheutil?\n\t\t}\n\t}", "function zen_spectre_starterkit_status_messages($variables) {\n $display = $variables['display'];\n $output = '';\n\n $status_heading = array(\n 'status' => t('Status message'),\n 'error' => t('Error message'),\n 'warning' => t('Warning message'),\n );\n foreach (drupal_get_messages($display) as $type => $messages) {\n $output .= \"<div class=\\\"messages messages--$type\\\">\\n\";\n if (!empty($status_heading[$type])) {\n $output .= '<h2 class=\"visually-hidden\">' . $status_heading[$type] . \"</h2>\\n\";\n }\n\n if (count($messages) > 1) {\n $output .= \" <ul class=\\\"messages__list\\\">\\n\";\n foreach ($messages as $message) {\n $output .= ' <li class=\"messages__item\">' . $message . \"</li>\\n\";\n }\n $output .= \" </ul>\\n\";\n }\n else {\n $output .= reset($messages);\n }\n $output .= \"</div>\\n\";\n }\n return $output;\n}", "public function renderFlashMessages() {}", "function gwt_drupal_status_messages($variables) {\n $display = $variables['display'];\n $output = '';\n\n $status_heading = array(\n 'status' => t('Status message'),\n 'error' => t('Error message'),\n 'warning' => t('Warning message'),\n );\n foreach (drupal_get_messages($display) as $type => $messages) {\n $output .= \"<div class=\\\"messages--$type messages $type\\\">\\n\";\n if (!empty($status_heading[$type])) {\n $output .= '<h2 class=\"element-invisible\">' . $status_heading[$type] . \"</h2>\\n\";\n }\n if (count($messages) > 1) {\n $output .= \" <ul class=\\\"messages__list\\\">\\n\";\n foreach ($messages as $message) {\n $output .= ' <li class=\\\"messages__item\\\">' . $message . \"</li>\\n\";\n }\n $output .= \" </ul>\\n\";\n }\n else {\n $output .= $messages[0];\n }\n $output .= \"</div>\\n\";\n }\n return $output;\n}", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function prepareFlashMessages()\n {\n global $session;\n\n $messages = [];\n foreach ($session->getFlashBag()->all() as $msgType => $msg) {\n $messages[$msgType] = $msg;\n }\n //print_r($messages);\n //exit;\n\n $this->addTwigVar('messages', $messages);\n }", "public function action_chat_history() {\n\t\t$this->_template->set('page_title', 'All Messages');\n\t\t$this->_template->set('page_info', 'view and manage chat messages');\n\t\t$messages = ORM::factory('Message')->get_grouped_messages($this->_current_user->id);\n\t\t$this->_template->set('messages', $messages);\n\t\t$this->_set_content('messages');\n\t}", "function updateStatus() {\n global $status, $spambotDataLoc;\n return file_put_contents( $spambotDataLoc.'sbstatus', serialize($status) ); \n}", "function add() {\n if(!$this->request->isApiCall() && !$this->request->isAsyncCall()) {\n $this->httpError(HTTP_ERR_BAD_REQUEST);\n } // if\n \n $this->wireframe->print_button = false;\n \n if($this->request->isSubmitted()) {\n $status_data = $this->request->post('status');\n \n $status = new StatusUpdate();\n \n $status->setAttributes($status_data);\n $status->setCreatedById($this->logged_user->getId());\n $status->setCreatedByName($this->logged_user->getName());\n $status->setCreatedByEmail($this->logged_user->getEmail());\n \n $save = $status->save();\n if(!$save || is_error($save)) {\n if($this->request->isApiCall()) {\n $this->serveData($save);\n } else {\n $this->httpError(HTTP_ERR_OPERATION_FAILED);\n } // if\n } // if\n \n if($this->request->isApiCall()) {\n $this->serveData($status, 'message');\n } else {\n UserConfigOptions::setValue('status_update_last_visited', new DateTimeValue(), $this->logged_user);\n \n $this->smarty->assign('status_update', $status);\n print $this->smarty->fetch(get_template_path('_status_row', $this->controller_name, STATUS_MODULE));\n die();\n } // if\n } else {\n $this->httpError(HTTP_ERR_BAD_REQUEST);\n } // if\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}", "public function onWorkerHandlerStatusMessage(WorkerHandlerStatus $msg)\n {\n $handlerId = $msg->getWorkerHandlerId();\n\n if (isset($this->workerHandlers[$handlerId])) {\n // Remove to make sure the handlers are ordered by time.\n unset($this->workerHandlers[$handlerId]);\n }\n\n $this->workerHandlers[$handlerId] = microtime(true);\n\n $requestId = $msg->getRequestId();\n\n if ($requestId === null) {\n return;\n }\n\n $this->getLogger()->debug('Storage has a result available for: '.$requestId.'.');\n\n $this->sendResponseToClients($requestId);\n }", "function index() {\n UserConfigOptions::setValue('status_update_last_visited', new DateTimeValue(), $this->logged_user);\n \n // Popup\n if($this->request->isAsyncCall()) {\n $this->skip_layout = true;\n \n $this->setTemplate(array(\n 'template' => 'popup',\n 'controller' => 'status',\n 'module' => STATUS_MODULE,\n ));\n \n $last_visit = UserConfigOptions::getValue('status_update_last_visited', $this->logged_user);\n $new_messages_count = StatusUpdates::countNewMessagesForUser($this->logged_user, $last_visit);\n \n $limit = $new_messages_count > 10 ? $new_messages_count : 10;\n \n $latest_status_updates = StatusUpdates::findVisibleForUser($this->logged_user, $limit);\n $this->smarty->assign(array(\n 'status_updates' => $latest_status_updates,\n \"rss_url\" => assemble_url('status_updates_rss', array(\n 'token' => $this->logged_user->getToken(true),\n )),\n ));\n \n // Archive\n } else {\n $this->setTemplate(array(\n 'template' => 'messages',\n 'controller' => 'status',\n 'module' => STATUS_MODULE,\n ));\n \n $visible_users = $this->logged_user->visibleUserIds();\n $selected_user_id = $this->request->getId('user_id');\n if($selected_user_id) {\n if(!in_array($selected_user_id, $visible_users)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n $selected_user = Users::findById($selected_user_id);\n if(!instance_of($selected_user, 'User')) {\n $this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n } else {\n $selected_user = null;\n } // if\n \n if($this->request->isApiCall()) {\n if($selected_user) {\n $this->serveData(StatusUpdates::findByUser($selected_user), 'messages');\n } else {\n $this->serveData(StatusUpdates::findVisibleForUser($this->logged_user, 50), 'messages');\n } // if\n } else {\n $per_page = $this->status_updates_per_page; // Messages per page\n $page = (integer) $this->request->get('page');\n if($page < 1) {\n $page = 1;\n } // if\n \n if($selected_user) {\n $rss_url = assemble_url('status_updates_rss', array(\n \"user_id\" => $selected_user_id,\n 'token' => $this->logged_user->getToken(true),\n ));\n $rss_title = clean($selected_user->getDisplayName()). ': '.lang('Status Updates');\n list($status_updates, $pagination) = StatusUpdates::paginateByUser($selected_user, $page, $per_page);\n $this->smarty->assign(array(\n \"selected_user\" => $selected_user,\n \"rss_url\" => $rss_url\n ));\n } else {\n $rss_url = assemble_url('status_updates_rss', array('token' => $this->logged_user->getToken(true)));\n $rss_title = lang('Status Updates');\n list($status_updates, $pagination) = StatusUpdates::paginateByUserIds($visible_users, $page, $per_page);\n $this->smarty->assign(array(\n \"rss_url\" => $rss_url\n ));\n } // if\n \n $this->wireframe->addRssFeed(\n $rss_title,\n $rss_url,\n FEED_RSS \n );\n \n $this->smarty->assign(array(\n \"visible_users\" => Users::findUsersDetails($visible_users),\n \"status_updates\" => $status_updates,\n \"pagination\" => $pagination\n ));\n } // if\n } // if\n }", "function tn_prepare_messages() {\n\n\t$_messages = TN_Messages::get_instance();\n\n\t$messages = $_messages->get_messages();\n\n\tif( $messages ) :\n\n\t\tadd_action( 'tn_messages', function() use ( $messages ) { \n\n\t\t\tforeach( $messages as $key => $message ) {\n\t\t\t\t// we add data-message - useful if element is eg cloned to pull it downscreen\n\t\t\t\tif( isset( $message['success'] ) ) : ?>\n\t\t\t\t\t<div data-message=\"<?php echo ++$key; ?>\" class=\"tn_message success\"><?php echo $message['success']; ?></div>\n\t\t\t\t<?php elseif ( isset( $message['error'] ) ) : ?>\n\t\t\t\t\t<div data-message=\"<?php echo ++$key; ?>\" class=\"tn_message error\"><?php echo $message['error']; ?></div>\t\n\t\t\t\t<?php endif; \n\t\t\t}\n\n\t\t});\n\n\tendif;\n}", "protected function renderAlertStatus() {}", "function updated_messages( $messages ) {\n\t\tglobal $post_ID, $post;\n\t\t\n\t\t$messages['units'] = array(\n\t\t\t0 => '', // Unused. Messages start at index 1.\n\t\t\t1 => __('Unit updated.'),\n\t\t\t2 => __('Unit updated.'),\n\t\t\t3 => __('Custom field deleted.'),\n\t\t\t4 => __('Unit updated.'),\n\t\t\t5 => isset($_GET['revision']) ? sprintf( __('Unit restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n\t\t\t6 => __('Unit published.'),\n\t\t\t7 => __('Unit saved.'),\n\t\t\t8 => __('Unit submitted. <a target=\"_blank\" href=\"%s\">Preview Unit</a>'),\n\t\t\t9 => sprintf( __('Unit scheduled for: <strong>%1$s</strong>.'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ) ),\n\t\t\t10 => __('Unit draft updated.')\n\t\t);\n\t\t\n\t\treturn $messages;\n\t}", "function messaging_inbox_page_output() {\n\tglobal $wpdb, $wp_roles, $current_user, $user_ID, $current_site, $messaging_official_message_bg_color, $messaging_max_inbox_messages, $messaging_max_reached_message, $wp_version;\n\n\tif (isset($_GET['updated'])) {\n\t\t?><div id=\"message\" class=\"updated fade\"><p><?php echo stripslashes(sanitize_text_field($_GET['updatedmsg'])) ?></p></div><?php\n\t}\n\n\t$action = isset($_GET[ 'action' ]) ? $_GET[ 'action' ] : '';\n\n\techo '<div class=\"wrap\">';\n\tswitch( $action ) {\n\t\t//---------------------------------------------------//\n\t\tdefault:\n\t\t\tif ( isset($_POST['Remove']) ) {\n\t\t\t\tmessaging_update_message_status(intval($_POST['mid']),'removed');\n\t\t\t\techo \"\n\t\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\t\twindow.location='admin.php?page=messaging&updated=true&updatedmsg=\" . urlencode(__('Message removed.', 'messaging')) . \"';\n\t\t\t\t</script>\n\t\t\t\t\";\n\t\t\t}\n\t\t\tif ( isset($_POST['Reply']) ) {\n\t\t\t\techo \"\n\t\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\t\twindow.location='admin.php?page=messaging&action=reply&mid=\" . intval($_POST['mid']) . \"';\n\t\t\t\t</script>\n\t\t\t\t\";\n\t\t\t}\n\t\t\t$tmp_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status != %s\", $user_ID, 'removed'));\n\t\t\t$tmp_unread_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status = %s\", $user_ID, 'unread'));\n\t\t\t$tmp_read_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status = %s\", $user_ID, 'read'));\n\t\t\t?>\n <h2><?php _e('Inbox', 'messaging') ?> <a class=\"add-new-h2\" href=\"admin.php?page=messaging_new\"><?php _e('New Message', 'messaging') ?></a></h2>\n <?php\n\t\t\tif ($tmp_message_count == 0){\n\t\t\t?>\n <p><?php _e('No messages to display', 'messaging') ?></p>\n <?php\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Usage', 'messaging') ?></h3>\n <p>\n\t\t\t\t<?php _e('Maximum inbox messages', 'messaging') ?>: <strong><?php echo $messaging_max_inbox_messages; ?></strong>\n <br />\n <?php _e('Current inbox messages', 'messaging') ?>: <strong><?php echo $tmp_message_count; ?></strong>\n </p>\n <?php\n\t\t\t\tif ($tmp_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t?>\n <p><strong><center><?php _e($messaging_max_reached_message, 'messaging') ?></center></strong></p>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\tif ($tmp_unread_message_count > 0){\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Unread', 'messaging') ?></h3>\n\t\t\t\t<?php\n\t\t\t\t$query = $wpdb->prepare(\"SELECT * FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %s AND message_status = %s ORDER BY message_ID DESC\", $user_ID, 'unread');\n\t\t\t\t$tmp_messages = $wpdb->get_results( $query, ARRAY_A );\n\t\t\t\techo \"\n\t\t\t\t<table cellpadding='3' cellspacing='3' width='100%' class='widefat'>\n\t\t\t\t<thead><tr>\n\t\t\t\t<th scope='col'>\" . __(\"From\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Subject\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Recieved\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Actions\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t</tr></thead>\n\t\t\t\t<tbody id='the-list'>\n\t\t\t\t\";\n\t\t\t\t$class = '';\n\t\t\t\tif (count($tmp_messages) > 0){\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\tforeach ($tmp_messages as $tmp_message){\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$style = \"'style=background-color:\" . $messaging_official_message_bg_color . \";'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$style = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\techo \"<tr class='\" . $class . \"' \" . $style . \">\";\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT display_name FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_from_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'><strong>\" . $tmp_display_name . \"</strong></td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><strong><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></strong></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . stripslashes($tmp_message['message_subject']) . \"</strong></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</strong></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT display_name FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_from_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'>\" . $tmp_display_name . \"</td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'>\" . stripslashes($tmp_message['message_subject']) . \"</td>\";\n\t\t\t\t\t\techo \"<td valign='top'>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\tif ($tmp_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=view&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=reply&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=remove&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='delete'>\" . __('Remove', 'messaging') . \"</a></td>\";\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</tbody></table>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t//=========================================================//\n\t\t\t\tif ($tmp_read_message_count > 0){\n\t\t\t\t?>\n\t\t\t\t<h3><?php _e('Read', 'messaging') ?></h3>\n\t\t\t\t<?php\n\t\t\t\t$query = $wpdb->prepare(\"SELECT * FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d AND message_status = %s ORDER BY message_ID DESC\", $user_ID, 'read');\n\t\t\t\t$tmp_messages = $wpdb->get_results( $query, ARRAY_A );\n\t\t\t\techo \"\n\t\t\t\t<table cellpadding='3' cellspacing='3' width='100%' class='widefat'>\n\t\t\t\t<thead><tr>\n\t\t\t\t<th scope='col'>\" . __(\"From\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Subject\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Recieved\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'>\" . __(\"Actions\", 'messaging') . \"</th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t<th scope='col'></th>\n\t\t\t\t</tr></thead>\n\t\t\t\t<tbody id='the-list'>\n\t\t\t\t\";\n\t\t\t\t$class = '';\n\t\t\t\tif (count($tmp_messages) > 0){\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\tforeach ($tmp_messages as $tmp_message){\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$style = \"'style=background-color:\" . $messaging_official_message_bg_color . \";'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$style = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\techo \"<tr class='\" . $class . \"' \" . $style . \">\";\n\t\t\t\t\tif ($tmp_message['message_official'] == 1){\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_to_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'><strong>\" . $tmp_display_name . \"</strong></td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><strong><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></strong></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . stripslashes($tmp_message['message_subject']) . \"</strong></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><strong>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</strong></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\t$tmp_display_name = $wpdb->get_var($wpdb->prepare(\"SELECT display_name FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message['message_from_user_ID']));\n\t\t\t\t\t\tif ( $tmp_display_name == '' ) {\n\t\t\t\t\t\t\t$tmp_display_name = $tmp_username;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_user_url = messaging_user_primary_blog_url($tmp_message['message_to_user_ID']);\n\t\t\t\t\t\tif ($tmp_user_url == ''){\n\t\t\t\t\t\t\techo \"<td valign='top'>\" . $tmp_display_name . \"</td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"<td valign='top'><a href='\" . $tmp_user_url . \"'>\" . $tmp_display_name . \"</a></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"<td valign='top'>\" . stripslashes($tmp_message['message_subject']) . \"</td>\";\n\t\t\t\t\t\techo \"<td valign='top'>\" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message['message_stamp']) . \"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\tif ($tmp_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=view&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('View', 'messaging') . \"</a></td>\";\n\t\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=reply&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='edit'>\" . __('Reply', 'messaging') . \"</a></td>\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"<td valign='top'><a href='admin.php?page=messaging&action=remove&mid=\" . $tmp_message['message_ID'] . \"' rel='permalink' class='delete'>\" . __('Remove', 'messaging') . \"</a></td>\";\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t$class = ('alternate' == $class) ? '' : 'alternate';\n\t\t\t\t\t//=========================================================//\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</tbody></table>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"view\":\n\t\t\t$tmp_total_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_to_user_ID = %d\", $user_ID));\n\t\t\t$tmp_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d AND message_to_user_ID = %d\", $_GET['mid'], $user_ID));\n\t\t\tif ($tmp_message_count > 0){\n\t\t\t\tif ($tmp_total_message_count >= $messaging_max_inbox_messages){\n\t\t\t\t\t?>\n\t\t\t\t\t<p><strong><center><?php _e($messaging_max_reached_message, 'messaging') ?></center></strong></p>\n\t\t\t\t\t<?php\n\t\t\t\t\t} else {\n\t\t\t\t\tmessaging_update_message_status(intval($_GET['mid']),'read');\n\t\t\t\t\t$tmp_message_subject = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_subject FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t\t\t$tmp_message_content = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_content FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t\t\t$tmp_message_from_user_ID = $wpdb->get_var($wpdb->prepare(\"SELECT message_from_user_ID FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message_from_user_ID));\n\t\t\t\t\t$tmp_message_status = $wpdb->get_var($wpdb->prepare(\"SELECT message_status FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t\t\t$tmp_message_status = ucfirst($tmp_message_status);\n\t\t\t\t\t$tmp_message_status = __($tmp_message_status, 'messaging');\n\t\t\t\t\t$tmp_message_stamp = $wpdb->get_var($wpdb->prepare(\"SELECT message_stamp FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t\t\t?>\n\n\t\t\t\t\t<h2><?php _e('View Message: ', 'messaging') ?><?php echo intval($_GET['mid']); ?></h2>\n\t\t\t\t\t<form name=\"new_message\" method=\"POST\" action=\"admin.php?page=messaging\">\n\t\t\t\t\t<input type=\"hidden\" name=\"mid\" value=\"<?php echo intval($_GET['mid']); ?>\" />\n\t\t\t\t\t<h3><?php _e('Sent', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo date_i18n(get_option('date_format') . ' ' . get_option('time_format'),$tmp_message_stamp); ?></p>\n\t\t\t\t\t<h3><?php _e('Status', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_message_status; ?></p>\n\t\t\t\t\t<h3><?php _e('From', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_username; ?></p>\n\t\t\t\t\t<h3><?php _e('Subject', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_message_subject; ?></p>\n\t\t\t\t\t<h3><?php _e('Content', 'messaging') ?></h3>\n\t\t\t\t\t<p><?php echo $tmp_message_content; ?></p>\n <p class=\"submit\">\n\t\t\t\t\t<input class=\"button button-secondary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Back', 'messaging') ?>\" />\n\t\t\t\t\t<input class=\"button button-secondary\" type=\"submit\" name=\"Remove\" value=\"<?php _e('Remove', 'messaging') ?>\" />\n\t\t\t\t\t<input class=\"button button-primary\" type=\"submit\" name=\"Reply\" value=\"<?php _e('Reply', 'messaging') ?>\" />\n </p>\n\t\t\t\t\t</form>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t?>\n <p><?php _e('You do not have permission to view this message', 'messaging') ?></p>\n <?php\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"remove\":\n\t\t\t//messaging_update_message_status($_GET['mid'],'removed');\n\t\t\tmessaging_remove_message(intval($_GET['mid']));\n\t\t\techo \"\n\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\twindow.location='admin.php?page=messaging&updated=true&updatedmsg=\" . urlencode('Message removed.') . \"';\n\t\t\t</script>\n\t\t\t\";\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"reply\":\n\t\t\t$tmp_message_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d AND message_to_user_ID = %d\", $_GET['mid'], $user_ID));\n\t\t\tif ($tmp_message_count > 0){\n\t\t\t$tmp_message_from_user_ID = $wpdb->get_var($wpdb->prepare(\"SELECT message_from_user_ID FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid']));\n\t\t\t$tmp_username = $wpdb->get_var($wpdb->prepare(\"SELECT user_login FROM \" . $wpdb->users . \" WHERE ID = %d\", $tmp_message_from_user_ID));\n\t\t\t$tmp_message_subject = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_subject FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t$tmp_message_subject = __('RE: ', 'messaging') . $tmp_message_subject;\n\t\t\t$tmp_message_content = stripslashes($wpdb->get_var($wpdb->prepare(\"SELECT message_content FROM \" . $wpdb->base_prefix . \"messages WHERE message_ID = %d\", $_GET['mid'])));\n\t\t\t//$tmp_message_content = \"\\n\\n\" . $tmp_username . __(' wrote:') . '<hr>' . $tmp_message_content;\n\n\t\t\t$rows = get_option('default_post_edit_rows');\n if (($rows < 3) || ($rows > 100)){\n $rows = 12;\n\t\t\t}\n $rows = \"rows='$rows'\";\n\n if ( user_can_richedit() ){\n add_filter('the_editor_content', 'wp_richedit_pre');\n\t\t\t}\n\t\t\t//\t$the_editor_content = apply_filters('the_editor_content', $content);\n ?>\n\t\t\t<h2><?php _e('Send Reply', 'messaging') ?></h2>\n\t\t\t<form name=\"reply_to_message\" method=\"POST\" action=\"admin.php?page=messaging&action=reply_process\">\n <input type=\"hidden\" name=\"message_to\" value=\"<?php echo $tmp_username; ?>\" class=\"messaging-suggest-user ui-autocomplete-input\" autocomplete=\"off\" />\n <input type=\"hidden\" name=\"message_subject\" value=\"<?php echo $tmp_message_subject; ?>\" />\n <table class=\"form-table\">\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('To', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_to\" id=\"message_to_disabled\" style=\"width: 95%\" maxlength=\"200\" value=\"<?php echo $tmp_username; ?>\" />\n <br />\n <?php //_e('Required - seperate multiple usernames by commas Ex: demouser1,demouser2') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Subject', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_subject\" id=\"message_subject_disabled\" style=\"width: 95%\" maxlength=\"200\" value=\"<?php echo $tmp_message_subject; ?>\" />\n <br />\n <?php //_e('Required') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php echo $tmp_username . __(' wrote', 'messaging'); ?></th>\n <td><?php echo $tmp_message_content; ?>\n <br />\n <?php _e('Required', 'messaging') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Content', 'messaging') ?></th>\n <td>\n\t\t\t<?php if (version_compare($wp_version, \"3.3\") >= 0 && user_can_richedit()) { ?>\n\t\t\t\t<?php wp_editor('', 'message_content'); ?>\n\t\t\t<?php } else { ?>\n\t\t\t\t<textarea <?php if ( user_can_richedit() ){ echo \"class='mceEditor'\"; } ?> <?php echo $rows; ?> style=\"width: 95%\" name='message_content' tabindex='1' id='message_content'></textarea>\n\t\t\t<?php } ?>\n\n\t\t<br />\n <?php _e('Required', 'messaging') ?></td>\n </tr>\n </table>\n <p class=\"submit\">\n <input class=\"button button-primary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Send', 'messaging') ?>\" />\n </p>\n </form> <?php\n\t\t\t} else {\n\t\t\t?>\n\t\t\t<p><?php _e('You do not have permission to view this message', 'messaging') ?></p>\n\t\t\t<?php\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"reply_process\":\n\t\t\tif ($_POST['message_to'] == '' || $_POST['message_subject'] == '' || $_POST['message_content'] == ''){\n\t\t\t\t$rows = get_option('default_post_edit_rows');\n\t\t\t\tif (($rows < 3) || ($rows > 100)){\n\t\t\t\t\t$rows = 12;\n\t\t\t\t}\n\t\t\t\t$rows = \"rows='$rows'\";\n\n\t\t\t\tif ( user_can_richedit() ){\n\t\t\t\t\tadd_filter('the_editor_content', 'wp_richedit_pre');\n\t\t\t\t}\n\t\t\t\t//\t$the_editor_content = apply_filters('the_editor_content', $content);\n\t\t\t\t?>\n\t\t\t\t<h2><?php _e('Send Reply', 'messaging') ?></h2>\n <p><?php _e('Please fill in all required fields', 'messaging') ?></p>\n\t\t\t\t<form name=\"reply_to_message\" method=\"POST\" action=\"admin.php?page=messaging&action=reply_process\">\n <input type=\"hidden\" name=\"message_to\" value=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n <input type=\"hidden\" name=\"message_subject\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('To', 'messaging') ?></th>\n\t\t\t\t\t<td><input disabled=\"disabled\" type=\"text\" name=\"message_to\" id=\"message_to_disabled\"\n\t\t\t\t\t\tclass=\"messaging-suggest-user ui-autocomplete-input\" autocomplete=\"off\"\n\t\t\t\t\t\tstyle=\"width: 95%\" maxlength=\"200\"\n\t\t\t\t\t\tvalue=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n\t\t\t\t\t<br />\n\t\t\t\t\t<?php //_e('Required - seperate multiple usernames by commas Ex: demouser1,demouser2') ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Subject', 'messaging') ?></th>\n\t\t\t\t\t<td><input disabled=\"disabled\" type=\"text\" name=\"message_subject\" id=\"message_subject_disabled\" style=\"width: 95%\" maxlength=\"200\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n\t\t\t\t\t<br />\n\t\t\t\t\t<?php //_e('Required') ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Content', 'messaging') ?></th>\n\t\t\t\t\t<td><textarea <?php if ( user_can_richedit() ){ echo \"class='mceEditor'\"; } ?> <?php echo $rows; ?> style=\"width: 95%\" name='message_content' tabindex='1' id='message_content'><?php echo wp_kses_post($_POST['message_content']); ?></textarea>\n\t\t\t\t\t<br />\n\t\t\t\t\t<?php _e('Required', 'messaging') ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n <p class=\"submit\">\n <input class=\"button button-primary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Send', 'messaging') ?>\" />\n </p>\n\t\t\t\t</form>\n\t\t<?php\n\t\t\t\t\tif ( user_can_richedit() ){\n\t\t\t\t\t\twp_print_scripts( array( 'wpdialogs-popup' ) );\n\t\t\t\t\t\twp_print_styles('wp-jquery-ui-dialog');\n\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/internal-linking.php';\n\t\t\t\t\t\t?><div style=\"display:none;\"><?php wp_link_dialog(); ?></div><?php\n\t\t\t\t\t\twp_print_scripts('wplink');\n\t\t\t\t\t\twp_print_styles('wplink');\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//==========================================================//\n\t\t\t\t$tmp_usernames = sanitize_text_field($_POST['message_to']);\n\t\t\t\t//$tmp_usernames = str_replace( \",\", ', ', $tmp_usernames );\n\t\t\t\t//$tmp_usernames = ',,' . $tmp_usernames . ',,';\n\t\t\t\t//$tmp_usernames = str_replace( \" \", '', $tmp_usernames );\n\t\t\t\t$tmp_usernames_array = explode(\",\", $tmp_usernames);\n\t\t\t\t$tmp_usernames_array = array_unique($tmp_usernames_array);\n\n\t\t\t\t$tmp_username_error = 0;\n\t\t\t\t$tmp_error_usernames = '';\n\t\t\t\t$tmp_to_all_uids = '|';\n\n\t\t\t\tforeach ($tmp_usernames_array as $tmp_username){\n\t\t\t\t\t$tmp_username = trim($tmp_username);\n\t\t\t\t\tif ($tmp_username != ''){\n\t\t\t\t\t\t$tmp_username_count = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM \" . $wpdb->users . \" WHERE user_login = %s\", $tmp_username));\n\t\t\t\t\t\tif ($tmp_username_count > 0){\n\t\t\t\t\t\t\t$tmp_user_id = $wpdb->get_var($wpdb->prepare(\"SELECT ID FROM \" . $wpdb->users . \" WHERE user_login = %s\", $tmp_username));\n\t\t\t\t\t\t\t$tmp_to_all_uids = $tmp_to_all_uids . $tmp_user_id . '|';\n\t\t\t\t\t\t\t//found\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$tmp_username_error = $tmp_username_error + 1;\n\t\t\t\t\t\t\t$tmp_error_usernames = $tmp_error_usernames . $tmp_username . ', ';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$tmp_error_usernames = trim($tmp_error_usernames, \", \");\n\t\t\t\t//==========================================================//\n\t\t\t\tif ($tmp_username_error > 0){\n\t\t\t\t\t$rows = get_option('default_post_edit_rows');\n\t\t\t\t\tif (($rows < 3) || ($rows > 100)){\n\t\t\t\t\t\t$rows = 12;\n\t\t\t\t\t}\n\t\t\t\t\t$rows = \"rows='$rows'\";\n\t\t\t\t\t?>\n\t\t\t\t\t<h2><?php _e('Send Reply', 'messaging') ?></h2>\n\t\t\t\t\t<p><?php _e('The following usernames could not be found in the system', 'messaging') ?> <em><?php echo $tmp_error_usernames; ?></em></p>\n <form name=\"new_message\" method=\"POST\" action=\"admin.php?page=messaging&action=reply_process\">\n <input type=\"hidden\" name=\"message_to\" value=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n <input type=\"hidden\" name=\"message_subject\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n <table class=\"form-table\">\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('To', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_to\" id=\"message_to_disabled\"\n \tclass=\"messaging-suggest-user ui-autocomplete-input\" autocomplete=\"off\"\n \tstyle=\"width: 95%\" tabindex='1' maxlength=\"200\"\n \tvalue=\"<?php echo sanitize_text_field($_POST['message_to']); ?>\" />\n <br />\n <?php //_e('Required - seperate multiple usernames by commas Ex: demouser1,demouser2') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Subject', 'messaging') ?></th>\n <td><input disabled=\"disabled\" type=\"text\" name=\"message_subject\" id=\"message_subject_disabled\" style=\"width: 95%\" tabindex='2' maxlength=\"200\" value=\"<?php echo stripslashes(sanitize_text_field($_POST['message_subject'])); ?>\" />\n <br />\n <?php //_e('Required') ?></td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Content', 'messaging') ?></th>\n <td><textarea <?php if ( user_can_richedit() ){ echo \"class='mceEditor'\"; } ?> <?php echo $rows; ?> style=\"width: 95%\" name='message_content' tabindex='3' id='message_content'><?php echo wp_kses_post($_POST['message_content']); ?></textarea>\n\t\t\t<br />\n <?php _e('Required', 'messaging') ?></td>\n </tr>\n </table>\n <p class=\"submit\">\n <input class=\"button button-primary\" type=\"submit\" name=\"Submit\" value=\"<?php _e('Send', 'messaging') ?>\" />\n </p>\n </form>\n\t\t <?php\n\t\t\t\t\tif ( user_can_richedit() ){\n\t\t\t\t\t\twp_print_scripts( array( 'wpdialogs-popup' ) );\n\t\t\t\t\t\twp_print_styles('wp-jquery-ui-dialog');\n\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/internal-linking.php';\n\t\t\t\t\t\t?><div style=\"display:none;\"><?php wp_link_dialog(); ?></div><?php\n\t\t\t\t\t\twp_print_scripts('wplink');\n\t\t\t\t\t\twp_print_styles('wplink');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//everything checked out - send the messages\n\t\t\t\t\t?>\n\t\t\t\t\t<p><?php _e('Sending message(s)...', 'messaging') ?></p>\n <?php\n\t\t\t\t\tforeach ($tmp_usernames_array as $tmp_username){\n\t\t\t\t\t\tif ($tmp_username != ''){\n\t\t\t\t\t\t\t$tmp_to_uid = $wpdb->get_var($wpdb->prepare(\"SELECT ID FROM \" . $wpdb->users . \" WHERE user_login = %s\", $tmp_username));\n\t\t\t\t\t\t\tmessaging_insert_message($tmp_to_uid,$tmp_to_all_uids,$user_ID, stripslashes(sanitize_text_field($_POST['message_subject'])), wp_kses_post($_POST['message_content']), 'unread', 0);\n\t\t\t\t\t\t\tmessaging_new_message_notification($tmp_to_uid,$user_ID, stripslashes(sanitize_text_field($_POST['message_subject'])), wp_kses_post($_POST['message_content']));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmessaging_insert_sent_message($tmp_to_all_uids,$user_ID, sanitize_text_field($_POST['message_subject']),wp_kses_post($_POST['message_content']),0);\n\t\t\t\t\techo \"\n\t\t\t\t\t<SCRIPT LANGUAGE='JavaScript'>\n\t\t\t\t\twindow.location='admin.php?page=messaging&updated=true&updatedmsg=\" . urlencode('Reply Sent.') . \"';\n\t\t\t\t\t</script>\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t\tcase \"test\":\n\t\tbreak;\n\t\t//---------------------------------------------------//\n\t}\n\techo '</div>';\n}", "protected function addFlashMessages() {}", "function cis_login_get_messages() {\n\n\tglobal $cis_login_message;\n\t$html = \"<div id=\\\"message-1\\\" class=\\\"updated\\\"><ul>\\n\";\n\n\tif (!count($cis_login_message))\n\t\treturn false;\n\tforeach ($cis_login_message as $msg)\n\t\t$html .= \"<li>{$msg}</li>\\n\";\n\n\twp_enqueue_style('colors');\n\treturn $html .= \"</ul>\\n</div>\\n\";\n}", "public function messages() {\n return [\n ];\n }", "public function messages() {\n return [\n ];\n }", "public function status()\n {\n if (list($controller, $method) = self::origin(4)) {\n if (isset($_SESSION[$controller][$method]['success'])) {\n // on success\n echo '<ul class=\"success\"><li>';\n echo $_SESSION[$controller][$method]['success'];\n echo '</li></ul>';\n\n // clean up data we no longer need for this particular form\n $this->data = [];\n $temp = $_SESSION[$controller][$method]['csrf'];\n unset($_SESSION[$controller][$method]);\n if (empty($_SESSION[$controller])) {\n unset($_SESSION[$controller]);\n }\n $_SESSION[$controller][$method]['csrf'] = $temp;\n } elseif (isset($_SESSION[$controller][$method]['failed'])) {\n // on error\n echo '<ul class=\"error\">';\n if (is_array($_SESSION[$controller][$method]['failed'])) {\n foreach ($_SESSION[$controller][$method]['failed'] as $desc) {\n echo '<li>' . $desc . '</li>';\n }\n } else {\n // this might hint at a more serious error, as it's not tied to a specific input\n echo '<li>' . $_SESSION[$controller][$method]['failed'] . '</li>';\n }\n echo '</ul>';\n }\n }\n }", "protected function flushMessages() {\n \n if ( !empty( $this->messages ) ) {\n $filePointer = fopen( $this->filePath, 'a' );\n\n fwrite( $filePointer, $this->messages );\n\n fclose( $filePointer ); \n \n $this->messages = '';\n }\n }", "public function writeStatus($message, $status = null, $type = null);", "public function messages()\n {\n return [\n ];\n }", "public function updated_messages($messages)\n {\n global $post, $post_ID;\n\n $messages[$this->token] = [\n 0 => '', // Unused. Messages start at index 1.\n 1 => sprintf(__('Quiz updated. %sView page%s.', $this->token), '<a href=\"' . esc_url(get_permalink($post_ID)) . '\">', '</a>'),\n 4 => __('Quiz updated.', $this->token),\n /* translators: %s: date and time of the revision */\n 5 => isset($_GET['revision']) ? sprintf(__('Quiz restored to revision from %s.', $this->token), wp_post_revision_title((int) $_GET['revision'], false)) : false,\n 6 => sprintf(__('Quiz published. %sView quiz%s.', $this->token), '<a href=\"' . esc_url(get_permalink($post_ID)) . '\">', '</a>'),\n 7 => __('Quiz saved.', $this->token),\n 8 => sprintf(__('Quiz submitted. %sPreview quiz%s.', $this->token), '<a target=\"_blank\" href=\"' . esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))) . '\">', '</a>'),\n 9 => sprintf(__('Quiz scheduled for: %1$s. %2$sPreview quiz%3$s.', $this->token), '<strong>' . date_i18n(__('M j, Y @ G:i', $this->token), strtotime($post->post_date)) . '</strong>', '<a target=\"_blank\" href=\"' . esc_url(get_permalink($post_ID)) . '\">', '</a>'),\n 10 => sprintf(__('Quiz draft updated. %sPreview quiz%s.', $this->token), '<a target=\"_blank\" href=\"' . esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))) . '\">', '</a>'),\n ];\n\n return $messages;\n }", "public static function output()\n {\n self::processPendingRemoveIds();\n\n $info = '';\n $error = '';\n $success = '';\n\n $allMessages = self::getMessages();\n foreach ($allMessages as $type => $messages) {\n if (!empty($messages)) {\n $$type = '';\n\n $empty = true;\n foreach ($messages as $id => $data) {\n if (!($data['visibility'] === null || $data['visibility'] === false))\n continue;\n\n $message = $data['message'];\n\n $$type .= apply_filters('tflash_frontend_message_html', '<div class=\"tf-flash-message\"><p>'. nl2br($message) .'</p></div>', array(\n 'type' => $type,\n 'message' => $message,\n 'id' => $id\n ));\n\n unset($allMessages[$type][$id]);\n\n $empty = false;\n }\n\n if ($empty) {\n $$type = '';\n continue;\n }\n\n $$type = '<div class=\"tf-flash-type-'.$type.'\">'.$$type.'</div>';\n }\n }\n\n self::setMessages($allMessages);\n\n echo '<div class=\"tf-flash-messages\">';\n echo $success;\n echo $error;\n echo $info;\n echo '</div>';\n }", "public function postDispatch()\n {\n $this->view->flashMessenger = array_merge(\n $this->_flashMessenger->getMessages(), $this->_flashMessenger->getCurrentMessages()\n );\n $this->_flashMessenger->clearCurrentMessages();\n }", "private function updateSpoolStatus ()\n {\n\n $oAppMessage = (new AppMessage())->retrieveByPK ($this->spool_id);\n if ( is_array ($this->fileData['attachments']) )\n {\n $attachment = implode (\",\", $this->fileData['attachments']);\n $oAppMessage->setappMsgAttach ($attachment);\n }\n $oAppMessage->setappMsgstatus ($this->status);\n $oAppMessage->setappMsgsenddate (date ('Y-m-d H:i:s'));\n $oAppMessage->save ();\n }", "function wimbase_status_messages($variables) {\n $display = $variables['display'];\n $output = '';\n\n $status_heading = [\n 'status' => t('Status message'),\n 'error' => t('Error message'),\n 'warning' => t('Warning message'),\n 'info' => t('Informative message'),\n ];\n\n // Map Drupal message types to their corresponding Bootstrap classes.\n // @see http://twitter.github.com/bootstrap/components.html#alerts\n $status_class = [\n 'status' => 'success',\n 'error' => 'danger',\n 'warning' => 'warning',\n // Not supported, but in theory a module could send any type of message.\n // @see drupal_set_message()\n // @see theme_status_messages()\n 'info' => 'info',\n ];\n\n $dismiss_alert = t('Dismiss alert');\n\n // Retrieve messages.\n $message_list = drupal_get_messages($display);\n\n // Allow the disabled_messages module to filter the messages, if enabled.\n if (module_exists('disable_messages') && variable_get('disable_messages_enable', '1')) {\n $message_list = disable_messages_apply_filters($message_list);\n }\n\n foreach ($message_list as $type => $messages) {\n $class = (isset($status_class[$type])) ? ' alert-' . $status_class[$type] : '';\n $output .= \"<div class=\\\"alert alert-block$class messages $type\\\">\\n\";\n $output .= \" <a class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-label=\\\"{$dismiss_alert}\\\" title=\\\"{$dismiss_alert}\\\" href=\\\"#\\\">&times;</a>\\n\";\n\n if (!empty($status_heading[$type])) {\n $output .= '<h4 class=\"element-invisible\">' . _bootstrap_filter_xss($status_heading[$type]) . \"</h4>\\n\";\n }\n\n if (count($messages) > 1) {\n $output .= \" <ul>\\n\";\n foreach ($messages as $message) {\n $attributes = drupal_attributes(['id' => md5($message)]);\n $output .= ' <li ><span ' . $attributes . '>' . _bootstrap_filter_xss($message) . \"</span></li>\\n\";\n }\n $output .= \" </ul>\\n\";\n }\n else {\n $attributes = drupal_attributes(['id' => md5($messages[0])]);\n $output .= '<span ' . $attributes . '>' . _bootstrap_filter_xss($messages[0]) . '</span>';\n }\n\n $output .= \"</div>\\n\";\n }\n return $output;\n}", "public function messages()\n {\n return [\n\n ];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "private function _flashdata_mark() {\n\t\tforeach ($_SESSION as $name => $value) {\n\t\t\t$parts = explode(':new:', $name);\n\t\t\tif (is_array($parts) && count($parts) == 2) {\n\t\t\t\t$new_name = $this->flash_key.':old:'.$parts[1];\n\t\t\t\t$this->set_userdata($new_name, $value);\n\t\t\t\t$this->unset_userdata($name);\n\t\t\t}\n\t\t}\n\t}", "protected function setReceivedTransactionStatuses(): void\n {\n $txId = $this->postData['brq_transactions'];\n $statusCode = $this->postData['brq_statuscode'];\n\n if (empty($txId) || empty($statusCode)) {\n return;\n }\n\n $payment = $this->order->getPayment();\n\n $receivedTxStatuses = $payment->getAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS_STATUSES) ?? [];\n $receivedTxStatuses[$txId] = $statusCode;\n\n $payment->setAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS_STATUSES, $receivedTxStatuses);\n }", "public function get_message_strings() {\n foreach($this->messages as $singleMessage) {\n \n }\n }", "protected function _setSessionMessages($messages) {}", "function updatestatus() {\n global $_lib;\n\n $dataH = array();\n $dataH['ID'] = $this->transaction->ID;\n $dataH['RemittanceSequence'] = $this->transaction->RemittanceSequence;\n $dataH['RemittanceDaySequence'] = $this->transaction->RemittanceDaySequence;\n $dataH['RemittanceSendtDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceSendtPersonID'] = $_lib['sess']->get_person('PersonID');\n $dataH['RemittanceStatus'] = 'sent';\n \n #Disse mŒ fjernes nŒr vi har en godkjenningsprosess\n $dataH['RemittanceApprovedDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceApprovedPersonID'] = $_lib['sess']->get_person('PersonID');\n\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'invoicein', 'debug' => false));\n }", "public function notify_list(){\n\n\t\tif(!empty($_SESSION[\"notify\"][\"messages\"])){\n\n\n\t\t\techo \"<ul id=\\\"notify-messages\\\">\";\n\t\t\tforeach ($_SESSION[\"notify\"][\"messages\"] as $message) {\n\t\t\t\techo \"<li data-type=\\\"\".$message[\"type\"].\"\\\">\" . $message[\"message\"] . \"</li>\";\n\t\t\t}\n\t\t\techo \"</ul>\";\n\t\t}\n\n\t\t//limpar o queue de notifications\n\t\tself::notify_empty();\n\n\t}", "public function status()\n {\n return [\n 'publish' => trans('dashboard::post/base.status_list.publish'),\n 'draft' => trans('dashboard::post/base.status_list.draft'),\n ];\n }", "function _show_forum_new_msgs_status ($forum_info = array()) {\n\t\t// Forum is read-only\n\t\tif ($forum_info['status'] == 'r') {\n\t\t\t$forum_status = 2;\n\t\t} else {\n\t\t\t// No new messages by default\n\t\t\t$forum_status = 0;\n\t\t\t// Try to find read messages\n\t\t\tif (module('forum')->SETTINGS['USE_READ_MESSAGES'] && !module('forum')->_get_forum_read($forum_info)) {\n\t\t\t\t$forum_status = 1;\n\t\t\t}\n\t\t}\n\t\t$replace = array(\n\t\t\t'img_src'\t\t=> WEB_PATH. tpl()->TPL_PATH. module('forum')->FORUM_STATUSES[$forum_status][0],\n\t\t\t'status_title'\t=> t(module('forum')->FORUM_STATUSES[$forum_status][1]),\n\t\t\t'status_id'\t\t=> intval($forum_status),\n\t\t);\n\t\treturn tpl()->parse('forum'.'/view_home_status_icon', $replace);\n\t}", "protected function defineMessages()\n {\n return [];\n }", "public function updated_message() {\n\t\t$tab = Template::current_tab();\n\n\t\t// Show updated notice.\n\t\tadd_action( 'beehive_admin_top_notices', function () use ( $tab ) {\n\t\t\tswitch ( $tab ) {\n\t\t\t\tcase 'tracking':\n\t\t\t\t\t$this->notice( __( 'Tracking ID updated successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->notice( __( 'Changes were saved successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} );\n\t}", "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 status() {\n\t\t$output = array(\n\t\t\tarray('CURRENT', ''),\n\t\t array('Queue', 'Size'),\n\t\t array('----', '---'),\n\t\t);\n\n\t\tforeach($this->queues as $queue) {\n\t\t $output[] = array( $queue, ResqueProxy::size( $queue ) );\n\t\t}\n\n\t\t$output[] = array( 'failed', ResqueProxy::redis()->llen('failed') );\n\n\n\t\t$output[] = array('----', '---');\n\t\t$output[] = array('TOTALS', '');\n\t\t$output[] = array( 'processed', ResqueProxy::redis()->get('resque:stat:processed') );\n\t\t$output[] = array( 'failed', ResqueProxy::redis()->get('resque:stat:failed') );\n\n\t\t$this->columns($output);\n\t}", "public function pushErrorMessagesToFlashMessageQueue() {}", "public function messages();", "public function messages();", "public function messages();", "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 }", "public function setMessageCount()\n\t\t{\n\t\t\tif(Auth::check() && Auth::user()->profiles)\n\t\t\t{\n\t\t\t\t$profileId = \\Auth::user()->profiles->id;\n\n\t\t\t\t$messageCount = \\DB::table('messages')->where('receiver_id', $profileId)->where('read', false)->count();\n\n\t\t\t\t\\View::share('messageCount', $messageCount);\n\t\t\t}\n\t\t}", "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}", "public function publicMessages()\n {\n return $this->state(function (array $attributes) {\n return [\n 'public_messages' => 1,\n ];\n });\n }", "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}", "public function renderMessages()\n {\n // No messages available\n if(!$this->processor->messages) return;\n\n $messages = '';\n foreach($this->processor->messages as $message) {\n $messages .= $this->genMessage($message['type'], $message['text']);\n }\n return $messages;\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}", "private function status()\n {\n $this->botman->hears('status', function(BotMan $bot) {\n\n $status = 'subscribed';\n $user = Subscriber::where('telegram_user_id', $bot->getUser()->getId())->first();\n\n if(is_null($user))\n {\n $status = 'unsubscribed';\n }\n\n $bot->reply('status: '. $status);\n });\n }", "public function run()\n {\n Status::insert($this->statusLists);\n }", "public function messages()\n {\n return [\n \n ];\n }", "function statusMessage()\n {\n }", "function record_message($message) {\n global $messages;\n array_push($messages, $message);\n}", "public static function render_messages()\n\t\t{\t$output = '';\n\t\t\tif ( !empty( self::$messages ) )\n\t\t\t{\t$output .= '<div class=\"wpvm_messages\">';\n\t\t\t\t$output .= implode( '', self::$messages );\n\t\t\t\t$output .= '</div>';\n\t\t\t}\n\n\t\t\treturn $output;\n\t\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}", "function count_new_messages() {\n $last_visit = UserConfigOptions::getValue('status_update_last_visited', $this->logged_user);\n echo StatusUpdates::countNewMessagesForUser($this->logged_user, $last_visit);\n die();\n }", "function count_new_messages() {\n $this->renderText(NotificationsActivityLogs::countSinceLastVisit($this->logged_user));\n }", "function _pushStatusMessage($message, $type = 'ok') {\r\n switch ($type) {\r\n case 'ok':\r\n array_push($this->_okMessage, $message);\r\n break;\r\n case 'error':\r\n array_push($this->_errMessage, $message);\r\n break;\r\n default:\r\n $this->_pushStatusMessage('invalid errortype, check FileBrowser.class.php', 'error');\r\n break;\r\n }\r\n }", "public function renderFlash()\n {\n // get the feedback (they are arrays, to make multiple positive/negative messages possible)\n $feedback_positive = Session::get('feedback_positive');\n $feedback_negative = Session::get('feedback_negative');\n\n // echo out positive messages\n if (isset($feedback_positive)) {\n foreach ($feedback_positive as $feedback) {\n echo '<div class=\"flash success\">'.$feedback.'</div>';\n }\n }\n\n // echo out negative messages\n if (isset($feedback_negative)) {\n foreach ($feedback_negative as $feedback) {\n echo '<div class=\"flash error\">'.$feedback.'</div>';\n }\n }\n\n // delete these messages (as they are not needed anymore and we want to avoid to show them twice\n Session::set('feedback_positive', null);\n Session::set('feedback_negative', null);\n }", "function _flashdata_mark()\n {\n $userdata = $this->all_userdata();\n foreach ($userdata as $name => $value)\n {\n $parts = explode(':new:', $name);\n if (is_array($parts) && count($parts) === 2)\n {\n $new_name = $this->flashdata_key.':old:'.$parts[1];\n $this->set_userdata($new_name, $value);\n $this->unset_userdata($name);\n }\n }\n }", "protected function initializeMessages()\n {\n $this->messages = array(\n \n );\n }", "public function setStatus() \n {\n // set status\n $status = array();\n $status['error'] = 0;\n $status['message'] = 'OK';\n\n return $status;\n }", "public function setStatus() \n {\n // set status\n $status = array();\n $status['error'] = 0;\n $status['message'] = 'OK';\n\n return $status;\n }", "function _flashdata_mark()\n\t{\n\t\tforeach ($this->userdata as $name => $value)\n\t\t{\n\t\t\t$parts = explode(':new:', $name);\n\t\t\tif (is_array($parts) && count($parts) === 2)\n\t\t\t{\n\t\t\t\t$new_name = $this->flashdata_key.':old:'.$parts[1];\n\t\t\t\t$this->userdata[$new_name] = $value;\n\t\t\t\tunset($this->userdata[$name]);\n\t\t\t}\n\t\t}\n\t}", "public function store()\r\n {\r\n if ($this->storage) {\r\n $this->storage->store($this->messages);\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "protected static function setResponseToSession($status, $message) {\n Session::set('message', ['status' => $status, 'text' => $message]);\n }" ]
[ "0.6093102", "0.59336424", "0.5747812", "0.55842113", "0.55678624", "0.55329525", "0.55265963", "0.5519247", "0.54774797", "0.5423553", "0.542155", "0.53419", "0.5341405", "0.5329764", "0.5313484", "0.5279278", "0.52568185", "0.52487266", "0.5246716", "0.5239802", "0.52274495", "0.52274495", "0.52274495", "0.52274495", "0.52274495", "0.52274495", "0.52274495", "0.52274495", "0.52078205", "0.5189591", "0.5188588", "0.5180552", "0.51727325", "0.51591593", "0.51565367", "0.5155846", "0.51488763", "0.5135268", "0.512887", "0.5121683", "0.510578", "0.5093189", "0.5093189", "0.5092408", "0.5078405", "0.5071631", "0.50707376", "0.5051503", "0.50489765", "0.50398415", "0.5038681", "0.5022151", "0.5021293", "0.50152874", "0.50152874", "0.50152874", "0.50152874", "0.50152874", "0.50152874", "0.50152874", "0.5007609", "0.49967256", "0.49858215", "0.4982129", "0.49811023", "0.49799892", "0.49782637", "0.49765798", "0.4972232", "0.4968884", "0.4968766", "0.49510962", "0.49494058", "0.4940847", "0.4940847", "0.4940847", "0.49277613", "0.49246967", "0.4917656", "0.4917618", "0.49163133", "0.49081263", "0.48980525", "0.4884944", "0.48763326", "0.4873657", "0.48630834", "0.48617968", "0.48603794", "0.4859812", "0.48546034", "0.4851883", "0.4850365", "0.48429334", "0.48377913", "0.48326302", "0.48285952", "0.48285952", "0.48071617", "0.48069653", "0.48054582" ]
0.0
-1
Retrieve current status messages.
protected function getMessages(): ?array { return is_null($this->messages) ? $this->messenger()->deleteAll() : $this->messages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMessageStatus()\n {\n return $this->messageStatus;\n }", "public function messages() {\n\t\treturn $this->master->call('account/messages');\n\t}", "public function get_messages() {\n\t\t$messages = $this->_read_messages();\n\t\t$this->clear_messages();\n\t\treturn apply_filters( 'tn_get_messages', $messages );\t\n\t}", "public function getStatusMessage();", "public function getStatusLogMessages() {\n foreach($this->statusLogs as $log) {\n $log = explode(\",\", $log);\n $logMessage = &$log[0];\n $logTimestamp = &$log[1];\n $this->statusLogMessages[] = array($this->statusTemplates[ $logMessage ], date(\"Y:m:d h:i:s\", $logTimestamp));\n }\n\n return $this->statusLogMessages;\n }", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getStatus() {\n\t\t$status = $this->status;\n\t\tif(!empty($this->messages)) {\n\t\t\tforeach($this->messages as $idx => $message) {\n\t\t\t\tif($message->getStatus() > $status) {\n\t\t\t\t\t$status = $message->getStatus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $status;\n\t}", "public function getMessages() {}", "public function getMessages() {}", "public function get_messages() {\n return $this->messages;\n }", "public function get_status_message() {\n\n\t\treturn $this->get_status_info()->message;\n\t}", "public function getStatusMessage()\n {\n return $this->status_message;\n }", "public function get_messages(){\n return $this->messages;\n }", "public function messages() {\n return $this->get_from_model(__FUNCTION__);\n }", "public function getMessage() {\n return $this->getStatus();\n }", "public function getMessages(){ }", "public function getStatusMessage()\n {\n return $this->statusMessage;\n }", "public function messages()\n {\n return static::staticMessages();\n }", "public function getStatusMessage()\r\n\t{\r\n\t\treturn $this->m_message;\r\n\t}", "public function readableStatus()\n {\n $status = $this->status;\n $match = [\n\n 'message_ok' => \"En attente d'envoi\",\n 'message_issues' => \"Le message contient des erreurs\",\n 'sent' => \"Le message a été envoyé\",\n 'sending' => \"En cours d'envoi…\"\n ];\n\n return isset($match[$status]) ? $match[$status] : $status;\n }", "public function messages() {\n return $this->_messages;\n }", "public function getMessages () {\n return $this->messages;\n }", "public function getStatus()\n {\n return $this->query('mnsync status');\n }", "function getStatusMessage() \r\n\t{\r\n\t\treturn $this->replyString;\r\n\t}", "public function status()\n {\n return array_map(\n function (array $status) {\n return Status::fromArray($status);\n },\n $this->client->get('status')\n );\n }", "public function getStatus($message_id);", "public function getMessages(){\n\t\treturn $this->messages;\n\t}", "public function getMessages(){\n\t\treturn $this->messages;\n\t}", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function getEveryStatus()\n {\n static $status;\n\n if ($status) {\n return $status;\n }\n\n $status = array(\n 'U' => $this->_('Valid from date unknown'),\n 'W' => $this->_('Valid from date in the future'),\n 'O' => $this->_('Open - can be answered now'),\n 'A' => $this->_('Answered'),\n 'M' => $this->_('Missed deadline'),\n 'D' => $this->_('Token does not exist'),\n );\n\n return $status;\n }", "public function getSystemMessages()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('systemMessages');\n }", "public function getStatus(){\n $this->client->request('GET','/session/status');\n $status_message = $this->getJsonResponse();\n return $status_message;\n }", "public function getMessages()\n {\n return $this->messages;\n }", "public function getMessages()\n {\n return $this->messages;\n }", "public function getMessages()\r\n {\n return $this->fm->getMessages();\n }", "public function getMessages() {\n return $this->messages;\n }", "function getMessages(){\r\n return $this->messages;\r\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function messages()\n {\n return [\n ];\n }", "public function all()\r\n {\r\n return $this->messages;\r\n }", "public function messages()\n {\n return [\n\n ];\n }", "public function messages() {\n return [\n ];\n }", "public function messages() {\n return [\n ];\n }", "public function messages()\n {\n return Project::$messages;\n }", "function statusMessagesOn()\n\t{\n\t\t$this->bStatusMessages = true;\n\t}", "public static function statuses()\n {\n return Lastus::statuses(static::class);\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function getMessages()\n {\n return $this->_msg;\n }", "public static function ReadMessages(Request $request) {\n if (Usermessage::UpdateStatus($request)) {\n $msgs = Usermessage::where('status', '0')->get()->toArray();\n return Response::json($msgs);\n }\n }", "public function getStatuses() {\n\t}", "public function actionFetchMessages() {\n\t\ttry {\n\t\t\treturn $this->getService('SupportMessage')->fetchMessages();\n\t\t} catch (Exception $e) {\n\t\t\treturn $this->sendError('You have reached error');\n\t\t}\n\t}", "public function getMessages() {\n\t\treturn isset($this->messages) ? $this->messages : [];\n\t}", "public function statusMessage(): string;", "public function actionGetMessages() {\n\n // prepare response array\n $response = array(\n 'status' => true,\n 'records' => array()\n );\n\n // get last message id from client, 0 by default\n\t\t$id = (int)Yii::app()->request->getPost('lastMessageId', 0);\n\n // get messages list from model\n $messages = Chat::model()->getLastMessages($id);\n\n // add messages list to return array\n $response['records'] = $messages;\n\n // encode return arra to JSON\n echo json_encode($response);\n\n // force app to end\n Yii::app()->end();\n\t}", "public function getMessages() {\n return $this->message;\n }", "abstract public static function getStatuses();", "public function get_message_strings() {\n foreach($this->messages as $singleMessage) {\n \n }\n }", "public static function info() {\n return self::instance()->getClient()->get('api/status/info');\n }", "function zen_spectre_starterkit_status_messages($variables) {\n $display = $variables['display'];\n $output = '';\n\n $status_heading = array(\n 'status' => t('Status message'),\n 'error' => t('Error message'),\n 'warning' => t('Warning message'),\n );\n foreach (drupal_get_messages($display) as $type => $messages) {\n $output .= \"<div class=\\\"messages messages--$type\\\">\\n\";\n if (!empty($status_heading[$type])) {\n $output .= '<h2 class=\"visually-hidden\">' . $status_heading[$type] . \"</h2>\\n\";\n }\n\n if (count($messages) > 1) {\n $output .= \" <ul class=\\\"messages__list\\\">\\n\";\n foreach ($messages as $message) {\n $output .= ' <li class=\"messages__item\">' . $message . \"</li>\\n\";\n }\n $output .= \" </ul>\\n\";\n }\n else {\n $output .= reset($messages);\n }\n $output .= \"</div>\\n\";\n }\n return $output;\n}", "public function getCurrentStatus()\n {\n return $this->currentStatus;\n }", "public function get_messages() {\n\t\treturn $this->upgrader_skin->messages;\n\t}", "public static function getReceivedStatus(){\n\t\treturn self::getStatus( 'received' );\n\t}", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "public function getMessages()\n {\n return Controllers\\MessagesController::getInstance();\n }", "public function getMessages()\n {\n return Controllers\\MessagesController::getInstance();\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "private function getStatusMessage(){\n\t\t$status = array(\n\t\t\t\t100 => 'Continue', \n\t\t\t\t101 => 'Switching Protocols', \n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created', \n\t\t\t\t202 => 'Accepted', \n\t\t\t\t203 => 'Non-Authoritative Information', \n\t\t\t\t204 => 'No Content', \n\t\t\t\t205 => 'Reset Content', \n\t\t\t\t206 => 'Partial Content', \n\t\t\t\t300 => 'Multiple Choices', \n\t\t\t\t301 => 'Moved Permanently', \n\t\t\t\t302 => 'Found', \n\t\t\t\t303 => 'See Other', \n\t\t\t\t304 => 'Not Modified', \n\t\t\t\t305 => 'Use Proxy', \n\t\t\t\t306 => '(Unused)', \n\t\t\t\t307 => 'Temporary Redirect', \n\t\t\t\t400 => 'Bad Request', \n\t\t\t\t401 => 'Unauthorized', \n\t\t\t\t402 => 'Payment Required', \n\t\t\t\t403 => 'Forbidden', \n\t\t\t\t404 => 'Not Found', \n\t\t\t\t405 => 'Method Not Allowed', \n\t\t\t\t406 => 'Not Acceptable', \n\t\t\t\t407 => 'Proxy Authentication Required', \n\t\t\t\t408 => 'Request Timeout', \n\t\t\t\t409 => 'Conflict', \n\t\t\t\t410 => 'Gone', \n\t\t\t\t411 => 'Length Required', \n\t\t\t\t412 => 'Precondition Failed', \n\t\t\t\t413 => 'Request Entity Too Large', \n\t\t\t\t414 => 'Request-URI Too Long', \n\t\t\t\t415 => 'Unsupported Media Type', \n\t\t\t\t416 => 'Requested Range Not Satisfiable', \n\t\t\t\t417 => 'Expectation Failed', \n\t\t\t\t500 => 'Internal Server Error', \n\t\t\t\t501 => 'Not Implemented', \n\t\t\t\t502 => 'Bad Gateway', \n\t\t\t\t503 => 'Service Unavailable', \n\t\t\t\t504 => 'Gateway Timeout', \n\t\t\t\t505 => 'HTTP Version Not Supported');\n\t\treturn ($status[$this->_code]) ? $status[$this->_code] : $status[500];\n\t}", "public function getMessages(): array\n {\n return $this->messages;\n }", "public function getMessages(): array\n {\n return $this->messages;\n }", "public function getMessages(): array\n {\n return $this->messages;\n }", "public function getMessages(): array\n {\n return $this->messages;\n }", "public function getAll()\n\t{\n\t\t$msgs = Message::findByUser($this->getUser());\n\t\t$this->updateQueryTime();\n\t\treturn $msgs;\n\t}", "public function messages();" ]
[ "0.7050795", "0.7002872", "0.695769", "0.69143224", "0.6864924", "0.6810795", "0.6810795", "0.6810795", "0.6810795", "0.6810795", "0.6810795", "0.6810795", "0.68090385", "0.68059117", "0.68059117", "0.67970705", "0.674579", "0.6708639", "0.67033625", "0.667633", "0.6673271", "0.6593763", "0.65650165", "0.6547667", "0.65385085", "0.6533275", "0.65299696", "0.65269035", "0.65233296", "0.6509615", "0.6499394", "0.64911526", "0.6484318", "0.6484318", "0.64357126", "0.64357126", "0.64357126", "0.64357126", "0.64357126", "0.64357126", "0.64357126", "0.64302623", "0.6424178", "0.6420445", "0.64191943", "0.64191943", "0.6408857", "0.63980204", "0.6393659", "0.6390516", "0.639035", "0.6390244", "0.6383588", "0.63491994", "0.63491994", "0.6339157", "0.63379794", "0.632361", "0.6321625", "0.6321625", "0.6321625", "0.6321625", "0.6321625", "0.6320568", "0.6320568", "0.6320568", "0.6320568", "0.6320568", "0.6320568", "0.6320568", "0.6320568", "0.63203335", "0.63162273", "0.6298154", "0.6293476", "0.62934047", "0.62894505", "0.62716013", "0.62441576", "0.62415606", "0.6239147", "0.6234307", "0.62309164", "0.62281173", "0.62115973", "0.61965543", "0.6193656", "0.6193656", "0.6191949", "0.6191949", "0.6190862", "0.6190862", "0.6190862", "0.6190862", "0.6187009", "0.6184904", "0.6184904", "0.6184904", "0.6184904", "0.6182057", "0.61792654" ]
0.0
-1
Asserting given response is an instance of service
protected function assertInstanceOfService($response): self { $this->assertInstanceOf(AccountRefresh::class, $response); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testIsResponseClass()\n {\n $cut = new ListAddresses();\n $this->assertInstanceOf('\\Sake\\BlockchainWalletApi\\Response\\ResponseInterface', $cut);\n }", "protected abstract function service(Response $response);", "public function testFromOkResponse() : void {\n $bob = Record::fromName(\"bob\");\n $result = Result::fromResponse(Response::fromQueriedRecords(null, $bob));\n foreach ($result as $object) {\n $this->assertInstanceOf(SalesforceObject::class, $object);\n }\n\n $first = $result->first();\n $this->assertInstanceOf(SalesforceObject::class, $first);\n $this->assertEquals($bob[\"Id\"], $first->Id);\n $this->assertEquals($bob[\"Name\"], $first->Name);\n }", "public function testAssertResponseContains(): void\n {\n $this->_response = new Response();\n $this->_response = $this->_response->withStringBody('Some content');\n\n $this->assertResponseContains('content');\n }", "public function testGetImplementedServiceReturnService()\n {\n $service = $this->factory->messages;\n $this->assertNotEmpty($service);\n $this->assertInstanceOf(ServiceInterface::class, $service);\n }", "public function testObject()\n {\n $this->assertInstanceOf('ZF2XmlApiSendeffect\\Service\\AbstractService', $this->service);\n }", "public function testHttpResponseInstanceOf(UnitTester $I)\n {\n $response = $this->getResponseObject();\n\n $class = Response::class;\n $I->assertInstanceOf($class, $response);\n }", "public function hasValidResponse(RequestEntity $request);", "public function testHandleWithMockServices(): void\n {\n $this->mockService(stdClass::class, function () {\n return json_decode('{\"mock\":true}');\n });\n $this->get('/dependencies/requiredDep');\n $this->assertResponseOk();\n $this->assertResponseContains('\"mock\":true', 'Contains the data from the stdClass mock container.');\n }", "public function testResponseGet()\n {\n $result = json_decode($this->body, true);\n\n $this->assertEquals($this->response->get('Model'), $result['Model']);\n $this->assertEquals($this->response->get('RequestId'), $result['RequestId']);\n $this->assertEquals($this->response->get('Inexistence'), null);\n $this->assertEquals($this->response->get('Inexistence', 'Inexistence'), 'Inexistence');\n }", "public function testAsSuccess(): void\n\t{\n\t\t$my_response_builder = DummyResponseBuilder::asSuccess();\n\t\t$this->assertEquals(DummyResponseBuilder::class, \\get_class($my_response_builder));\n\t}", "public function testGettingResponse()\n {\n $response = new Response(\n json_encode(array(\n 'msg' => 'Testing Beepsend API'\n )), \n array(\n 'http_code' => 200,\n 'Content-Type' => 'application/json'\n )\n );\n \n $value = $response->get();\n $this->assertEquals('Testing Beepsend API', $value['msg']);\n }", "public function testInstancesOf()\n {\n $this->assertInstanceOf('Symfony\\Component\\EventDispatcher\\Event', $this->gearmanClientCallbackExceptionEvent);\n }", "public function testAssertResponseEquals(): void\n {\n $this->_response = new Response();\n $this->_response = $this->_response->withStringBody('Some content');\n\n $this->assertResponseEquals('Some content');\n }", "public function test_can_create_psr7_response(): void {\n\n\t\t$response = HTTP_Helper::response( array( 'key' => 'test_VALUE' ), 500 );\n\n\t\t$body = json_decode( (string) $response->getBody(), true );\n\n\t\t$this->assertInstanceOf( ResponseInterface::class, $response );\n\t\t$this->assertIsArray( $body );\n\t\t$this->assertArrayHasKey( 'key', $body );\n\t\t$this->assertEquals( 'test_VALUE', $body['key'] );\n\t\t$this->assertEquals( 500, $response->getStatusCode() );\n\t}", "public function testCreate()\n {\n $result = new \\Arch\\Output\\HTTP\\Response\\JSON();\n $this->assertInstanceOf('\\Arch\\Output\\HTTP\\Response\\JSON', $result);\n }", "public function it_can_be_instantiated(): void\n {\n $response = new ResponseV3(true);\n\n static::assertTrue($response->isSuccess());\n }", "public function testGetServiceReturnsLazyLoadedObject()\n {\n $service = $this->factory->messages;\n $this->assertNotEmpty($service);\n $this->assertInstanceOf(ServiceInterface::class, $service);\n \n $service2 = $this->factory->messages;\n $this->assertNotEmpty($service);\n $this->assertInstanceOf(ServiceInterface::class, $service);\n $this->assertSame($service, $service2);\n }", "public function testInstanceOf()\n {\n $this->assertInstanceOf('Symfony\\Component\\EventDispatcher\\Event', $this->event);\n }", "abstract protected function checkExistingResponse();", "public function testHandleWithMockServicesFromReflectionContainer(): void\n {\n $this->mockService(ReflectionDependency::class, function () {\n return new ReflectionDependency();\n });\n $this->get('/dependencies/reflectionDep');\n $this->assertResponseOk();\n $this->assertResponseContains('{\"dep\":{}}', 'Contains the data from the reflection container');\n }", "public function testGetWillCreateAndReturnUnregisteredServiceIfTheNameResolvesToAValidClassName(): void\n {\n $container = new Container();\n\n $name = \\stdClass::class;\n $this->assertFalse($container->has($name));\n $service = $container->get(\\stdClass::class);\n\n $this->assertInstanceOf($name, $service);\n $this->assertTrue($container->has($name));\n $this->assertSame($service, $container->get($name));\n }", "public function makeResponse(): ResponseInterface;", "public function testGetAddressFromServiceGoodWay()\n {\n $response = Mockery::mock('Psr\\Http\\Message\\MessageInterface');\n $response->shouldReceive('getBody')->andReturn($this->getAddressFromServiceJson(true));\n $client_mock = Mockery::mock('GuzzleHttp\\Client');\n $client_mock->shouldReceive('request')->andReturn($response);\n $service = new GoogleInformationAddressService($client_mock);\n $service_respose = $service->getAddressFromService(31.4256195, 64.1876011);\n $this->assertEquals(\"False Street\", $service_respose);\n }", "public function testAssertContentType(): void\n {\n $this->_response = new Response();\n $this->_response = $this->_response->withType('json');\n\n $this->assertContentType('json');\n $this->assertContentType('application/json');\n }", "public function testHasWillAssertBooleanTrueForRegisteredService(): void\n {\n $container = new Container();\n\n $name = \\stdClass::class;\n $service = new \\stdClass();\n\n $this->assertFalse($container->has($name));\n\n $container->set($name, $service);\n\n $this->assertTrue($container->has($name));\n }", "public function testReturnInstance()\n {\n $this->assertInstanceOf('\\mate\\Resource\\ResourceInterface', $this->resource,\n 'Return of factory does not implement \\mate\\Resource\\ResourceInterface');\n $this->assertInstanceOf($this->resourceClass, $this->resource,\n 'Factory did not return instance of ' . $this->resourceClass);\n $this->skipFurtherTests = true;\n }", "public function it_can_be_instantiated()\n {\n $expectations = [\n \\Arcanedev\\GeoLocation\\Google\\AbstractService::class,\n \\Arcanedev\\GeoLocation\\Google\\Elevation\\ElevationService::class,\n ];\n\n foreach ($expectations as $expected) {\n static::assertInstanceOf($expected, $this->service);\n }\n }", "public function testNewService()\n {\n $className = 'TechDivision\\ApplicationServer\\Api\\Mock\\MockService';\n $service = $this->service->newService($className);\n $this->assertInstanceOf($className, $service);\n }", "public function testGetClass()\n {\n $viewCounterServiceMock = $this->getMockBuilder(ViewCounter::class)\n ->setConstructorArgs([$this->counterManagerMock, $this->requestStackMock, $this->viewcounterConfigMock])\n ->setMethods(['getClass'])\n ->getMock();\n\n $viewCounterServiceMock\n ->expects($this->once())\n ->method('getClass')\n ->with()\n ->willReturn($this->viewCounterEntityMock);\n\n $viewCounterObject = $this->invokeMethod($viewCounterServiceMock, 'getClass', []);\n\n $this->assertTrue($viewCounterObject instanceof ViewCounterInterface);\n }", "function assertResponseObject($responseObject, $returnValidationMethodOrClassName = 'is_object', $errorCount = 0, $warningCount = 0){\n $this->assertIsA($responseObject, 'RightNow\\Libraries\\ResponseObject');\n if(is_callable($returnValidationMethodOrClassName)){\n $this->assertTrue($returnValidationMethodOrClassName($responseObject->result));\n }\n else{\n $this->assertIsA($responseObject->result, $returnValidationMethodOrClassName);\n }\n $this->assertSame($errorCount, count($responseObject->errors));\n $this->assertSame($warningCount, count($responseObject->warnings));\n }", "public function testGetAddressFromServiceWrongWay()\n {\n $response = Mockery::mock('Psr\\Http\\Message\\MessageInterface');\n $response->shouldReceive('getBody')->andReturn($this->getAddressFromServiceJson(false));\n $client_mock = Mockery::mock('GuzzleHttp\\Client');\n $client_mock->shouldReceive('request')->andReturn($response);\n $service = new GoogleInformationAddressService($client_mock);\n $service_respose = $service->getAddressFromService(31.4256195, 64.1876011);\n $this->assertEquals(null, $service_respose);\n }", "public function testCallReturnObjectContainsTrue()\n {\n $validator = new Rpc( array(\n 'service' => 'SampleRpc',\n 'method' => __FUNCTION__,\n ) );\n\n $validator->setServiceLocator( $this->serviceManager );\n\n $this->rpc\n ->expects( $this->once() )\n ->method( 'call' )\n ->with( $this->equalTo( __FUNCTION__ ),\n $this->equalTo( array( 'value', null ) ) )\n ->will( $this->returnValue( (object) array(\n 'success' => true\n ) ) );\n\n $this->assertTrue( $validator->isValid( 'value' ) );\n }", "public function testGetWillReturnAServiceByName(): void\n {\n $container = new Container();\n\n $name = \\stdClass::class;\n $service = new \\stdClass();\n\n $container->set($name, $service);\n\n $this->assertSame($service, $container->get($name));\n }", "public function test__construct(): void {\n\n $obj = new DepartementsResponse();\n\n $this->assertEquals([], $obj->getDepartements());\n }", "public function test_get_payum()\n {\n\n $payum = m::spy('\\Payum\\Core\\Payum');\n $request = m::spy('\\Illuminate\\Http\\Request');\n $responseFactory = m::spy('\\Illuminate\\Contracts\\Routing\\ResponseFactory');\n $converter = m::spy('\\Payum\\Core\\Bridge\\Symfony\\ReplyToSymfonyResponseConverter');\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $payumService = new PayumService($payum, $request, $responseFactory, $converter);\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $this->assertSame($payum, $payumService->getPayum());\n }", "public function testConstructor()\n {\n // no params\n $result = new ExperimentRecruitingTokenResponse();\n $this->assertEquals('Sizzle\\Bacon\\Database\\ExperimentRecruitingTokenResponse', get_class($result));\n }", "public function testPayload() {\n $payload = array(\n \"this\" => \"is\",\n \"the\" => \"payload\",\n );\n $response = new Response();\n $response->setPayload($payload);\n $this->assertEquals($payload, $response->payload());\n }", "public function test_receive_returnsResponse_ifEntityIsFound()\n\t{\n\t\t$this->url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"foo\":\"bar\"}');\n\t\t\n\t\treturn $this->assertEquals(\n\t\t\t(new Response\\Json())->setData(['foo' => 'bar']), \n\t\t\t(new Client())\n\t\t\t\t->send(new Request\\Get((string) $this->url))\n\t\t\t\t->receive(new Response\\Json())\n\t\t);\n\t}", "public function testInstanceType()\n {\n $this->assertType('HTTP_OAuthProvider_Consumer', $this->consumer);\n }", "public function testOrdersOneResponseStatus()\n\t{\n\t\t$this->client->request('GET', \"/orders/$this->orderId\");\n\t\t$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());\n\n\t\t$this->client->request('GET', '/orders/foo');\n\t\t$this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode());\n\t}", "public static function newInstance($class)\r\n {\r\n // the class exists\r\n $object = new $class();\r\n\r\n if (!($object instanceof sfResponse))\r\n {\r\n // the class name is of the wrong type\r\n $error = 'Class \"%s\" is not of the type sfResponse';\r\n $error = sprintf($error, $class);\r\n\r\n throw new sfFactoryException($error);\r\n }\r\n\r\n return $object;\r\n }", "public function getResponse(): ResponseInterface;", "public function getResponse(): ResponseInterface;", "public function testHandleWithMockServicesOverwrite(): void\n {\n $this->mockService(stdClass::class, function () {\n return json_decode('{\"first\":true}');\n });\n $this->mockService(stdClass::class, function () {\n return json_decode('{\"second\":true}');\n });\n $this->get('/dependencies/requiredDep');\n $this->assertResponseOk();\n $this->assertResponseContains('\"second\":true', 'Contains the data from the stdClass mock container.');\n }", "public function testDataResponse()\n {\n $driverPassesEndpoint = new DriverPassesEndpoint(getenv('MRP_API_KEY'));\n $data = $driverPassesEndpoint->setClassId(1000)\n ->setScheduleId(5508)\n ->setDataOrder('nameAsc')\n ->setDriverId(1023)\n ->setEndDate('8/21/2016')\n ->setStartDate('8/21/2015')\n ->getRequest();\n\n $this->assertNotEmpty($data);\n $this->assertTrue(is_object($data));\n $this->assertEquals(1, $data->RequestValid);\n }", "public function me():ResponseInterface;", "public function deserializeResponse(string $response): Response;", "public function testHasWillAssertBooleanFalseForNonRegisteredService(): void\n {\n $container = new Container();\n\n $name = \\stdClass::class;\n\n $this->assertFalse($container->has($name));\n }", "private function checkDataStructure($response)\n {\n $this->assertInstanceOf(Data::class, $response);\n $this->assertIsArray($response->data);\n foreach ($response->data as $ticker) {\n $this->assertInstanceOf(Ticker::class, $ticker);\n $this->assertIsString($ticker->slug);\n $this->assertIsString($ticker->title);\n $this->assertIsString($ticker->symbol);\n $this->assertIsInt($ticker->rank);\n $this->assertIsFloat($ticker->price);\n $this->assertIsFloat($ticker->volume);\n }\n }", "public function testInstanceOf ()\n {\n $this->assertInstanceOf('Noherczeg\\Breadcrumb\\Translator', $this->tran);\n }", "public function testGetService()\n {\n $app = new \\Cilex\\Application('Test');\n $app->command($this->fixture);\n\n $this->assertInstanceOf(\n '\\Symfony\\Component\\Console\\Application',\n $this->fixture->getService('console')\n );\n }", "public function testStructuredSuccessResponse()\n {\n $data = [\n 'items' => [\n 'company' => 'Google',\n 'website' => 'https://www.google.com/',\n 'address' => [\n 'line1' => '111 8th Ave',\n 'line2' => '4th Floor',\n 'state' => 'NY',\n 'city' => 'New York',\n 'zip' => '10011'\n ]\n ]\n ];\n\n $success = $this->response->success($data);\n json_decode($success);\n $checkJson = (json_last_error() == JSON_ERROR_NONE);\n\n $this->assertTrue($checkJson);\n }", "public function createResponse(): IResponse;", "public function __construct(ServicesContract $services, ResponseContract $response);", "private function checkResponseIsSet()\n {\n if ($this->response === null) {\n $this->fail('Must call call() before assertions');\n }\n }", "protected function _assertJsonApiResponse()\n {\n $this->assertHeader('Content-Type', 'application/vnd.api+json');\n $this->assertContentType('application/vnd.api+json');\n }", "public function testPlaceDetailsService()\n {\n self::$placesService->setPlaceDetailsService(new PlaceDetailsService());\n $this->assertInstanceOf('Ivory\\GoogleMapBundle\\Model\\Services\\Places\\PlaceDetailsService', self::$placesService->getPlaceDetailsService());\n }", "public function response(): ResponseContract;", "public function getResponse($response) {\r\n\r\n\r\n }", "public function testCreateResponse()\n {\n $config = [\n 'app_base_path' => __DIR__ . '/test_app',\n 'security.config' => [],\n ];\n\n $_SERVER['REQUEST_URI'] = '/';\n $_SERVER['REQUEST_METHOD'] = 'GET';\n\n $response = new Response('test');\n\n $route = $this->getMockBuilder(Route::class)\n ->setMethods(['handle'])\n ->getMock();\n $route->expects($this->once())\n ->method('handle')\n ->willReturn($response);\n $route->setPath('/');\n\n $app = $this->getMockBuilder(Application::class)\n ->setConstructorArgs([$config])\n ->setMethods(['sessionStart', 'sendResponse'])\n ->getMock();\n $app->expects($this->once())\n ->method('sendResponse')\n ->with($this->identicalTo($response));\n\n // Adding a route using the service to be able to match them perfectly.\n $app->get('routing')->addRoute($route);\n\n $app->run();\n }", "public function if_is_instance_of_contract()\n {\n $this->assertInstanceOf('App\\Contract', self::$contract);\n }", "public function testInstance()\n {\n static::assertInstanceOf(ShoppingListActionBuilder::class, $this->fixture);\n }", "public function testAssertResponseNotContains(): void\n {\n $this->_response = new Response();\n $this->_response = $this->_response->withStringBody('Some content');\n\n $this->assertResponseNotContains('contents');\n }", "public function testInstanceOfLoan()\n {\n $loan = new Loan([\n ]);\n $this->assertInstanceOf(Loan::class, $loan);\n }", "public function testNewInstance()\n {\n $className = 'TechDivision\\ApplicationServer\\Api\\Mock\\MockService';\n $instance = $this->service->newInstance($className, array(\n $this->service->getInitialContext(),\n \\Mutex::create(false)\n ));\n $this->assertInstanceOf($className, $instance);\n }", "public function testGetItemById(){\n $mockedService = Mockery::mock('DealfishService'); \n $mockedService->shouldReceive('findItemById')->with(10)->once()->andReturn('Foo');\n $this->app->instance('DealfishService', $mockedService);\n\n $crawler = $this->client->request('GET', '/item/10');\n\t\t$this->assertTrue($this->client->getResponse()->isOk());\n\t}", "public function testGetExistingResource()\n {\n $resource = $this->client->Invoices();\n $this->assertInstanceOf(\n BaseResource::class,\n $resource\n );\n }", "public function testSuccessfulResponseDataFormatForConfirmProcessWithValidSuccessfulStatus(): void\n {\n $this->tryTestWithRequest();\n $this->assertTrue($this->response->getOriginalResponse()->isSuccessful());\n }", "private function examineResponse($json) {\n $decoded = json_decode($json);\n\n if ( isset($decoded->error) ) {\n error_log('Web Service Responded With Error: ' . $decoded->error->message . ' : ' . $decoded->error->code);\n throw new EmmaDashboardServiceException('Service Error, please contact Administrator.');\n }\n }", "public function testFactory()\n {\n $actual = Solar::factory('Solar_Auth_Logout');\n $expect = 'Solar_Auth_Logout_Adapter';\n $this->assertInstance($actual, $expect);\n }", "public function testAssertResponseNotEquals(): void\n {\n $this->_response = new Response();\n $this->_response = $this->_response->withStringBody('Some content');\n\n $this->assertResponseNotEquals('Some Content');\n }", "public function test__construct()\n {\n $obj = Solar::factory('Solar_Json');\n $this->assertInstance($obj, 'Solar_Json');\n }", "public function testCanRetrieveAuthenticationServiceSingleton(): void\n {\n // Performs test.\n $service1 = AuthenticationServiceFactory::get();\n $service2 = AuthenticationServiceFactory::get();\n\n // Performs assertion.\n $this->assertSame($service1, $service2);\n }", "public function createFooResponseValidator(): ResponseValidatorInterface\n {\n return new AcmeFooResponseValidator();\n }", "public function testGetCreatedResponse()\n {\n /** @noinspection PhpMethodParametersCountMismatchInspection */\n $this->mockResponses->shouldReceive('createResponse')->once()\n ->withArgs(['content', 201, ['Location' => '/resource/123', 'Content-Type' => 'some/type']])\n ->andReturn('something');\n\n $mediaType = new MediaType('some', 'type');\n\n /** @var EncoderInterface $encoder */\n $this->assertEquals('something', $this->factory->getCreatedResponse(\n '/resource/123',\n $mediaType,\n 'content'\n ));\n }", "public function Response($response);", "function media_theplatform_mpx_check_json_response($response, $service) {\n // No response\n if(!strlen($response))\n return array('status' => 'error', 'response' => t('No response from @service', array('@service' => $service)));\n // Decode JSON\n $responseObject = json_decode($response);\n // Make sure the response decodes, if not, return it's text\n if(!is_object($responseObject))\n return array('status' => 'error', 'response' => t('Error response from @service: @response', array('@service' => $service, '@response' => $response)));\n // Check for an exception on the response, return it's description if set\n if(property_exists($responseObject, 'isException'))\n return array('status' => 'error', 'response' => t('Exception from @service: @response', array('@service' => $service, '@response' => $responseObject->description)));\n // Looking good, return the response object\n else\n return array('status' => 'success', 'response' => $responseObject);\n}", "public function testGetService()\n {\n try {\n $this->cosClient->ListBuckets();\n $this->assertTrue(True);\n } catch (ServiceResponseException $e) {\n $this->assertFalse(True);\n }\n }", "public function testGetServiceCall()\n {\n $this->_markTestAsRestOnly();\n $itemId = 1;\n $name = 'Test';\n $serviceInfo = [\n 'rest' => [\n 'resourcePath' => '/V1/testmodule4/' . $itemId,\n 'httpMethod' => \\Magento\\Webapi\\Model\\Rest\\Config::HTTP_METHOD_GET,\n ],\n ];\n $item = $this->_webApiCall($serviceInfo, [], null, null, $this->integration);\n $this->assertEquals($itemId, $item['entity_id'], 'id field returned incorrectly');\n $this->assertEquals($name, $item['name'], 'name field returned incorrectly');\n }", "public static function isResponse($msg): bool\n {\n return is_object($msg) && property_exists($msg, 'id') && (property_exists($msg, 'result') || isset($msg->error));\n }", "public function testReturnsResponse()\n {\n $controller = new YatzyController();\n $this->assertInstanceOf(\"App\\Http\\Controllers\\YatzyController\", $controller);\n\n $response = $this->get('/yatzy');\n\n $response->assertStatus(200);\n }", "public function testControllerReturnsResponse()\n {\n $controller = new DiceGame();\n\n $exp = \"Illuminate\\View\\View\";\n $res = $controller->index();\n $this->assertInstanceOf($exp, $res);\n }", "public function testInstance()\n {\n $this->assertInstanceOf(Product::class, $this->subject);\n $this->assertInstanceOf(Base::class, $this->subject);\n }", "function __construct(ResponseFactory $response)\n {\n $this->response = $response;\n }", "public function testValidCase()\n {\n $this->mock(AlphaVantageApiService::class, function ($mock) {\n return $mock->shouldReceive('querySymbol')\n ->once()\n ->andReturn(new \\GuzzleHttp\\Psr7\\Response(\n Response::HTTP_OK,\n [],\n '{\n \"Global Quote\": {\n \"01. symbol\": \"AMZN\",\n \"02. open\": \"3185.5600\",\n \"03. high\": \"3228.8600\",\n \"04. low\": \"3183.0000\",\n \"05. price\": \"3222.9000\",\n \"06. volume\": \"3325022\",\n \"07. latest trading day\": \"2021-05-14\",\n \"08. previous close\": \"3161.4700\",\n \"09. change\": \"61.4300\",\n \"10. change percent\": \"1.9431%\"\n }\n }'\n ));\n });\n\n $response = $this->getJson('api/stock-quotes?symbol=AMZN');\n $response->assertStatus(Response::HTTP_CREATED);\n $response->assertJson([\n 'id' => 1,\n 'symbol' => 'AMZN',\n 'high' => \"3228.8600\",\n 'low' => \"3183.0000\",\n 'price' => \"3222.9000\",\n ]);\n }", "public function testStatusDefaultsTo200OnCreation()\n {\n $response = new Response();\n $this->assertEquals(200, $response->getStatus());\n }", "public function assertResponseContent($content)\n {\n $this->assertEquals(\n $content,\n $this->getResponse()->getBody(),\n \"Failed asserting that response body is '$content'\"\n );\n }", "public function testHandleWithContainerDependencies(): void\n {\n $this->get('/dependencies/requiredDep');\n $this->assertResponseOk();\n $this->assertResponseContains('\"key\":\"value\"', 'Contains the data from the stdClass container object.');\n }", "public function testCanGetClientFromResource()\n {\n $invoicesResource = $this->client->Invoices();\n\n $this->assertInstanceOf(\n Client::class,\n $invoicesResource->getClient()\n );\n }", "public function testSettingStatusOnCreation()\n {\n $response = new Response(array('status' => 404));\n $this->assertEquals(404, $response->getStatus());\n }", "public function testIfClassCanBeCreated()\n {\n $this->assertInstanceOf(Validator::class, $this->_validator);\n }", "public function testValidXml() {\r\n\t\t$xml=\"<xml><test>works</test></xml>\";\r\n\t\t$actual = Response::xml($xml);\r\n\t\r\n\t\t$this->assertEquals($actual->test, 'works');\r\n\t}", "public function testPlaceSearchService()\n {\n self::$placesService->setPlaceSearchService(new PlaceSearchService());\n $this->assertInstanceOf('Ivory\\GoogleMapBundle\\Model\\Services\\Places\\PlaceSearchService', self::$placesService->getPlaceSearchService());\n }", "public function assertResponseOk()\n {\n $this->assertResponseStatusCode(200);\n }", "public function GetResponseClass ();", "public function testReturnEntityClass()\n {\n $this->assertInstanceOf(Tree::class, TreeFactory::createFromArray($this->request));\n }", "public function testHttpResponseHeadersInstanceOf(UnitTester $I)\n {\n $headers = new Headers();\n\n $I->assertInstanceOf(\n Headers::class,\n $headers\n );\n }", "public function youCanMakeSuccessResponses()\n {\n // Arrange...\n $fruit = $this->createTestModel();\n\n // Act...\n $response = $this->responder->success( $fruit );\n\n // Assert...\n $this->assertInstanceOf( JsonResponse::class, $response );\n $this->assertEquals( $response->getStatusCode(), 200 );\n $this->assertEquals( $response->getData( true ), [\n 'status' => 200,\n 'success' => true,\n 'data' => [\n 'name' => 'Mango',\n 'price' => 10,\n 'isRotten' => false\n ]\n ] );\n }", "public function youCanMakeSuccessResponses()\n {\n // Arrange...\n $fruit = $this->createTestModel();\n\n // Act...\n $response = $this->responder->success( $fruit );\n\n // Assert...\n $this->assertInstanceOf( JsonResponse::class, $response );\n $this->assertEquals( $response->getStatusCode(), 200 );\n $this->assertEquals( $response->getData( true ), [\n 'status' => 200,\n 'success' => true,\n 'data' => [\n 'name' => 'Mango',\n 'price' => 10,\n 'isRotten' => false\n ]\n ] );\n }" ]
[ "0.70991033", "0.6104187", "0.6100889", "0.60982686", "0.60323614", "0.6004992", "0.59792525", "0.5903631", "0.586578", "0.5843244", "0.58300954", "0.5768745", "0.5723586", "0.5719957", "0.56912833", "0.5666353", "0.56356555", "0.5622675", "0.5589653", "0.555751", "0.5520184", "0.5505337", "0.5494064", "0.54822487", "0.5438052", "0.54154754", "0.5411518", "0.5402318", "0.5390444", "0.53812045", "0.5368527", "0.5365952", "0.5360891", "0.53531796", "0.5347927", "0.5343528", "0.53146553", "0.5300405", "0.5274812", "0.52559656", "0.5250596", "0.5248137", "0.5242745", "0.5242745", "0.52364135", "0.5228322", "0.5213915", "0.52014035", "0.51977825", "0.5186817", "0.51859725", "0.5180534", "0.51735413", "0.51730204", "0.51544505", "0.51490885", "0.51389384", "0.51356375", "0.5134807", "0.5128722", "0.51278013", "0.5121533", "0.51172334", "0.5116364", "0.51148856", "0.5112566", "0.5109173", "0.50941515", "0.508672", "0.5083768", "0.50756806", "0.5074554", "0.50695413", "0.50646704", "0.5061708", "0.5057208", "0.5056644", "0.50544393", "0.5053229", "0.5052543", "0.50506055", "0.504813", "0.50477064", "0.5045931", "0.5041667", "0.5037006", "0.50365597", "0.503019", "0.5029148", "0.50286996", "0.5027662", "0.5026053", "0.50232697", "0.5020874", "0.5018282", "0.50165117", "0.5014425", "0.50141364", "0.501057", "0.501057" ]
0.6362999
1
Setting mocked now value
protected function mockNow(): self { $this->mocked_now = now(); $this->mockCarbonNow($this->mocked_now); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function setTestingNow(\\DateTime $date = null)\n {\n self::$now = $date;\n }", "protected function setUpFakeDateTime()\n {\n $date = null;\n if (method_exists($this, 'fakeDateTime')) {\n $date = $this->fakeDateTime();\n } elseif (property_exists($this, 'fakeDateTime')) {\n $date = $this->fakeDateTime;\n }\n\n if (is_int($date)) {\n $date = Carbon::createFromTimestamp($date);\n }\n\n if (is_string($date)) {\n $date = Carbon::parse($date);\n }\n\n if ($date instanceof DateTimeInterface) {\n Carbon::setTestNow($date);\n }\n }", "public function testCurrentTime0()\n{\n\n $actual = $this->systemTimeProvider->currentTime();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testSetValues()\n {\n $this->todo('stub');\n }", "public function testSetValue()\n {\n $this->todo('stub');\n }", "function set_date_to_now()\n {\n $this->timestamp=time();\n }", "public function testSendDefaultTime(): void\n {\n // Testing default value of a $now variable. Asserted below with generous\n // delta.\n $expectedDate = new DateTime('now');\n\n $activityData = new ActivityDataStub();\n\n $activityPersister = new ActivityPersisterStub();\n $activityPersister->setNextSequence(5);\n $dispatcher = new EventDispatcherStub();\n $payloadManager = new PayloadManagerStub();\n $payloadManager->addPayload(['payload' => 'wot']);\n\n $manager = $this->getManager(\n $dispatcher,\n $payloadManager,\n $activityPersister\n );\n\n $manager->send(new Provider('provider', 'Test Provider Inc.'), $activityData);\n\n $saved = $activityPersister->getSaved();\n $activity = \\reset($saved);\n\n self::assertArrayHasKey('occurredAt', $activity);\n\n // Asserts the expected date is within 10 seconds of the generated now inside the\n // service.\n self::assertEqualsWithDelta($expectedDate, $activity['occurredAt'], 10);\n }", "public function testReenable()\n {\n $mock = new Mock(\n __NAMESPACE__,\n \"time\",\n function () {\n return 1234;\n }\n );\n $mock->enable();\n $mock->disable();\n $mock->enable();\n $this->assertEquals(1234, time());\n }", "public function testGetNowDate()\n {\n $viewCounterServiceMock = $this->getMockBuilder(ViewCounter::class)\n ->setConstructorArgs([$this->counterManagerMock, $this->requestStackMock, $this->viewcounterConfigMock])\n ->setMethods(['getPage'])\n ->getMock();\n\n $nowDate = $this->invokeMethod($viewCounterServiceMock, 'getNowDate', []);\n\n $this->assertTrue($nowDate instanceof \\DateTime);\n }", "private function resetNow()\n {\n $this->now = time();\n }", "public function assertUpdateDefaults() {\n\t\t\t$this->set('lastModified', 'NOW()', false);\n\t\t\t$this->enclose('lastModified', false);\n\t\t}", "public function mocked_returns_set_value_test()\n {\n $mocked = new Mocked('user', VarStore::singleton());\n // what would be set in a class when using Mocked::class\n $mocked->name->class = 'test';\n\n $this->assertContains('=> [\"test\"]', (string)$mocked->name->class);\n $this->assertSame('user->name->class => [\"test\"]', (string)$mocked->name->class);\n $this->assertNotSame('user->name->class => [\"test\"]', (string)$mocked->name->class->data);\n }", "public function testSetPermisExpireLe() {\n\n // Set a Date/time mock.\n $permisExpireLe = new DateTime(\"2018-09-10\");\n\n $obj = new Employes();\n\n $obj->setPermisExpireLe($permisExpireLe);\n $this->assertSame($permisExpireLe, $obj->getPermisExpireLe());\n }", "public function setModifiedValue()\n {\n $this->setModified(new \\DateTime());\n }", "public function testSetTime() {\n $time = new \\DateTime();\n $this->order->setTime($time);\n $this->assertEquals($time, $this->order->getTime());\n }", "public function test_now_vs_then(){\n\t\n\t\t$listotron = new Listotron();\n\t\t$now = $listotron->getNOW();\n\t\tusleep(300);\n\t\t$listotron->updateNOW();\n\t\t$then = $listotron->getNOW();\n\n\t\t$this->assertNotEqual($now, $then);\n\t}", "public function testUpdatedAt()\n {\n $value = date('Y-m-d H:i:s');\n\n $model = $this->getOfferModel();\n\n $model->setUpdatedAt($value);\n\n $this->assertEquals($value, $model->getUpdatedAt());\n }", "final public function newlySetValueIsReturnedWithGetValue(): void\n {\n $dataType = new DataTypeMock();\n $this->assertTrue($dataType->isEqual(null));\n\n $someObject = new stdClass();\n $dataType->setValue($someObject);\n $this->assertTrue($dataType->isEqual($someObject));\n }", "public function testSetHeureFinMob() {\n\n // Set a Date/time mock.\n $heureFinMob = new DateTime(\"2018-09-10\");\n\n $obj = new PointBonTrav();\n\n $obj->setHeureFinMob($heureFinMob);\n $this->assertSame($heureFinMob, $obj->getHeureFinMob());\n }", "public function testSetHeureDebMob() {\n\n // Set a Date/time mock.\n $heureDebMob = new DateTime(\"2018-09-10\");\n\n $obj = new PointBonTrav();\n\n $obj->setHeureDebMob($heureDebMob);\n $this->assertSame($heureDebMob, $obj->getHeureDebMob());\n }", "public function testSetDate()\n {\n $month = new Month();\n\n $date = date_create('now');\n $month->setDate($date);\n\n $this->assertEquals($date, $month->getDate());\n }", "public function testSetDateAdded() {\n\n // Set a Date/time mock.\n $dateAdded = new DateTime(\"2018-09-10\");\n\n $obj = new iSessions();\n\n $obj->setDateAdded($dateAdded);\n $this->assertSame($dateAdded, $obj->getDateAdded());\n }", "function test()\n {\n $this->updated = '2010-01-18 11:39';\n $this->created = '2010-01-18 08:48';\n }", "function SimpleMock() {\n $this->actions = new SimpleCallSchedule();\n $this->expectations = new SimpleCallSchedule();\n $this->call_counts = array();\n $this->expected_counts = array();\n $this->max_counts = array();\n $this->expected_args = array();\n $this->expected_args_at = array();\n $this->getCurrentTestCase()->tell($this);\n }", "public function testGetAndSetSetting()\n {\n $this->assertEquals(0, $this->fixture->getSetting('foo'));\n\n $this->fixture->setSetting('foo', 'bar');\n\n $this->assertEquals('bar', $this->fixture->getSetting('foo'));\n }", "protected function setUp()\n {\n global $header;\n $header = array();\n unset($_SERVER['IF_MODIFIED_SINCE']);\n $this->object = new LastModified(function () {\n return new \\DateTime('2011-11-11 11:11:12');\n\n });\n }", "public function set(DateTimeImmutable $nowCurrent): void\n {\n $this->interval = $this->realClockService->get()->diff($nowCurrent);\n $this->sesionSection->offsetSet(static::INTERVAL, serialize($this->interval));\n }", "public function testSetDateRefBt() {\n\n // Set a Date/time mock.\n $dateRefBt = new DateTime(\"2018-09-10\");\n\n $obj = new PointBonTrav();\n\n $obj->setDateRefBt($dateRefBt);\n $this->assertSame($dateRefBt, $obj->getDateRefBt());\n }", "public function testItReturnsTheCurrentDateTimeWithARealClock()\n {\n // issues due to $now possibly being equal to $before\n\n // Sleeping for 5ms is enough on PHP 7.1+\n $timeToSleep = 5000;\n\n // Before PHP 7.1, microseconds were not included when constructing date\n // objects, so we need to sleep for an entire second\n if (version_compare(PHP_VERSION, '7.1.0', '<')) {\n $timeToSleep = 1000 * 1000;\n }\n\n $before = new DateTimeImmutable();\n\n usleep($timeToSleep);\n\n $now = new DateTimeImmutable(Date::now());\n\n usleep($timeToSleep);\n\n $after = new DateTimeImmutable();\n\n $this->assertGreaterThan($before, $now);\n $this->assertLessThan($after, $now);\n }", "public function testGetMaxAge0()\n{\n\n $actual = $this->setCookie->getMaxAge();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testFake0()\n{\n\n $actual = $this->bus->fake();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testIsExpired0()\n{\n\n $actual = $this->setCookie->isExpired();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testSetDateActive() {\n\n // Set a Date/time mock.\n $dateActive = new DateTime(\"2018-09-10\");\n\n $obj = new iSessions();\n\n $obj->setDateActive($dateActive);\n $this->assertSame($dateActive, $obj->getDateActive());\n }", "public function testGetExpires0()\n{\n\n $actual = $this->setCookie->getExpires();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testSetDateNotification() {\n\n // Set a Date/time mock.\n $dateNotification = new DateTime(\"2018-09-10\");\n\n $obj = new AttestationCacm();\n\n $obj->setDateNotification($dateNotification);\n $this->assertSame($dateNotification, $obj->getDateNotification());\n }", "public function testSetDateRedir() {\n\n // Set a Date/time mock.\n $dateRedir = new DateTime(\"2018-09-10\");\n\n $obj = new AppelsEnCours();\n\n $obj->setDateRedir($dateRedir);\n $this->assertSame($dateRedir, $obj->getDateRedir());\n }", "public function testSetHeureDeb() {\n\n // Set a Date/time mock.\n $heureDeb = new DateTime(\"2018-09-10\");\n\n $obj = new PointBonTrav();\n\n $obj->setHeureDeb($heureDeb);\n $this->assertSame($heureDeb, $obj->getHeureDeb());\n }", "protected function setUp()\n {\n $format = new HttpDateFormat(-540);\n $time = new Timestamp(2012, 5, 21, 8, 34, 45);\n $this->object = new HttpDate(\"Last-Modified\", $time, $format);\n }", "public function testDatetimeSetCorrectly()\n {\n $property = $this->logger_reflection->getProperty('datetime');\n $property->setAccessible(TRUE);\n\n $this->assertInstanceOf('Lunr\\Core\\DateTime', $property->getValue($this->logger));\n }", "public function testSetSignDate() {\n\n // Set a Date/time mock.\n $signDate = new DateTime(\"2018-09-10\");\n\n $obj = new AttestationCacm();\n\n $obj->setSignDate($signDate);\n $this->assertSame($signDate, $obj->getSignDate());\n }", "public function testGetLastUseDate()\n {\n $this->assertEquals($this->attributes->{'last use date'}, \n $this->user->getLastUseDate());\n }", "public function testSetDatePassage() {\n\n // Set a Date/time mock.\n $datePassage = new DateTime(\"2018-09-10\");\n\n $obj = new PointBonTrav();\n\n $obj->setDatePassage($datePassage);\n $this->assertSame($datePassage, $obj->getDatePassage());\n }", "public function testSetHeuresNuit() {\n\n // Set a Date/time mock.\n $heuresNuit = new DateTime(\"2018-09-10\");\n\n $obj = new PointBonTrav();\n\n $obj->setHeuresNuit($heuresNuit);\n $this->assertSame($heuresNuit, $obj->getHeuresNuit());\n }", "private function mockCache()\n {\n $this->objectManager->configure([\n 'preferences' => [\n Cache::class => DummyCache::class\n ]\n ]);\n }", "public function testSetDateFinUtil() {\n\n // Set a Date/time mock.\n $dateFinUtil = new DateTime(\"2018-09-10\");\n\n $obj = new Materiels();\n\n $obj->setDateFinUtil($dateFinUtil);\n $this->assertSame($dateFinUtil, $obj->getDateFinUtil());\n }", "public function now();", "public function testUpdateTimesheet()\n {\n }", "public function testSetDateModification() {\n\n // Set a Date/time mock.\n $dateModification = new DateTime(\"2018-09-10\");\n\n $obj = new Employes();\n\n $obj->setDateModification($dateModification);\n $this->assertSame($dateModification, $obj->getDateModification());\n }", "private function setMockDataConfig() {\n\n }", "public function setData()\n {\n $this->data=new \\DateTime('now');\n\n }", "public static function resetCurrentTime()\n {\n \tself::$_currentTime = 'now';\n }", "public function testTime()\n {\n $this->assertEquals(self::$cache->time('Toaster'), '');\n\n //Standard function test\n self::$cache->set('Toaster', 'Test', 5);\n\n $this->assertEquals(self::$cache->time('Toaster'), time());\n }", "public function nowMutable(): \\DateTime;", "function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}", "public function shouldGetMeasurementTime(): void\n {\n $expectedValue = $this->faker->dateTime();\n\n $this->waqi->shouldReceive('getMeasurementTime')\n ->once()\n ->withNoArgs()\n ->andReturn($expectedValue);\n\n $result = $this->waqi->getMeasurementTime();\n\n $this->assertEquals($expectedValue, $result);\n $this->assertInstanceOf(\\DateTime::class, $result);\n $this->assertNotEmpty($result);\n $this->assertNotNull($result);\n }", "#[@test]\n public function returnValue_canSetGet() {\n $this->sut->setReturn('foo');\n $this->assertEquals('foo', $this->sut->getReturn());\n }", "public function testGetValues()\n {\n $this->todo('stub');\n }", "public function test() {\r\n $this->vkdata = date(\"Y-m-d H:i:s\");\r\n\r\n }", "public function testSet()\n {\n $this->container->set('foo', 'newValue');\n $this->assertEquals('newValue', $this->container->get('foo'));\n }", "public function test_updateSettings() {\n\n }", "public function testUpdated()\n {\n \t$player_factory = factory(KillingMode::class)->create();\n \t$player_factory->mode = sprintf('Randon mode %s', microtime());\n\n $this->assertTrue($player_factory->save());\n }", "public function testBackup_now() {\n\t\t$this->backup->backup_now();\n\t\t$schedule = wp_next_scheduled( 'execute_instant_drobox_backup' );\n\t\t$this->assertEquals( time(), $schedule );\n\t}", "public function testGetValue()\n {\n $this->todo('stub');\n }", "public static function simulate_new_request() {\n self::$now += 0.1;\n self::$purgetoken = null;\n }", "public function test_updating() {\n\t\t$key = rand_str();\n\n\t\t// Setting temporary should be true.\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, 'value1', 5 ) );\n\n\t\t// Direct retrieval of temporary value should return set value.\n\t\t$this->assertEquals( get_site_option( '_site_temporary_' . $key ), 'value1' );\n\n\t\t// Direct retrieval of temporary timeout should be integer and greater than current time.\n\t\t$raw_key1_timeout_before_sleep = get_site_option( '_site_temporary_timeout_' . $key );\n\t\t$this->assertTrue( is_int( $raw_key1_timeout_before_sleep ) );\n\t\t$this->assertGreaterThan( time(), $raw_key1_timeout_before_sleep );\n\n\t\t// Getting of temporary should return set value.\n\t\t$this->assertEquals( WP_Temporary::get_site( $key ), 'value1' );\n\n\t\t// Updating temporary should be true.\n\t\t$this->assertTrue( WP_Temporary::update_site( $key, 'value1-update1', 5 ) );\n\n\t\t// Getting of temporary should return updated value.\n\t\t$this->assertEquals( WP_Temporary::get_site( $key ), 'value1-update1' );\n\n\t\t// Timeout should be unchanged.\n\t\t$this->assertEquals( $raw_key1_timeout_before_sleep, get_site_option( '_site_temporary_timeout_' . $key ) );\n\n\t\t// Sleep for two minutes.\n\t\tsleep( 2 * MINUTE_IN_SECONDS );\n\n\t\t// Updating temporary should be true.\n\t\t$this->assertTrue( WP_Temporary::update_site( $key, 'value1-update2', 5 ) );\n\n\t\t// Getting of temporary should return updated value.\n\t\t$this->assertEquals( WP_Temporary::get_site( $key ), 'value1-update2' );\n\n\t\t// Direct retrieval of temporary timeout should be integer, and greater than current time or timeout before sleep.\n\t\t$raw_key1_timeout_after_sleep = get_site_option( '_site_temporary_timeout_' . $key );\n\t\t$this->assertTrue( is_int( $raw_key1_timeout_after_sleep ) );\n\t\t$this->assertGreaterThan( time(), $raw_key1_timeout_after_sleep );\n\t\t$this->assertGreaterThan( $raw_key1_timeout_before_sleep, $raw_key1_timeout_after_sleep );\n\t}", "private function configureMock()\n {\n $this->controller->expects($this->once())->method('doSomething')->with($this->parameters);\n }", "public function getNow(): \\DateTimeImmutable;", "public function testSetHeuresJour() {\n\n // Set a Date/time mock.\n $heuresJour = new DateTime(\"2018-09-10\");\n\n $obj = new PointBonTrav();\n\n $obj->setHeuresJour($heuresJour);\n $this->assertSame($heuresJour, $obj->getHeuresJour());\n }", "public function setValueDefault()\n {\n $this->createdAt = new \\DateTime();\n }", "public function testSettingTs()\n {\n $groupsMark = new GroupsMark();\n $returnedObject = $groupsMark->setTs($this->dummyString);\n $refGroupsMark = new \\ReflectionObject($groupsMark);\n $tsProperty = $refGroupsMark->getProperty('ts');\n $tsProperty->setAccessible(true);\n $this->assertInstanceOf(GroupsMark::class, $returnedObject);\n $this->assertEquals($this->dummyString, $tsProperty->getValue($groupsMark));\n }", "public function testSaveValue()\n {\n $faker = Factory::create();\n $data = [\n $faker->unixTime => $faker->sentence,\n ];\n $response = $this->json('POST', '/api/values', $data);\n $response\n ->assertStatus(201)\n ->assertJson($data);\n }", "public function setUp() {\n\t\t$this->mockDecoratedRequestEngine = $this->getMockBuilder('TYPO3\\Flow\\Http\\Client\\RequestEngineInterface')->getMock();\n\t\t$this->cacheAwareRequestEngine = new CacheAwareRequestEngine($this->mockDecoratedRequestEngine);\n\n\t\t$this->mockRequestCache = $this->getMockBuilder('TYPO3\\Flow\\Cache\\Frontend\\VariableFrontend')->disableOriginalConstructor()->getMock();\n\t\t$this->inject($this->cacheAwareRequestEngine, 'requestCache', $this->mockRequestCache);\n\n\t\t# simulating a date in order to test absolute expiration dates\n\t\t$this->mockNow = new Now('Sat, 13 Dec 2014 20:00:00 +0100');\n\t\t$this->inject($this->cacheAwareRequestEngine, 'now', $this->mockNow);\n\n\t\t# we use real request/response objects by intention (otherwise there are too many mocks to create)\n\t\t$this->mockRequest = new Request(array(), array(), array(), array());\n\t\t$this->mockResponse = new Response();\n\t}", "public function testSetReponse() {\n\n $obj = new AppelsEnCours();\n\n $obj->setReponse(\"reponse\");\n $this->assertEquals(\"reponse\", $obj->getReponse());\n }", "public function testPropertyDateModified($value)\n {\n $object = new Metadata();\n $object->setDateModified($value);\n\n $this->assertEquals($value, $object->getDateModified());\n }", "public function refreshUpdated() {\n $this->setUpdated(new \\DateTime(\"now\"));\n}", "function testResetToday() {\n $counter = Counter::findOne(1);\n\n $startDate = Carbon::now()->subDays(5);\n $resetDate = Carbon::now($counter->getTimeZone());\n \n codecept_debug(\"Start Date: {$startDate->toAtomString()} {$startDate->getTimeZone()->getName()}\");\n codecept_debug(\"Reset Date: {$resetDate->toAtomString()} {$resetDate->getTimeZone()->getName()}\");\n\n //Test precondition\n $this->tester->seeInDatabase('History', ['counterId'=>1, 'startDate'=>$startDate->toDateString(),\n 'endDate'=>null]);\n\n Counter::findOne(1)->reset($resetDate->toDateString());\n\n //Test the results after reset\n $this->tester->seeInDatabase('History', ['counterId'=>1, 'startDate'=>$startDate->toDateString(),\n 'endDate'=>$resetDate->toDateString()]);\n $this->tester->seeInDatabase('History', ['counterId'=>1, 'startDate'=>$resetDate->toDateString(),\n 'endDate'=>null]);\n }", "public function testSetType()\n {\n $this->todo('stub');\n }", "public function testGetDefaultDriver0()\n{\n\n $actual = $this->cacheManager->getDefaultDriver();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function testResetDateGreaterThanToday() {\n Counter::findOne(1)->reset(Carbon::now()->addDays(1)->toDateString());\n }", "protected function setUp()\n {\n parent::setUp();\n\n $this->dateService = Mockery::mock(IDateService::class);\n }", "public function testSetValueProperty() {\n // Test Date::setValue() with a date+time field.\n // Test a date+time field.\n $this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATETIME);\n $this->fieldStorage->save();\n $entity = EntityTest::create();\n $value = '2014-01-01T20:00:00';\n\n $entity->set('field_datetime', $value);\n $this->entityValidateAndSave($entity);\n // Load the entity and ensure the field was saved correctly.\n $id = $entity->id();\n $entity = EntityTest::load($id);\n $this->assertEquals($value, $entity->field_datetime[0]->value, '\"Value\" property can be set directly.');\n $this->assertEquals(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime->date->getTimeZone()->getName());\n\n // Test Date::setValue() with a date-only field.\n // Test a date+time field.\n $this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATE);\n $this->fieldStorage->save();\n $entity = EntityTest::create();\n $value = '2014-01-01';\n\n $entity->set('field_datetime', $value);\n $this->entityValidateAndSave($entity);\n // Load the entity and ensure the field was saved correctly.\n $id = $entity->id();\n $entity = EntityTest::load($id);\n $this->assertEquals($value, $entity->field_datetime[0]->value, '\"Value\" property can be set directly.');\n $this->assertEquals(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime->date->getTimeZone()->getName());\n }", "public function testSetState()\n\t{\n\t\t$state = $this->getMockForAbstractClass('PNEngineState', array($this->object));\n\n\t\t$this->object->setState($state);\n\n\t\t$this->assertEquals($state, TestReflection::getValue($this->object, 'state'));\n\t}", "public function testSetStatus()\n {\n $this->todo('stub');\n }", "function setMockSession() {\n if (!class_exists('\\RightNow\\Libraries\\MockSession')) {\n Mock::generate('\\RightNow\\Libraries\\Session');\n }\n $session = new \\RightNow\\Libraries\\MockSession;\n $this->realSession = $this->CI->session;\n $this->CI->session = $session;\n $session->setSessionData(array('sessionID' => 'garbage'));\n }", "public function testCreatedAt()\n {\n $value = date('Y-m-d H:i:s');\n\n $model = $this->getOfferModel();\n\n $model->setCreatedAt($value);\n\n $this->assertEquals($value, $model->getCreatedAt());\n }", "public function testSetProperties() {\n\t\t$this->CurrentConditions->update(\n\t\t\t.70,\n\t\t\t.33,\n\t\t\t.34\n\t\t);\n\n\t\t$reflection = new ReflectionClass($this->CurrentConditions);\n\t\t$reflectionTemperature = $reflection->getProperty('temperature');\n\t\t$reflectionTemperature->setAccessible(TRUE);\n\t\t$reflectionHumidity = $reflection->getProperty('humidity');\n\t\t$reflectionHumidity->setAccessible(TRUE);\n\n\t\t$this->assertSame(\n\t\t\t$reflectionTemperature->getValue($this->CurrentConditions),\n\t\t\t.70\n\t\t);\n\t\t$this->assertSame(\n\t\t\t$reflectionHumidity->getValue($this->CurrentConditions),\n\t\t\t.33\n\t\t);\n\t}", "public function test_refreshMessageTimeout() {\n\n }", "public function testWebinarPollUpdate()\n {\n }", "public function testSet() {\n\n // Set a mock class for the state container.\n // See http://phpunit.de/manual/current/en/test-doubles.html\n $stub = $this\n ->getMockBuilder('Drupal\\Core\\KeyValueStore\\KeyValueStoreInterface')\n ->getMock();\n // Configure the stub to get the values passed by exexute().\n $stub->expects($this->once())\n ->method('set')\n ->with(\n $this->equalTo('drupalgotchi.attention'),\n $this->equalTo(10)\n );\n\n $config = array('name' => 'foo', 'needy' => 10);\n $set = new SetDrupalgotchi(\n $config,\n 'drupalgotchi_set_attention',\n array(),\n $stub\n );\n\n $set->execute(10);\n\n }", "private function getNewUserMock() {\n $user_mock = $this->getMockForAbstractClass('\\Drupal\\Core\\Session\\AccountProxyInterface', ['id']);\n $user_mock->method('id')->willReturn(1);\n return $user_mock;\n }", "public function testSetMiseEnSommDateHeure() {\n\n // Set a Date/time mock.\n $miseEnSommDateHeure = new DateTime(\"2018-09-10\");\n\n $obj = new AppelsEnCours();\n\n $obj->setMiseEnSommDateHeure($miseEnSommDateHeure);\n $this->assertSame($miseEnSommDateHeure, $obj->getMiseEnSommDateHeure());\n }", "public function testTheDateOfTodayExampleInReadMe(): void\n {\n $container = new Container();\n\n $name = 'TodaysDate';\n $service = new \\DateTime('today');\n $container->set($name, $service);\n\n $this->assertSame($service, $container->get($name));\n }", "function testSaveExpectsUpdatePostMetaCalledOnce() {\n\n\t\t// arrange\n\t\t$post_id = 100;\n\t\t$postvalues = array(\n\t\t\t'field' => 'Some text',\n\t\t);\n\t\t\\WP_Mock::wpFunction( 'get_post_meta', array(\n\t\t\t'times' => 1,\n\t\t\t'return' => false,\n\t\t\t)\n\t\t);\n\t\t\\WP_Mock::wpFunction( 'update_post_meta', array(\n\t\t\t'times' => 1,\n\t\t\t'return' => true,\n\t\t\t'with' => array(\n\t\t\t\t$post_id,\n\t\t\t\t'field',\n\t\t\t\t'Some text',\n\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$form = new TestValidTextField();\n\t\t$form->post_type = 'post';\n\n\t\t// act\n\t\t$form->save($post_id, $postvalues);\n\n\t\t// assert\n\n\t}", "public function testMethodSetLocked()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setLocked(true);\n\n $status = $scorebox->isLocked();\n\n $expStatus = true;\n\n $this->assertEquals($status, $expStatus);\n }", "public function testSetHeureFin() {\n\n // Set a Date/time mock.\n $heureFin = new DateTime(\"2018-09-10\");\n\n $obj = new FichesControlesEntetes();\n\n $obj->setHeureFin($heureFin);\n $this->assertSame($heureFin, $obj->getHeureFin());\n }", "public function testSetAndGetBirthDate()\r\n {\r\n $testObj = $this->_createMockModel();\r\n $baseObj = $this->_createMockModel();\r\n\r\n // Set the Birth Date\r\n $testObj->setBirthDate('1981-01-26T11:22:33-03:30');\r\n\r\n // Assert that a change occurred in the test object\r\n $this->assertNotEquals($testObj, $baseObj);\r\n\r\n // Assert that Birth Date field was updated\r\n $this->assertEquals('1981-01-26T11:22:33-03:30', $testObj->getBirthDate());\r\n\r\n // Assert that no other return values were affected\r\n $this->_assertModelsSameExcept($testObj, $baseObj, 'BirthDate');\r\n }", "public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}", "public function testSetCarteTravailExpireLe() {\n\n // Set a Date/time mock.\n $carteTravailExpireLe = new DateTime(\"2018-09-10\");\n\n $obj = new Employes();\n\n $obj->setCarteTravailExpireLe($carteTravailExpireLe);\n $this->assertSame($carteTravailExpireLe, $obj->getCarteTravailExpireLe());\n }", "public function testSetAndGetMicrotime(callable $storageFactory)\n {\n $this->storage = call_user_func($storageFactory);\n $this->storage->bootstrap(1);\n $this->storage->getMicrotime();\n \n $this->storage->setMicrotime(1.1);\n $this->assertSame(1.1, $this->storage->getMicrotime());\n $this->assertSame(1.1, $this->storage->getMicrotime());\n \n $this->storage->setMicrotime(1.2);\n $this->assertSame(1.2, $this->storage->getMicrotime());\n \n $this->storage->setMicrotime(1436551945.0192);\n $this->assertSame(1436551945.0192, $this->storage->getMicrotime());\n }", "public function now(): \\DateTimeImmutable;" ]
[ "0.65740293", "0.63893086", "0.6379536", "0.6260439", "0.6258142", "0.61491764", "0.6122743", "0.6080281", "0.6067263", "0.5947956", "0.59408766", "0.59347844", "0.5890012", "0.58760697", "0.5858848", "0.585253", "0.5847853", "0.58415675", "0.579679", "0.5790066", "0.5786473", "0.5764766", "0.57415044", "0.57387245", "0.5716494", "0.5692938", "0.5692747", "0.56833905", "0.5671709", "0.56646186", "0.5646986", "0.56404376", "0.56397724", "0.563292", "0.56254345", "0.562068", "0.56202877", "0.56166005", "0.55710816", "0.55657583", "0.55578583", "0.5544909", "0.5539583", "0.5534778", "0.5521065", "0.5491235", "0.54735744", "0.5463264", "0.5459127", "0.5458811", "0.5456527", "0.5450272", "0.5448066", "0.54289126", "0.5427744", "0.5427254", "0.5423337", "0.54185516", "0.54033273", "0.5393278", "0.5392149", "0.5389731", "0.53892493", "0.5380383", "0.5372671", "0.53667647", "0.53647786", "0.53633326", "0.5362828", "0.53540814", "0.5353976", "0.5347342", "0.5347196", "0.5341101", "0.53305495", "0.5319271", "0.5316972", "0.5302654", "0.5290989", "0.5289494", "0.52859247", "0.528376", "0.52824515", "0.5278938", "0.5274629", "0.5273441", "0.52702194", "0.5268855", "0.5268756", "0.52605695", "0.5253089", "0.52528864", "0.52374095", "0.5236812", "0.52347994", "0.52243835", "0.5222594", "0.5218635", "0.52165186", "0.52123743" ]
0.7065401
0
Implements hook_form_FORM_ID_form_alter(). Custom search block form No 'submit button' Use javascript to show/hide the 'search this site' prompt inside of the text field
function mayo_form_search_block_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'search_block_form') { unset($form['actions']['submit']); $form['keys']['#size'] = theme_get_setting('searchbox_size', 'mayo'); $prompt = t('search this site'); $form['keys']['#default_value'] = $prompt; $form['actions']['submit']['#type'] = 'hidden'; $form['keys']['#attributes'] = array('onblur' => "if (this.value == '') {this.value = '{$prompt}';}", 'onfocus' => "if (this.value == '{$prompt}') {this.value = '';}" ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function captogov_form_alter( &$form, &$form_state, $form_id )\n{\n if ($form_id == 'search_api_page_search_form_default_search') { \n $form['keys_1']['#attributes']['placeholder'] = t( 'Search our website' );\n }\n}", "function dapper_form_alter(&$form, &$form_state, $form_id) {\n if ($form_id == 'search_block_form') {\n $form['mobile_link']['#weight'] = -99;\n $form['mobile_link']['#markup'] = '<span class=\"icon-search expand_menu\"></span>';\n $form['actions']['submit']['#prefix'] = '<div class=\"button\">';\n $form['actions']['submit']['#type'] = 'button';\n $form['actions']['submit']['#title'] = 'Search';\n $form['actions']['submit']['#executes_submit_callback'] = true;\n $form['actions']['submit']['#value'] = '<span class=\"icon-search\"></span>';\n $form['actions']['submit']['#suffix'] = '</div>';\n\n $form['search_block_form']['#title_display'] = 'invisible';\n $form['search_block_form']['#attributes']['placeholder'] = t('Search');\n $form['search_block_form']['#attributes']['size'] = 28;\n }\n}", "function illuminate_preprocess_search_block_form(&$vars, $hook) {\n // to yourthemename_preprocess_search_block_form and use\n // 'search_block_form' instead of 'search_theme_form' in the customizations\n // bellow.\n\n //get site name\n $site_name = variable_get('site_name', \"this website\");\n $search_string = 'Search '. strtolower($site_name);\n \n\n // Modify elements of the search form\n $vars['form']['search_block_form']['#title'] = t('');\n\n // Set a default value for the search box\n $vars['form']['search_block_form']['#value'] = t($search_string);\n\n // Set a default width for the search box\n $vars['form']['search_block_form']['#size'] = 26;\n\n // Add a custom class to the search box\n $vars['form']['search_block_form']['#attributes'] = array(\n 'class' => 'NormalTextBox txtSearch',\n 'onfocus' => \"if (this.value == '$search_string') {this.value = '';}\",\n 'onblur' => \"if (this.value == '') {this.value = '$search_string';}\");\n\n // Rebuild the rendered version (search form only, rest remains unchanged)\n unset($vars['form']['search_block_form']['#printed']);\n $vars['search']['search_block_form'] = drupal_render($vars['form']['search_block_form']);\n\n // Rebuild the rendered version (submit button, rest remains unchanged)\n unset($vars['form']['submit']['#printed']);\n $vars['search']['submit'] = drupal_render($vars['form']['submit']);\n\n // Collect all form elements to make it easier to print the whole form.\n $vars['search_form'] = implode($vars['search']);\n}", "function charangoten_preprocess_search_block_form(&$vars, $hook) {\n // Modify elements of the search form\n unset($vars['form']['search_block_form']['#title']);\n\n // Set a default value for the search box\n $vars['form']['search_block_form']['#value'] = t('Search this site');\n \n // Add a custom class to the search box\n // Set yourtheme.css > #search-block-form .form-text { color: #888888; }\n $vars['form']['search_block_form']['#attributes'] = array(\n 'onblur' => \"if (this.value == '') {this.value = '\".$vars['form']['search_block_form']['#value'].\"';} this.style.color = '#000000';\",\n 'onfocus' => \"if (this.value == '\".$vars['form']['search_block_form']['#value'].\"') {this.value = '';} this.style.color = '#996600';\" );\n\n // Modify elements of the submit button\n unset($vars['form']['submit']);\n\n // Change text on the submit button\n //$vars['form']['submit']['#value'] = t('Go!');\n\n // Change submit button into image button - NOTE: '#src' leading '/' automatically added\n //$vars['form']['submit']['image_button'] = array('#type' => 'image_button', '#src' => base_path() . path_to_theme('sites/default/charangoten') . '/images/search-button.png');\n\t\n\t$vars['form']['submit']['#type'] = 'image_button';\n\t$vars['form']['submit']['#src'] = path_to_theme() . '/images/search-button.png';\n\n // Rebuild the rendered version (search form only, rest remains unchanged)\n unset($vars['form']['search_block_form']['#printed']);\n $vars['search']['search_block_form'] = drupal_render($vars['form']['search_block_form']);\n\n // Rebuild the rendered version (submit button, rest remains unchanged)\n unset($vars['form']['submit']['#printed']);\n $vars['search']['submit'] = drupal_render($vars['form']['submit']);\n \n // Collect all form elements to print entire form\n $vars['search_form'] = implode($vars['search']);\n}", "function wraith_preprocess_search_block_form(&$vars) {\n $vars['search_form'] = str_replace('type=\"text\"', 'type=\"search\"', $vars['search_form']);\n}", "function isfnet_preprocess_search_block_form(&$vars) {\n $vars['search_form'] = str_replace('type=\"text\"', 'type=\"search\"', $vars['search_form']);\n}", "function gavias_edmix_theme_suggestions_form_alter(array &$suggestions, array $variables) {\n if ($variables['element']['#form_id'] == 'search_block_form') {\n $suggestions[] = 'form__search_block_form';\n }\n}", "function nscm_show_search_form() {\n\treturn get_search_form();\n}", "function esf_tc_custom_partner_search_form($form, &$form_state) {\n $form['#attributes']['class'][] = 'form-inline';\n $form['keys'] = array(\n '#type' => 'textfield',\n '#name' => 'keys',\n '#attributes' => array('placeholder' => t('Search in the databases')),\n '#prefix' => '<div class=form-group >',\n '#suffix' => '</div>',\n );\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('search'),\n );\n $form['#submit'][] = 'esf_tc_custom_partner_search_form_submit';\n return $form;\n\n}", "public static function form_list_searchform( $return ) {\n\t\t\t/* The filter is applied twice, we only need to inject once... */\n\t\t\tremove_filter( 'gform_form_apply_button', array( __CLASS__, 'form_list_searchform' ) );\n\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\tjQuery( document ).ready( function() {\n\t\t\t\t\t\tvar searchform = jQuery( '<form class=\"search-form\" method=\"GET\">' );\n\t\t\t\t\t\tsearchform.append( '<input type=\"hidden\" name=\"page\" value=\"gf_edit_forms\" /><p class=\"search-box\"><label class=\"screen-reader-text\" for=\"searchtags\"><?php esc_html_e( 'Search Forms', self::$_translation_domain ); ?>:</label><input type=\"search\" id=\"searchforms\" name=\"s\" value=\"<?php _admin_search_query(); ?>\" /><?php submit_button( __( 'Search Forms', self::$_translation_domain ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?></p>' );\n\t\t\t\t\t\tjQuery('.wrap h2').after( searchform );\n\t\t\t\t\t} );\n\t\t\t\t</script>\n\n\t\t\t<?php\n\n\t\t\t// Add the search results label if search\n\t\t\tif ( isset( $_GET['s'] ) ) {\n\t\t\t\t?>\n\t\t\t\t\t<script type=\"text/javascript\">\t\n\t\t\t\t\t\tjQuery( document ).ready( function() {\n\t\t\t\t\t\t\tvar searchspan = '<?php printf( '<span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) ); ?>';\n\t\t\t\t\t\t\tjQuery( '.wrap h2' ).append( searchspan );\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t</script>\n\t\t\t\t<?php\n\t\t\t}\n\n\t\t\treturn $return;\n\t\t}", "function honeycomb_property_search_form() {\n\t\techo do_shortcode('[property_search_form id=\"default\"]');\n\t}", "function scribbles_add_search_form() {\n\n\tget_template_part( 'templates/parts/search' );\n\n}", "function eventoni_add_searchform()\n{\n\t$options = get_option('eventoni_options');\n\n\t$input_width = 30;\n\tif( $options['placement'] == 'sidebar' ){\n\t\t$input_width = 100;\n\t}\n\t$ip = eventoni_get_visitor_ip();\n\t?>\n\n<div id=\"eventoni_container\" class=\"eventoni_shadow\">\n\n<div id=\"eventoni_container_normale_suche\">\n<div style=\"width: 90%; margin: 0 auto; text-align: center;\">\n<form id=\"eventoni_form\" action=\"#\" method=\"GET\">\n<input type=\"hidden\" name=\"eventoni_search\" value=\"1\" />\n<div style=\"width: <?php echo $input_width; ?>%; float: left; padding: 0; text-align: center; color: #C8D7B9;\">\n\tWas?<br />\n\t<input tabindex=11 style=\"width: 90%; margin: 0 auto;\" type=\"text\" id=\"eventoni_was\" name=\"was\" value=\"<?php echo get_query_var('was');?>\" />\n</div>\n<div style=\"width: <?php echo $input_width; ?>%; float: right; padding: 0; text-align: center; color: #C8D7B9;\">\n\tWann?<br />\n\t<input tabindex=13 style=\"width: 90%; margin: 0 auto;\" type=\"text\" id=\"eventoni_wann\" name=\"wann\" value=\"<?php echo get_query_var('wann');?>\" />\n</div>\n<div style=\"width: <?php echo $input_width; ?>%; margin-top: 10px; margin-left: auto; margin-right: auto; margin-top: 10px; padding: 0; text-align: center; color: #C8D7B9;\">\n\tWo?<br />\n\t<input tabindex=12 style=\"width: 90%; margin: 0 auto;\" type=\"text\" id=\"eventoni_wo\" name=\"wo\" value=\"<?php echo get_query_var('wo');?>\" />\n</div>\n<input tabindex=14 type=\"image\" style=\"margin-top: 10px;\"\n\tsrc=\"<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/eventoni-events/img/search-button.png\"\n\tname=\"submit\" value=\"submit\">\n\t<input type=\"hidden\" name=\"eventoni_page\" id=\"eventoni_page\" value=\"1\" autocomplete=\"off\"/>\n\t<input type=\"hidden\" name=\"eventoni_subpage\" id=\"eventoni_subpage\" value=\"0\" autocomplete=\"off\"/>\n\t</form>\n</div>\n</div>\n\n\t<?php\n\n\tif( isset($options['geolocation'])){\n\t\techo '<div><a href=\"#\" id=\"eventoni_umkreissuche\" style=\"display:none\">Im Umkreis suchen (<span id=\"eventoni_umkreis\"></span>)</a></div>';\n\t}\n\n\techo '<div class=\"tsr\">';\n\tfor($z=1;$z<=5;$z++)\n\t{\n\t?>\n\t<div class=\"text font_0\">\n\t\t<div class=\"top5tsr big\" id=\"top5_<?php echo $z; ?>\">\n\t\t\t<div class=\"right\">\n\t\t\t\t<div class=\"teaserText\">\n\t\t\t\t\t<a href=\"#\" class=\"link image\">\n\t\t\t\t\t\t<img class=\"image\" src=\"\" align=\"left\">\n\t\t\t\t\t</a>\n\t\t\t\t\t<div class=\"headline\">\n\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"link font_46\"></a>\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t</div>\n\t\t\t\t\t<br clear=\"left\">\n\t\t\t\t\t<div class=\"texte font_43\">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"float:right\">\n\t\t\t\t\t\t<a class=\"facebook_link\" href=\"#\" target=\"_blank\">\n\t\t\t\t\t\t\t<img src=\"<?php echo get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/facebook.png'; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"float:right\">\n\t\t\t\t\t\t<a class=\"twitter_link\" href=\"TODO\" target=\"_blank\">\n\t\t\t\t\t\t\t<img src=\"<?php echo get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/twitter.png'; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<?php\n\n\t}\n\techo '</div>';\n\techo '<div id=\"eventoni_pagination\"><span id=\"eventoni_last\" style=\"float:left;display:none;\">zur&uuml;ck</span><span id=\"eventoni_next\" style=\"float:right\">vor</span></div><br/>';\n\techo '<div><a href=\"http://www.eventoni.de/event/add.html\">Event melden</a></div>';\n\tif( isset($options['show_map'])){\n\t\techo '<div id=\"eventoni_map\" style=\"width:100%; height:200px;\"></div>';\n\t}\n\techo '<div style=\"float:right\"><small style=\"color:#ffffff;font-size:10px;\">powered by</small> <a href=\"http://www.eventoni.de/\" title=\"Eventoni Startseite\"><img alt=\"Eventoni Veranstaltungen und Termine in Deiner Region\" src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/logo.png\" /></a></div>';\n\techo '</div>';\n}", "function cardealer_wpsearch( $form ) { \r\n\t$form = '<form role=\"search\" method=\"get\" id=\"searchform\" class=\"clearfix\" action=\"' . esc_url( home_url( '/' ) ) . '\" >\r\n\t<label class=\"screen-reader-text\" for=\"s\">' . esc_html__('Search for:', 'cardealer') . '</label>\r\n\t <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" class=\"cardealer-default-search\" placeholder=\"'.esc_attr__( 'Search...', 'cardealer' ).'\" />\r\n\t <input type=\"submit\" id=\"searchsubmit\" value=\"'. esc_attr__('Go','cardealer') .'\" />\r\n <div class=\"cardealer-auto-compalte-default\"><ul></ul></div>\t\r\n </form>';\r\n\treturn $form;\r\n}", "function widget_sandbox_search_control() {\n\t$options = $newoptions = get_option('widget_sandbox_search');\n\tif ( $_POST['search-submit'] ) {\n\t\t$newoptions['title'] = strip_tags( stripslashes( $_POST['search-title'] ) );\n\t\t$newoptions['button'] = strip_tags( stripslashes( $_POST['search-button'] ) );\n\t}\n\tif ( $options != $newoptions ) {\n\t\t$options = $newoptions;\n\t\tupdate_option( 'widget_sandbox_search', $options );\n\t}\n\t$title = attribute_escape( $options['title'] );\n\t$button = attribute_escape( $options['button'] );\n?>\n\t\t\t<p><label for=\"search-title\"><?php _e( 'Title:', 'sandbox' ) ?> <input class=\"widefat\" id=\"search-title\" name=\"search-title\" type=\"text\" value=\"<?php echo $title; ?>\" /></label></p>\n\t\t\t<p><label for=\"search-button\"><?php _e( 'Button Text:', 'sandbox' ) ?> <input class=\"widefat\" id=\"search-button\" name=\"search-button\" type=\"text\" value=\"<?php echo $button; ?>\" /></label></p>\n\t\t\t<input type=\"hidden\" id=\"search-submit\" name=\"search-submit\" value=\"1\" />\n<?php\n}", "function ocita_form_alter(&$form, &$form_state, $form_id) {\n if ($form_id == 'views-exposed-form-vejledninger-page-1') {\n // HTML5 placeholder attribute\n $form['views-exposed-form-vejledninger-page-1']['#attributes']['placeholder'] = t('Find svar i dokumentationen');\n }\n}", "function gavias_edmix_form_alter(&$form, \\Drupal\\Core\\Form\\FormStateInterface $form_state, $form_id) {\n if (in_array($form_id, ['search_block_form', 'search_form'])) {\n $key = ($form_id == 'search_block_form') ? 'actions' : 'basic';\n if (!isset($form[$key]['submit']['#attributes'])) {\n $form[$key]['submit']['#attributes'] = new Attribute();\n }\n $form[$key]['submit']['#attributes']->addClass('search-form__submit');\n }\n}", "function searchBox() {\n\t\tglobal $wgUseTwoButtonsSearchForm; ?>\n\t\t<form action=\"<?php $this->text('wgScript'); ?>\" class=\"searchform\">\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchInput(array('id' => 'searchInput', 'class' => 'form-control')); ?>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchButton('go', array( 'class' => 'btn btn-primary' )); ?>\n\t\t\t</div>\n\t\t</form><?php\n\t}", "function custom_search_form($form)\n{\n $form = '<form method=\"get\" id=\"quick-search\" action=\"' . home_url('/') . '\" >';\n $form .= '<input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" class=\"search-field\" />';\n $form .= '<input type=\"submit\" value=\"OK\" class=\"search-submit\" />';\n $form .= '</form>';\n return $form;\n}", "function embed_search_form( $form ) {\r\n $form = '<form role=\"search\" method=\"get\" id=\"searchform\" action=\"' . home_url( '/' ) . '\" >\r\n <div><label class=\"screen-reader-text\" for=\"s\">' . __('Search for:') . '</label>\r\n <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" />\r\n <input type=\"submit\" id=\"searchsubmit\" value=\"'. esc_attr__('Search') .'\" />\r\n </div>\r\n </form>';\r\n\r\n return $form;\r\n}", "function katakrak_search_search_results_content_type_edit_form($form, &$form_state) {\n $conf = $form_state['conf'];\n\n $action_options = array(\n 'none' => t('From context'),\n 'override' => t('Override'),\n 'append' => t('Append to'),\n 'fallback' => t('Fallback if empty'),\n );\n\n $form['keys_action'] = array(\n '#prefix' => '<div class=\"form-item container-inline\">',\n '#title' => t('Keywords'),\n '#type' => 'select',\n '#options' => $action_options,\n '#default_value' => $conf['keys_action'],\n );\n\n $form['keys'] = array(\n '#title' => '',\n '#type' => 'textfield',\n '#default_value' => $conf['keys'],\n '#process' => array('ctools_dependent_process'),\n '#dependency' => array('edit-keys-action' => array('fallback', 'override', 'append')),\n );\n\n $form['keys_required'] = array(\n '#title' => t('Required'),\n '#type' => 'checkbox',\n '#default_value' => $conf['keys_required'],\n '#suffix' => '</div>',\n );\n\n $form['filters_action'] = array(\n '#prefix' => '<div class=\"form-item container-inline\">',\n '#title' => t('Filters'),\n '#type' => 'select',\n '#options' => $action_options,\n '#default_value' => $conf['filters_action'],\n );\n\n $form['filters'] = array(\n '#title' => '',\n '#type' => 'textfield',\n '#default_value' => $conf['filters'],\n '#process' => array('ctools_dependent_process'),\n '#dependency' => array('edit-filters-action' => array('fallback', 'override', 'append')),\n '#suffix' => '</div>',\n );\n\n $form['sort_action'] = array(\n '#prefix' => '<div class=\"form-item container-inline\">',\n '#title' => t('Sort'),\n '#type' => 'select',\n '#options' => $action_options,\n '#default_value' => $conf['sort_action'],\n );\n\n $form['sort'] = array(\n '#title' => '',\n '#type' => 'textfield',\n '#default_value' => $conf['sort'],\n '#process' => array('ctools_dependent_process'),\n '#dependency' => array('edit-sort-action' => array('fallback', 'override', 'append')),\n '#suffix' => '</div>',\n );\n $form['rows'] = array(\n '#prefix' => '<div class=\"form-item container-inline\">',\n '#title' => t('Results per page'),\n '#type' => 'textfield',\n '#default_value' => isset($conf['rows']) ? $conf['rows'] : 10,\n '#suffix' => '</div>',\n );\n $form['env_id'] = array(\n '#prefix' => '<div class=\"form-item container-inline\">',\n '#title' => t('Solr Environment ID'),\n '#description' => t('The machine name of the Solr environment, as defined in the Settings page of the Apache Solr module'),\n '#type' => 'textfield',\n '#default_value' => isset($conf['env_id']) ? $conf['env_id'] : '',\n '#suffix' => '</div>',\n );\n\n $form['title_override'] = array(\n '#title' => t('Override title'),\n '#type' => 'checkbox',\n '#default_value' => $conf['title_override'],\n );\n\n $form['title_override_text'] = array(\n '#type' => 'textfield',\n '#default_value' => $conf['title_override_text'],\n '#size' => 35,\n '#process' => array('ctools_dependent_process'),\n '#dependency' => array('edit-title-override' => array(1)),\n );\n\n $form['empty_override'] = array(\n '#title' => t('Override \"no result\" text'),\n '#type' => 'checkbox',\n '#default_value' => $conf['empty_override'],\n );\n\n $form['empty_override_field']['empty_override_title'] = array(\n '#title' => t('Title'),\n '#type' => 'textfield',\n '#default_value' => $conf['empty_override_title'],\n '#process' => array('ctools_dependent_process'),\n '#dependency' => array('edit-empty-override' => array(1)),\n );\n\n $form['empty_override_field']['empty_override_text'] = array(\n '#title' => t('No result text'),\n '#type' => 'text_format',\n '#base_type' => 'textarea',\n '#default_value' => $conf['empty_override_text'],\n '#format' => $conf['empty_override_format'],\n '#process' => array('filter_process_format', 'ctools_dependent_process'),\n '#dependency' => array('edit-empty-override' => array(1)),\n '#id' => 'edit-empty-override-text-value',\n '#prefix' => '<div id=\"edit-empty-override-text-value-wrapper\">',\n '#suffix' => '</div>',\n );\n\n $form['breadcrumb'] = array(\n '#title' => t('Show keywords and filters in the breadcrumb trail'),\n '#type' => 'checkbox',\n '#default_value' => $conf['breadcrumb'],\n );\n\n $form['log'] = array(\n '#title' => t('Record a watchdog log entry when searches are made'),\n '#type' => 'checkbox',\n '#default_value' => $conf['log'],\n );\n \n $form['tipo'] = array(\n '#title' => t('Tipo de búsqueda'),\n '#type' => 'select',\n '#options' => array(\n 'blogs' => 'blogs',\n 'agenda' => 'agenda',\n 'libros' => 'libros',\n ),\n '#default_value' => $conf['tipo'],\n );\n \n $form['columns'] = array(\n '#title' => t('Number of columns'),\n '#type' => 'textfield',\n '#default_value' => $conf['columns'],\n );\n\n // Substitutions.\n if (!empty($form_state['contexts'])) {\n $form['substitute'] = array(\n '#type' => 'checkbox',\n '#title' => t('Use context keywords'),\n '#description' => t('If checked, context keywords will be substituted in this content.'),\n '#default_value' => !empty($conf['substitute']),\n );\n $form['contexts'] = array(\n '#title' => t('Substitutions'),\n '#type' => 'fieldset',\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n\n $header = array(t('Keyword'), t('Value'));\n\n $rows = array();\n foreach ($form_state['contexts'] as $context) {\n foreach (ctools_context_get_converters('%' . check_plain($context->keyword) . ':', $context) as $keyword => $title) {\n $rows[] = array(\n check_plain($keyword),\n t('@identifier: @title', array('@title' => $title, '@identifier' => $context->identifier)),\n );\n }\n }\n\n $form['contexts']['context'] = array('#value' => theme('table', array('header' => $header, 'rows' => $rows)));\n }\n\n return $form;\n}", "function sopac_search_form_basic() {\n\n $locum = sopac_get_locum('locum');\n $locum_cfg = $locum->locum_config;\n $getvars = sopac_parse_get_vars();\n\n $actions = sopac_parse_uri();\n if ($actions[0] == \"search\") {\n if ($actions[3]) {\n $actions[2] = $actions[2] . \"/\" . $actions[3];\n urlencode($actions[2]);\n }\n $search_query = $actions[2];\n $stype_selected = $actions[1] ? 'cat_' . $actions[1] : 'cat_keyword';\n }\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg[format_groups] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n\n $stypes = array(\n 'cat_keyword' => t('Keyword'),\n 'cat_title' => t('Title'),\n 'cat_author' => t('Author'),\n 'cat_series' => t('Series'),\n 'cat_tags' => t('Tags'),\n 'cat_reviews' => t('Reviews'),\n 'cat_subject' => t('Subject'),\n 'cat_callnum' => t('Call Number'),\n );\n\n $sortopts = array(\n 'relevance' => t('Relevance'),\n 'newest' => t('Newest First'),\n 'oldest' => t('Oldest First'),\n );\n\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg['format_groups'] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n if (is_null($prompt)) {\n $prompt = t('Enter your keywords');\n }\n\n // Initialize the form\n $form = array(\n '#attributes' => array('class' => 'search-form'),\n '#validate' => array('sopac_search_catalog_validate'),\n '#submit' => array('sopac_search_catalog_submit'),\n );\n // Start creating the basic search form\n $form['inline'] = array(\n '#prefix' => '<div class=\"basic-search-inline\">',\n '#suffix' => '</div>'\n );\n $form['inline']['search_query'] = array(\n '#type' => 'textfield',\n '#default_value' => $search_query,\n '#size' => 25,\n '#maxlength' => 255,\n '#attributes' => array('x-webkit-speech' => 'true'),\n );\n $form['inline']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search'),\n );\n\n $form['filters'] = array(\n '#prefix' => '<div id=\"filters\">',\n '#suffix' => '</div>'\n );\n $form['filters']['search_type'] = array(\n '#type' => 'select',\n '#title' => t('Search By'),\n '#default_value' => $stype_selected,\n '#options' => $stypes,\n );\n $form['filters']['search_format'] = array(\n '#type' => 'select',\n '#title' => t('Material'),\n '#default_value' => $_GET['search_format'],\n '#selected' => $_GET['search_format'],\n '#options' => $sformats,\n );\n $form['filters']['limit_avail'] = array(\n '#type' => 'select',\n '#title' => 'On Shelf At',\n '#options' => array_merge(array('' => '--', 'any' => \"Any Location\"), $locum_cfg['branches']),\n '#default_value' => $getvars['limit_avail'],\n );\n $form['advanced'] = array(\n '#value' => '<div class=\"basic-search-links\">' .\n l(\"Advanced Search\", variable_get('sopac_url_prefix', 'cat/seek') . '/advanced') .\n '&nbsp;|&nbsp;' .\n l(\"Search Tips\", variable_get('sopac_url_prefix', 'cat/seek') . '/tips') .\n '</div>',\n );\n\n return $form;\n}", "function itstar_search_form( $form ) {\n global $post,$wp_query,$wpdb;\n \n\n if(ICL_LANGUAGE_CODE == 'en' || ICL_LANGUAGE_CODE == 'it'){\n $form = '<form role=\"search\" method=\"get\" id=\"searchform\" class=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n <div><label class=\"screen-reader-text\" for=\"s\">' . __( 'Search for:' ) . '</label>\n <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder'.__(\"Search...\",\"itstar\").'/>\n <input type=\"hidden\" name=\"lang\" value=\"'.ICL_LANGUAGE_CODE.'\"/>\n </div>\n </form>';\n } else {\n $form = '<form role=\"search\" method=\"get\" id=\"searchform\" class=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n <div><label class=\"screen-reader-text\" for=\"s\">' . __( 'Search for:' ) . '</label>\n <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" '.__(\"Search...\",\"itstar\").'/>\n </div>\n </form>';\n }\n\n return $form;\n}", "function culturefeed_pages_search_user_form() {\n\n $form = array();\n\n $form['title'] = array(\n '#markup' => t('Add new members'),\n '#weight' => -999,\n );\n\n $form['search'] = array(\n '#title' => t('Keyword'),\n '#type' => 'textfield',\n '#default_value' => isset($_GET['search']) ? $_GET['search'] : '',\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search User'),\n );\n\n return $form;\n\n}", "function display_search_box(){\r\n\t\r\n\t$random_number = rand(0, 99);\r\n\t$search_div_id = \"cse-search-form\".$random_number;\r\n\t\r\n\t$useGoogleCSE = of_get_option('opt_google_cse');\r\n\t$googleCSEID = of_get_option('opt_google_cse_id');\r\n\t\r\n\t$formHtml = '<div id=\"' . $search_div_id . '\" style=\"width: 100%;\">Loading</div>\r\n\t\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\tgoogle.load(\\'search\\', \\'1\\');\r\n\t\t\t\t\tgoogle.setOnLoadCallback(function() {\r\n\t\t\t\t\tvar customSearchOptions = {};';\r\n\t\r\n\tif (function_exists('domain_mapping_siteurl')) \r\n\t\t$domain = domain_mapping_siteurl(null);\r\n\telse\r\n\t\t$domain = get_bloginfo('url');\r\n\t\r\n\tif ($useGoogleCSE) { \r\n\t\t$formHtml .= 'var customSearchControl = new google.search.CustomSearchControl(\\'' . $googleCSEID . '\\', customSearchOptions);';\r\n\t} else {\r\n\t\t$formHtml .= 'var customSearchControl = new google.search.CustomSearchControl({crefUrl:\\'' . $domain . '/wp-content/themes/UFandShands/cref_xml.php\\'});';\r\n\t}\r\n\t\r\n\t$formHtml .= 'customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);\r\n\t\t\t\t var options = new google.search.DrawOptions();\r\n\t\t\t\t options.setAutoComplete(true);';\r\n\t\r\n\tif ($useGoogleCSE) { \r\n\t\t$formHtml .= 'customSearchControl.setAutoCompletionId(\\'' . $googleCSEID . '+qptype:1\\');';\r\n\t} \r\n\t\r\n\t$formHtml .= 'options.enableSearchboxOnly(\"' . $domain . '/\", \"s\");\r\n\t\t\t\t\tcustomSearchControl.draw(\\''. $search_div_id . '\\', options);\r\n\t\t\t\t\t}, true);\r\n\t\t\t\t\t</script>';\r\n\t\r\n\treturn $formHtml;\r\n}", "function bones_wpsearch($form) {\r\n $form = '<form role=\"search\" method=\"get\" id=\"searchform\" action=\"' . home_url( '/' ) . '\" >\r\n <label class=\"screen-reader-text\" for=\"s\">' . __('Search for:', 'bonestheme') . '</label>\r\n <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"Search the Site...\" />\r\n <input type=\"submit\" class=\"btn\" id=\"searchsubmit\" value=\"'. esc_attr__('Search') .'\" />\r\n </form>';\r\n return $form;\r\n}", "function modemaken_main_search() {\n\t?>\n\t<form class=\"search-form first\" method=\"get\" action=\"<?php echo home_url(); ?>\" role=\"search\">\n\t\t<label for=\"main-search-mvs-bedrijf\">Zoek een (web)winkel, naailes of modeopleiding</label>\n\t\t<input type=\"hidden\" name=\"post_type\" value=\"mvs_bedrijf\">\n\t\t<input type=\"search\" name=\"s\" id=\"main-search-mvs-bedrijf\" autocomplete=\"off\" value=\"\" placeholder=\"bijvoorbeeld: naailes Amsterdam\"><button type=\"submit\">Zoek</button>\n\t</form>\n\t<?php\n}", "function widget_sandbox_search($args) {\n\textract($args);\n\t$options = get_option('widget_sandbox_search');\n\t$title = empty($options['title']) ? __( 'Search', 'sandbox' ) : $options['title'];\n\t$button = empty($options['button']) ? __( 'Find', 'sandbox' ) : $options['button'];\n?>\n\t\t\t<?php echo $before_widget ?>\n\t\t\t\t<?php echo $before_title ?><label for=\"s\"><?php echo $title ?></label><?php echo $after_title ?>\n\t\t\t\t<form id=\"searchform\" method=\"get\" action=\"<?php bloginfo('home') ?>\">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<input id=\"s\" class=\"text-input\" name=\"s\" type=\"text\" value=\"<?php the_search_query() ?>\" size=\"10\" tabindex=\"1\" accesskey=\"S\" />\n\t\t\t\t\t\t<input id=\"searchsubmit\" class=\"submit-button\" name=\"searchsubmit\" type=\"submit\" value=\"<?php echo $button ?>\" tabindex=\"2\" />\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t<?php echo $after_widget ?>\n<?php\n}", "function bones_wpsearch($form) {\n $form = '<form role=\"search\" method=\"get\" id=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n <label class=\"screen-reader-text\" for=\"s\">' . __('Search for:', 'bonestheme') . '</label>\n <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"Search the Site...\" />\n <input type=\"submit\" id=\"searchsubmit\" value=\"'. esc_attr__('Search') .'\" />\n </form>';\n return $form;\n}", "function custom_search_form( $form ) {\r\n $form = '<form role=\"search\" method=\"get\" id=\"searchform\" class=\"searchform\" action=\"' . home_url( '/' ) . '\" >\r\n <div><label class=\"screen-reader-text\" for=\"s\">' . __( 'Search for:' ) . '</label>\r\n <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"Search\" />\r\n <button type=\"submit\" id=\"searchsubmit\" />\r\n <span class=\"icon\"><i class=\"fa fa-search\"></i></span> \r\n </button>\r\n </div>\r\n </form>';\r\n \r\n return $form;\r\n}", "function bones_wpsearch($form) {\n\n $form = '<form role=\"search\" method=\"get\" id=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n\n <label class=\"screen-reader-text\" for=\"s\">' . __('Search for:', 'bonestheme') . '</label>\n\n <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"'.esc_attr__('Search the Site...','bonestheme').'\" />\n\n <input type=\"submit\" id=\"searchsubmit\" value=\"'. esc_attr__('Search') .'\" />\n\n </form>';\n\n return $form;\n\n}", "function bones_wpsearch($form) {\n $form = '<form role=\"search\" method=\"get\" id=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n <input class=\"iconfont\" type=\"submit\" id=\"searchsubmit\" value=\"e\" />\n <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"'.esc_attr__('Cerca su Tasc...','bonestheme').'\" />\n </form>';\n return $form;\n}", "function bones_wpsearch($form) {\n\t$form = '<form role=\"search\" method=\"get\" id=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n\t<label class=\"screen-reader-text\" for=\"s\">' . __( 'Search for:', 'bonestheme' ) . '</label>\n\t<input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"' . esc_attr__( 'Search the Site...', 'bonestheme' ) . '\" />\n\t<input type=\"submit\" id=\"searchsubmit\" value=\"' . esc_attr__( 'Search' ) .'\" />\n\t</form>';\n\treturn $form;\n}", "function bones_wpsearch($form) {\n\t$form = '<form role=\"search\" method=\"get\" id=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n\t<label class=\"screen-reader-text\" for=\"s\">' . __( 'Search for:', 'bonestheme' ) . '</label>\n\t<input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"' . esc_attr__( 'Search the Site...', 'bonestheme' ) . '\" />\n\t<input type=\"submit\" id=\"searchsubmit\" value=\"' . esc_attr__( 'Search' ) .'\" />\n\t</form>';\n\treturn $form;\n}", "function inline_archive_search_form() {\n\n\techo '<div class=\"archive-search clear\">';\n\t\techo '<h2 class=\"search\">';\n\t\t\techo apply_filters( 'inline_search_archives_text', __( 'You can also search the site using the form below:', 'inline' ) );\n\t\techo '</h2>';\n\t\t\n\t\t\tget_search_form();\n\t\t\t\n\techo '</div><!--end .archive-search-->';\n\n}", "public function action_block_content_search_form( $block, $theme )\n\t{\n\t\t$block->form = '<form method=\"get\" id=\"searchform\" action=\"' . URL::get( 'display_search' ) .\n\t\t\t'\"><p><input type=\"text\" id=\"s\" name=\"criteria\" value=\"' . ( isset( $theme->criteria ) ? htmlentities( $theme->criteria, ENT_COMPAT, 'UTF-8' ) : '' ) .\n\t\t\t'\"><input type=\"submit\" id=\"searchsubmit\" value=\"' . ( isset( $block->button ) ? $block->button : _t( 'Search' ) ) . '\"></p></form>';\n\t}", "function bones_wpsearch($form) {\n\t$form = '<form role=\"search\" method=\"get\" class=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n\t<label class=\"obscure\" for=\"s\">' . __( 'Search for:', 'bonestheme' ) . '</label>\n\t<input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"' . esc_attr__( 'Search '.get_bloginfo('name'), 'bonestheme' ) . '\" />\n\t<input type=\"submit\" id=\"searchsubmit\" value=\"' . esc_attr__( 'Go!' ) .'\" />\n\t</form>';\n\treturn $form;\n}", "function custom_search_footer($form)\n{\n $form = '<form role=\"search\" method=\"get\" class=\"search-form\" action=\"' . home_url('/') . '\">';\n $form .= '<label for=\"s2\" class=\"screen-reader-text\">' . __('Search for', 'label') . '</label>';\n $form .= '<input type=\"search\" class=\"search-field\" placeholder=\"' . esc_attr_x('Search …', 'placeholder') . '\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s2\" />';\n $form .= '<input type=\"submit\" value=\" \" class=\"search-submit\" />';\n $form .= '</form>';\n return $form;\n}", "function mysite_netcomp_build_search_form($form, &$form_state){\n $form['search_pns'] = array(\n '#type' => 'fieldset',\n '#title' => t('Enter up to three product numbers')\n );\n $form['search_pns']['search_pn1'] = array(\n '#type' => 'textfield',\n// '#title' => t('Product ID')\n );\n $form['search_pns']['search_pn2'] = array(\n '#type' => 'textfield',\n// '#title' => t('Product ID')\n );\n $form['search_pns']['search_pn3'] = array(\n '#type' => 'textfield',\n// '#title' => t('Product ID')\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search'),\n '#submit' => array('mysite_netcomp_search_submit')\n );\n $form['#validate'][] = 'mysite_netcomp_search_validate';\n if (isset($form_state['storage']['results'])){\n $form['results']= array(\n '#markup' => theme('nc_product_results', $form_state['storage']['results']),\n\n );\n }\n return $form;\n\n\n}", "function pamparam_wpsearch($form) {\n $form = '<form role=\"search\" class=\"widget\" method=\"get\" id=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n <div id=\"form-content\">\n <input type=\"submit\" id=\"searchsubmit\" value=\"'. esc_attr__('Search') .'\" />\n <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"Enter your search keywords...\" />\n </div>\n </form>';\n return $form;\n}", "function dustrial_search_form($form) {\n\n /**\n * Search form customization.\n *\n * @link http://codex.wordpress.org/Function_Reference/get_search_form\n * @since 1.0.0\n */\n $form = '<div class=\"ws-input\"><form role=\"search\" method=\"get\" action=\"' .esc_url( home_url('/') ) . '\">\n <input type=\"search\" placeholder=\"'.esc_attr__( 'Search ...', 'dustrial' ).'\" name=\"s\">\n <button><i class=\"fa fa-search\"></i></button>\n </form></div>';\n return $form;\n}", "public function searchForm(){\n\t echo '<input type=\"text\" id=\"myInput\" title=\"Mit Esc-Taste eingabe löschen\" placeholder=\"Suche..\">';?>\n\t\t<script>\n\t\t\t$(\"#myInput\").on(\"focus\", function() //1 click inside the form folds it together\n\t\t\t{\n\t\t\t\tvar value = this.value.toLowerCase().trim();\n\t\t\t\t$(\"#talents li\").hide(200);\n\t\t\t\t $(\"h2.tal_header\").removeClass('active');\n\t\t\t})\n\t\t\t \n\t\t\t$(\"#myInput\").on(\"keyup\", function() //watch search input\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tvar value = this.value.toLowerCase().trim();\n\t\t\t\t\tif(value.length > 1 ) //must be more than 1 key\n\t\t\t\t\t{\n\t\t\t\t\t\t$(\"#talents li\").addClass('show').filter(function() {\t\t\t\t\t \n\t\t\t\t\t\t\treturn $(this).text().toLowerCase().trim().indexOf(value) == -1;\n\t\t\t\t\t\t}).removeClass('show');\n\t\t\t\t\t }\n\t\t\t\t\t else \n\t\t\t\t\t {\n\t\t\t\t\t\t $(\"#talents li\").removeClass('show');\n\t\t\t\t\t }\n\t\t\t\t});\n\t\t</script><?php\n }", "function show_search_form($sosl_search){\r\n\r\n\r\nprint \"<script>\\n\";\r\n\r\nprint <<<SEARCH_BUILDER_SCRIPT\r\n\r\nfunction toggleFieldDisabled(){\r\n\tif(document.getElementById('SB_searchString').value){\r\n\t\tdocument.getElementById('SB_limit').disabled = false;\r\n\t\tdocument.getElementById('SB_fieldTypeSelect').disabled = false;\r\n\t\tdocument.getElementById('SB_objSelect1').disabled = false;\r\n\t\tdocument.getElementById('SB_objDetail1').disabled = false;\r\n\t} else {\r\n\t\tdocument.getElementById('SB_limit').disabled = true;\r\n\t\tdocument.getElementById('SB_fieldTypeSelect').disabled = true;\r\n\t\tdocument.getElementById('SB_objSelect1').disabled = true;\r\n\t\tdocument.getElementById('SB_objDetail1').disabled = true;\r\n\t}\r\n\t\r\n\tif(!document.getElementById('SB_objSelect1').value || document.getElementById('SB_objSelect1').disabled){\r\n\t\tdocument.getElementById('SB_objDetail1').disabled = true;\r\n\t\tdocument.getElementById('SB_objSelect2').disabled = true;\r\n\t\tdocument.getElementById('SB_objDetail2').disabled = true;\r\n\t} else {\r\n\t\tdocument.getElementById('SB_objDetail1').disabled = false;\r\n\t\tdocument.getElementById('SB_objSelect2').disabled = false;\r\n\t\tdocument.getElementById('SB_objDetail2').disabled = false;\r\n\t}\r\n\r\n\tif(!document.getElementById('SB_objSelect2').value || document.getElementById('SB_objSelect2').disabled){\r\n\t\tdocument.getElementById('SB_objDetail2').disabled = true;\r\n\t\tdocument.getElementById('SB_objSelect3').disabled = true;\r\n\t\tdocument.getElementById('SB_objDetail3').disabled = true;\r\n\t} else {\r\n\t\tdocument.getElementById('SB_objDetail2').disabled = false;\r\n\t\tdocument.getElementById('SB_objSelect3').disabled = false;\r\n\t\tdocument.getElementById('SB_objDetail3').disabled = false;\r\n\t}\r\n\t\r\n\tif(!document.getElementById('SB_objSelect3').value || document.getElementById('SB_objSelect3').disabled){\r\n\t\tdocument.getElementById('SB_objDetail3').disabled = true;\r\n\t} else {\r\n\t\tdocument.getElementById('SB_objDetail3').disabled = false;\r\n\t}\r\n}\r\n\r\n//function updateObject(){\r\n// document.search_form.justUpdate.value = 1;\r\n// document.search_form.submit();\r\n//}\r\n\r\nfunction build_search(){\r\n\ttoggleFieldDisabled();\r\n\t\r\n\tvar searchString = 'FIND {' + document.getElementById('SB_searchString').value + '}';\r\n\t\r\n\tvar fieldTypeSelect = '';\r\n\tif(document.getElementById('SB_fieldTypeSelect').value && !document.getElementById('SB_fieldTypeSelect').disabled){\r\n\t\tfieldTypeSelect = ' IN ' + document.getElementById('SB_fieldTypeSelect').value;\r\n\t}\r\n\t\r\n\tvar objSelect1 = '';\r\n\tif(document.getElementById('SB_objSelect1').value && !document.getElementById('SB_objSelect1').disabled){\r\n\t\tobjSelect1 = ' RETURNING ' + document.getElementById('SB_objSelect1').value;\r\n\r\n\t\tif(document.getElementById('SB_objDetail1').value && !document.getElementById('SB_objDetail1').disabled){\r\n\t\t\tobjSelect1 += '(' + document.getElementById('SB_objDetail1').value + ')';\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar objSelect2 = '';\r\n\tif(document.getElementById('SB_objSelect2').value && !document.getElementById('SB_objSelect2').disabled){\r\n\t\tobjSelect2 = ', ' + document.getElementById('SB_objSelect2').value;\r\n\r\n\t\tif(document.getElementById('SB_objDetail2').value && !document.getElementById('SB_objDetail2').disabled){\r\n\t\t\tobjSelect2 += '(' + document.getElementById('SB_objDetail2').value + ')';\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar objSelect3 = '';\r\n\tif(document.getElementById('SB_objSelect3').value && !document.getElementById('SB_objSelect3').disabled){\r\n\t\tobjSelect3 = ', ' + document.getElementById('SB_objSelect3').value;\r\n\r\n\t\tif(document.getElementById('SB_objDetail3').value && !document.getElementById('SB_objDetail3').disabled){\r\n\t\t\tobjSelect3 += '(' + document.getElementById('SB_objDetail3').value + ')';\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar limit = '';\r\n\tif(document.getElementById('SB_limit').value && !document.getElementById('SB_limit').disabled){\r\n\t\tlimit = ' LIMIT ' + document.getElementById('SB_limit').value;\r\n\t}\r\n\r\n\r\n\tif (searchString)\r\n\t\tdocument.getElementById('sosl_search_textarea').value = searchString + fieldTypeSelect + objSelect1 + objSelect2 + objSelect3 + limit;\r\n\r\n}\r\n</script>\r\nSEARCH_BUILDER_SCRIPT;\r\n\r\n\tif($_SESSION['config']['autoJumpToSearchResults']){\r\n\t\tprint \"<form method='POST' name='search_form' action='$_SERVER[PHP_SELF]#sr'>\\n\";\r\n\t} else {\r\n\t\tprint \"<form method='POST' name='search_form' action='$_SERVER[PHP_SELF]#sr'>\\n\";\r\n\t}\r\n\t\r\n\tprint \"<p><strong>Enter a search string and optionally select the objects and fields to return to build a SOSL search below:</strong></p>\\n\";\r\n\tprint \"<table border='0' width=1>\\n<tr>\\n\";\r\n \r\n print \"<td>Search for </td><td><input type='text' id='SB_searchString' name='SB_searchString' value=\\\"\" . htmlspecialchars($_SESSION['SB_searchString'],ENT_QUOTES,'UTF-8') . \"\\\" size='37' onKeyUp='build_search();' /> in \";\r\n \r\n\t$fieldTypeSelectOptions = array(\r\n\t\t'ALL FIELDS' => 'All Fields',\r\n\t\t'NAME FIELDS' => 'Name Fields',\r\n\t\t'PHONE FIELDS' => 'Phone Fields',\r\n\t\t'EMAIL FIELDS' => 'Email Fields'\t\t\t\r\n\t);\r\n\tprint \"<select id='SB_fieldTypeSelect' name='SB_fieldTypeSelect' onChange='build_search();'>\\n\";\r\n\tforeach ($fieldTypeSelectOptions as $op_key => $op){\r\n\t\tprint \"<option value='$op_key'\";\r\n\t\tif (isset($_SESSION['SB_fieldTypeSelect']) && $op_key == $_SESSION['SB_fieldTypeSelect']) print \" selected='selected' \";\r\n\t\tprint \">$op</option>\";\r\n\t}\r\n\tprint \"</select>\";\r\n\r\n print \" limited to <input id='SB_limit' name='SB_limit' type='text' value='\" . htmlspecialchars($_SESSION['SB_limit'],ENT_QUOTES,'UTF-8') . \"' size='5' onKeyUp='build_search();' /> maximum records</td></tr>\\n\";\r\n\r\n\tprint \"<tr><td colspan='2'></td></tr>\";\r\n\tprint \"<tr><td>returning object </td><td NOWRAP>\";\r\n\tmyGlobalSelect($_SESSION['SB_objSelect1'],'SB_objSelect1',20,\"onChange='build_search();'\");\r\n\tprint \" including fields <input id='SB_objDetail1' name='SB_objDetail1' type='text' value=\\\"\" . htmlspecialchars($_SESSION['SB_objDetail1'],ENT_QUOTES,'UTF-8') . \"\\\" size='40' onKeyUp='build_search();' />\";\r\n\t\tprint \"&nbsp;<img onmouseover=\\\"Tip('List the API names of the fields to be returned; otherwise, only the Id is returned. Optionally include WHERE and LIMIT statements to futher filter search results.')\\\" align='absmiddle' src='images/help16.png'/>\";\r\n\t\tprint \"</td></tr>\";\r\n\tprint \"<tr><td colspan='2'></td></tr>\";\r\n\tprint \"<tr><td>and object </td><td NOWRAP>\";\r\n\tmyGlobalSelect($_SESSION['SB_objSelect2'],'SB_objSelect2',20,\"onChange='build_search();'\");\r\n\tprint \" including fields <input id='SB_objDetail2' name='SB_objDetail2' type='text' value=\\\"\" . htmlspecialchars($_SESSION['SB_objDetail2'],ENT_QUOTES,'UTF-8') . \"\\\" size='40' onKeyUp='build_search();' /></td></tr>\";\r\n\t\r\n\tprint \"<tr><td colspan='2'></td></tr>\";\r\n\tprint \"<tr><td>and object </td><td NOWRAP>\";\r\n\tmyGlobalSelect($_SESSION['SB_objSelect3'],'SB_objSelect3',20,\"onChange='build_search();'\");\r\n\tprint \" including fields <input id='SB_objDetail3' name='SB_objDetail3' type='text' value=\\\"\" . htmlspecialchars($_SESSION['SB_objDetail3'],ENT_QUOTES,'UTF-8') . \"\\\" size='40' onKeyUp='build_search();' /></td></tr>\";\r\n\r\n\tprint \"<tr><td valign='top' colspan='3'><br/>Enter or modify a SOSL search below:\" .\r\n\t\t\t\"<br/><textarea id='sosl_search_textarea' type='text' name='sosl_search' cols='100' rows='4' style='overflow: auto; font-family: monospace, courier;'>\". htmlspecialchars($sosl_search,ENT_QUOTES,'UTF-8') . \"</textarea>\" .\r\n\t\t \"</td></tr>\";\r\n\r\n\r\n\tprint \"<tr><td colspan=3><input type='submit' name='searchSubmit' value='Search' />\";\r\n\tprint \"<input type='reset' value='Reset' />\";\r\n\tprint \"</td></tr></table><p/></form>\\n\";\r\n}", "function ds_block_edit_form($form, &$form_submit)\n{\n\n switch ($form_submit['build_info']['args'][0]) {\n case 'ds_social':\n $form += _social_block_form();\n $form_title = 'Block Widget - Social';\n break;\n case 'ds_about':\n $form += _about_block_form();\n $form_title = 'Block Widget - About';\n break;\n case 'ds_about_teaser':\n $form += _about_block_teaser_form();\n $form_title = 'Block Widget - About Teaser';\n break;\n case 'ds_copy_rights':\n $form += _copy_rights_block_form();\n $form_title = 'Block Widget - Copy Rights';\n break;\n case 'ds_contact_info':\n $form += _contact_info_block_form();\n $form_title = 'Block Widget - Contact Info';\n break;\n case 'ds_announcement':\n $form += _announcement_block_form();\n $form_title = 'Block Widget - Announcement';\n break;\n case 'ds_recent_tweets':\n $form += _recent_tweets_block_form();\n $form_title = 'Block Widget - Recent Tweets';\n break;\n case 'ds_blog_categories':\n $form += _blog_categories_block_form();\n $form_title = 'Block Widget - Categories';\n break;\n case 'ds_blog_archive':\n $form += _blog_archive_block_form();\n $form_title = 'Block Widget - Archive';\n break;\n case 'ds_blog_recent_posts_sidebar':\n $form += _blog_recent_posts_block_form();\n $form_title = 'Block Widget - Recent Posts';\n break;\n case 'ds_testimonial':\n $form += _testimonial_block_form();\n $form_title = 'Block Widget - Testimonial';\n break;\n }\n\n $form['form_header'] = array(\n '#markup' => '<h2>' . $form_title . '</h2>',\n '#weight' => -15,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => 'Submit',\n );\n return $form;\n}", "function esf_tc_custom_partner_search_form_submit($form, &$form_state) {\n $path = _esf_tc_helper_get_solr_default_page_path();\n $path_return = $path . '/' . trim($form_state['values']['keys']);\n drupal_goto($path_return);\n}", "function add_search_form($items, $args) {\nif( $args->theme_location == 'menu-principal' )\n\t $items .= '<li class=\"search\">\n\t\t\t\t\t<a class=\"search_icon\">\n\t\t\t\t\t\t<span class=\"spicewpsearch_icon\"></span>\n\t\t\t\t\t</a>\n\t\t\t\t\t<div style=\"display:none;\" class=\"spicewpsearchform\">'. get_search_form(false) .'</div>\n\t\t\t\t</li>';\n return $items;\n}", "function ssSearchDisplayForm() {\n ?>\n\n <!-- form -->\n <form class=\"ajax-search-form ui form\" method=\"POST\">\n <h3>Search Similar Posts</h3>\n\n <div class=\"field\">\n <!-- input post title -->\n <div class=\"field\">\n <label>Post Title</label>\n <input type=\"text\" class=\"ajax-input-post-title\" name=\"ajax-input-post-title\" />\n </div>\n \n <!-- submit button -->\n <div class=\"field\">\n <button type=\"button\" class=\"ajax-search-submit-button ui button\">Search</button>\n </div>\n </div>\n </form>\n <!-- end form -->\n\n <!-- ajax result container -->\n <div class=\"ajax-search-result-container\" style=\"display: none;\">\n <h3>Post Suggestions :</h3>\n\n <!-- result -->\n <div class=\"post-suggestion\">\n </div>\n <!-- end result -->\n\n <!-- pagination -->\n <div class=\"pagination-container\">\n \n </div>\n <!-- end pagination -->\n </div>\n <!-- end ajax result container -->\n\n <?php\n }", "function recherche_form($form, &$form_state, $args) {\n $form['f'] = array(\n '#type' => 'fieldset',\n '#title' => t('Recherche tous azimuts'),\n '#attributes' => array('class' => array('sessions','recherchestage', 'collapsible', 'collapsed')),\n );\n\n $form['f']['comodu'] = array(\n '#type' => 'textfield',\n '#title' => t('Rechercher un STAGE'),\n '#description' => t('Saisissez quelques lettres du titre (ou chiffres du numéro) pour rechercher un stage'),\n '#autocomplete_path' => 'autocomp/stage',\n '#element_validate' => array('element_validate_integer_positive'),\n '#prefix' => '<div class=\"ajaxform inline\">',\n '#suffix' => '</div>',\n '#size' => 80, \n );\n $form['f']['submit'] = array(\n '#type' => 'submit',\n '#value' => 'Envoyer,',\n '#submit' => array('recherche_stage_form_submit'),\n );\n\n $form['f']['coresp'] = array(\n '#type' => 'textfield',\n '#title' => t('Rechercher un FORMATEUR'),\n '#description' => t('Saisissez quelques lettres du nom pour rechercher un formateur'),\n '#autocomplete_path' => 'autocomp/formateur2',\n '#element_validate' => array('element_validate_integer_positive'),\n '#prefix' => '<div class=\"ajaxform inline\">',\n '#suffix' => '</div>',\n '#size' => 80, \n );\n $form['f']['submit2'] = array(\n '#type' => 'submit',\n '#value' => 'Envoyer.',\n '#submit' => array('recherche_formateur_form_submit'),\n );\n\n if (user_access('gest_etablissements gaiabb')) {\n $etab_add_icon = array(\n 'path' => drupal_get_path('module', 'gaiabb') . '/images/building_add.png',\n 'alt' => 'etab_add',\n 'title' => t('Ajouter un établissement manquant.'),\n 'attributes' => array('class' => 'some-img', 'id' => 'my-img'));\n $form['f']['lieu'] = array(\n '#markup' => t('<p>Ajouter un lieu&nbsp;').l(theme('image',$etab_add_icon),'etablissement/',\n array('attributes' => array('class' => 'anchor-class'), 'html' => TRUE)) . '</p>',\n );\n };\n return $form;\n}", "function searchAdvancedForm($filters='', $msg='', $current_app, $removed_search_terms=array(), $isFT=false, $canTag=array()) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<style type='text/css'>\n \t@import url('{$this->settings['public_dir']}style_css/{$this->registry->output->skin['_csscacheid']}/calendar_select.css');\n</style>\n<script type='text/javascript' src='{$this->settings['public_dir']}js/3rd_party/calendar_date_select/calendar_date_select.js'></script>\n{parse js_module=\"search\"}\n<h1 class='ipsType_pagetitle'>{$this->lang->words['search']}</h1>\n<if test=\"searchTermsRemoved:|:is_array( $removed_search_terms ) && count( $removed_search_terms )\">\n<br />\n<p class='message error'>{$this->lang->words['removed_search_terms']} <strong>{parse expression=\"implode( ',', $removed_search_terms )\"}</strong></p>\n</if>\n<if test=\"searchError:|:$msg\">\n<br />\n<p class='message error'>{$msg}</p>\n</if>\n<br />\n<div class='ipsBox' id='main_search_form'>\n\t<form action=\"{parse url=\"app=core&amp;module=search&amp;section=search&amp;do=search\" base=\"public\"}&amp;fromsearch=1\" method=\"post\" id='search-box' >\n\t\t<input type='hidden' name='search_app' id='search_app' value='{$this->request['search_app']}' />\n\t\t<fieldset id='' class='ipsBox_container ipsPad'>\n\t\t\t<ul class='ipsForm_horizontal'>\n\t\t\t\t<li class='ipsField'>\n\t\t\t\t\t<label for='query' class='ipsField_title'>{$this->lang->words['find_words']}</label>\n\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t<input type='text' class='input_text' name='search_term' id='query' value='{$this->request['search_term']}' size='50' /><br />\n\t\t\t\t\t\t<span class='desc lighter'>{$this->lang->words['s_andor_quotes']}</span>\n\t\t\t\t\t</p>\n\t\t\t\t</li>\n\t\t\t\t<if test=\"count($filters)\">\n\t\t\t\t\t<li class='ipsField app_chooser'>\n\t\t\t\t\t\t<label class='ipsField_title' for=''>{$this->lang->words['search_section']}</label>\n\t\t\t\t\t\t<div class='ipsField_content'>\n\t\t\t\t\t\t\t<ul id='sapps'>\n\t\t\t\t\t\t\t\t<if test=\"IPSLib::appIsSearchable( 'forums', 'search' )\">\n\t\t\t\t\t\t\t\t\t<li style='display: inline-block;' class='search_app' id='sapp_forums'>\n\t\t\t\t\t\t\t\t\t\t<input type='radio' data-allowtags='{$canTag[ 'forums' ]}' name='search_app' value='forums' id='radio_forums' <if test=\"$this->request['search_app'] == 'forums'\">checked=\"checked\"</if> /> <label for='radio_forums'>{IPSLib::getAppTitle( 'forums' )}</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</if>\n\t\t\t\t\t\t\t\t<if test=\"IPSLib::appIsSearchable( 'members', 'search' )\">\n\t\t\t\t\t\t\t\t\t<li style='display: inline-block;' class='search_app' id='sapp_members'>\n\t\t\t\t\t\t\t\t\t\t<input type='radio' data-allowtags='{$canTag[ 'members' ]}' name='search_app' value='members' id='radio_members' <if test=\"$this->request['search_app'] == 'members'\">checked=\"checked\"</if> /> <label for='radio_members'>{IPSLib::getAppTitle( 'members' )}</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</if>\n\t\t\t\t\t\t\t\t<if test=\"IPSLib::appIsSearchable( 'core', 'search' )\">\n\t\t\t\t\t\t\t\t\t<li style='display: inline-block;' class='search_app' id='sapp_core'>\n\t\t\t\t\t\t\t\t\t\t<input type='radio' data-allowtags='{$canTag[ 'core' ]}' name='search_app' value='core' id='radio_core' <if test=\"$this->request['search_app'] == 'core'\">checked=\"checked\"</if> /> <label for='radio_core'>{IPSLib::getAppTitle( 'core' )}</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</if>\n\t\t\t\n\t\t\t\t\t\t\t\t<foreach loop=\"appLoop:$this->registry->getApplications() as $app => $data\">\n\t\t\t\t\t\t\t\t\t<if test=\"IPSLib::appIsSearchable( $app, 'search' ) AND !in_array( $app, array( 'forums', 'members', 'core' ) )\">\n\t\t\t\t\t\t\t\t\t\t<li style='display: inline-block;' class='search_app' id='sapp_{$app}'>\n\t\t\t\t\t\t\t\t\t\t\t<input type='radio' data-allowtags='{$canTag[ $app ]}' name='search_app' value='{$app}' id='radio_{$app}' <if test=\"$app == $this->request['search_app']\">checked=\"checked\"</if> /> <label for='radio_{$app}'>{IPSLib::getAppTitle( $app )}</label>\n\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t</if>\n\t\t\t\t\t\t\t\t</foreach>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t</if>\n\t\t\t</ul>\n\t\t</fieldset>\n\t\t\n\t\t<fieldset id='other_filters' class='ipsBox_container ipsPad'>\n\t\t\t<ul class='ipsForm_horizontal'>\n\t\t\t\t<li class='ipsField ipsField_select clear'>\n\t\t\t\t\t<label for='andor_type' class='ipsField_title'><strong>{$this->lang->words['matchlabel']}</strong></label>\n\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t<if test=\"isFullText:|:$this->settings['use_fulltext'] AND $this->DB->checkBooleanFulltextSupport()\">\n\t\t\t\t\t\t\t<select name=\"andor_type\" id=\"andor_type\">\n\t\t\t\t\t\t\t\t<option value=\"and\" <if test=\"$this->settings['s_andor_type'] == 'and'\">selected='selected'</if>>{$this->lang->words['s_andor_and']}</option>\n\t\t\t\t\t\t\t\t<option value=\"or\" <if test=\"$this->settings['s_andor_type'] == 'or'\">selected='selected'</if>>{$this->lang->words['s_andor_or']}</option>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t&nbsp;&nbsp;\n\t\t\t\t\t\t</if>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<select name=\"search_content\" id=\"search_content\">\n\t\t\t\t\t\t\t<option value=\"both\">{$this->lang->words['search_both_types']}</option>\n\t\t\t\t\t\t\t<option value=\"titles\">{$this->lang->words['search_titles_types']}</option>\n\t\t\t\t\t\t\t<option value=\"content\">{$this->lang->words['search_content_types']}</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</p>\n\t\t\t\t</li>\n\t\t\t\t<if test=\"tagyouareit:|:$canTag[ $current_app ]\">\n\t\t\t\t\t<li class='ipsField clear' id='tag_row'>\n\t\t\t\t\t\t<label for='tags' class='ipsField_title'>{$this->lang->words['find_by_tags']}</label>\n\t\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t\t<input type='text' class='input_text input' name='search_tags' id='tags' value='{$this->request['find_by_tags']}' size='50' />\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t<span class='desc lighter'>{$this->lang->words['find_by_tags_desc']}</span>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</li>\n\t\t\t\t</if>\n\t\t\t\t<li class='ipsField clear'>\n\t\t\t\t\t<label for='author' class='ipsField_title'>{$this->lang->words['find_author']}</label>\n\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t<input type='text' class='input_text input' name='search_author' id='author' value='{$this->request['search_author']}' size='50' />\n\t\t\t\t\t</p>\n\t\t\t\t</li>\n\t\t\t\t<li class='ipsField clear'>\n\t\t\t\t\t<label for='date_start' class='ipsField_title'>{$this->lang->words['find_date']}</label>\n\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t<input type='text' class='input_text' name='search_date_start' id='date_start' value='{$this->request['_search_date_start']}' /><img src='{$this->settings['img_url']}/date.png' alt='' id='date_start_icon' style='cursor: pointer' /> &nbsp;\n\t\t\t\t\t\t<strong>{$this->lang->words['to']}</strong> &nbsp;<input type='text' class='input_text' name='search_date_end' id='date_end' value='{$this->request['_search_date_end']}' /><img src='{$this->settings['img_url']}/date.png' alt='' id='date_end_icon' style='cursor: pointer' />\n\t\t\t\t\t</p>\n\t\t\t\t</li>\n\t\t\t\t\n\t\t\t</ul>\n\t\t</fieldset>\n\t\t<if test=\"count($filters)\">\n\t\t\t<foreach loop=\"$filters as $app => $data\">\n\t\t\t\t<div id='app_filter_{$app}' class='ipsBox_container ipsPad' style='display: none'>\n\t\t\t\t\t<if test=\"!empty($data['html'])\">\n\t\t\t\t\t\t{$data['html']}\n\t\t\t\t\t</if>\n\t\t\t\t\t<if test=\"count($data['sortDropDown'])\">\n\t\t\t\t\t\t<fieldset class='{parse striping=\"search\"}'>\n\t\t\t\t\t\t\t<if test=\"is_array($data['sortDropIn']) AND count( $data['sortDropIn'] )\">\n\t\t\t\t\t\t\t\t<foreach loop=\"$data['sortDropIn'] as $id => $_data\">\n\t\t\t\t\t\t\t\t\t<ul class='ipsForm_horizontal'>\n\t\t\t\t\t\t\t\t\t\t<li class='ipsField ipsField_select'>\n\t\t\t\t\t\t\t\t\t\t\t<label class='ipsField_title' for='search_by_{$_data[0]}'><if test=\"! $id\">{$this->lang->words['s_member_sin']}<else />&nbsp;</if></label>\n\t\t\t\t\t\t\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type='radio' name='search_app_filters[$app][searchInKey]' value='{$_data[0]}' <if test=\"$this->request['search_app_filters'][$app]['searchInKey'] == $_data[0] || ( ! $this->request['search_app_filters'][$app]['searchInKey'] AND ! $id )\">checked=\"checked\"</if> /> $_data[1]\n\t\t\t\t\t\t\t\t\t\t\t\t<select name='search_app_filters[$app][{$_data[0]}][sortKey]' class='input_select' style='width:auto'>\n\t\t\t\t\t\t\t\t\t\t\t\t<foreach loop=\"$data['sortDropDown'][$_data[0]] as $k => $l\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value='$k' <if test=\"$this->request['search_app_filters'][$app][$_data[0]]['sortKey'.$_data[0]] == $k\">selected='selected'</if>>{$l}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t</foreach>\n\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t<select name='search_app_filters[$app][{$_data[0]}][sortDir]' class='input_select' style='width:auto'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value='0' <if test=\"!$this->request['search_app_filters'][$app][$_data[0]]['sortDir']\">selected='selected'</if>>{$this->lang->words['s_search_type_o_0']}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value='1' <if test=\"$this->request['search_app_filters'][$app][$_data[0]]['sortDir']\">selected='selected'</if>>{$this->lang->words['s_search_type_o_1']}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</foreach>\n\t\t\t\t\t\t\t<else />\n\t\t\t\t\t\t\t\t<ul class='ipsForm_horizontal'>\n\t\t\t\t\t\t\t\t\t<li class='ipsField ipsField_select'>\n\t\t\t\t\t\t\t\t\t\t<label class='ipsField_title' for='search_by'>{$this->lang->words['s_search_type']}</label>\n\t\t\t\t\t\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t\t\t\t\t\t<select name='search_app_filters[$app][sortKey]' id='search_sort_by_{$app}' class='input_select' style='width:auto'>\n\t\t\t\t\t\t\t\t\t\t\t<foreach loop=\"$data['sortDropDown'] as $k => $l\">\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='$k' <if test=\"$this->request['search_app_filters'][$app]['sortKey'] == $k\">selected='selected'</if>>{$l}</option>\n\t\t\t\t\t\t\t\t\t\t\t</foreach>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t<select name='search_app_filters[$app][sortDir]' id='search_sort_order_{$app}' class='input_select' style='width:auto'>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='0' <if test=\"!$this->request['search_app_filters'][$app]['sortDir']\">selected='selected'</if>>{$this->lang->words['s_search_type_o_0']}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='1' <if test=\"$this->request['search_app_filters'][$app]['sortDir']\">selected='selected'</if>>{$this->lang->words['s_search_type_o_1']}</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</if>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</if>\n\t\t\t\t</div>\n\t\t\t</foreach>\n\t\t</if>\n\t\t<fieldset class='submit'>\n\t\t\t<input type='submit' name='submit' class='input_submit' value='{$this->lang->words['do_search']}'> {$this->lang->words['or']} <a href='{$this->settings['board_url']}' title='{$this->lang->words['cancel']}' class='cancel'>{$this->lang->words['cancel']}</a>\n\t\t</fieldset>\n\t</form>\n</div>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "function my_search_form( $form ) {\n $form = '<div class=\"fixed-search\">\n\t<form role=\"search\" method=\"get\" id=\"searchform\" class=\"searchform\" action=\"' . home_url( '/' ) . '\" >\n <div class=\"col-md-2 pull-right\"><div class=\"input-group\">\n\t\t\t <input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" class=\"form-control search-box\" />\n <span class=\"input-group-btn\">\n\t\t\t <input type=\"submit\" id=\"searchsubmit\" value=\"'. esc_attr__( '' ) .'\" class=\"btn btn-default\" />\n </span>\n\n </div><!-- /input-group --></div>\n\t\t\t\t\t\t </form>\n </div>';\n return $form;\n}", "function install_theme_search_form($type_selector = \\true)\n {\n }", "function _esf_tc_helper_custom_search_block($path) {\n $form = drupal_get_form('esf_tc_custom_partner_search_form');\n return drupal_render($form);\n}", "function wheels_get_search_form( $form ) {\n\t$form = '';\n\tlocate_template( '/templates/searchform.php', true, false );\n\n\treturn $form;\n}", "function vcn_findwork() { // Callback fucntion\r\n\t//return drupal_get_form('vcn_findwork_form');\r\n\treturn theme('vcn_findwork_overview');\r\n}", "function search_form( $form ) {\n $form = '<form role=\"search\" method=\"get\" id=\"search\" action=\"' . home_url( '/' ) . '\" ><input type=\"search\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" placeholder=\"' . __( 'Search' ) . '\"></form>';\n return $form;\n}", "function print_search_form(){\n global $cfg, $db, $libhtml;\n\n $html = $libhtml->form_start();\n $html .= open_table();\n $html .= $libhtml->render_form_table_row(\"keyword\", my_request(\"keyword\"), \"Keyword\", \"keyword\");\n $html .= close_table();\n $html .= $libhtml->render_form_table_row_hidden(\"search\", \"Search\");\n $html .= $libhtml->render_form_table_row_hidden(\"move_to_get\", true);\n\n $html .= $libhtml->render_actions(\n array(\n $libhtml->render_button(\"search_button\", \"Search\"),\n ),\n array(\n \"show_prompt\"=>false,\n \"show_cancel\"=>false,\n \"pause\"=>false,\n )\n );\n\n $html .= $libhtml->form_end();\n $html .= '<div class=\"clear\"></div><br/>';\n return $html;\n }", "function localisation_sc_form() {\n\treturn vdsl_get_template( 'search-form.php' );\n}", "function path_admin_filter_form(&$form_state, $keys = '') {\n $form['#attributes'] = array('class' => 'search-form');\n $form['basic'] = array('#type' => 'fieldset',\n '#title' => t('Filter aliases')\n );\n $form['basic']['inline'] = array('#prefix' => '<div class=\"container-inline\">', '#suffix' => '</div>');\n $form['basic']['inline']['filter'] = array(\n '#type' => 'textfield',\n '#title' => '',\n '#default_value' => $keys,\n '#maxlength' => 128,\n '#size' => 25,\n );\n $form['basic']['inline']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Filter'),\n '#submit' => array('path_admin_filter_form_submit_filter'),\n );\n if ($keys) {\n $form['basic']['inline']['reset'] = array(\n '#type' => 'submit',\n '#value' => t('Reset'),\n '#submit' => array('path_admin_filter_form_submit_reset'),\n );\n }\n return $form;\n}", "function form_submit_confirm_new() {\r\n /* echoed before enterim form, inside <script>, define form_submit_confirm javascript function behaviour in your code\r\n */\r\n return <<<__END__\r\n function form_submit_confirm(myform) {\r\n //action = myform.elements['act'].value;\r\n //myform.submit();\r\n }\r\n__END__;\r\n }", "function YOUR_THEME_theme() {\n return array(\n 'ecl_search_form_wrapper' => array(\n 'render element' => 'element',\n ),\n );\n}", "public function hookForm() {\n if ($this->isCompanyForm()) {\n $this->setDefaultExpDate();\n $this->makeBillingAreaRequired();\n }\n elseif ($this->isCompanyViewsMultiSearchForm()) {\n $this->form['company_name']['#type'] = 'textarea';\n $this->duplicateField('sort_by');\n }\n }", "function sopac_search_form_adv() {\n $locum = sopac_get_locum();\n $locum_cfg = $locum->locum_config;\n $getvars = sopac_parse_get_vars();\n\n $actions = sopac_parse_uri();\n if ($actions[0] == \"search\") {\n if($actions[3]) { $actions[2] = $actions[2] . \"/\" . $actions[3]; urlencode($actions[2]); }\n $search_query = $actions[2];\n $stype_selected = $actions[1] ? 'cat_' . $actions[1] : 'cat_keyword';\n }\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg[format_groups] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n\n $stypes = array(\n 'cat_keyword' => 'Keyword',\n 'cat_title' => 'Title',\n 'cat_author' => 'Author',\n 'cat_series' => 'Series',\n 'cat_tags' => 'Tags',\n 'cat_reviews' => 'Reviews',\n 'cat_subject' => 'Subject',\n 'cat_callnum' => 'Call Number',\n 'cat_isn' => 'ISBN or ISSN',\n );\n\n $sortopts = array(\n '' => 'Relevance',\n 'atoz' => 'Alphabetical A to Z',\n 'ztoa' => 'Alphabetical Z to A',\n 'catalog_newest' => 'Just Added',\n 'newest' => 'Pub date: Newest',\n 'oldest' => 'Pub date: Oldest',\n 'author' => 'Alphabetically by Author',\n 'top_rated' => 'Top Rated Items',\n 'popular_week' => 'Most Popular this Week',\n 'popular_month' => 'Most Popular this Month',\n 'popular_year' => 'Most Popular this Year',\n 'popular_total' => 'All Time Most Popular',\n );\n\n // Initialize the form\n $form = array(\n '#attributes' => array('class' => 'search-form'),\n '#validate' => array('sopac_search_catalog_validate'),\n '#submit' => array('sopac_search_catalog_submit'),\n );\n\n $form['search_query'] = array(\n '#type' => 'textfield',\n '#title' => t('Search term or phrase'),\n '#default_value' => $search_query,\n '#size' => 50,\n '#maxlength' => 255,\n );\n\n $form['search_type'] = array(\n '#type' => 'select',\n '#title' => t('Search by'),\n '#default_value' => $stype_selected,\n '#options' => $stypes,\n );\n $form['sort'] = array(\n '#type' => 'select',\n '#title' => t('Sorted by'),\n '#default_value' => '',\n '#options' => $sortopts,\n );\n $form['age_group'] = array(\n '#type' => 'select',\n '#title' => 'in age group',\n '#options' => array('' => \"Any Age Group\", 'adult' => \"Adult\", 'teen' => \"Teen\", 'youth' => \"Youth\"),\n );\n $form['limit_avail'] = array(\n '#type' => 'select',\n '#title' => 'limit to items on shelf at',\n '#options' => array_merge(array('' => '--', 'any' => \"Any Location\"), $locum_cfg['branches']),\n '#default_value' => $getvars['limit_avail'],\n '#suffix' => \"</div>\",\n );\n if (count($locum_cfg[collections])) {\n foreach ($locum_cfg[collections] as $loc_collect_key => $loc_collect_var) {\n $loc_collect[$loc_collect_key] = $loc_collect_key;\n }\n\n $form['collection'] = array(\n '#type' => 'select',\n '#title' => t('In these collections'),\n '#size' => 5,\n '#default_value' => $getvars[collection],\n '#options' => $loc_collect,\n '#multiple' => TRUE,\n );\n }\n\n asort($locum_cfg[formats]);\n $form['search_format'] = array(\n '#type' => 'select',\n '#title' => t('In these formats'),\n '#size' => 5,\n '#default_value' => $getvars[search_format],\n '#options' => $locum_cfg[formats],\n '#multiple' => TRUE,\n );\n $form['publisher'] = array(\n '#type' => 'textfield',\n '#title' => t('Publisher'),\n '#size' => 20,\n '#maxlength' => 255,\n );\n $form['pub_year_start'] = array(\n '#type' => 'textfield',\n '#title' => t('Published year between'),\n '#size' => 20,\n '#maxlength' => 255,\n );\n $form['pub_year_end'] = array(\n '#type' => 'textfield',\n '#title' => t('and'),\n '#size' => 20,\n '#maxlength' => 255,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search'),\n );\n $form['clear'] = array(\n '#name' => 'clear',\n '#type' => 'button',\n '#value' => t('Reset'),\n '#attributes' => array('onclick' => 'this.form.reset(); return false;'),\n );\n return $form;\n}", "function cjpopups_admin_form_raw($options, $search_box = null, $return = null, $chzn_class = 'chzn-select-no-results', $form_submit = null){\n\tglobal $display;\n\t$display = '';\n\trequire(sprintf('%s/admin_form_raw.php', cjpopups_item_path('includes_dir')));\n\tif(is_null($return)){\n\t\techo implode('', $display);\n\t}else{\n\t\treturn implode('', $display);\n\t}\n}", "function ting_extended_search_settings_display_form_submit($form, &$form_state) {\n $display = $form_state['values']['display'];\n $fields = $form_state['fields'];\n\n for ($i = 0; $i < count($display); $i++) {\n if ($display[$i]['machine_name'] == $fields[$i]['machine_name']) {\n $fields[$i]['column'] = $display[$i]['column'];\n $fields[$i]['sort'] = $display[$i]['sort'];\n $fields[$i]['status'] = $display[$i]['status'];\n $fields[$i]['weight'] = $display[$i]['weight'];\n }\n }\n\n uasort($fields, function($a, $b) {\n if ($a['weight'] == $b['weight'])\n return 0;\n return $a['weight'] < $b['weight'] ? -1 : 1;\n });\n\n $fields = array_values($fields);\n variable_set('ting_ext_search_fields_settings', $fields);\n}", "function onGetFormHead($output = false) {\n\t\t\n\t\t$html = '<div id=\"bf_previewform_div_' . $this->_FORM_CONFIG ['id'] . '\"></div>';\n\t\t//$html .= '<div id=\"bf_pleasewait_preview\"><h2>' . bfText::_ ( 'Please wait a moment, while we validate your submission...' ) . '</h2><br/><img src=\"' . bfCompat::getLiveSite () . '/' . bfCompat::mambotsfoldername () . '/system/blueflame/view/images/check_throbber.gif\" alt=\"throbber\" /></div>';\n\t\t//$html .= '<div id=\"bf_pleasewait_submit\"><h2>' . bfText::_ ( 'Please wait a moment, while we validate &amp; submit your submission...' ) . '</h2><br/><img src=\"' . bfCompat::getLiveSite () . '/' . bfCompat::mambotsfoldername () . '/system/blueflame/view/images/check_throbber.gif\" alt=\"throbber\" /></div>';\n\t\t$html .= \"\\n\\n\" . '<form %s>';\n\t\t\n\t\t$JMenu = JMenu::getInstance ( 'site' );\n\t\t$activeMenu = $JMenu->getActive ();\n\t\t$activeMenu === null ? $Itemid = 1 : $Itemid = $activeMenu->id;\n\t\t\n\t\t$attributes = array ();\n\t\t$attributes ['method'] = 'method=\"' . strtolower ( $this->_FORM_CONFIG ['method'] ) . '\"';\n\t\t$attributes ['action'] = 'action=\"' . ($this->_FORM_CONFIG ['processorurl'] ? $this->_FORM_CONFIG ['processorurl'] : bfCompat::getLiveSite () . '/index.php?Itemid=' . ($Itemid ? $Itemid : '1')) . '\"';\n\t\t$attributes ['name'] = 'name=\"' . 'BF_FORM_' . $this->_FORM_CONFIG ['id'] . '\"';\n\t\t$attributes ['id'] = 'id=\"' . 'BF_FORM_' . $this->_FORM_CONFIG ['id'] . '\"';\n\t\t$attributes ['enctype'] = 'enctype=\"' . $this->_FORM_CONFIG ['enctype'] . '\"';\n\t\t$attributes ['class'] = ' class=\"bfform ' . $this->_FORM_CONFIG ['layout'] . 'form\"';\n\t\t$attributes ['target'] = ' target=\"' . ($this->_FORM_CONFIG ['target'] ? $this->_FORM_CONFIG ['target'] : '_self') . '\"';\n\t\t\n\t\tksort ( $attributes );\n\t\t\n\t\t$attributes = implode ( ' ', $attributes );\n\t\t\n\t\t$html = sprintf ( $html, $attributes );\n\t\t\n\t\tswitch ($output) {\n\t\t\tcase true :\n\t\t\t\techo $html;\n\t\t\t\tbreak;\n\t\t\tcase false :\n\t\t\t\treturn $html;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}", "function twentysixty_search_form_modify( $html ) {\n\treturn str_replace( 'class=\"search-submit\"', 'class=\"search-submit screen-reader-text\"', $html );\n}", "function search_form($db = 0, $search = 0)\n {\n //IMPORTANT: $search is $_REQUEST['b'] -- the inputs from a previous search, but potentially unclean. Sanitize inputs from there before use\n\n $this->page_id = 44;\n $this->get_text();\n $this->category_name = geoCategory::getName($this->site_category);\n $this->get_ad_configuration();\n //use site-wide settings\n $groupId = 0;\n if ($this->userid) {\n $user = geoUser::getUser($this->userid);\n if ($user) {\n $groupId = (int)$user->group_id;\n }\n }\n //Need to use site-wide settings, category specific fields will be loaded\n //dynamically by call to get cat thingies.\n $fields = $this->fields->getDisplayLocationFields('search_fields');\n\n if ($this->configuration_data['use_search_form']) {\n $this->display_page();\n return true;\n }\n\n //always make sure calendar stuff is at top, for when calendar stuff is\n //needed from ajax\n geoCalendar::init();\n\n $this->CountOptionalFields();\n\n //check for category-specific settings (getCategoryConfig handles checking for is_ent())\n $this->field_configuration_data = $this->ad_configuration_data;\n $catCfg = geoCategory::getCategoryConfig($this->site_category, true);\n if ($catCfg && $catCfg['what_fields_to_use'] != 'site') {\n $this->field_configuration_data = array_merge($this->field_configuration_data, $catCfg);\n }\n\n $tpl_vars = array();\n\n if ((strlen(trim($this->search_sql_query)) > 0)) {\n $tpl_vars['search_sql_query'] = 1;\n }\n //get category dropdown and checkbox\n $this->withAjax = false;\n\n $this->onload_cat_id = true;\n //if ($this->site_category)$this->onload_cat_id = $this->site_category;\n\n //***use LeveledFields for category selection***\n $parent_category = (int)$_REQUEST['c'] ? (int)$_REQUEST['c'] : 0;\n $cat_ids = array();\n\n //always do this, because it sets up for Optional Fields a little later on, and they can be added by ajax if not initially present\n $leveled = geoLeveledField::getInstance();\n geoView::getInstance()->addCssFile(geoTemplate::getUrl('css', 'system/order_items/shared/leveled_fields.css'));\n\n while ($parent_category > 0 && !in_array($parent_category, $cat_ids)) {\n $cat_ids[] = $parent_category;\n $parent_category = (int)$this->db->GetOne(\"SELECT `parent_id` FROM \" . geoTables::categories_table . \" WHERE `category_id`=?\", array($parent_category));\n }\n\n //we now have array of $cat_ids with \"top level\" at bottom.. so just loop and pop top one off list each time\n $entry = array();\n\n //let it know what it is\n $entry['leveled_field'] = 'cat';\n\n $maxLevel = 1;\n $canEditLeveled = $entry['can_edit'] = true;\n $prevParent = 0;\n $i = 1;\n do {\n $selected = ($cat_ids) ? array_pop($cat_ids) : 0;\n $level_i = \"leveled_cat_{$i}\";\n\n $page = 1;\n $value_info = geoCategory::getCategoryLeveledValues($prevParent, $listing_types_allowed, $selected, $page, null, $i);\n if (count($value_info['values']) < 1) {\n //no values at this level\n break;\n }\n $maxLevel = $i;\n if ($value_info['maxPages'] > 1) {\n //pagination\n $pagination_url = \"AJAX.php?controller=LeveledFields&amp;action=getLevel&amp;leveled_field=cat&amp;cat=1&amp;parent={$prevParent}&amp;selected={$selected}&amp;listing_types_allowed=$listing_types_allowed&amp;page=\";\n $value_info['pagination'] = geoPagination::getHTML($value_info['maxPages'], $value_info['page'], $pagination_url, 'leveled_pagination', '', false, false);\n }\n $entry['levels'][$i]['can_edit'] = true;\n $entry['levels'][$i]['value_info'] = $value_info;\n $entry['levels'][$i]['level'] = array('level' => $i);\n $entry['levels'][$i]['page'] = $value_info['page'];\n $prevParent = $selected;\n $i++;\n } while ($prevParent > 0);\n\n $entry['maxLevel'] = $maxLevel;\n $tpl_vars['cats'] = $entry;\n\n if (count($tpl_vars['cats']) > 0) {\n //Add CSS for leveled fields\n geoView::getInstance()->addCssFile($externalPre . geoTemplate::getUrl('css', 'system/order_items/shared/leveled_fields.css'));\n }\n //***end category selection code***\n\n // Special case for joe edwards\n $tpl_vars['je_search_setting'] = $this->db->get_site_setting('je_search_setting');\n\n $tpl_vars['show_close_24_hours'] = geoMaster::is('auctions');\n\n if (geoMaster::is('classifieds') && geoMaster::is('auctions')) {\n $tpl_vars['is_auction'] = 1;\n $tpl_vars['listing_type_allowed'] = '';\n } else {\n $tpl_vars['is_auction'] = 0;\n //if auctions or classified listings are turned off, then insert a hidden field to filter by the admin settings.\n if (!geoMaster::is('classifieds')) {\n $tpl_vars['listing_type_allowed'] = 2;\n } elseif (!geoMaster::is('auctions')) {\n $tpl_vars['listing_type_allowed'] = 1;\n }\n }\n\n $tpl_vars['addonCriteria'] = geoAddon::triggerDisplay('Search_classifieds_search_form', array ('this' => $this, 'search_fields' => $fields), geoAddon::ARRAY_ARRAY);\n\n\n //TODO: finish moving to zipsearch addon files\n $zipSettings = geoAddon::getRegistry('zipsearch');\n\n if ($zipSettings && $zipSettings->enabled == 1) {\n $tpl_vars['use_zip_distance_calculator'] = 1;\n $zipText = geoAddon::getText('geo_addons', 'zipsearch');\n $tpl_vars['default_distance_text'] = ($zipSettings->units == 'M') ? $zipText['default_distance_mi'] : $zipText['default_distance_km'];\n\n if ($this->db->get_site_setting('zipsearch_by_location_name') == 1) {\n //beta setting: replace zipcode with city name\n $tpl_vars['zipsearch_by_location'] = true;\n $tpl_vars['zipsearchByLocation_html'] = geoSearchUtils::zipsearchByLocation();\n }\n\n $tpl_vars['zip_filter'] = ($this->zip_filter) ? $this->zip_filter : false;\n\n $basic_distances = array(5,10,15,20,25,30,40,50,75,100,200,300,400,500);\n $tpl_vars['basic_distances'] = $basic_distances;\n $tpl_vars['zip_filter_distance'] = $this->zip_filter_distance;\n }\n\n $maxLocationDepth = 0;\n for ($r = geoRegion::getLowestLevel(); $r > 0; $r--) {\n $field = 'region_level_' . $r;\n if ($fields[$field]) {\n $maxLocationDepth = $r;\n break;\n }\n }\n $locationPrevalue = array();\n $currentRegion = 0;\n if (isset($search['search_location'])) {\n $search_location = (array)$search['search_location'];\n while ($search_location && !$currentRegion) {\n $currentRegion = (int)array_pop($search_location);\n }\n }\n if (!$currentRegion && isset($_COOKIE['region'])) {\n //set by cookie\n $currentRegion = (int)$_COOKIE['region'];\n }\n if ($currentRegion) {\n $locationPrevalue = geoRegion::getRegionWithParents($currentRegion);\n }\n $tpl_vars['region_selector'] = geoRegion::regionSelector('b[search_location]', $locationPrevalue, $maxLocationDepth, false, $this->db->get_site_setting('advSearch_skipEmptyRegions'));\n\n\n\n if (!$this->max_optional_fields) {\n $this->CountOptionalFields();\n }\n\n //Need to use site-wide settings, fields only enabled by category will be loaded\n //dynamically by call to get cat thingies. (used by leveled and optionals)\n $siteFields = geoFields::getInstance($groupId, 0)->getDisplayLocationFields('search_fields');\n\n //Leveled fields\n $leveled_ids = $leveled->getLeveledFieldIds();\n if ($leveled_ids) {\n $tpl_vars['leveled_fields'] = array();\n $tpl_vars['leveled_clear_selection_text'] = $this->messages[502065];\n foreach ($leveled_ids as $lev_id) {\n $level_1 = \"leveled_{$lev_id}_1\";\n if ($fields[$level_1] && $siteFields[$level_1]) {\n $entry = array();\n //put together each of the indexes, it's easier to do in PHP\n //than in smarty\n $entry['level_1'] = $level_1;\n\n //let it know what it is\n $entry['leveled_field'] = $lev_id;\n\n $maxLevelEver = $leveled->getMaxLevel($lev_id, true);\n $maxLevel = 1;\n //can edit just applies to listing placement/editing\n $canEditLeveled = $entry['can_edit'] = true;\n $prevParent = 0;\n\n for ($i = 1; $i <= $maxLevelEver; $i++) {\n $level_i = \"leveled_{$lev_id}_{$i}\";\n if ($fields[$level_i] && $siteFields[$level_i]) {\n $maxLevel = $i;\n } else {\n //we reached limit to enabled ones\n break;\n }\n //(currently) no pre-selected values\n $selected = 0;\n //populate the first level\n\n //page is always 1 starting out\n $page = 1;\n if ($i > 1) {\n //Nothing past first level is going to be populated yet...\n $value_info = array(\n 'values' => array(),\n 'maxPages' => 1);\n } else {\n $value_info = $leveled->getValues($lev_id, $prevParent, $selected, $page);\n }\n if ($value_info['maxPages'] > 1) {\n //pagination\n $pagination_url = \"AJAX.php?controller=LeveledFields&amp;action=getLevel&amp;leveled_field=$lev_id&amp;parent={$prevParent}&amp;selected=0&amp;page=\";\n $value_info['pagination'] = geoPagination::getHTML($value_info['maxPages'], $value_info['page'], $pagination_url, 'leveled_pagination', '', false, false);\n }\n $entry['levels'][$i]['can_edit'] = true;\n $entry['levels'][$i]['leveled_field'] = $lev_id;\n $entry['levels'][$i]['value_info'] = $value_info;\n $prevParent = $selected;\n\n $entry['levels'][$i]['level'] = $leveled->getLevel($lev_id, $i, $this->db->getLanguage());\n }\n $entry['maxLevel'] = $maxLevel;\n $tpl_vars['leveled_fields'][$lev_id] = $entry;\n }\n }\n }\n\n if (geoPC::is_ent() && $this->max_optional_fields > 0) {\n $show_header = true;\n $optionals = array();\n\n for ($i = 1; $i <= $this->max_optional_fields; $i++) {\n $fieldName = 'optional_field_' . $i;\n if ($fields[$fieldName] && $siteFields[$fieldName]) {\n $optionals[$i]['field_number'] = $i;\n if ($i == 1) {\n $optionals[$i]['label'] = geoString::fromDB($this->messages[1457]);\n } elseif ($i <= 10) {\n $optionals[$i]['label'] = geoString::fromDB($this->messages[(1458 + ($i - 1))]);\n } elseif ($i <= 20) {\n $optionals[$i]['label'] = geoString::fromDB($this->messages[(1933 + ($i - 11))]);\n } elseif ($i <= 35) {\n $optionals[$i]['label'] = geoString::fromDB($this->messages[(2778 + ($i - 21))]);\n }\n $field_type = $this->fields->$fieldName->field_type;\n if ($field_type == 'number' || $field_type == 'cost') {\n //if numbers only - produce a upper and lower limit\n $optionals[$i]['type'] = 'numbers';\n } elseif ($field_type == 'date') {\n //date type\n $optionals[$i]['type'] = 'date';\n } elseif ($field_type != 'dropdown') {\n //default to text input\n $optionals[$i]['type'] = 'text';\n } else {\n $sql = \"select * from \" . $this->sell_choices_table . \" where type_id = \" . intval($this->fields->$fieldName->type_data) . \" order by display_order,value\";\n $type_result = $this->db->Execute($sql);\n\n if ($type_result && $type_result->RecordCount() > 0) {\n $optionals[$i]['type'] = 'select';\n\n $optionals[$i]['dropdown'][0]['value'] = '0';\n $optionals[$i]['dropdown'][0]['label'] = '';\n\n for ($d = 1; $show_dropdown = $type_result->FetchNextObject(); $d++) {\n $optionals[$i]['dropdown'][$d]['value'] = $show_dropdown->VALUE;\n $optionals[$i]['dropdown'][$d]['label'] = $show_dropdown->VALUE;\n if ($this->classified_variables[\"optional_field_\" . $i] == $show_dropdown->VALUE) {\n $optionals[$i]['dropdown'][$d]['selected'] = true;\n }\n }\n } else {\n //no options available -- fallback to text box\n $optionals[$i]['type'] = 'text';\n }\n }\n if (strpos($this->fields->$fieldName->type_data, ':use_other') !== false && intval($this->fields->$fieldName->type_data)) {\n $optionals[$i]['other_box'] = true;\n }\n }\n }\n if (count($optionals) > 0) {\n $tpl_vars['show_optionals'] = true;\n $tpl_vars['optionals'] = $optionals;\n }\n }\n\n $tooltip[1] = $this->display_help_link(585);\n $tooltip[2] = $this->display_help_link(574);\n $tooltip[3] = $this->display_help_link(1951);\n $tooltip[4] = $this->display_help_link(586);\n $tpl_vars['tooltip'] = $tooltip;\n $tpl_vars['category_dropdown'] = $category_dropdown;\n $tpl_vars['queryFields'] = $fields;\n\n\n //body for errors because any error messages from a failed Search()\n //will already be held in $this->body.\n //(probably need to rework that, but quickhack to make it work for now)\n $tpl_vars['errors'] = $this->body;\n $this->body = '';\n\n $share_fees = geoAddon::getUtil('share_fees');\n $tpl_vars['feeshare_active'] = $share_fees->active;\n if (($share_fees) && ($share_fees->active)) {\n //display storefront to search choices here\n $users_can_attach_to = $share_fees->attachableUsers();\n $share_fee_text =& geoAddon::getText('geo_addons', 'share_fees');\n $tpl_vars['feeshare_userattachmentchoices'] = $users_can_attach_to;\n $tpl_vars['feeshare_attachtouserlabel'] = $share_fee_text['share_fees_search_choices'];\n }\n\n geoView::getInstance()->setBodyTpl('details_form.tpl', '', 'search_class')\n ->setBodyVar($tpl_vars);\n\n $this->display_page();\n return true;\n }", "protected static function display_search_form() {\n $locale = self::$locale;\n add_to_title($locale['global_202']);\n $form_elements = self::$form_config['form_elements'];\n /*\n * Search Areas\n */\n $options_table = \"<p><strong>\".$locale['405'].\"</strong></p><table style='width:100%'>\\n\";\n if (!empty(self::$form_config['radio_button'])) {\n foreach (self::$form_config['radio_button'] as $key => $value) {\n $options_table .= \"<tr>\\n<td>\".$value.\"</td>\\n</tr>\\n\";\n }\n }\n $options_table .= \"<tr>\\n<td>\\n\n \".form_checkbox('stype', $locale['407'], self::get_param('stype'), [\n 'type' => 'radio',\n 'value' => 'all',\n 'onclick' => 'display(this.value)',\n 'reverse_label' => TRUE\n ]\n ).\"</td>\\n</tr>\\n</table>\\n\";\n\n /*\n * Date limit\n */\n $date_opts = [\n '0' => $locale['421'],\n '86400' => $locale['422'],\n '604800' => $locale['423'],\n '1209600' => $locale['424'],\n '2419200' => $locale['425'],\n '7257600' => $locale['426'],\n '14515200' => $locale['427']\n ];\n\n $disabled_status = FALSE;\n if (isset($form_elements[self::get_param('stype')]['disabled'])) {\n $disabled_status = !empty($form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE;\n if (self::get_param('stype') != 'all') {\n $disabled_status = in_array(\"datelimit\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE;\n }\n }\n\n if (self::get_param('stype') == \"all\") {\n $disabled_status = TRUE;\n }\n\n $search_areas = \"<div class='row'>\";\n $search_areas .= \"<div class='col-xs-12 col-sm-3'>\".$locale['420'].\"</div>\";\n $search_areas .= \"<div class='col-xs-12 col-sm-9'>\";\n $search_areas .= form_select('datelimit', '', self::get_param('datelimit'),\n [\n 'inner_width' => '150px',\n 'options' => $date_opts,\n 'deactivate' => $disabled_status\n ]);\n $search_areas .= form_checkbox('fields', $locale['430'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '2',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields1',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields1\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= form_checkbox('fields', $locale['431'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '1',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields2',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields2\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= form_checkbox('fields', $locale['432'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '0',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields3',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields3\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= \"</div></div>\";\n\n /*\n * Sort\n */\n $sort_opts = [\n 'datestamp' => $locale['441'],\n 'subject' => $locale['442'],\n 'author' => $locale['443']\n ];\n\n $sort = \"<div class='row'>\";\n $sort .= \"<div class='col-xs-12 col-sm-3'>\".$locale['440'].\"</div>\";\n $sort .= \"<div class='col-xs-12 col-sm-9'>\";\n $sort .= form_select('sort', '', self::get_param('sort'), [\n 'inner_width' => '150px',\n 'options' => $sort_opts,\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"sort\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]);\n $sort .= form_checkbox('order', $locale['450'], self::get_param('order'),\n [\n 'type' => 'radio',\n 'value' => '0',\n 'reverse_label' => TRUE,\n 'input_id' => 'order1',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"order1\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $sort .= form_checkbox('order', $locale['451'], self::get_param('order'),\n [\n 'type' => 'radio',\n 'value' => '1',\n 'reverse_label' => TRUE,\n 'input_id' => 'order2',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"order2\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $sort .= \"</div></div>\";\n\n /*\n * Char list\n */\n $char_opts = [\n '50' => '50',\n '100' => '100',\n '150' => '150',\n '200' => '200'\n ];\n\n $char_areas = \"<div class='row'>\";\n $char_areas .= \"<div class='col-xs-12 col-sm-3'>\".$locale['460'].\"</div>\";\n $char_areas .= \"<div class='col-xs-12 col-sm-9'>\";\n $char_areas .= form_select('chars', '', self::get_param('chars'), [\n 'inner_width' => '150px',\n 'options' => $char_opts,\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"chars\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $char_areas .= \"</div></div>\";\n\n /*\n * Bind\n */\n $info = [\n 'openform' => openform('advanced_search_form', 'post', BASEDIR.'search.php'),\n 'closeform' => closeform(),\n 'search_form_stext' => form_text('stext', str_replace('[SITENAME]', fusion_get_settings('sitename'), self::$locale['400']), urldecode(self::get_param('stext')), ['inline' => FALSE, 'placeholder' => $locale['401']]),\n 'search_form_button' => form_button('search', $locale['402'], $locale['402'], ['class' => 'btn-primary']),\n 'search_form_method' => form_checkbox('method', '', self::get_param('method'),\n [\n \"options\" => [\n 'OR' => $locale['403'],\n 'AND' => $locale['404']\n ],\n 'type' => 'radio',\n 'reverse_label' => TRUE,\n ]),\n 'search_form_sources' => $options_table,\n 'search_areas' => $search_areas,\n 'sort_areas' => $sort,\n 'char_areas' => $char_areas\n ];\n /*\n * Replace\n */\n echo $info['openform'];\n echo strtr(Search::render_search(), [\n '{%title%}' => str_replace('[SITENAME]', fusion_get_settings('sitename'), self::$locale['400']),\n '{%search_text%}' => $info['search_form_stext'],\n '{%search_button%}' => $info['search_form_button'],\n '{%search_method%}' => $info['search_form_method'],\n '{%search_sources%}' => $info['search_form_sources'],\n '{%search_areas%}' => $info['search_areas'],\n '{%sort_areas%}' => $info['sort_areas'],\n '{%char_areas%}' => $info['char_areas'],\n ]);\n echo $info['closeform'];\n /*\n * Javascript\n */\n $search_js = \"function display(val) {\\nswitch (val) {\\n\";\n foreach ($form_elements as $type => $array1) {\n $search_js .= \"case '\".$type.\"':\\n\";\n foreach ($array1 as $what => $array2) {\n foreach ($array2 as $elements => $value) {\n if ($what == \"enabled\") {\n $search_js .= \"document.getElementById('\".$value.\"').disabled = false;\\n\";\n } else {\n if ($what == \"disabled\") {\n $search_js .= \"document.getElementById('\".$value.\"').disabled = true;\\n\";\n } else {\n if ($what == \"display\") {\n $search_js .= \"document.getElementById('\".$value.\"').style.display = 'block';\\n\";\n } else {\n if ($what == \"nodisplay\") {\n $search_js .= \"document.getElementById('\".$value.\"').style.display = 'none';\\n\";\n }\n }\n }\n }\n }\n }\n $search_js .= \"break;\\n\";\n }\n $search_js .= \"case 'all':\\n\";\n $search_js .= \"document.getElementById('datelimit').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields1').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields2').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields3').disabled = false;\\n\";\n $search_js .= \"document.getElementById('sort').disabled = false;\\n\";\n $search_js .= \"document.getElementById('order1').disabled = false;\\n\";\n $search_js .= \"document.getElementById('order2').disabled = false;\\n\";\n $search_js .= \"document.getElementById('chars').disabled = false;\\n\";\n $search_js .= \"break;}}\";\n add_to_footer(\"<script type='text/javascript'>\".jsminify($search_js).\"</script>\");\n }", "function nscm_my_search_form( $form ) {\n $form = '<form role=\"search\" method=\"get\" id=\"searchform\" class=\"form-inline\" action=\"' . home_url( '/' ) . '\" >\n <div class=\"input-group w-100\"><input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" class=\"form-control\" placeholder=\"Search for\" />\n <div class=\"input-group-append\"><button type=\"submit\" id=\"searchsubmit\" value=\"'. esc_attr__( 'Search' ) .'\" class=\"btn btn-primary\" />Search</button></div>\n </div>\n </form><hr class=\"mt-5 mb-4\"/>';\n \n return $form;\n}", "public function searchForm() {\n $search = $this->object->infoSearch();\n $searchQuery = $this->object->infoSearchQuery();\n $searchValue = urldecode($this->id);\n if ($search!='' || $searchQuery!='') {\n $fieldsSearch = FormField_Text::create(array('name'=>'search', 'value'=>$searchValue));\n $searchInfo = '';\n if ($this->id!='') {\n $searchInfo = '<div class=\"button buttonBack\">\n <a href=\"'.url($this->type.'/listAdmin', true).'\">'.__('viewAllItems').'</a>\n </div>\n <h2>'.__('resultsFor').': \"'.$searchValue.'\"'.'</h2>';\n }\n return '<div class=\"formAdminSearchWrapper\">\n '.Form::createForm($fieldsSearch, array('action'=>url($this->type.'/search', true),\n 'submit'=>__('search'),\n 'class'=>'formAdminSearch')).'\n '.$searchInfo.'\n </div>';\n }\n }", "private function displaySearchForm($filter)\t{\n trace('[CMD] '.__METHOD__);\n\n\t\t$formname = 'SearchForm';\n $tmplForm = $this->cObj->getSubpart($this->templateFile, '###'.strtoupper($formname).'###');\n\n\t\t$choicesArray = array();\n\t\t$disableArray = array();\n\t\t$hideArray = array();\n\n\t\t$formMarkerArray = $this->formHandler->prepareConfSubst($formname, $filter, $choicesArray, $disableArray, $hideArray);\n\n\t\t// HOOK: allow multiple hooks to manipulate formMarkerArray\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['pt_gsauserreg']['pi5_hooks']['displaySearchFormHook'])) {\n\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['pt_gsauserreg']['pi5_hooks']['displaySearchFormHook'] as $className) {\n\t\t\t\t$hookObj = &t3lib_div::getUserObj($className);\n\t\t\t\t$formMarkerArray = $hookObj->displaySearchFormHook($this, $formMarkerArray);\n\t\t\t}\n\t\t}\n\n return $this->cObj->substituteMarkerArray($tmplForm, $formMarkerArray);\n\t}", "function My_Search_Form(){ ?>\n\n <form role=\"search\" method=\"get\" class=\"form-inline my-2 my-lg-0\" action=\"<?php echo home_url( '/' ); ?>\">\n \n <input type=\"search\" class=\"search-field search\"\n placeholder=\"<?php echo esc_attr_x( 'Search …', 'placeholder' ) ?>\"\n value=\"<?php echo get_search_query() ?>\" name=\"s\"\n title=\"<?php echo esc_attr_x( 'Search for:', 'label' ) ?>\" />\n \n <button class=\"btn search-submit\" type=\"submit\"><i class=\"fas fa-search\"></i></button>\n \n </form>\n <?php\n }", "function tachp_search_form($html)\r\n{\r\n $html = str_replace('placeholder=\"Search ', 'placeholder=\"Search this website ', $html);\r\n\r\n return $html;\r\n}", "public function GoogleSiteSearchForm()\n {\n if ($page = GoogleSiteSearchPage::get()->first()) {\n $label = $this->owner->config()->get('submit_button_label');\n $formLabel = $this->owner->config()->get('input_label');\n\n $form = new Form(\n Controller::curr(),\n 'GoogleSiteSearchForm',\n new FieldList(new TextField('Search', $formLabel)),\n new FieldList(new FormAction('doSearch', $label))\n );\n\n $form->setFormMethod('GET');\n $form->setFormAction($page->Link());\n $form->disableSecurityToken();\n $form->loadDataFrom($_GET);\n\n return $form;\n }\n }", "function get_search_form() {\n $form = '';\n locate_template('/templates/searchform.php', true, false);\n return $form;\n}", "function ting_extended_search_settings_fields_form_submit($form, &$form_state) {\n $fields = $form_state['values']['fields'];\n unset($fields['more']);\n $display = $form_state['fields'];\n\n for ($i = 0; $i < count($fields); $i++) {\n if (isset($display[$i]) && ($display[$i]['machine_name'] == $fields[$i]['machine_name'])) {\n $display[$i]['title'] = $fields[$i]['title'];\n $display[$i]['placeholder'] = $fields[$i]['placeholder'];\n $display[$i]['index'] = $fields[$i]['index'];\n $display[$i]['type'] = $fields[$i]['type'];\n $display[$i]['values'] = $fields[$i]['values'];\n }\n elseif (!isset($display[$i])) {\n // Add new items.\n $display[$i]['machine_name'] = $fields[$i]['machine_name'];\n $display[$i]['title'] = $fields[$i]['title'];\n $display[$i]['placeholder'] = $fields[$i]['placeholder'];\n $display[$i]['index'] = $fields[$i]['index'];\n $display[$i]['type'] = $fields[$i]['type'];\n $display[$i]['values'] = $fields[$i]['values'];\n }\n }\n\n $display = array_filter($display, function($f) {\n return !empty($f['title']) && !empty($f['placeholder']) && !empty($f['index']);\n });\n\n $display = array_values($display);\n variable_set('ting_ext_search_fields_settings', $display);\n}", "function form_submit_confirm_edit() {\r\n /* echoed before enterim form, inside <script>, define form_submit_confirm javascript function behaviour in your code\r\n */\r\n return <<<__END__\r\n function form_submit_confirm(myform) {\r\n //action = myform.elements['act'].value;\r\n //myform.submit();\r\n }\r\n__END__;\r\n }", "function ding_mobilesearch_plugin_settings($form, &$form_state) {\n $form['vt'] = array(\n '#type' => 'vertical_tabs',\n '#weight' => 99,\n );\n\n $plugin_info = module_invoke_all('mobilesearch_plugin_info');\n foreach ($plugin_info as $plugin => $info) {\n $config_form_func = $info['config_form_callback'];\n if (function_exists($config_form_func)) {\n $form['plugin__' . $plugin] = array(\n '#type' => 'fieldset',\n '#title' => $info['title'],\n '#description' => $info['description'],\n '#group' => 'vt',\n );\n $form['plugin__' . $plugin] += $config_form_func($form['plugin__' . $plugin], $form_state);\n }\n if (!empty($info['config_form_validate']) && function_exists($info['config_form_validate'])) {\n $form['#validate'][] = $info['config_form_validate'];\n }\n if (!empty($info['config_form_submit']) && function_exists($info['config_form_submit'])) {\n $form['#submit'][] = $info['config_form_submit'];\n }\n }\n\n return system_settings_form($form);\n}", "function async_social_vk_form() {\n\n\t$form['sasync_social_vk_text'] = array(\n \t'#markup' => '<label for=\"vk-notice\">Please note:</label><div id=\"vk-notice\">\n \t<p>VK buttons don\\'t work without an API ID.<br />\n \tAnd at the same time the VK button language<br/>\n \tdepends on the language that is set for<br />\n \tthe VK account the API ID was created with.</p>\n \t<p>You may also pay attention at VK to set<br />\n \ta corresponding base domain during development<br />\n \tto test the button in your local environment<br />\n \tas well.</p></div>'\n\t);\n\t$form['async_social_vk_apiid'] = array(\n\t\t'#type' => 'textfield',\n\t\t'#title' => t('Mandatory: VK API ID'),\n\t\t'#description' => t('Enter a VK API ID. It\\'s mandatory to make the VK button work.'),\n\t\t'#default_value' => variable_get('async_social_vk_apiid', ''),\n\t);\n\n\treturn system_settings_form($form);\n}", "function getmmsresult_submit($form, &$form_state) {\r\n $searched_keyword = '';\r\n $searched_keyword = $form_state['values']['getmms_textbox'];\r\n $_SESSION['searched_keyword_mms'] = $searched_keyword;\r\n drupal_goto(\"admin/im/getmms/\".$searched_keyword);\r\n unset($_SESSION['searched_keyword_mms']);\r\n exit;\r\n}", "function roots_get_search_form($form) {\n $form = '';\n locate_template('/templates/searchform.php', true, false);\n return $form;\n}", "function itcr_search_form_wrapper( $variables ) {\n $output = '<div class=\"field append\">';\n $output .= $variables['element']['#children'];\n $output .= '<button type=\"submit\" class=\"medium primary btn small-4 headsearch-btn\">';\n $output .= '<span class=\"icon-search entypo scale-lg\"><label for=\"search-form\">SEARCH</label></span>';\n// $output .= '<span class=\"element-invisible\"><label for=\"search-block-form\">' . t('Search') . '</label></span>';\n $output .= '</button>';\n $output .= '</div>';\n return $output;\n}", "function Get_Search_Form_HTML()\n{\n $html = '';\n $html .= '<form class=\"Indented\" method=\"post\" ' .\n 'action=\"index.php?Page_Type=Search\">';\n $html .= '<input type=\"text\" name=\"SearchString\" class=\"Search\"/>';\n $html .= '<input type=\"submit\" value=\"Submit\" class=\"Search_Button\"/>';\n $html .= '</form>';\n return $html;\n}", "function ShowSearchForm()\n{\n\t$str0=\"select value1 from options where name='search'\";\n\t$result0=mysql_query($str0) or die(mysql_error());\n\t$row0=mysql_fetch_array($result0);\n\tif ($row0['value1']==1)\n\t{ \t\t\n\t\techo(\"<tr><td height='172' valign='top' style=\\\"border:1px solid #22496c;\\\">\");\n\t\techo(\"<form name='searchform' action='searchresult.php?id=999999' method='post'>\");\n\t\techo(\"<table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'>\");\n\t\techo(\"<tr><td width='193' valign='middle' bgcolor='\");\n\t\techo(background());\n\t\techo(\"' class='leftmenumainitem'><img src='image/point.jpg' />&nbsp;&nbsp;\");\n\t\t\n\t\techo(getPara('search','value2'));\n\t\techo(\"</td></tr><tr><td height='5'></td></tr><tr><td height='25' align='center' valign='middle'><center>\");\n\t\techo(\"Từ khóa: </center></td></tr>\");\n\t\t\t \n\t\techo(\"<tr><td height='25' valign='middle'><center>\");\n\t\techo(\"<input name='keyword' type='text' id='keyword' size='20' maxlength='100' />\");\n\t\techo(\"</center></td></tr>\");\n\t\techo(\"<tr><td height='25' valign='middle'><center>\");\n\t\techo(\"Mục tin: </center></td></tr>\");\n\t\t\n\t\t\n\t\t$str1=\"select * from menu where menutype=1 order by menuorder\";\n\t\t$result=mysql_query($str1) or die(mysql_error());\n\t\t \n\t\t\t \n\t\techo(\"<tr><td height='25' valign='middle'><center>\");\n\t\techo(\"<select name='field' id='field' class='center_pull'>\");\n\t\techo(\"<option value='0'>Tất cả</option>\");\n\t\n\t\n\t\twhile ($row=mysql_fetch_array($result))\n\t\t\t{\t\t \n\t\t\t\t echo(\"<option value='\".$row['menuid'].\"'>\".$row['menutitle'].\"</option>\");\n\t\t\t}\n\t\tmysql_free_result($result);\n\t\n\t\techo(\"</select></center></td></tr>\");\n\t\techo(\"<tr><td height='39' align='center' valign='middle'><center>\");\n\t\techo(\"<input type='submit' name='Submit' value='Tìm' onClick='return Check1();'/>\");\n\t\techo(\"</center></td></tr></table></form></td></tr>\");\n\t}\t\n\tmysql_free_result($result0);\n}", "public function meta_box_display_forms() {\n\t?>\n\t\t<p><?php _e( 'Add forms to your Posts or Pages by locating the <strong>Add Form</strong> button in the area above your post/page editor.', 'visual-form-builder-pro' ); ?></p>\n \t<p><?php _e( 'You may also manually insert the shortcode into a post/page or the template tag into a template file.', 'visual-form-builder-pro' ); ?></p>\n \t<p>\n \t\t<?php _e( 'Shortcode', 'visual-form-builder-pro' ); ?>\n \t\t<input value=\"[vfb id='<?php echo (int) $_REQUEST['form']; ?>']\" readonly=\"readonly\" />\n \t</p>\n \t<p>\n \t\t<?php _e( 'Template Tag', 'visual-form-builder-pro' ); ?>\n \t\t<input value=\"&lt;?php vfb_pro( 'id=<?php echo (int) $_REQUEST['form']; ?>' ); ?&gt;\" readonly=\"readonly\"/>\n \t</p>\n\t<?php\n\t}", "function weldata_form_alter(&$form, &$form_state){\n\n}", "function form_search_projects_block_submit($form, &$form_state) {\n\n // TODO: creates problems on concurrent requests!\n if(!empty($form_state['values']['keyword'])) {\n cache_set('search-keyword', $form_state['values']['keyword'], 'cache');\n }\n\n drupal_goto('search/projects');\n}", "function _syndicated_content_form($form, &$form_state)\n{\n // sources \n $form = _syndicated_content_admin_sources_form($form,$form_state);\n\n return $form;\n}", "function pwb_search_form_submit($form, &$form_state) {\n $form_state['redirect'] = array('search/personaleweb' . '/' . $form_state['values']['pwb_custom_search']);\n}", "function process_form()\n {\n }", "function form( $instance ) {\r\n\r\n\t\t/* Set up some default widget settings. */\r\n\t\t$defaults = array( 'title' => __('DHL Search', ''), 'search'=> __('Search', ''), 'name' => __('John Doe', ''), 'searchField'=>__('s'), 'searchButton'=>__('searchsubmit'), 'sex' => 'male', 'show_sex' => true );\r\n\t\t$instance = wp_parse_args( (array) $instance, $defaults ); ?>\r\n \r\n <?php echo DHLSettings::getVal('dhl_username') == \"\" ? \"<p><em>\".DHLOutput::__(\"Inactive\").\"</em></p>\" : \"\"; ?>\r\n \r\n <!-- Widget Title: Text Input -->\r\n\t\t<p>\r\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e('Title:', 'hybrid'); ?></label>\r\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" value=\"<?php echo $instance['title']; ?>\" style=\"width:90%;\" />\r\n\t\t</p>\r\n \r\n <p>\r\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'search' ); ?>\"><?php _e(\"Fallback Search:\"); ?></label>\r\n\t\t\t<select id=\"<?php echo $this->get_field_id( 'search' ); ?>\" name=\"<?php echo $this->get_field_name( 'search' ); ?>\" class=\"widefat\" style=\"width:90%;\">\r\n\t\t\t\t<option <?php if ( 'wordpress' == $instance['search'] ) echo 'selected=\"selected\"'; ?> value=\"wordpress\">WordPress</option>\r\n\t\t\t\t<!--<option <?php if ( 'google' == $instance['search'] ) echo 'selected=\"selected\"'; ?> value=\"google\">Google</option>-->\r\n\t\t\t\t<option <?php if ( 'none' == $instance['search'] ) echo 'selected=\"selected\"'; ?> value=\"none\">None</option>\r\n\t\t\t</select>\r\n\t\t</p>\r\n\t<?php\r\n\t}", "public function action_block_form_search_form( $form, $block )\n\t{\n\t\t$form->append( FormControlLabel::wrap( _t( 'Button:' ),\n\t\t\tFormControlText::create( 'button', $block )\n\t\t));\n\t}", "function dentalimplants_search_widget() {\n\tgenesis_widget_area ( 'search', array( \n\t'before' => '<div id=\"search-form-container\">',\n\t'after' => '</div>',));\n}", "function puma_get_search_form()\n{\n $form = '<form method=\"get\" class=\"search-form\" action=\"' . esc_url(home_url('/')) . '\">\n <input type=\"search\" class=\"search-field\" placeholder=\"输入内容按回车搜索\" value=\"' . get_search_query() . '\" name=\"s\" />\n </form>';\n return $form;\n}", "public function modify_searchlayout( $html ) {\n\n \t// Change the search form layout, hide it, etc.\n\t // Shortcode attribute takes precedence, then check the map settings hide search form.\n\t $alwaysOutput = '';\n\n\t // Ignore Radius Set, possibly in shortcode attribute, make sure it is on the form.\n\t // If radius behavior is set to always ignore\n\t // Or if it is set to ignore on blank address and the address is indeed blank\n\t // note: this exact logic is used in 2 places, here and sql distance\n\t //\n\t $ignore_radius_value = ( $this->slplus->options_nojs['radius_behavior'] == \"always_ignore\" ? '1':'0');\n\t $alwaysOutput .= \"<input type='hidden' name='ignore_radius' id='ignore_radius' value='{$ignore_radius_value}' />\" ; // Needs documentation\n\n\t // Always retain hidden fields.\n\t //\n\t $type_hidden = '(?=[^>]*type=[\"\\']hidden)';\n\t $pattern = \"/(<input\\b\\s+{$type_hidden}[^>]*>)/im\";\n\t preg_match_all($pattern,$html,$matches);\n\t foreach ($matches[0] as $match) {\n\t\t $alwaysOutput .= $match;\n\t }\n\n\t // Hide Search Form\n\t //\n\t if ( $this->slplus->SmartOptions->hide_search_form->is_true ) {\n\t \treturn '<form id=\"searchForm\" onsubmit=\"return false;\">' . $alwaysOutput . '</form>';\n\t }\n\n\t // Custom Layout\n\t //\n\t if ( ! empty( $this->slplus->SmartOptions->searchlayout->value )) {\n\t\t $html = $this->slplus->SmartOptions->searchlayout->value;\n\t }\n\n\t // Hide Address Input\n\t //\n\t if ( $this->slplus->is_CheckTrue( $this->addon->options['hide_address_entry'] ) ) {\n\t\t $html = preg_replace('/\\[slp_search_element\\s+.*input_with_label=\"address\".*\\]/i' , '' , $html);\n\t }\n\n\t // Add Name Search\n\t //\n\t if (\n\t\t ( $this->slplus->is_CheckTrue( $this->addon->options['search_by_name'] ) )\n\t\t &&\n\t\t (!preg_match('/\\[slp_search_element\\s+.*input_with_label=\"name\".*\\]/i',$html))\n\t ){\n\t\t $html .= '[slp_search_element input_with_label=\"name\"]';\n\t }\n\n\t // Add City Dropdown\n\t //\n\t if ( ! preg_match( '/\\[slp_search_element\\s+.*dropdown_with_label=\"city\".*\\]/i' , $html ) ) {\n\t\t $html .= '[slp_search_element dropdown_with_label=\"city\"]';\n\t }\n\n\t // Add State Dropdown\n\t //\n\t if (\n\t\t ($this->addon->options['state_selector'] !== 'hidden')\n\t\t &&\n\t\t (!preg_match('/\\[slp_search_element\\s+.*dropdown_with_label=\"state\".*\\]/i',$html))\n\t ){\n\t\t $html .= '[slp_search_element dropdown_with_label=\"state\"]';\n\t }\n\n\n\t // Add Country Dropdown\n\t //\n\t if (\n\t\t ($this->addon->options['country_selector'] !== 'hidden')\n\t\t &&\n\t\t (!preg_match('/\\[slp_search_element\\s+.*dropdown_with_label=\"country\".*\\]/i',$html))\n\t ){\n\t\t $html .= '[slp_search_element dropdown_with_label=\"country\"]';\n\t }\n\n\t $html = $html.$alwaysOutput;\n\n\t // Add the Widget post variables to the search form data on the map page : level 10\n\t //\n\t if ( $this->addon->widget->is_initial_widget_search( $_REQUEST ) ) {\n\t\t $new_html = $this->create_string_hidden_fields_from_widget_vars();\n\t } else {\n\t\t $new_html = '';\n\t }\n\n\t return $new_html . $html;\n }", "public function get_search_form( $form ) {\n\t\tif ( $form ) {\n\t\t\tif ( $this->links_model->using_permalinks ) {\n\t\t\t\t// Take care to modify only the url in the <form> tag.\n\t\t\t\tpreg_match( '#<form.+>#', $form, $matches );\n\t\t\t\t$old = reset( $matches );\n\t\t\t\t$new = preg_replace( '#' . esc_url( $this->links_model->home ) . '\\/?#', esc_url( $this->curlang->search_url ), $old );\n\t\t\t\t$form = str_replace( $old, $new, $form );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$form = str_replace( '</form>', '<input type=\"hidden\" name=\"lang\" value=\"' . esc_attr( $this->curlang->slug ) . '\" /></form>', $form );\n\t\t\t}\n\t\t}\n\n\t\treturn $form;\n\t}", "function cera_grimlock_search_post() {\n\t\tdo_action( 'grimlock_search_post' );\n\t}", "function item_form()\n\t{\n\t\t$its = new item_search($this->pg);\n\t\t$its->action = $_SESSION['root_admin'].'utilities/preorder.php';\n\t\t$its->form_head();\n\t\t$its->upc();\n\t\t$its->title();\n\t\t$its->platform();\n\t\t$its->form_foot('upc');\n\t}", "function elife_article_jumpto_edit_submit(&$form, &$form_state) {\n // Nothing.\n}", "function ShowRightSearchForm()\n{\n\t$str0=\"select value1 from options where name='search'\";\n\t$result0=mysql_query($str0) or die(mysql_error());\n\t$row0=mysql_fetch_array($result0);\n\tif ($row0['value1']==1)\n\t{ \t\t\n\t\techo(\"<tr><td valign='middle' background='images/menusearch.png' class='topbartitle' height='33' width='216'>\"); \n\t\techo(\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\".getPara('search','value2'));\n\t\techo(\"</td></tr>\");\n\t\techo(\"<form name='searchform' action='searchresult.php?id=999999' method='post'>\");\n\n\t\techo(\"<tr><td >\");\n\t\techo(\"</td></tr><tr><td align='center' valign='middle'><center>\");\n\t\techo(\"Từ khóa: </center></td></tr>\");\n\t\t\t \n\t\techo(\"<tr><td valign='middle'><center>\");\n\t\techo(\"<input name='keyword' type='text' id='keyword' size='20' maxlength='100' />\");\n\t\techo(\"</center></td></tr>\");\n\t\techo(\"<tr><td valign='middle'><center>\");\n\t\techo(\"Mục tin: </center></td></tr>\");\n\t\t\n\t\t\n\t\t$str1=\"select * from menu where menutype=1 order by menuorder\";\n\t\t$result=mysql_query($str1) or die(mysql_error());\n\t\t \n\t\t\t \n\t\techo(\"<tr><td valign='middle'><center>\");\n\t\techo(\"<select name='field' id='field' class=\\\"center_pull\\\">\");\n\t\techo(\"<option value='0'>Tất cả</option>\");\n\t\n\t\n\t\twhile ($row=mysql_fetch_array($result))\n\t\t\t{\t\t \n\t\t\t\t echo(\"<option value='\".$row['menuid'].\"'>\".$row['menutitle'].\"</option>\");\n\t\t\t}\n\t\tmysql_free_result($result);\n\t\n\t\techo(\"</select></center></td></tr>\");\n\t\techo(\"<tr><td align='center' valign='middle'><center>\");\n\t\techo(\"<input type='submit' name='Submit' value='Tìm' onClick='return Check1();'/>\");\n\t\techo(\"</center></td></tr>\");\n\t\t//echo(\"<tr><td background='pic/bottombar.jpg' height='12'></tr>\"); \n\t}\t\n\tmysql_free_result($result0);\n}" ]
[ "0.75302744", "0.738922", "0.7376515", "0.729712", "0.7069263", "0.7023208", "0.6794137", "0.6758186", "0.6711507", "0.6676483", "0.66483015", "0.65756166", "0.6528452", "0.65256816", "0.6495248", "0.6475989", "0.64340925", "0.6431015", "0.6391208", "0.6388962", "0.63717026", "0.6352285", "0.6351017", "0.63222444", "0.63061804", "0.630185", "0.6299071", "0.62835795", "0.62821233", "0.627233", "0.62562877", "0.6246407", "0.6226841", "0.6226841", "0.6224913", "0.621821", "0.6213929", "0.6211816", "0.6207792", "0.6202696", "0.62020606", "0.6198592", "0.6194351", "0.618625", "0.6170801", "0.61679876", "0.61518055", "0.6145594", "0.61450696", "0.61415535", "0.6123553", "0.61079234", "0.6087499", "0.6084381", "0.6076421", "0.60727537", "0.60723823", "0.6034792", "0.601407", "0.6013086", "0.6006371", "0.6003591", "0.6002933", "0.5999472", "0.59941816", "0.59936106", "0.59892553", "0.5983069", "0.5975968", "0.59631157", "0.59398735", "0.5930951", "0.59296125", "0.5921501", "0.5914849", "0.59071076", "0.59067297", "0.5905111", "0.58971053", "0.5895411", "0.5894348", "0.5890966", "0.58877575", "0.58863246", "0.588413", "0.5882313", "0.5879514", "0.5877361", "0.5873715", "0.5869438", "0.58626884", "0.5862569", "0.5856786", "0.58537835", "0.58326036", "0.58325315", "0.58254904", "0.5814296", "0.5803924", "0.5799564" ]
0.8447459
0
Set the default values for the range elements
private function getDefaultValues() { return [ 'year-start' => 1997, 'year-end' => 2018, 'month-start' => 1, 'month-end' => 12, 'page-start' => 1, 'page-end' => 300, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setDefaultValues() {}", "public function setDefaultValues() {\n $this->effective_date = \"1970-1-1\";\n $this->end_date = \"9999-12-31\";\n $this->pu_percentage = 100;\n }", "public function setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "protected static function setRange(array $range = [])\n {\n static::$range = ! empty($range) ? $range : range(0, 9);\n }", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n {\n $this->setregis = 0;\n }", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n\t}", "public function applyDefaultValues()\n {\n $this->is_not = false;\n $this->rank = 0;\n }", "public function assignDefaultValues() {\n\t\t$this->assignByArray(self::$DEFAULT_VALUES);\n\t}", "public function assignDefaultValues() {\n\t\t$this->assignByArray(self::$DEFAULT_VALUES);\n\t}", "public function assignDefaultValues() {\n\t\t$this->assignByArray(self::$DEFAULT_VALUES);\n\t}", "public static function preRenderRange($element) {\n $element['#attributes']['type'] = 'range';\n Element::setAttributes($element, ['id', 'name', 'value', 'step', 'min', 'max']);\n static::setAttributes($element, ['form-range']);\n\n return $element;\n }", "public function applyDefaultValues()\n {\n $this->montacargas_baja = 0;\n }", "function _setDefaults() {}", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}", "protected function _construct() {\n parent::_construct();\n\n if (!$this->hasData('range')) {\n $this->setData('range', 5);\n }\n }", "public function applyDefaultValues()\n {\n $this->jml_lantai = '1';\n $this->asal_data = '1';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->closed = 0;\n\t\t$this->lastfmid = 0;\n\t\t$this->hasphotos = 0;\n\t}", "function setDefaults()\n {\n }", "function setDisplayRange(&$range_limits,$total_pages,$page_index){\n\t\tdefine('PAGES_DISPLAYED',7);\n\t\tdefine('MAX_OFFSET',3);\n\t\t\n\t\tif ($total_pages <= constant('PAGES_DISPLAYED')){\n\t\t\t//range 1 to $total_pages\n\t\t\t$range_limits['min'] = 1;\n\t\t\t$range_limits['max'] = $total_pages;\n\t\t} else {//range $PAGE_NO_MAX buttons required\n\t\t\t//button moves, range is stationary\n\t\t\tif (($page_index <= constant('MAX_OFFSET')) || (($total_pages - $page_index) < constant('MAX_OFFSET'))) {\n\t\t\t\tif ($page_index <= constant('MAX_OFFSET')) {\n\t\t\t\t\t$range_limits['min'] = 1;\n\t\t\t\t\t$range_limits['max'] = constant('PAGES_DISPLAYED');\n\t\t\t\t} else {\n\t\t\t\t\t$range_limits['min'] = $total_pages - (constant('PAGES_DISPLAYED') - 1);\n\t\t\t\t\t$range_limits['max'] = $total_pages;\n\t\t\t\t}\n\t\t\t} else {//($page_index > $max_offset) && (($total_pages - $page_index) > $max_offset)\n\t\t\t\t//button stationary, range moves[$page_index +/- $max_offset] \n\t\t\t\t$range_limits['min'] = $page_index - constant('MAX_OFFSET');\n\t\t\t\t$range_limits['max'] = $page_index + constant('MAX_OFFSET');\n\t\t\t}\t\n\t\t}\n\t\treturn;\t\t\t\n\t}", "private function init_set() {\n\t\t$this->_set = array();\n\t\tfor($i=0; $i < $this->_max-$this->_min + 1; $i++) {\n\t\t\t$this->_set[$i] = $this->_min + $i;\n\t\t}\n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->type = 1;\n\t\t$this->total_index = 0;\n\t\t$this->is_published = true;\n\t\t$this->is_featured = false;\n\t\t$this->comments_count = 0;\n\t}", "function range($args) {\r\n\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\t\techo \"<div style='line-height:24px;'><input style=' float:left;\" . $this->width($args['width']) . \"' type='range' data-tooltip='\" . $args['tooltip'] . \"' min='\" . $args['min'] . \"' max='\" . $args['max'] . \"' class='range' size='57' \" . $this->placeholder($args['placeholder'] ) . \" name='\" . $args['formname'] . \"' value='\" . $args['value'] . \"'/>\";\t\t\t\t\r\n\t\t\r\n\t\techo \"<span style=' float:left; margin-left:10px;' class='rangeval'>\" . $args['value']. \"</span><span>\" . $args['unit']. \"</span</div>\";\r\n\t\r\n\t\t$this->description($args['description']);\r\n\t\t}", "public function addRange($min, $max)\n {\n $this->range = \"$min to $max\";\n array_push($this->options, array(\"options\" => array(\"min_range\" => $min, \"max_range\" => $max)));\n }", "public function applyDefaultValues()\n {\n $this->is_active = false;\n $this->is_closed = false;\n }", "public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}", "public function getRange() {\n\n }", "public function applyDefaultValues()\n {\n $this->active = false;\n }", "protected function set_date_range_parameters($adjust_empty_vals = TRUE)\n\t{\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\tif ($this->P->value('show_years') > 0 OR\n\t\t\t\t$this->P->value('show_months') > 0 OR\n\t\t\t\t$this->P->value('show_weeks') > 0 OR\n\t\t\t\t$this->P->value('show_days') > 0)\n\t\t\t{\n\t\t\t\t$this->P->set('date_range_end', $this->P->params['date_range_start']['value']);\n\n\t\t\t\tif ($this->P->value('show_years') > 0)\n\t\t\t\t{\n\t\t\t\t\t $this->CDT->add_year($this->P->value('show_years') -1, TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_months') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_month(($this->P->value('show_months') - 1), TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_weeks') > 0)\n\t\t\t\t{\n\t\t\t\t\t//get the current day of week (1-7)\n\t\t\t\t\t$dow\t\t= $this->CDT->get_day_of_week(\n\t\t\t\t\t\t$this->CDT->year,\n\t\t\t\t\t\t$this->CDT->month,\n\t\t\t\t\t\t$this->CDT->day\n\t\t\t\t\t) + 1;\n\n\t\t\t\t\t//first day of week\n\t\t\t\t\t$fdow \t\t= $this->get_first_day_of_week();\n\n\t\t\t\t\t//we need to calculate 2 weeks backwards, counting today (-1) removing the remaining\n\t\t\t\t\t//days of the week, MINUS the first day of the week...\n\t\t\t\t\t//this will give is first day of the week, x weeks forward, counting this week as a full\n\t\t\t\t\t//week regardless of the day\n\n\t\t\t\t\t$this->CDT->add_day(( 7 * $this->P->value('show_weeks') ) - ($dow - $fdow));\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_days') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day($this->P->value('show_days') - 1);\n\t\t\t\t}\n\n\t\t\t\t$end = $this->CDT->datetime_array();\n\n\t\t\t\t$end[\"time\"]\t= \"2359\";\n\t\t\t\t$end[\"hour\"]\t= '23';\n\t\t\t\t$end[\"minute\"]\t= '59';\n\n\t\t\t\t$this->P->set('date_range_end', $end);\n\t\t\t}\n\t\t}\n\t\telseif ($this->P->value('date_range_start') === FALSE AND\n\t\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t$this->CDT->change_ymd($this->P->value('date_range_end', 'ymd'));\n\n\t\t\tif ($this->P->value('show_years') > 0 OR\n\t\t\t\t$this->P->value('show_months') > 0 OR\n\t\t\t\t$this->P->value('show_weeks') > 0 OR\n\t\t\t\t$this->P->value('show_days') > 0)\n\t\t\t{\n\t\t\t\tif ($this->P->value('show_years') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_year(-$this->P->value('show_years') + 1, TRUE, 'backward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_months') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_month(-$this->P->value('show_months') + 1, TRUE, 'backward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_weeks') > 0)\n\t\t\t\t{\n\t\t\t\t\t//get the current day of week (1-7)\n\t\t\t\t\t$dow\t\t= $this->CDT->get_day_of_week(\n\t\t\t\t\t\t$this->CDT->year,\n\t\t\t\t\t\t$this->CDT->month,\n\t\t\t\t\t\t$this->CDT->day\n\t\t\t\t\t) + 1;\n\n\t\t\t\t\t//first day of week\n\t\t\t\t\t$fdow \t\t= $this->get_first_day_of_week();\n\n\t\t\t\t\t//we need to calculate 2 weeks backwards, counting today (+1) removing the remaining\n\t\t\t\t\t//days of the week, MINUS the first day of the week...\n\t\t\t\t\t//this will give is first day of the week, x weeks back, counting this week as a full\n\t\t\t\t\t//week regardless of the day\n\t\t\t\t\t$this->CDT->add_day(( -7 * $this->P->value('show_weeks') ) + 1 + (7 - ($dow - $fdow)));\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_days') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(-$this->P->value('show_days') + 1);\n\t\t\t\t}\n\n\t\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\t\t\t}\n\t\t}\n\t\telseif ($adjust_empty_vals === TRUE AND\n\t\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t\t$this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\n\t\t\tif ($this->P->value('show_years') > 0 OR\n\t\t\t\t$this->P->value('show_months') > 0 OR\n\t\t\t\t$this->P->value('show_weeks') > 0 OR\n\t\t\t\t$this->P->value('show_days') > 0)\n\t\t\t{\n\t\t\t\tif ($this->P->value('show_years') > 0)\n\t\t\t\t{\n\t\t\t\t\t $this->CDT->add_year($this->P->value('show_years') -1, TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_months') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_month(($this->P->value('show_months') - 1), TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_weeks') > 0)\n\t\t\t\t{\n\t\t\t\t\t//get the current day of week (1-7)\n\t\t\t\t\t$dow\t\t= $this->CDT->get_day_of_week(\n\t\t\t\t\t\t$this->CDT->year,\n\t\t\t\t\t\t$this->CDT->month,\n\t\t\t\t\t\t$this->CDT->day\n\t\t\t\t\t) + 1;\n\n\t\t\t\t\t//first day of week\n\t\t\t\t\t$fdow \t\t= $this->get_first_day_of_week();\n\n\t\t\t\t\t//we need to calculate 2 weeks backwards, counting today (-1) removing the remaining\n\t\t\t\t\t//days of the week, MINUS the first day of the week...\n\t\t\t\t\t//this will give is first day of the week, x weeks forward, counting this week as a full\n\t\t\t\t\t//week regardless of the day\n\n\t\t\t\t\t$this->CDT->add_day(( 7 * $this->P->value('show_weeks') ) - ($dow - $fdow));\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_days') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day($this->P->value('show_days') - 1);\n\t\t\t\t}\n\n\t\t\t\t$end = $this->CDT->datetime_array();\n\n\t\t\t\t$end[\"time\"]\t= \"2359\";\n\t\t\t\t$end[\"hour\"]\t= '23';\n\t\t\t\t$end[\"minute\"]\t= '59';\n\n\t\t\t\t$this->P->set('date_range_end', $end);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$end = $this->P->params['date_range_start']['value'];\n\n\t\t\t\t$end[\"time\"]\t= \"2359\";\n\t\t\t\t$end[\"hour\"]\t= '23';\n\t\t\t\t$end[\"minute\"]\t= '59';\n\n\t\t\t\t$this->P->set('date_range_end', $end);\n\n\t\t\t\t//$this->P->set('date_range_end', $this->P->value('date_range_start'));\n\t\t\t}\n\t\t}\n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}", "public function setDefaultValues() {\n return [];\n }", "function setArticleCountsRange($min, $max)\n\t{\n\t\t$this->validate['articles_count']['range']['rule'][1] = $min-1;\n\t\t$this->validate['articles_count']['range']['rule'][2] = $max+1;\n\t}", "public function setDataRange($startVal, $endVal) {\n\t\t$this->setMaxValue($endVal);\n\t\t$this->setMinValue($startVal);\n\t\t$this->setProperty('chds', $startVal.','.$endVal);\n\t}", "public function setMinMax($min, $max) {\r\n $this->automatic = false;\r\n $this->automaticMinimum = false;\r\n $this->automaticMaximum = false;\r\n\r\n if ($min > $max) { // swap\r\n $tmp = $min;\r\n $min = $max;\r\n $max = $tmp;\r\n }\r\n\r\n $this->internalSetMinimum($min);\r\n $this->internalSetMaximum($max);\r\n if (($this->maximumvalue - $this->minimumvalue) < self::$MINAXISRANGE) {\r\n $this->internalSetMaximum($this->minimumvalue + self::$MINAXISRANGE);\r\n }\r\n }", "public function applyDefaultValues()\n {\n $this->create_date = '2020-04-16 09:40:03';\n $this->last_update = '2020-04-16 09:40:03';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "private function setDefaults()\n {\n /** @var Property $property */\n foreach($this->properties as $name => $property)\n {\n $property->applyDefault();\n }\n }", "public function setRange($range)\n {\n Argument::i()->test(1, 'int');\n \n if ($range < 0) {\n $range = 25;\n }\n \n $this->range = $range;\n \n return $this;\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->platform = 'pc';\n\t\t$this->experience_score = 0;\n\t\t$this->up_votes = 0;\n\t\t$this->down_votes = 0;\n\t\t$this->is_guest = 0;\n\t\t$this->is_admin = 0;\n\t\t$this->today_votes = 0;\n\t\t$this->email_on = 1;\n\t}", "public function getPrintPageRange(array $defaultValue = [/** value is missing */]) {}", "public function setBoundaries()\n {\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->is_archived = 0;\n\t\t$this->google_analytics_enabled = false;\n\t}", "public function defaultValues($items = array()){\n //Merge the default vales entered with any existing ones\n $this->defaultValues = array_merge($this->defaultValues, $items);\n }", "public static function range($value, $min, $max, $message = '');", "abstract protected function defaults(): array;", "function setDefault($value)\n {\n $this->_defValue = $value;\n }", "public function setRange( $range ) \n {\n \n if( !is_int( $range ) ) {\n throw new Execption( \"<<THE RANGE MUST BE AN INTEGER>>\" );\n }\n \n $this->_range = $range;\n \n }", "public function applyDefaultValues()\n {\n $this->last_sync = '1901-01-01 00:00:00';\n }", "public function initializeDefaults()\n {\n }", "public function setRange(int $low, int $high) : void\n\t{\n\t\t$this->isRangeY = true;\n\t\t$this->rangeYHigh = $high;\n\t\t$this->rangeYLow = $low;\n\n\t}", "public function getDefaultAttributes()\n {\n return [\n 'Value' => 0,\n 'MinValue' => 0,\n 'MaxValue' => 100,\n 'Increment' => 1,\n ];\n }", "function set_defaults()\n {\n $mapper = $this->get_mapper();\n if ($mapper->has_method('set_defaults')) {\n $mapper->set_defaults($this);\n }\n }", "public function __construct($alias='',$name='',$default=0,$min=NULL,$max=NULL){\n\t\tparent::__construct($alias,$name,$default);\n\t\t$this->min=$min;\n\t\t$this->max=$max;\n\t\t}", "protected function fill()\n {\n array_map(function ($field) {\n $defaultValue = isset($this->defaultFields[$field]['defaultValue']) ?\n $this->defaultFields[$field]['defaultValue'] :\n null;\n\n $this->values[$field] = (new $this->defaultFields[$field]['format']($defaultValue))\n ->setPosition($this->defaultFields[$field]['position'])\n ->setLength($this->defaultFields[$field]['length']);\n }, array_keys($this->defaultFields));\n }", "public function range($start, $end, $step = null): static;", "public function addDefaultEntriesAndValues() {}", "public function setMemberDefaults(){\n parent::setMemberDefaults();\n \n $this->id = $this->id ? $this->id : UniqId::get(\"rbn-\");\n if (!$this->collarTriangleWidth) {\n $this->collarTriangleWidth = StyleUtil::getHalf($this->collarWidth);\n }\n if (!$this->collarColor) {\n if ($this->barColor){\n $this->collarColor = $this->barColor;\n }\n else if( $this->barGradient ){\n $this->collarColor = GradientInfo::getLastColor($this->barGradient);\n }\n }\n }", "function tradeoff_value_range($definition)\n {\n return app(Models\\Problem\\Range\\ValueRange::class)->setData($definition);\n }", "final protected function _defaults(){\n if(! $this->_defaults) return;\n foreach($this->_defaults as $conf => $default_value){\n if(! self::inform($conf)) self::define($conf, $default_value);\n }\n }", "protected function _initItems()\n {\n $attribute = $this->getAttributeModel();\n if ($this->advLayNavHelper->isAdvLayNavRangeSliderAttribute($attribute)) {\n if (!$this->_items) {\n $attributeCode = $attribute->getAttributeCode();\n $layer = $this->getLayer();\n /** @var \\Magento\\CatalogSearch\\Model\\ResourceModel\\Fulltext\\Collection $productCollection */\n $productCollection = $layer->getProductCollection();\n if ($this->advLayNavHelper->isFilterApplied($layer->getState(), $attributeCode)) {\n $productCollection = $layer->getCurrentCategory()->getProductCollection();\n }\n $productCollection->addPriceData(\n $this->custSession->getCustomerGroupId(),\n $this->_storeManager->getStore()->getWebsiteId()\n );\n $minValue = floor($productCollection->getMinPrice());\n $maxValue = ceil($productCollection->getMaxPrice());\n if (!$this->fromValue) {\n $this->fromValue = $minValue;\n }\n if (!$this->toValue) {\n $this->toValue = $maxValue;\n }\n\n if ($minValue == $maxValue) {\n $this->_items = [];\n } else {\n $this->_items = [\n 'min' => max(0, $minValue),\n 'from' => max(0, $this->fromValue),\n 'to' => max(0, $this->toValue),\n 'max' => max(0, $maxValue),\n ];\n }\n }\n return $this;\n }\n return parent::_initItems();\n }", "function option_definition() {\n $options = parent::option_definition();\n $options['year_range'] = array('default' => '-3:+3');\n $options['granularity'] = array('default' => 'month');\n $options['default_argument_type']['default'] = 'date';\n $options['add_delta'] = array('default' => '');\n $options['use_fromto'] = array('default' => '');\n $options['title_format'] = array('default' => '');\n $options['title_format_custom'] = array('default' => '');\n return $options;\n }", "protected function setDefaults()\n {\n return;\n }", "public function setMinMax(?int $iMin, ?int $iMax) : void\n {\n $this->iMin = $iMin ?? $this->iMin;\n $this->iMax = $iMax ?? $this->iMax;\n }", "public function set_defaults() {\n\n\t\t// Retrieve the stylesheet option to set the proper defaults\n\t\t$style_option = tribe_get_option( 'stylesheetOption', 'tribe' );\n\n\t\tswitch ( $style_option ) {\n\t\t\tcase 'full': // Full styles\n\t\t\t\t$this->defaults = array(\n\t\t\t\t\t'table_bg_color' => '#fff',\n\t\t\t\t\t'highlight_color' => '#666',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'skeleton': // Skeleton styles\n\t\t\tdefault: // tribe styles is the default so add full and theme (tribe)\n\t\t\t\t$this->defaults = array(\n\t\t\t\t\t'table_bg_color' => '#f9f9f9',\n\t\t\t\t\t'highlight_color' => '#21759b',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "public static function set_default_values() {\n\t\t?>\n\t\tcase \"nu_phone\" :\n\t\t\tfield.label = \"Phone\";\n\t\t\tfield.isRequired = true;\n\t\t\tfield.description = \"Numbers only. e.g. 8885551212\";\n\t\t\tbreak;\n\t\t<?php\n\t}", "public function setDefaultValues()\r\n {\r\n foreach ($this->defaultValues as $property => $value) {\r\n if (is_null($this->$property)) {\r\n $this->$property = $value;\r\n }\r\n }\r\n }", "function slider_theme_settings_default($default_arr = array()){\n $slider_default = array(\n 'slider_speed' => '700',\n 'slider_effect' => 'fade',\n 'slider_pause' => '3000',\n 'slider_num' => '5',\n 'use_slider' => '0'\n );\n\n return array_merge($default_arr, $slider_default);\n}", "public function applyDefaultValues()\n {\n $this->pothnbr = '';\n $this->pothstat = 'N';\n $this->pothrcptdate = '';\n $this->intbwhse = '';\n $this->pothglpd = 0;\n $this->pothairship = 'N';\n $this->potherinreview = 'N';\n $this->pothexchctry = '';\n $this->pothexchrate = '0.0000000';\n $this->intbwhseorig = '';\n $this->pothlandcost = '0.0000000';\n $this->pothrcptnbr = 0;\n $this->pothlandbasedon = '';\n $this->pothinvcnbr = '';\n $this->pothinvcdate = '';\n $this->pothfrtamt = '0.00';\n $this->pothmiscamt = '0.00';\n $this->dateupdtd = '';\n $this->timeupdtd = '';\n $this->dummy = 'P';\n }", "protected function defaultValues() : array\n {\n return [\n 'limit' => 20,\n 'offset' => 0,\n 'order_by_dir' => 'DESC',\n ];\n }", "public function setDefaultValues(array $defaultValues)\n {\n $this->defaultValues = $defaultValues;\n }", "function range( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_RANGE,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}", "public function SetDefaults ($defaults = []);", "public function pi_setPiVarDefaults() {}", "public function setModelDefaults() \n {\n if (!empty($this->model->defaultFieldValues())) {\n \n foreach($this->model->defaultFieldValues() as $field => $defaultValue) {\n\n $this->model->$field = $defaultValue;\n }\n } \n }", "public function testRange() {\n\t\t$result = _::range(5);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(0, $result[0]);\n\t\t$this->assertEquals(1, $result[1]);\n\t\t$this->assertEquals(2, $result[2]);\n\t\t$this->assertEquals(3, $result[3]);\n\t\t$this->assertEquals(4, $result[4]);\n\n\t\t// test range with two parameters\n\t\t$result = _::range(1, 4);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(3, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\n\t\t// test range with three parameters\n\t\t$result = _::range(1, 10, 2);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(3, $result[1]);\n\t\t$this->assertEquals(5, $result[2]);\n\t\t$this->assertEquals(7, $result[3]);\n\t\t$this->assertEquals(9, $result[4]);\n\t}", "public function setDefaultValue($value);", "public function applyDefaultValues()\n {\n $this->create_date = '2021-06-07 11:49:57';\n $this->last_update = '2021-06-07 11:49:57';\n $this->last_sync = '1901-01-01 00:00:00';\n $this->jml_jamban_l_g = '0';\n $this->jml_jamban_l_tg = '0';\n $this->jml_jamban_p_g = '0';\n $this->jml_jamban_p_tg = '0';\n $this->jml_jamban_lp_g = '0';\n $this->jml_jamban_lp_tg = '0';\n $this->tipe_jamban = '9';\n $this->a_sedia_pembalut = '0';\n $this->a_tempat_sampah_kelas = '0';\n $this->a_tempat_sampah_tutup_p = '0';\n $this->a_cermin_jamban_p = '0';\n $this->a_memiliki_tps = '0';\n $this->a_tps_angkut_rutin = '0';\n $this->a_anggaran_sanitasi = '0';\n $this->a_melibatkan_sanitasi_siswa = '0';\n }", "function pixgraphy_get_option_defaults_values() {\n\t\tglobal $pixgraphy_default_values;\n\t\t$pixgraphy_default_values = array(\n\t\t\t'pixgraphy_responsive'\t=> 'on',\n\t\t\t'pixgraphy_column_post'\t=>'four',\n\t\t\t'pixgraphy_border_column'\t=>'on',\n\t\t\t'pixgraphy_design_layout' => 'wide-layout',\n\t\t\t'pixgraphy_animate_css'\t=> 'on',\n\t\t\t'pixgraphy_sidebar_layout_options' => 'right',\n\t\t\t'pixgraphy_photography_layout' => 'photography_layout',\n\t\t\t'pixgraphy_search_custom_header' => 0,\n\t\t\t'pixgraphy-img-upload-footer-image' => '',\n\t\t\t'pixgraphy-footer-title'\t=> '',\n\t\t\t'pixgraphy-footer-link'\t=> '#',\n\t\t\t'pixgraphy_header_display'=> 'header_text',\n\t\t\t'pixgraphy_categories'\t=> array(),\n\t\t\t'pixgraphy_custom_css'\t=> '',\n\t\t\t'pixgraphy_scroll'\t=> 0,\n\t\t\t'pixgraphy_tag_text' => esc_html__('Read More','pixgraphy'),\n\t\t\t'pixgraphy_excerpt_length'\t=> '20',\n\t\t\t'pixgraphy_single_post_image' => 'off',\n\t\t\t'pixgraphy_reset_all' => 0,\n\t\t\t'pixgraphy_stick_menu'\t=>0,\n\t\t\t'pixgraphy_blog_post_image' => 'on',\n\t\t\t'pixgraphy_entry_format_blog' => 'excerptblog_display',\n\t\t\t'pixgraphy_search_text' => esc_html__('Search &hellip;','pixgraphy'),\n\t\t\t'pixgraphy_blog_content_layout'\t=> '',\n\t\t\t'pixgraphy_display_page_featured_image'=>0,\n\t\t\t/* Slider Settings */\n\t\t\t'pixgraphy_slider_type'\t=> 'default_slider',\n\t\t\t'pixgraphy_slider_link' =>0,\n\t\t\t'pixgraphy_enable_slider' => 'frontpage',\n\t\t\t'pixgraphy_transition_effect' => 'fade',\n\t\t\t'pixgraphy_transition_delay' => '4',\n\t\t\t'pixgraphy_transition_duration' => '1',\n\t\t\t/* Front page feature */\n\t\t\t'pixgraphy_entry_format_blog' => 'show',\n\t\t\t'pixgraphy_entry_meta_blog' => 'show-meta',\n\t\t\t/*Social Icons */\n\t\t\t'pixgraphy_top_social_icons' =>0,\n\t\t\t'pixgraphy_buttom_social_icons'\t=>0,\n\t\t\t'pixgraphy_social_facebook'=> '',\n\t\t\t'pixgraphy_social_twitter'=> '',\n\t\t\t'pixgraphy_social_pinterest'=> '',\n\t\t\t'pixgraphy_social_dribbble'=> '',\n\t\t\t'pixgraphy_social_instagram'=> '',\n\t\t\t'pixgraphy_social_flickr'=> '',\n\t\t\t'pixgraphy_social_googleplus'=> '',\n\t\t\t'pixgraphy_remove_parallax_fromheader'=>0,\n\t\t\t);\n\t\treturn apply_filters( 'pixgraphy_get_option_defaults_values', $pixgraphy_default_values );\n\t}", "private function init(): void\n {\n $this->value_signs = [\n '+' => 'plus',\n '-' => 'minus',\n ];\n\n // init number formatter\n $formatter = new NumberFormatter($this->getValueLocale(), NumberFormatter::SPELLOUT);\n\n // generate number value array with translated labels per locale\n for ($index = $this->getValueRange()[0]; $index <= $this->getValueRange()[1]; $index++) {\n $this->value_numbers[$index] = $formatter->format($index);\n }\n }", "public function getDefaultValue();", "public function getDefaultValue();", "public function __construct($name, $value, $start = false, $end = false, phpMyWave_Range $range = false) {\n\n }", "public function fillupDefault()\n {\n\n foreach (static::$cols as $key => $col) {\n if ('' != $col[self::COL_DEFAULT]) {\n $this->data[$key] = $col[self::COL_DEFAULT];\n }\n }\n\n }", "public function range($start = NULL, $length = NULL);", "private function _setDefaults(): void {\n\t\t// default query options\n\t\t$options['limit'] = 50;\n\t\t$options['offset'] = false;\n\t\t$options['sort'] = false;\n\t\t$options['sortDirection'] = false;\n\t\t$this->setQueryOptions($options);\n\t}", "protected function setElementDefaultValue(array &$element, array $limits, array $disabled, $operation) {\n $webform_element = $this->getWebformElement();\n $has_multiple_values = $webform_element->hasMultipleValues($element);\n // Make sure the test default value is an enabled option.\n if ($operation === 'test') {\n $test_values = array_keys($disabled ? array_diff_key($limits, $disabled) : $limits);\n if ($test_values) {\n $test_value = $test_values[array_rand($test_values)];\n $element['#default_value'] = ($has_multiple_values) ? [$test_value] : $test_value;\n }\n else {\n $element['#default_value'] = ($has_multiple_values) ? [] : NULL;\n }\n }\n // Cleanup default values.\n elseif (!empty($element['#default_value'])) {\n $default_value = $element['#default_value'];\n if ($has_multiple_values) {\n $element['#default_value'] = array_values(array_diff($default_value, $disabled));\n }\n else {\n if (isset($disabled[$default_value])) {\n $element['#default_value'] = ($has_multiple_values) ? [] : NULL;\n }\n }\n }\n }", "public function setDefaults (array $options = []);", "function set_data($default_values) {\n if (is_object($default_values)) {\n $default_values = (array)$default_values;\n }\n $this->data_preprocessing($default_values);\n parent::set_data($default_values); //never slashed for moodleform_mod\n }", "public static function getRangeOptions()\n\t{\n\t\t$options = array(\n\t\t\tJHtml::_('select.option', 'today', JText::_('COM_REALTOR_OPTION_RANGE_TODAY')),\n\t\t\tJHtml::_('select.option', 'past_week', JText::_('COM_REALTOR_OPTION_RANGE_PAST_WEEK')),\n\t\t\tJHtml::_('select.option', 'past_1month', JText::_('COM_REALTOR_OPTION_RANGE_PAST_1MONTH')),\n\t\t\tJHtml::_('select.option', 'past_3month', JText::_('COM_REALTOR_OPTION_RANGE_PAST_3MONTH')),\n\t\t\tJHtml::_('select.option', 'past_6month', JText::_('COM_REALTOR_OPTION_RANGE_PAST_6MONTH')),\n\t\t\tJHtml::_('select.option', 'past_year', JText::_('COM_REALTOR_OPTION_RANGE_PAST_YEAR')),\n\t\t\tJHtml::_('select.option', 'post_year', JText::_('COM_REALTOR_OPTION_RANGE_POST_YEAR')),\n\t\t);\n\t\treturn $options;\n\t}", "public function setRange($limit = null, $offset = null)\n {\n $this->range_limit = $limit;\n $this->range_offset = $offset;\n\n return $this;\n }", "function setDefaults() {\r\n\t\t$this->border='1px solid #46b0ee';\r\n\t\t$this->fgColor='#ff9000';\r\n\t\t$this->bgColor='#FFFFFF';\r\n\t}", "public function __construct()\n\t{\n\t\t$this->vardef_map['enable_range_search'] = 'enable_range_search';\n\t\t$this->vardef_map['options'] = 'options';\n\t}", "public function setFilterRange($attribute, $min, $max, $exclude = false)\n\t{\n\t\t$this->range[] = ($exclude ? '!' : '') . $attribute . \",{$min},{$max}\";\n\t}", "public function setDefaultValue($value=null);", "public function getDefaults();", "public function setDefault($value);", "public function getDefaultParameters();" ]
[ "0.70952886", "0.6910228", "0.6867594", "0.6743669", "0.6733688", "0.6733688", "0.6733688", "0.65325993", "0.6472337", "0.6349926", "0.6337429", "0.6337429", "0.6337429", "0.62502474", "0.621203", "0.6173687", "0.60988736", "0.60082996", "0.59952825", "0.59924823", "0.5985392", "0.5979443", "0.59794384", "0.5977782", "0.5921483", "0.59177923", "0.58827794", "0.58207417", "0.5808196", "0.57773817", "0.57304215", "0.5716239", "0.57158315", "0.5713462", "0.5710496", "0.56891274", "0.56753504", "0.56481576", "0.5646695", "0.5638808", "0.56332874", "0.5627486", "0.56260353", "0.5602373", "0.5598622", "0.55957586", "0.55950797", "0.5584116", "0.55765337", "0.5566119", "0.55390966", "0.55251986", "0.5499151", "0.5498202", "0.54952365", "0.54892004", "0.54682547", "0.5466927", "0.5455004", "0.5442529", "0.5435277", "0.54350525", "0.5427326", "0.54187316", "0.5413044", "0.54070526", "0.54066", "0.540442", "0.5402139", "0.5400592", "0.5398919", "0.53814656", "0.53730613", "0.5368765", "0.53584355", "0.5357032", "0.532779", "0.53173363", "0.53163993", "0.5312553", "0.5305921", "0.53023344", "0.52924305", "0.52924305", "0.52893883", "0.52878535", "0.5278228", "0.5277512", "0.5275709", "0.5272196", "0.5255106", "0.525023", "0.5238594", "0.52352244", "0.5224084", "0.522117", "0.5218075", "0.52175146", "0.52052253", "0.5205109" ]
0.60266376
17
Merge the provided range values with the default values
private function mergeRangeValues(array $ranges) { // Get the default values $defaults = $this->getDefaultValues(); // Merge the default values with the provided range values return array_merge($defaults, $ranges); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "function setDefaultValues() {}", "private function getDefaultValues()\n {\n return [\n 'year-start' => 1997,\n 'year-end' => 2018,\n 'month-start' => 1,\n 'month-end' => 12,\n 'page-start' => 1,\n 'page-end' => 300,\n ];\n }", "public function setDefaultValues() {\n $this->effective_date = \"1970-1-1\";\n $this->end_date = \"9999-12-31\";\n $this->pu_percentage = 100;\n }", "public function assignDefaultValues() {\n\t\t$this->assignByArray(self::$DEFAULT_VALUES);\n\t}", "public function assignDefaultValues() {\n\t\t$this->assignByArray(self::$DEFAULT_VALUES);\n\t}", "public function assignDefaultValues() {\n\t\t$this->assignByArray(self::$DEFAULT_VALUES);\n\t}", "protected static function setRange(array $range = [])\n {\n static::$range = ! empty($range) ? $range : range(0, 9);\n }", "public function addRange($min, $max)\n {\n $this->range = \"$min to $max\";\n array_push($this->options, array(\"options\" => array(\"min_range\" => $min, \"max_range\" => $max)));\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->closed = 0;\n\t\t$this->lastfmid = 0;\n\t\t$this->hasphotos = 0;\n\t}", "protected function set_date_range_parameters($adjust_empty_vals = TRUE)\n\t{\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\tif ($this->P->value('show_years') > 0 OR\n\t\t\t\t$this->P->value('show_months') > 0 OR\n\t\t\t\t$this->P->value('show_weeks') > 0 OR\n\t\t\t\t$this->P->value('show_days') > 0)\n\t\t\t{\n\t\t\t\t$this->P->set('date_range_end', $this->P->params['date_range_start']['value']);\n\n\t\t\t\tif ($this->P->value('show_years') > 0)\n\t\t\t\t{\n\t\t\t\t\t $this->CDT->add_year($this->P->value('show_years') -1, TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_months') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_month(($this->P->value('show_months') - 1), TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_weeks') > 0)\n\t\t\t\t{\n\t\t\t\t\t//get the current day of week (1-7)\n\t\t\t\t\t$dow\t\t= $this->CDT->get_day_of_week(\n\t\t\t\t\t\t$this->CDT->year,\n\t\t\t\t\t\t$this->CDT->month,\n\t\t\t\t\t\t$this->CDT->day\n\t\t\t\t\t) + 1;\n\n\t\t\t\t\t//first day of week\n\t\t\t\t\t$fdow \t\t= $this->get_first_day_of_week();\n\n\t\t\t\t\t//we need to calculate 2 weeks backwards, counting today (-1) removing the remaining\n\t\t\t\t\t//days of the week, MINUS the first day of the week...\n\t\t\t\t\t//this will give is first day of the week, x weeks forward, counting this week as a full\n\t\t\t\t\t//week regardless of the day\n\n\t\t\t\t\t$this->CDT->add_day(( 7 * $this->P->value('show_weeks') ) - ($dow - $fdow));\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_days') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day($this->P->value('show_days') - 1);\n\t\t\t\t}\n\n\t\t\t\t$end = $this->CDT->datetime_array();\n\n\t\t\t\t$end[\"time\"]\t= \"2359\";\n\t\t\t\t$end[\"hour\"]\t= '23';\n\t\t\t\t$end[\"minute\"]\t= '59';\n\n\t\t\t\t$this->P->set('date_range_end', $end);\n\t\t\t}\n\t\t}\n\t\telseif ($this->P->value('date_range_start') === FALSE AND\n\t\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t$this->CDT->change_ymd($this->P->value('date_range_end', 'ymd'));\n\n\t\t\tif ($this->P->value('show_years') > 0 OR\n\t\t\t\t$this->P->value('show_months') > 0 OR\n\t\t\t\t$this->P->value('show_weeks') > 0 OR\n\t\t\t\t$this->P->value('show_days') > 0)\n\t\t\t{\n\t\t\t\tif ($this->P->value('show_years') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_year(-$this->P->value('show_years') + 1, TRUE, 'backward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_months') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_month(-$this->P->value('show_months') + 1, TRUE, 'backward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_weeks') > 0)\n\t\t\t\t{\n\t\t\t\t\t//get the current day of week (1-7)\n\t\t\t\t\t$dow\t\t= $this->CDT->get_day_of_week(\n\t\t\t\t\t\t$this->CDT->year,\n\t\t\t\t\t\t$this->CDT->month,\n\t\t\t\t\t\t$this->CDT->day\n\t\t\t\t\t) + 1;\n\n\t\t\t\t\t//first day of week\n\t\t\t\t\t$fdow \t\t= $this->get_first_day_of_week();\n\n\t\t\t\t\t//we need to calculate 2 weeks backwards, counting today (+1) removing the remaining\n\t\t\t\t\t//days of the week, MINUS the first day of the week...\n\t\t\t\t\t//this will give is first day of the week, x weeks back, counting this week as a full\n\t\t\t\t\t//week regardless of the day\n\t\t\t\t\t$this->CDT->add_day(( -7 * $this->P->value('show_weeks') ) + 1 + (7 - ($dow - $fdow)));\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_days') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(-$this->P->value('show_days') + 1);\n\t\t\t\t}\n\n\t\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\t\t\t}\n\t\t}\n\t\telseif ($adjust_empty_vals === TRUE AND\n\t\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t\t$this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\n\t\t\tif ($this->P->value('show_years') > 0 OR\n\t\t\t\t$this->P->value('show_months') > 0 OR\n\t\t\t\t$this->P->value('show_weeks') > 0 OR\n\t\t\t\t$this->P->value('show_days') > 0)\n\t\t\t{\n\t\t\t\tif ($this->P->value('show_years') > 0)\n\t\t\t\t{\n\t\t\t\t\t $this->CDT->add_year($this->P->value('show_years') -1, TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_months') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_month(($this->P->value('show_months') - 1), TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_weeks') > 0)\n\t\t\t\t{\n\t\t\t\t\t//get the current day of week (1-7)\n\t\t\t\t\t$dow\t\t= $this->CDT->get_day_of_week(\n\t\t\t\t\t\t$this->CDT->year,\n\t\t\t\t\t\t$this->CDT->month,\n\t\t\t\t\t\t$this->CDT->day\n\t\t\t\t\t) + 1;\n\n\t\t\t\t\t//first day of week\n\t\t\t\t\t$fdow \t\t= $this->get_first_day_of_week();\n\n\t\t\t\t\t//we need to calculate 2 weeks backwards, counting today (-1) removing the remaining\n\t\t\t\t\t//days of the week, MINUS the first day of the week...\n\t\t\t\t\t//this will give is first day of the week, x weeks forward, counting this week as a full\n\t\t\t\t\t//week regardless of the day\n\n\t\t\t\t\t$this->CDT->add_day(( 7 * $this->P->value('show_weeks') ) - ($dow - $fdow));\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_days') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day($this->P->value('show_days') - 1);\n\t\t\t\t}\n\n\t\t\t\t$end = $this->CDT->datetime_array();\n\n\t\t\t\t$end[\"time\"]\t= \"2359\";\n\t\t\t\t$end[\"hour\"]\t= '23';\n\t\t\t\t$end[\"minute\"]\t= '59';\n\n\t\t\t\t$this->P->set('date_range_end', $end);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$end = $this->P->params['date_range_start']['value'];\n\n\t\t\t\t$end[\"time\"]\t= \"2359\";\n\t\t\t\t$end[\"hour\"]\t= '23';\n\t\t\t\t$end[\"minute\"]\t= '59';\n\n\t\t\t\t$this->P->set('date_range_end', $end);\n\n\t\t\t\t//$this->P->set('date_range_end', $this->P->value('date_range_start'));\n\t\t\t}\n\t\t}\n\t}", "function _default($defaults, $options)\n\t{\n\t\treturn array_merge($defaults, $options);\n\t}", "public function applyDefaultValues()\n {\n $this->is_not = false;\n $this->rank = 0;\n }", "public function applyDefaultValues()\n {\n $this->setregis = 0;\n }", "public function defaultValues($items = array()){\n //Merge the default vales entered with any existing ones\n $this->defaultValues = array_merge($this->defaultValues, $items);\n }", "public function setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->is_archived = 0;\n\t\t$this->google_analytics_enabled = false;\n\t}", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "public function addDefaultEntriesAndValues() {}", "public function applyDefaultValues()\n {\n $this->jml_lantai = '1';\n $this->asal_data = '1';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "public function applyDefaultValues()\n {\n $this->montacargas_baja = 0;\n }", "public function applyDefaultValues()\n {\n $this->create_date = '2020-04-16 09:40:03';\n $this->last_update = '2020-04-16 09:40:03';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "function slider_theme_settings_default($default_arr = array()){\n $slider_default = array(\n 'slider_speed' => '700',\n 'slider_effect' => 'fade',\n 'slider_pause' => '3000',\n 'slider_num' => '5',\n 'use_slider' => '0'\n );\n\n return array_merge($default_arr, $slider_default);\n}", "public static function range($value, $min, $max, $message = '');", "function replace_min($range, $params=array(), $tagdata=FALSE)\n {\n return $range['min'];\n }", "public function applyDefaultValues()\n {\n $this->is_active = false;\n $this->is_closed = false;\n }", "public function setDefaultValues() {\n return [];\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}", "protected function mergeDefaults(array $opts) {\n // Merges with defaults.\n $opts = parent::mergeDefaults($opts);\n\n // Converts types.\n $opts['active'] = $this->convertToBoolean($opts['active']);\n $opts['voided'] = $this->convertToBoolean($opts['voided']);\n $opts['related_agents'] = $this->convertToBoolean($opts['related_agents']);\n $opts['related_activities'] = $this->convertToBoolean($opts['related_activities']);\n $opts['attachments'] = $this->convertToBoolean($opts['attachments']);\n $opts['ascending'] = $this->convertToBoolean($opts['ascending']);\n $opts['limit'] = $this->convertToInt($opts['limit']);\n $opts['offset'] = $this->convertToInt($opts['offset']);\n\n if ($opts['limit'] === 0) $opts['limit'] = 100;\n return $opts;\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}", "private function mergeDefaultSettings(){\n\t\t//Get a copy of the default configuration.\n\t\t$defaultConfig = $this->getDefaultConfig();\n\t\t//Check for a 'general' section\n\t\tif(array_key_exists('general', $this->configuration)){\n\t\t\t//If it exists, compare the default keys to the loaded config for missing values\n\t\t\t$missingGeneral = array_diff_key($defaultConfig['general'], $this->configuration['general']);\n\t\t\t//Iterate through the missing values and attach them to the running configuration.\n\t\t\tif(count($missingGeneral) > 0){\n\t\t\t\tforeach($missingGeneral as $key=>$parameter){\n\t\t\t\t\t$this->configuration['general'][$key] = $parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t//Section doesn't exist, so we need to set it to the defaults.\n\t\t\t$this->configuration['general'] = $defaultConfig['general'];\n\t\t}\n\t\t//Check for a 'options' section\n\t\tif(array_key_exists('options', $this->configuration)){\n\t\t\t//If it exists, compare the default keys to the loaded config for missing values\n\t\t\t$missingOptions = array_diff_key($defaultConfig['options'], $this->configuration['options']);\n\t\t\t//Iterate through the missing values and attach them to the running configuration.\n\t\t\tif(count($missionOptions) > 0){\n\t\t\t\tforeach($missingOptions as $key=>$parameter){\n\t\t\t\t\t$this->configuration['options'][$key] = $parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t//Section doesn't exist, so we need to set it to the defaults.\n\t\t\t$this->configuration['options'] = $defaultConfig['options'];\n\t\t}\n\t}", "function options($default) {\r\n $default = array_merge(\r\n $default,\r\n array(\r\n \"maximum_result_set\" => \"3\",\r\n \"default_title\" => __(\"Find nearby locations\", 'slp-experience'),\r\n 'radius_label' => __('Within', 'slp-experience'),\r\n \"search_label\" => __(\"Zip Code\", 'slp-experience'),\r\n \"button_label\" => __(\"Go!\", 'slp-experience'),\r\n )\r\n );\r\n\r\n return $default;\r\n }", "public function getPrintPageRange(array $defaultValue = [/** value is missing */]) {}", "public function applyDefaultValues()\n {\n $this->create_date = '2021-06-07 11:49:57';\n $this->last_update = '2021-06-07 11:49:57';\n $this->last_sync = '1901-01-01 00:00:00';\n $this->jml_jamban_l_g = '0';\n $this->jml_jamban_l_tg = '0';\n $this->jml_jamban_p_g = '0';\n $this->jml_jamban_p_tg = '0';\n $this->jml_jamban_lp_g = '0';\n $this->jml_jamban_lp_tg = '0';\n $this->tipe_jamban = '9';\n $this->a_sedia_pembalut = '0';\n $this->a_tempat_sampah_kelas = '0';\n $this->a_tempat_sampah_tutup_p = '0';\n $this->a_cermin_jamban_p = '0';\n $this->a_memiliki_tps = '0';\n $this->a_tps_angkut_rutin = '0';\n $this->a_anggaran_sanitasi = '0';\n $this->a_melibatkan_sanitasi_siswa = '0';\n }", "protected function calculateRange($data)\n {\n $data_range = array_fill(0, count(current($data)), ['min' => null, 'max' => null]);\n foreach ($data as $observation) {\n $key = 0;\n foreach ($observation as $value) {\n if ($data_range[$key]['min'] === null || $data_range[$key]['min'] > $value) {\n $data_range[$key]['min'] = $value;\n }\n if ($data_range[$key]['max'] === null || $data_range[$key]['max'] < $value) {\n $data_range[$key]['max'] = $value;\n }\n $key++;\n }\n }\n\n return $data_range;\n }", "abstract protected function defaults(): array;", "public function overrideDefaults( array $options ) {\n\t\tstatic::$options = \n\t\t\\array_merge( static::$options, $options );\n\t\t\n\t\tforeach ( static::$options as $k => $v ) {\n\t\t\tstatic::$options[$k] = \n\t\t\t\t$this->placeholders( $v );\n\t\t}\n\t}", "public function applyDefaultValues()\n {\n $this->pothnbr = '';\n $this->pothstat = 'N';\n $this->pothrcptdate = '';\n $this->intbwhse = '';\n $this->pothglpd = 0;\n $this->pothairship = 'N';\n $this->potherinreview = 'N';\n $this->pothexchctry = '';\n $this->pothexchrate = '0.0000000';\n $this->intbwhseorig = '';\n $this->pothlandcost = '0.0000000';\n $this->pothrcptnbr = 0;\n $this->pothlandbasedon = '';\n $this->pothinvcnbr = '';\n $this->pothinvcdate = '';\n $this->pothfrtamt = '0.00';\n $this->pothmiscamt = '0.00';\n $this->dateupdtd = '';\n $this->timeupdtd = '';\n $this->dummy = 'P';\n }", "public function applyDefaultValues()\n {\n $this->last_sync = '1901-01-01 00:00:00';\n }", "protected function fill()\n {\n array_map(function ($field) {\n $defaultValue = isset($this->defaultFields[$field]['defaultValue']) ?\n $this->defaultFields[$field]['defaultValue'] :\n null;\n\n $this->values[$field] = (new $this->defaultFields[$field]['format']($defaultValue))\n ->setPosition($this->defaultFields[$field]['position'])\n ->setLength($this->defaultFields[$field]['length']);\n }, array_keys($this->defaultFields));\n }", "public function getDefaultParams();", "function jt_cmb2_date_year_range_split_values( $override_value, $value, $object_id, $field_args ) {\n\tif ( ! isset( $field_args['split_values'] ) || ! $field_args['split_values'] ) {\n\t\t// Don't do the override\n\t\treturn $override_value;\n\t}\n\n\t$keys = array( 'start', 'finish' );\n\n\tforeach ( $keys as $key ) {\n\t\tif ( ! empty( $value[ $key ] ) ) {\n\t\t\tupdate_post_meta( $object_id, $field_args['id'] . '_'. $key, $value[ $key ] );\n\t\t}\n\t}\n\n\t// Tell CMB2 we already did the update\n\treturn true;\n}", "public function getDefaultParameters();", "public function getDefaultParameters();", "protected function defaultValues() : array\n {\n return [\n 'limit' => 20,\n 'offset' => 0,\n 'order_by_dir' => 'DESC',\n ];\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->type = 1;\n\t\t$this->total_index = 0;\n\t\t$this->is_published = true;\n\t\t$this->is_featured = false;\n\t\t$this->comments_count = 0;\n\t}", "private function calculateRawDefaults()\n\t{\n\t\tforeach ($this->form_def['field_groups'] as $gi => $g) {\n\t\t\tif (!empty($g['wild'])) {\n\t\t\t\t// Wild group has no default data, but group still exists\n\t\t\t\t$this->raw_defaults[$gi] = array();\n\t\t\t} else if (isset($this->field_defaults[$gi])) {\n\t\t\t\t// Values for the group are set, use them.\n\t\t\t\t$this->preProcessGroup($gi, $g, $this->field_defaults[$gi], $this->raw_defaults[$gi]);\n\t\t\t} else {\n\t\t\t\tif (empty($g['collection_dimensions'])) {\n\t\t\t\t\t// Values for the group are missing, use defaults from the form definition.\n\t\t\t\t\t$group_defaults = array();\n\t\t\t\t\tforeach ($g['fields'] as $fi => $f) {\n\t\t\t\t\t\tif (isset($f['default'])) {\n\t\t\t\t\t\t\t$group_defaults[$fi] = $f['default'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->preProcessGroup($gi, $g, $group_defaults, $this->raw_defaults[$gi]);\n\t\t\t\t} else {\n\t\t\t\t\t// Empty collection by default.\n\t\t\t\t\t$this->raw_defaults[$gi] = array();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function attack_values($args) {\n if (!is_array($args) ||\n !array_key_exists('attackType', $args) ||\n !array_key_exists('attackValues', $args) ||\n !array_key_exists('minValue', $args)) {\n return;\n }\n\n if ('Skill' != $args['attackType']) {\n return;\n }\n\n $args['attackValues'] = range($args['minValue'], max($args['attackValues']));\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->platform = 'pc';\n\t\t$this->experience_score = 0;\n\t\t$this->up_votes = 0;\n\t\t$this->down_votes = 0;\n\t\t$this->is_guest = 0;\n\t\t$this->is_admin = 0;\n\t\t$this->today_votes = 0;\n\t\t$this->email_on = 1;\n\t}", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n\t}", "public function merge($values): Sequence;", "public function getDefaults();", "public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}", "protected function getDefaultAtts() {\n \t\t\n \t\treturn array_combine(\n array_map(function($param) { \n \t\treturn $param['param_name'];\n }, $this->params),\n \t\tarray_map(function($param) { \n \t\treturn ! empty( $param['default'] ) ? $param['default'] : '';\n }, $this->params)\n );\n \t\t\n\t\t}", "function data_preprocessing(&$default_values){\n }", "static function merge() {\n\t\t$base = array();\n\t\t$args = func_get_args();\n\n\t\tforeach ( $args as $arg ) {\n\t\t\tself::array_merge( $base, $arg );\n\t\t}\n\n\t\treturn $base;\n\t}", "public function compare_default_date(){\n\t\t$getdates = $this->Timerecordsummary_model->get_default_date()->row();\n\t\tif(!(empty($getdates))){\n\t\t\t$data = array(\"success\" => 1, \"date_ranges\" => $getdates);\n\t\t}else{\n\t\t\t$data = array(\"success\" => 0, \"date_ranges\" => \"Please input valid date range from Time Record Summary Range in settings\");\n\t\t}\n\t\techo json_encode($data);\n\n\t}", "function getDefaults($app) {\r\n // Get stats object\r\n $stats = $app->getDoc()->stats();\r\n \r\n // Return some defaults\r\n return array(\r\n 'mileage' => (isset($stats['last']['mileage']) && isset($stats['all']['tripdistance'])) ? getMiles($stats['last']['mileage'] + $stats['all']['tripdistance']) : '',\r\n 'location' => (isset($stats['all']['location']) ? $stats['all']['location'] : ''),\r\n 'pricepergallon' => (isset($stats['last']['pricepergallon'])) ? getGasMoney($stats['last']['pricepergallon']) : '',\r\n 'grade' => (isset($stats['all']['grade'])) ? $stats['all']['grade'] : '0'\r\n );\r\n}", "function _setDefaults() {}", "function setDisplayRange(&$range_limits,$total_pages,$page_index){\n\t\tdefine('PAGES_DISPLAYED',7);\n\t\tdefine('MAX_OFFSET',3);\n\t\t\n\t\tif ($total_pages <= constant('PAGES_DISPLAYED')){\n\t\t\t//range 1 to $total_pages\n\t\t\t$range_limits['min'] = 1;\n\t\t\t$range_limits['max'] = $total_pages;\n\t\t} else {//range $PAGE_NO_MAX buttons required\n\t\t\t//button moves, range is stationary\n\t\t\tif (($page_index <= constant('MAX_OFFSET')) || (($total_pages - $page_index) < constant('MAX_OFFSET'))) {\n\t\t\t\tif ($page_index <= constant('MAX_OFFSET')) {\n\t\t\t\t\t$range_limits['min'] = 1;\n\t\t\t\t\t$range_limits['max'] = constant('PAGES_DISPLAYED');\n\t\t\t\t} else {\n\t\t\t\t\t$range_limits['min'] = $total_pages - (constant('PAGES_DISPLAYED') - 1);\n\t\t\t\t\t$range_limits['max'] = $total_pages;\n\t\t\t\t}\n\t\t\t} else {//($page_index > $max_offset) && (($total_pages - $page_index) > $max_offset)\n\t\t\t\t//button stationary, range moves[$page_index +/- $max_offset] \n\t\t\t\t$range_limits['min'] = $page_index - constant('MAX_OFFSET');\n\t\t\t\t$range_limits['max'] = $page_index + constant('MAX_OFFSET');\n\t\t\t}\t\n\t\t}\n\t\treturn;\t\t\t\n\t}", "public function testRange() {\n\t\t$result = _::range(5);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(0, $result[0]);\n\t\t$this->assertEquals(1, $result[1]);\n\t\t$this->assertEquals(2, $result[2]);\n\t\t$this->assertEquals(3, $result[3]);\n\t\t$this->assertEquals(4, $result[4]);\n\n\t\t// test range with two parameters\n\t\t$result = _::range(1, 4);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(3, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\n\t\t// test range with three parameters\n\t\t$result = _::range(1, 10, 2);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(3, $result[1]);\n\t\t$this->assertEquals(5, $result[2]);\n\t\t$this->assertEquals(7, $result[3]);\n\t\t$this->assertEquals(9, $result[4]);\n\t}", "function jt_cmb2_date_year_range_get_split_values( $no_override, $object_id, $args, $field ) {\n\tif ( 'date_year_range' !== $field->args( 'type' ) || ! $field->args( 'split_values' ) ) {\n\t\treturn $no_override;\n\t}\n\n\t$value = array(\n\t\t'start' => get_post_meta( $object_id, $args['field_id'] . '_start', 1 ),\n\t\t'finish' => get_post_meta( $object_id, $args['field_id'] . '_finish', 1 ),\n\t);\n\n\treturn $value;\n}", "function range($args) {\r\n\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\t\techo \"<div style='line-height:24px;'><input style=' float:left;\" . $this->width($args['width']) . \"' type='range' data-tooltip='\" . $args['tooltip'] . \"' min='\" . $args['min'] . \"' max='\" . $args['max'] . \"' class='range' size='57' \" . $this->placeholder($args['placeholder'] ) . \" name='\" . $args['formname'] . \"' value='\" . $args['value'] . \"'/>\";\t\t\t\t\r\n\t\t\r\n\t\techo \"<span style=' float:left; margin-left:10px;' class='rangeval'>\" . $args['value']. \"</span><span>\" . $args['unit']. \"</span</div>\";\r\n\t\r\n\t\t$this->description($args['description']);\r\n\t\t}", "function defaultValues(&$conf)\t{\n\t\t// Addition of default values\n\t\tif (is_array($conf[$conf['cmdKey'].'.']['defaultValues.']))\t{\n\t\t\treset($conf[$conf['cmdKey'].'.']['defaultValues.']);\n\t\t\twhile(list($theField,$theValue)=each($conf[$conf['cmdKey'].'.']['defaultValues.']))\t{\n\t\t\t\tif (strpos($theValue,\":\")) {\n\t\t\t\t\t$data=tx_metafeedit_lib::getData($theValue,0,$this->cObj);\n\t\t\t\t\tif (!$data) $data=$this->dataArr[$theField];\n\t\t\t\t} else {\n\t\t\t\t\t$data=$theValue;\n\t\t\t\t}\n\t\t\t\t$this->dataArr[$theField] = $data;\n\t\t\t}\n\t\t}\n\t}", "public function applyDefaultValues()\n {\n $this->active = false;\n }", "public function setDataRange($startVal, $endVal) {\n\t\t$this->setMaxValue($endVal);\n\t\t$this->setMinValue($startVal);\n\t\t$this->setProperty('chds', $startVal.','.$endVal);\n\t}", "public function setMinMax($min, $max) {\r\n $this->automatic = false;\r\n $this->automaticMinimum = false;\r\n $this->automaticMaximum = false;\r\n\r\n if ($min > $max) { // swap\r\n $tmp = $min;\r\n $min = $max;\r\n $max = $tmp;\r\n }\r\n\r\n $this->internalSetMinimum($min);\r\n $this->internalSetMaximum($max);\r\n if (($this->maximumvalue - $this->minimumvalue) < self::$MINAXISRANGE) {\r\n $this->internalSetMaximum($this->minimumvalue + self::$MINAXISRANGE);\r\n }\r\n }", "public static function getRangeOptions()\n\t{\n\t\t$options = array(\n\t\t\tJHtml::_('select.option', 'today', JText::_('COM_REALTOR_OPTION_RANGE_TODAY')),\n\t\t\tJHtml::_('select.option', 'past_week', JText::_('COM_REALTOR_OPTION_RANGE_PAST_WEEK')),\n\t\t\tJHtml::_('select.option', 'past_1month', JText::_('COM_REALTOR_OPTION_RANGE_PAST_1MONTH')),\n\t\t\tJHtml::_('select.option', 'past_3month', JText::_('COM_REALTOR_OPTION_RANGE_PAST_3MONTH')),\n\t\t\tJHtml::_('select.option', 'past_6month', JText::_('COM_REALTOR_OPTION_RANGE_PAST_6MONTH')),\n\t\t\tJHtml::_('select.option', 'past_year', JText::_('COM_REALTOR_OPTION_RANGE_PAST_YEAR')),\n\t\t\tJHtml::_('select.option', 'post_year', JText::_('COM_REALTOR_OPTION_RANGE_POST_YEAR')),\n\t\t);\n\t\treturn $options;\n\t}", "function setMinMax(&$min, &$max) {\n if (is_int($min) && is_int($max)) {\n if ($min > $max) {\n $inputA = $min;\n $inputB = $max;\n $min = $inputB;\n $max = $inputA;\n }\n return \"Generating a number between \" . $min . \" and \" . $max . \":\";\n } else {\n return \"Input not recognized as whole numbers. <br> Number generated between 1 and 100.\";\n } \n}", "public function range($start, $end, $step = null): static;", "function pixgraphy_get_option_defaults_values() {\n\t\tglobal $pixgraphy_default_values;\n\t\t$pixgraphy_default_values = array(\n\t\t\t'pixgraphy_responsive'\t=> 'on',\n\t\t\t'pixgraphy_column_post'\t=>'four',\n\t\t\t'pixgraphy_border_column'\t=>'on',\n\t\t\t'pixgraphy_design_layout' => 'wide-layout',\n\t\t\t'pixgraphy_animate_css'\t=> 'on',\n\t\t\t'pixgraphy_sidebar_layout_options' => 'right',\n\t\t\t'pixgraphy_photography_layout' => 'photography_layout',\n\t\t\t'pixgraphy_search_custom_header' => 0,\n\t\t\t'pixgraphy-img-upload-footer-image' => '',\n\t\t\t'pixgraphy-footer-title'\t=> '',\n\t\t\t'pixgraphy-footer-link'\t=> '#',\n\t\t\t'pixgraphy_header_display'=> 'header_text',\n\t\t\t'pixgraphy_categories'\t=> array(),\n\t\t\t'pixgraphy_custom_css'\t=> '',\n\t\t\t'pixgraphy_scroll'\t=> 0,\n\t\t\t'pixgraphy_tag_text' => esc_html__('Read More','pixgraphy'),\n\t\t\t'pixgraphy_excerpt_length'\t=> '20',\n\t\t\t'pixgraphy_single_post_image' => 'off',\n\t\t\t'pixgraphy_reset_all' => 0,\n\t\t\t'pixgraphy_stick_menu'\t=>0,\n\t\t\t'pixgraphy_blog_post_image' => 'on',\n\t\t\t'pixgraphy_entry_format_blog' => 'excerptblog_display',\n\t\t\t'pixgraphy_search_text' => esc_html__('Search &hellip;','pixgraphy'),\n\t\t\t'pixgraphy_blog_content_layout'\t=> '',\n\t\t\t'pixgraphy_display_page_featured_image'=>0,\n\t\t\t/* Slider Settings */\n\t\t\t'pixgraphy_slider_type'\t=> 'default_slider',\n\t\t\t'pixgraphy_slider_link' =>0,\n\t\t\t'pixgraphy_enable_slider' => 'frontpage',\n\t\t\t'pixgraphy_transition_effect' => 'fade',\n\t\t\t'pixgraphy_transition_delay' => '4',\n\t\t\t'pixgraphy_transition_duration' => '1',\n\t\t\t/* Front page feature */\n\t\t\t'pixgraphy_entry_format_blog' => 'show',\n\t\t\t'pixgraphy_entry_meta_blog' => 'show-meta',\n\t\t\t/*Social Icons */\n\t\t\t'pixgraphy_top_social_icons' =>0,\n\t\t\t'pixgraphy_buttom_social_icons'\t=>0,\n\t\t\t'pixgraphy_social_facebook'=> '',\n\t\t\t'pixgraphy_social_twitter'=> '',\n\t\t\t'pixgraphy_social_pinterest'=> '',\n\t\t\t'pixgraphy_social_dribbble'=> '',\n\t\t\t'pixgraphy_social_instagram'=> '',\n\t\t\t'pixgraphy_social_flickr'=> '',\n\t\t\t'pixgraphy_social_googleplus'=> '',\n\t\t\t'pixgraphy_remove_parallax_fromheader'=>0,\n\t\t\t);\n\t\treturn apply_filters( 'pixgraphy_get_option_defaults_values', $pixgraphy_default_values );\n\t}", "public function interval(int|float $value, int|float $min, int|float $max, int|float $default_value) : int|float\n\t{\n\t\treturn $this->handlers->map($value, function ($value) use ($min, $max, $default_value) {\n\t\t\treturn $this->handlers->get('interval')->filter($value, $min, $max, $default_value);\n\t\t});\n\t}", "protected function _defaults($arr)\n\t{\n\t\t$defaults = array(\n\t\t\t'enable_realtime' => false, \n\t\t\t'check_callbacks' => true, \n\t\t\t'qbxml_version' => '4.0',\n\t\t\t'qbxml_onerror' => 'stopOnError', \n\t\t\t'map_create_handler' => null, \n\t\t\t'map_to_quickbooks_handler' => null,\n\t\t\t'map_to_application_handler' => null,\n\t\t\t'map_to_editsequence_handler' => null, \n\t\t\t);\n\t\t\t\n\t\treturn array_merge($defaults, $arr);\n\t}", "public function getCalendarDefaultValues($organizationId, $userId, $calendarId, array $calendarIds);", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "function get_default_values() {\n\t\t$output = array();\n\t\t$config = & lcars_Framework::_lcarsframework_lcars();\n\t\tforeach ( (array) $config as $option ) {\n\t\t\tif ( ! isset( $option['id'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! isset( $option['std'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! isset( $option['type'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( has_filter( 'of_sanitize_' . $option['type'] ) ) {\n\t\t\t\t$output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option );\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "public static function nullOrBcRange(\n string $value,\n string $min,\n string $max,\n string $message = '',\n ?int $scale = null\n ): void;", "public function get_range_edges( $range_from = null, $range_to = null, $limit = null ) {\n\t\tglobal $wpdb;\n\n\t\t$this->validate_fields( array( $this->range_field ) );\n\n\t\t// Performance :: When getting the postmeta range we do not want to filter by the whitelist.\n\t\t// The reason for this is that it leads to a non-performant query that can timeout.\n\t\t// Instead lets get the range based on posts regardless of meta.\n\t\t$filter_values = $this->filter_values;\n\t\tif ( 'postmeta' === $this->table ) {\n\t\t\t$this->filter_values = null;\n\t\t}\n\n\t\t// `trim()` to make sure we don't add the statement if it's empty.\n\t\t$filters = trim( $this->build_filter_statement( $range_from, $range_to ) );\n\n\t\t// Reset Post meta filter.\n\t\tif ( 'postmeta' === $this->table ) {\n\t\t\t$this->filter_values = $filter_values;\n\t\t}\n\n\t\t$filter_statement = '';\n\t\tif ( ! empty( $filters ) ) {\n\t\t\t$filter_statement = \"\n\t\t\t\tWHERE\n\t\t\t\t\t{$filters}\n\t\t\t\";\n\t\t}\n\n\t\t// Only make the distinct count when we know there can be multiple entries for the range column.\n\t\t$distinct_count = count( $this->key_fields ) > 1 ? 'DISTINCT' : '';\n\n\t\t$query = \"\n\t\t\tSELECT\n\t\t\t MIN({$this->range_field}) as min_range,\n\t\t\t MAX({$this->range_field}) as max_range,\n\t\t\t COUNT( {$distinct_count} {$this->range_field}) as item_count\n\t\t\tFROM\n\t\t\";\n\n\t\t/**\n\t\t * If `$limit` is not specified, we can directly use the table.\n\t\t */\n\t\tif ( ! $limit ) {\n\t\t\t$query .= \"\n\t\t\t\t{$this->table}\n\t {$filter_statement}\n\t\t\t\";\n\t\t} else {\n\t\t\t/**\n\t\t\t * If there is `$limit` specified, we can't directly use `MIN/MAX()` as they don't work with `LIMIT`.\n\t\t\t * That's why we will alter the query for this case.\n\t\t\t */\n\t\t\t$limit = intval( $limit );\n\n\t\t\t$query .= \"\n\t\t\t\t(\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t{$distinct_count} {$this->range_field}\n\t\t\t\t\tFROM\n\t\t\t\t\t\t{$this->table}\n\t\t\t\t\t\t{$filter_statement}\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\t{$this->range_field} ASC\n\t\t\t\t\tLIMIT {$limit}\n\t\t\t\t) as ids_query\n\t\t\t\";\n\t\t}\n\n\t\t// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t$result = $wpdb->get_row( $query, ARRAY_A );\n\n\t\tif ( ! $result || ! is_array( $result ) ) {\n\t\t\tthrow new Exception( 'Unable to get range edges' );\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function setDefaultParams()\n {\n foreach ($this->allowedParams as $param => $options) {\n $this->params[$param] = null;\n if (! empty($options['arguments'])) {\n $this->params[$param] = array();\n foreach ($options['arguments'] as $arg => $opts) {\n if (! empty($opts['default'])) {\n $cast = ! empty($opts['cast']) ? $opts['cast'] : 'string';\n $this->params[$param][$arg] = $this->castValue($cast, $opts['default']);\n }\n }\n } elseif (! empty($options['default'])) {\n $cast = ! empty($options['cast']) ? $options['cast'] : 'string';\n $this->params[$param] = $this->castValue($cast, $options['default']);\n }\n }\n }", "public function getDefaultParams()\n {\n $defaults = array(\n );\n return $defaults;\n }", "function setArticleCountsRange($min, $max)\n\t{\n\t\t$this->validate['articles_count']['range']['rule'][1] = $min-1;\n\t\t$this->validate['articles_count']['range']['rule'][2] = $max+1;\n\t}", "public function getDefaultValues()\n {\n $values = [];\n $values['imagewidth'] = '170';\n $values['imageheight'] = '170';\n $values['infinite'] = '1';\n $values['slidestoshow'] = '6';\n $values['slidestoscroll'] = '2';\n $values['breakpointone'] = '1200';\n $values['resoneslidestoshow'] = '4';\n $values['resoneslidestoscroll'] = '2';\n $values['breakpointtwo'] = '600';\n $values['restwoslidestoshow'] = '3';\n $values['restwoslidestoscroll'] = '2';\n $values['breakpointthree'] = '480';\n $values['resthreeslidestoshow'] = '2';\n $values['resthreeslidestoscroll'] = '1';\n return $values;\n }", "public function setDefaultValues() {\n $defaults = [];\n if (($this->_action & CRM_Core_Action::DELETE)) {\n return;\n }\n if ($this->_id) {\n foreach (civicrm_api3(\n 'Address',\n 'getsingle',\n ['id' => $this->_id]\n ) as $key => $value) {\n $defaults[\"address[1][{$key}]\"] = $value;\n }\n $defaults['is_active'] = CRM_EventLocations_Utils::isActive($this->_locId);\n }\n else {\n $defaults['is_active'] = TRUE;\n }\n return $defaults;\n }", "public function filter_range($data,$min,$max){\n return filter_var($data,FILTER_VALIDATE_INT,array(\n \"options\" => array(\n \"min_range\" =>$min,\n \"min_range\"=>$max)\n ));\n }", "function overrideValues()\t{\t\n\n\t\t// Addition of overriding values\t\t\n\t\t// TODO add check and warnings on non existent fields ...\n\t\tif (is_array($this->conf[$this->conf['cmdKey'].'.']['overrideValues.']))\t{\n\t\t\treset($this->conf[$this->conf['cmdKey'].'.']['overrideValues.']);\n\t\t\twhile(list($theField,$theValue)=each($this->conf[$this->conf['cmdKey'].'.']['overrideValues.']))\t{\n\t\t\t\n\t\t\t\t$FValue=$this->dataArr[$theField];\n\t\t\t\t//here we handle special values ... \t\n\t\t\t\tif (strpos($theValue,\":\")) {\n\t\t\t\t\t$data=tx_metafeedit_lib::getData($theValue,0,$this->cObj);\n\t\t\t\t\tif (!$data) $data=$this->dataArr[$theField];\n\t\t\t\t} elseif (strpos($theValue,\".\")) {\t\n\t\t\t\t\t$fieldArr=explode('.',$theValue);\n\t\t\t\t\t$data=$FValue;\n\t\t\t\t\t$c=count($fieldArr);\n\t\t\t\t\tif ($c > 1) {\n\t\t\t\t\t\t$data=$this->cObj->getData($fieldArr[0],0);\n\t\t\t\t\t\t$i=1;\n\t\t\t\t\t\twhile ($i<=$c) {\n\t\t\t\t\t\t\tif (is_object($data)) {\n\t\t\t\t\t\t\t\t$data=get_object_vars($data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($data)) {\n\t\t\t\t\t\t\t\t$key=$fieldArr[$i];\n\t\t\t\t\t\t\t\t$data=$data[$fieldArr[$i]];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t} elseif (strpos($theValue,\"<\")===0) {\n\t\t\t\t\t// We override value with other incoming field\n\t\t\t\t\t$f=substr($theValue,1);\n\t\t\t\t\t$v=$this->dataArr[$f];\n\t\t\t\t\tif ($v) $data=$v;\n\t\t\t\t} else {\n\t\t\t\t\t$data=$theValue;\n\t\t\t\t}\n\t\t\t\tif ($data) $this->dataArr[$theField] = $data;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// call to user override function\n\t\tif ($this->conf[$this->conf['cmdKey'].'.']['userFunc_afterOverride']) {\n\t\t\tt3lib_div::callUserFunction($this->conf[$this->conf['cmdKey'].'.']['userFunc_afterOverride'],$this->conf,$this);\n\t\t}else if ($this->conf['userFunc_afterOverride']) {\n\t\t\tt3lib_div::callUserFunction($this->conf['userFunc_afterOverride'],$this->conf,$this);\n\t\t}\n\t}", "protected function useDefaultValuesForNotConfiguredOptions() {}", "private static function defaults() {\n\t\treturn array(\n\t\t\t\"before_tweet\" => function($data) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\t\"after_tweet\" => function($data) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t);\n\t}", "protected function _getDefaultValues()\n {\n return array(\n );\n }", "private function assignZrangeOptions(&$options)\n {\n $options['query_parameters']['options'] = 'withscores';\n\n if (isset($options['limit'])) {\n $options['query_parameters']['limit'] = implode(',', $options['limit']);\n unset($options['limit']);\n }\n }", "protected function _getRanges() {}", "public function setDefaultValues($default_values){\n\t\tif(!is_array($default_values)) return;\n\t\t\n\t\tforeach($default_values as $field_name => $default_value){\n\t\t\tif(isset($this->Fields[$field_name])){\n\t\t\t\t$this->Fields[$field_name]->default_value = $default_value;\n\t\t\t}\n\t\t}\n\t}", "function array_combine_safe(array $keys = [], array $values = [], $default = null): array\n {\n if (empty($keys)) {\n return [];\n }\n\n $out = [];\n\n foreach ($keys as $index => $key) {\n $out[$key] = (isset($values[$index])) ? $values[$index] : $default;\n }\n\n return $out;\n }", "public function SetDefaults ($defaults = []);", "public function getDefaultValue();", "public function getDefaultValue();", "function data_preprocessing(&$default_values){\r\n\r\n\t\t// Set up the completion checkboxes which aren't part of standard data.\r\n\t\t// We also make the default value (if you turn on the checkbox) for those\r\n\t\t// numbers to be 1, this will not apply unless checkbox is ticked.\r\n\t\t$default_values['completionlayersenabled']=\r\n\t\t\t!empty($default_values['completionlayers']) ? 1 : 0;\r\n\t\tif(empty($default_values['completionlayers'])) {\r\n\t\t\t$default_values['completionlayers']=1;\r\n\t\t}\r\n\t}", "private function fillOptions(array $options): array\n\t{\n\t\t$defaults = [\n\t\t\t'fromIndex' => 0,\n\t\t\t'limit' => -1,\n\t\t\t'reverse' => false,\n\t\t];\n\n\t\treturn array_merge($defaults, $options);\n\t}", "private function pupulate_default_terms()\n {\n\n $taxonomies = get_taxonomies();\n if (is_array($taxonomies)) {\n foreach ($taxonomies as $taxonomy) {\n $current_values = get_terms($taxonomy, array('hide_empty' => false));\n if (empty($current_values)) {\n $defaults = $this->get_default_taxonomy_values($taxonomy);\n if (!empty($defaults)) {\n foreach ($defaults as $default) {\n if (!term_exists($default['name'], $taxonomy)) {\n wp_insert_term($default['name'], $taxonomy, array('slug' => $default['short']));\n }\n }\n }\n }\n }\n }\n }" ]
[ "0.64265466", "0.64265466", "0.64265466", "0.60820985", "0.5906601", "0.5823315", "0.5745197", "0.5745197", "0.5745197", "0.56940556", "0.5686842", "0.56780416", "0.56373924", "0.56338376", "0.55964285", "0.5568599", "0.55432034", "0.5543199", "0.55079997", "0.5484763", "0.54577327", "0.5449874", "0.54286605", "0.5427793", "0.54010564", "0.53711504", "0.52770615", "0.52658755", "0.5259182", "0.5228014", "0.52168554", "0.52098763", "0.52022916", "0.51826817", "0.51757586", "0.5118353", "0.51146644", "0.51094496", "0.51021695", "0.5097729", "0.5094682", "0.50771165", "0.5066725", "0.50645095", "0.5057483", "0.5057483", "0.5053084", "0.5041133", "0.50306827", "0.5030408", "0.5023745", "0.50224006", "0.5015135", "0.50036055", "0.49968547", "0.49923173", "0.4968752", "0.4942033", "0.49365097", "0.49364325", "0.49325463", "0.4920085", "0.48992634", "0.48954394", "0.48930672", "0.4888802", "0.48864722", "0.48798484", "0.48659396", "0.48593226", "0.4853328", "0.48470092", "0.48399135", "0.48342943", "0.48316333", "0.4822431", "0.4817644", "0.48019987", "0.47979236", "0.47956252", "0.4794805", "0.47932228", "0.4787227", "0.477949", "0.47751805", "0.47742546", "0.47738165", "0.47699592", "0.4759097", "0.4756319", "0.4753924", "0.4749859", "0.47426432", "0.47402743", "0.4735909", "0.4732126", "0.4732126", "0.4728722", "0.47090578", "0.4705383" ]
0.6535262
0
Now, we should have all of the challenges but we need to put them into an array so we can pass it to a dropdown list
function id_name_to_array($result) { $res = $result->fetch_all(); $rows = $result->num_rows; $return_array = array(); for($i = 0; $i < $rows; $i++) { $id = $res[$i][0]; $name = $res[$i][1]; array_push($return_array, [$id, $name]); } return $return_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChallenges(): array\n {\n return $this->challenges;\n }", "public function challenges() {\n $team_id = Auth::user()->team_id;\n $bonus_points = Point::where(\"team_id\", \"=\", $team_id)->get();\n $validations = ChallengeValidation::where([\n [\"team_id\", \"=\", $team_id],\n ])->orderBy(\"last_update\", \"asc\")->get();\n $score = Team::find($team_id)->score();\n return view(\"dashboard.teams.challenges\", compact(\"validations\", \"score\", \"bonus_points\"));\n }", "public function getAllChallenges(){\n\t\t\treturn $this->_store->getAllChallenges();\n\t\t}", "public function listChallenges()\n {\n $db = $this->getDb();\n $result = $db->xpath('/am:challenges/am:challenge');\n\n if ($result === false) {\n return new Result(Result::ERROR);\n }\n\n if (count($result) == 0) {\n return new Result(Result::NO_EFFECT);\n }\n\n $challenges = array();\n foreach ($result as $challenge) {\n $currentChallenge['name'] = (string)$challenge->attributes()->name;\n $currentChallenge['fullname'] = (string)$challenge->fullname;\n $currentChallenge['description'] = (string)$challenge->description;\n $currentChallenge['common'] = (string)$challenge->deck->common;\n $currentChallenge['uncommon'] = (string)$challenge->deck->uncommon;\n $currentChallenge['rare'] = (string)$challenge->deck->rare;\n $currentChallenge['tokens'] = (string)$challenge->deck->tokens;\n $challenges[] = $currentChallenge;\n }\n\n return new Result(Result::SUCCESS, $challenges);\n }", "public function getByChallenge (){\n\t\t\n\t\t$challenge = array();\n\t\t\n\t\t$tmp = Util::groupMultiArray($this->data, 'choice');\n\t\t\n\t\tforeach ($tmp as $choice_id => $choicedata){\n\t\t\t\n\t\t\tif(empty($choice_id)){\n\t\t\t\tcontinue;\t\n\t\t\t}\n\t\t\t\n\t\t\t$open_email_count = '0';\n $link_visit_open = '0';\n\t\t\t\n\t\t\tforeach ($choicedata as $choiceid => $choices){\n\t\t\t\t\n\t\t\t if(($choices['email_open'] == '1')) {\n\t\t\t\t\t $open_email_count++;\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tif(($choices['link_visit_open'] == '1')) {\n\t\t\t\t\t $link_visit_open++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$challenge[$choice_id][4] = $open_email_count;\n\t\t\t$challenge[$choice_id][5] = $link_visit_open;\n\t\t\t\t\t\t\n\t\t\t$activities = Util::groupMultiArray( $choicedata, 'type');\n\t\t\t/*echo '<pre>';\n\t\t\tprint_r($choicedata);\n\t\t\tprint_r($activities );\n\t\t\techo '</pre>';*/\n\t\t\t$challenge[$choice_id][0] = count($choicedata);\n\t\t\t\n\t\t\tforeach ($activities as $typeid => $typedata){\n\t\t\t\t \n\t\t\t\t$challenge[$choice_id][$typeid] = count($typedata);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $challenge; //uasort($challenge,'sortByActivity');\n\t\t\n\t}", "public function challengesFor(Request $request): array;", "function buildChallengesList()\n\t{\n assert( isset( $this->dbConnection ) );\n\n $bSuccess = FALSE;\n\n $stmtQuery = \"SELECT idChallenge, challengeType, year, month, status, comments\";\n $stmtQuery .= \" FROM icaict406a_challenges\";\n $stmtQuery .= \" ORDER BY year DESC, month DESC\";\n\n if ($stmt = $this->dbConnection->prepare( $stmtQuery ) )\n {\n\t\t if( $bSuccess = $stmt->execute() )\n {\n $stmt->bind_result( $db_idChallenge, $db_challengeType, $db_year, $db_month, $db_status, $db_comments );\n\n $bSuccess = TRUE;\n\n\t\t while( $stmt->fetch() ) \n\t\t {\n $objChallengeStruct = new c_challengeStruct();\n\n $objChallengeStruct->idChallenge = $db_idChallenge;\n $objChallengeStruct->challengeType = $db_challengeType;\n $objChallengeStruct->year = $db_year;\n $objChallengeStruct->month = $db_month;\n $objChallengeStruct->status = $db_status;\n $objChallengeStruct->comments = $db_comments;\n\n $this->challenges[] = $objChallengeStruct;\n\t\t } \n }\n\t $stmt->close(); \t// Free resultset \n }\n\n \treturn $bSuccess;\n\n\t}", "function challenges($all=false,$reset = false) {\n $PDO = &DB::$PDO;\n static $challenges = array();\n if ($reset) {\n $challenges = array();\n }\n if (count($challenges) == 0) {\n $challs = $PDO->query('\n SELECT \n c.id,c.name,c.instructions,c.active,(c.open AND ((c.enddate IS NULL) OR (c.enddate > NOW()))),c.enddate,c.type,c.output_type,\n c.disabled_func,c.constant,c.input,c.output,c.trim_type,c.topic_id,\n (SELECT count(*) FROM challenges_rating WHERE challenge_id=c.id AND direction) AS ups,\n (SELECT count(*) FROM challenges_rating WHERE challenge_id=c.id AND NOT direction) AS downs\n FROM challenges AS c');\n while (list($id,$name,$instructions,$active,$open,$enddate,$type,$output_type,\n $disabled_func,$constant,$input,$output,$trim_type,$topic_id,$ups,$downs)=$challs->fetch()) {\n $safename = preg_replace('/[^0-9a-zA-Z\\-]/','',str_replace(' ','-',$name));\n $challenges[$id] = array('name' => $name,\n 'instructions' => $instructions,\n 'safename' => $safename, \n 'active' => (boolean)$active,\n 'open' => (boolean)$open,\n 'enddate' => $enddate,\n 'trim_type' => $trim_type,\n 'type' => $type,\n 'output_type' => $output_type,\n 'constant' => $constant,\n 'input' => $input,\n 'output' => $output,\n 'disabled_func' => $disabled_func,\n 'topic_id' => $topic_id,\n 'ups' => $ups,\n 'downs' => $downs);\n }\n }\n if ($all || access('show_unactive_challenges')) {\n return $challenges;\n } else {\n foreach($challenges as $id => $data) {\n if($data['active'] == true) {\n $return[$id] = $data;\n }\n }\n return $return;\n }\n \n}", "public function getChallenge()\n\t{\n\t}", "public function inputToSelectProblems()\n {\n $problems = $this->problem->getKeyValueAllOrderBy('id','name','id');\n foreach ($problems as $problem_id => $problem_name) {\n $problems[$problem_id] = $problem_id . ' - ' . $problem_name;\n }\n return $problems;\n }", "public function testGetChallenges()\n {\n }", "private function getChallengeData(): array {\n return [\n 'token' => env( 'VERIFICATION_TOKEN' ),\n 'challenge' => \"3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P\",\n 'type' => \"url_verification\"\n ];\n }", "public static function getChallenges($session) \n {\n \n KorisnikModel::updateWrapper($session->get('user')->summonerName);\n \n $uQModel = new UserQuestModel();\n $qModel = new QuestModel();\n $uQ = $uQModel->where('summonerName', $session->get('user')->summonerName)->findAll();\n $poroUser = count($uQModel->where('summonerName', $session->get('user')->summonerName)->where('completed', 1)->findAll());\n $poroTotal = count($qModel->findAll());\n\n $data = [\n 'poroUser' => $poroUser,\n 'poroTotal' => $poroTotal,\n 'quests' => []\n ];\n \n foreach ($uQ as $userQuest) {\n $quest = $qModel->find($userQuest->questId);\n $dataQuest = [\n 'id' => $userQuest->questId,\n 'title' => $quest->title,\n 'description' => $quest->description,\n 'image' => $quest->image,\n 'completed' => $userQuest->completed,\n 'attributes' => QuestAttributeModel::getAttributes($quest->questId)\n ];\n \n \n $questRequired = null;\n $preReqSatisfied = true;\n foreach($dataQuest['attributes'] as $atr){\n if($atr->attributeKey == 'Prerequisite Id'){\n $questRequired = intval($atr->attributeValue);\n $preReQuest = $uQModel->where('questId', $questRequired)->where('summonerName',$session->get('user')->summonerName)->find();\n if($preReQuest[0]->completed == 0){\n $preReqSatisfied = false;\n break;\n } \n } \n }\n \n if($preReqSatisfied == false){ \n continue;\n }\n // $dataQuest['attributes'];\n array_push($data['quests'], $dataQuest);\n }\n return $data;\n }", "public function listChallengeNames()\n {\n $db = $this->getDb();\n $result = $db->xpath('/am:challenges/am:challenge');\n\n if ($result === false) {\n return new Result(Result::ERROR);\n }\n\n if (count($result) == 0) {\n return new Result(Result::NO_EFFECT);\n }\n\n $challenges = array();\n foreach ($result as $challenge) {\n $challenges[] = (string)$challenge->attributes()->name;\n }\n\n return new Result(Result::SUCCESS, $challenges);\n }", "public function showCreateChallenge()\r\n {\r\n $tags = tags::pluck('id','title')->toArray();\r\n return view('sih_my_account.create_challenge', compact('tags'));\r\n }", "function recommends_req_wizard_courses_info($form, &$form_state) {\n $professor = variable_get('recommends_student_professor_email', 'FALSE');\n \n $entry = array();\n $entries = recommends_cp_entry_load_req($entry,$professor);\n \n $keyed_entries = array();\n if (empty($entries)) {\n drupal_set_message(t('There was a problem - There was no entries in the course conducted list. Please contact the professor to report the error. Your request cnnot be completed at this time..'), 'error');\n $form_state['num_courses'] = 0;\n return $form;\n }\n\n foreach ($entries as $entry) {\n $options[$entry->i_pid] = t(\"@i_course - @i_semester @i_year, @i_coursename\", array(\n '@i_pid' => $entry->i_pid, \n '@i_course' => $entry->i_course,\n '@i_coursename' => $entry->i_coursename,\n '@i_objective' => $entry->i_objective,\n '@i_grade_a' => $entry->i_grade_a,\n '@i_grade_b' => $entry->i_grade_b,\n '@i_grade_other' => $entry->i_grade_other,\n '@i_semester' => $entry->i_semester,\n '@i_year' => $entry->i_year,\n '@i_timestamp' => $entry->i_timestamp\n ));\n $keyed_entries[$entry->i_pid] = $entry;\n }\n $default_entry = !empty($form_state['values']['i_pid']) ? $keyed_entries[$form_state['values']['i_pid']] : $entries[0];\n\n $options[] = 'Independent Research';\n $options[] = 'Other interaction ';\n $form_state['entries'] = $keyed_entries; \n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['crsreq'] = array(\n '#type' => 'fieldset',\n '#title' => variable_get('recommends_req_student_professor'),\n );\n $form['crsreq']['description'] = array(\n '#type' => 'item',\n '#title' => t('select the course/activity in which you were enrolled with the professor. Click \"add\" for each additional course.'),\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n // Build the number of name fieldsets indicated by $form_state['num_courses']\n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n $form['crsname'][$i] = array(\n '#type' => 'fieldset',\n '#title' => t('Course #@num', array('@num' => $i)),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n \n $form['crsname'][$i]['i_pid'] = array(\n \n '#type' => 'select',\n '#options' => $options,\n '#required' => TRUE,\n \n );\n \n $form['crsname'][$i]['i_other'] = array(\n '#type' => 'textarea',\n '#title' => t('Other interation - please describe'),\n '#cols' => 25,\n '#resizable' => TRUE,\n '#rows' => 5,\n \n\n ); \n }\n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Add another course'),\n '#submit' => array('recommends_req_crstut_9_add_course'),\n );\n\n // If we have more than one name, this button allows removal of the\n // last name.\n if ($form_state['num_courses'] > 1) {\n $form['remove_course'] = array(\n '#type' => 'submit',\n '#value' => t('Remove latest course'),\n '#submit' => array('recommends_req_crstut_9_remove_course'),\n // Since we are removing a name, don't validate until later.\n '#limit_validation_errors' => array(),\n );\n }\n\n return $form;\n}", "public function edit($id)\n {\n if(Auth::user()->role == 'admin'){\n $challenge = Challenge::find($id);\n } else{\n $challenge = Challenge::where('id',$id)->where('company_id', Auth::user()->id)->first();\n // $challenge = DB::table('challenge')\n // ->join('builds', 'builds.id', '=', 'challenge.build_id')\n // ->select('challenge.*')\n // ->where('challenge.id', $id)\n // ->where('builds.company_id', Auth::user()->id)\n // ->first();\n }\n if($challenge == ''){\n return redirect()->route('challenge.index')->with('errors','No challenge Found.');\n }\n if($challenge->status != '-1'){\n return view('challenge.edit');\n }\n $challenge_data = array();\n $user = Auth::user();\n $challenge_data = array('is_admin' => 0);\n if($user->role == 'admin'){\n $challenge_data['is_admin'] = 1;\n $challenge_data['users'] = Users::select('id','name')->where('role', 'company')->get()->toArray();\n\n $challenge_data['categories'] = Categories::select('id','category_name')->whereIn('company_id',array($challenge->company_id, '0'))->get()->toArray();\n \n } else {\n $challenge_data['categories'] = Categories::select('id','category_name')->whereIn('company_id',array(Auth::user()->id, '0'))->get()->toArray();\n }\n // if(Auth::user()->role == 'admin'){\n // $builds = Builds::select('id','build_text')->get()->toArray();\n // } else{\n // $builds = Builds::select('id','build_text')->where('company_id',Auth::user()->id)->get()->toArray();\n // }\n // $build_array = array();\n // if(!empty($builds)){\n // foreach ($builds as $item) {\n // if($item['id'] == $challenge->build_id){\n // $build_array[] = $item;\n // } else {\n // $chal = Challenge::select('id')->where('build_id', $item['id'])->first();\n // if($chal && !empty($chal)){\n // }else {\n // $build_array[] = $item;\n // }\n // }\n // }\n // }\n // $challenge_data['builds'] = $build_array;\n $challenge_data['access_level_data'] = Accesslevel::where('id','<=',3)->get()->toArray();\n\n//Accesslevel::all();\n return view('challenge.edit',compact('challenge'))->with('challenge_data', $challenge_data);\n }", "public function run()\n {\n $habilitados = [\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'deshabilitado',\n 'description' => 'falta de fotocopia de carnet de identidad',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'deshabilitado',\n 'description' => 'le falta certificado de condicion de estudiante',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'deshabilitado',\n 'description' => 'le falta solicitud escrita y el kardex',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ], [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ],\n [\n 'name' => 'habilitado',\n 'description' => '',\n 'publicado' => 'no', \n ], \n ];\n foreach ($habilitados as $habilitado) {\n Habilitado::create($habilitado);\n } \n }", "public function index()\n\t{\n\t\t// Initialize Challenge Query\n\t\t$challenge_query = Challenge::with('score_elements');\n\n\t\t// Selected year, level select set in filters.php -> App::before()\n\t\t$year = Session::get('year', false);\n\t\t$level_select= Session::get('level_select', false);\n\n\t\t// Filter on Level, if set\n\t\tif($level_select) {\n\t\t\t$challenge_query = $challenge_query->where('level', $level_select);\n\t\t}\n\n\t\t// Filter on year, if set\n\t\tif($year) {\n\t\t\t$challenge_query = $challenge_query->where('year', $year);\n\t\t}\n\n\t\t// Get Challenges\n\t\t$challenges = $challenge_query->get();\n\n\t\tView::share('title', 'Manage Challenges');\n\t\treturn View::make('challenges.index', compact('challenges'));\n\t}", "function run_code_challenges(){\n $code_challenges = new Code_Challenges();\n $code_challenges->run();\n}", "public function challengesFor(Request $request): array\n {\n return $this->authenticationProvider->challengesFor($request);\n }", "public function challenge($challenge_id = null){\n\t\t//TODO: Important! I think that we have security issue here – teacher should not have ability to\n\t //edit challenges which are created by other users.\n\n\t //If parametes are sent as POST data, repack them as GET data\n $uri = Mapper_Helper::create_uri_segments();\n if ($uri !== null) {\n redirect('question/challenge/'.$challenge_id.'/' . $uri);\n }\n\n $this->mapperlib->set_default_base_page('question/challenge/'.$challenge_id);\n $this->mapperlib->set_breaking_segment(4);\n\n $data = new stdClass();\n $this->challenge_question_model->setChallenge_id($challenge_id);\n\n $data->challange_id = $challenge_id;\n\t $data->challenge = $this->challenge_model->getChallengeById($challenge_id);\n\n $challengeQuestions = $this->challenge_question_model->getList();\n $questionIds = array();\n foreach ($challengeQuestions as $cq) {\n /** @var $cq PropChallengeQuestion */\n $questionIds[] = $cq->getQuestionId();\n }\n\n /**\n * Nem's hack - this should be moved to question_model once\n */\n $questions = PropQuestionQuery::create()\n ->filterByQuestionId($questionIds)\n ->filterByIsDeleted(PropQuestionPeer::IS_DELETED_NO)\n ->find();\n\n $data->questions = array();\n\n foreach($questions as $k => $question){\n $data->questions[$k]['question_name'] = $question->getText();\n $question_id = $question->getQuestionId();\n $data->questions[$k]['question_id'] = $question_id;\n $data->questions[$k]['question_type'] = $this->challenge_questionlib->get_question_type($question_id);\n $data->questions[$k]['question_image'] = $this->challenge_questionlib->get_question_image_type($question_id);\n\n $question_data = $this->get_question_details($question_id);\n $data->questions[$k]['data'] = $question_data;\n }\n\n $data->content = $this->prepareView('x_challenge_question', 'home_challenge_question', $data);\n $this->load->view(config_item('teacher_template'), $data);\n }", "public function testListMemberMFAChallenges()\n {\n }", "function babeliumsubmission_get_available_exercise_list(){\n Logging::logBabelium(\"Getting available exercise list\");\n $this->exercises = $this->getBabeliumRemoteService()->getExerciseList();\n return $this->getExercisesMenu();\n }", "public function create()\n {\n // $challenge_data = array();\n // if(Auth::user()->role == 'admin'){\n // $builds = Builds::select('id','build_text')->get()->toArray();\n // } else{\n // $builds = Builds::select('id','build_text')->where('company_id',Auth::user()->id)->get()->toArray();\n // }\n // $build_array = array();\n // if(!empty($builds)){\n // foreach ($builds as $item) {\n // $chal = Challenge::select('id')->where('build_id', $item['id'])->first();\n // if($chal && !empty($chal)){\n // }else {\n // $build_array[] = $item;\n // }\n // }\n // }\n // $challenge_data['builds'] = $build_array;\n \n $user = Auth::user();\n $challenge_data = array('is_admin' => 0, 'categories' => []);\n if($user->role == 'admin'){\n $challenge_data['is_admin'] = 1;\n $challenge_data['users'] = Users::select('id','name')->where('role', 'company')->get()->toArray();\n } else {\n $challenge_data['categories'] = Categories::select('id','category_name')->whereIn('company_id',array(Auth::user()->id, '0'))->get()->toArray();\n }\n\n // $challenge_data['access_level_data'] = Accesslevel::where('id','<=',3)->get()->toArray();\n//Accesslevel::all();\n return view('challenge.create')->with('challenge_data', $challenge_data);\n }", "function mfcs_get_request_problems_list_options($option = NULL, $hidden = FALSE, $disabled = FALSE) {\n $options = array();\n $options_all = array();\n\n if ($hidden) {\n $options_all[MFCS_REQUEST_PROBLEM_NONE] = 'None';\n }\n\n $options_all[MFCS_REQUEST_PROBLEM_CONFLICT] = 'Conflict';\n $options_all[MFCS_REQUEST_PROBLEM_STALE] = 'Stale';\n $options_all[MFCS_REQUEST_PROBLEM_STUCK] = 'Stuck';\n $options_all[MFCS_REQUEST_PROBLEM_BLOCKED] = 'Blocked';\n $options_all[MFCS_REQUEST_PROBLEM_COORDINATOR] = 'Coordinator Invalid';\n $options_all[MFCS_REQUEST_PROBLEM_REQUESTER] = 'Requester Invalid';\n $options_all[MFCS_REQUEST_PROBLEM_ROOM] = 'Room Invalid';\n $options_all[MFCS_REQUEST_PROBLEM_BUILDING] = 'Building Invalid';\n $options_all[MFCS_REQUEST_PROBLEM_LOCATION] = 'Location Invalid';\n $options_all[MFCS_REQUEST_PROBLEM_CACHE_REQUEST] = 'Cache Invalid';\n $options_all[MFCS_REQUEST_PROBLEM_HOLIDAY] = 'Holiday Conflict';\n $options_all[MFCS_REQUEST_PROBLEM_UNAVAILABLE] = 'Room Unavailable';\n\n if ($option == 'select') {\n $options[''] = '- Select -';\n }\n\n foreach ($options_all as $option_id => $option_name) {\n $options[$option_id] = $option_name;\n }\n\n asort($options);\n\n return $options;\n}", "public function run()\n {\n DB::table('problems')->insert(array(\n\t\t array(\n\t\t \t'problem_code' => 'SCS112A', \n\t\t \t'difficulty' => 'easy',\n\t\t \t'problem_title' => 'Odd or Even' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 1, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS113A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Vowel or Consonant' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 2, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS114A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Equal to, greater than, or less than' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 3, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS115A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Combination of Primary Colors' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 4, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS116A', \n\t\t \t'difficulty' => 'easy',\n\t\t \t'problem_title' => 'Dominant or Recessive' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 5, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS117A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Leap Year' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 6, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS118A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Divisible by 3' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 7, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS119A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'High School Student Classification' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 8, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS120A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Day of the Week' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 9, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'switch(-case'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS121A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Square, Rectangle, or Triangle' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 10, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\n\n\n\n\n\n\n\t\t array(\n\t\t \t'problem_code' => 'RCS112A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Even Number Counter' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 11, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS113A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Digit Number Counter' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 12, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS114A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Print Numbers 1-20' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 13, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS115A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Print Cubes' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 14, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS116A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Numbers In Between' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 15, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'do{-while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS117A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => \"Output x's\" ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 16, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS118A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Until Only One Digit Remains' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 17, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS119A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Reverse a Number' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 18, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS120A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Descending 1 to 10' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 19, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS121A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Decrementation' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 20, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS122A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Count digits' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 21, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS123A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Perfect Square Counter' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 22, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS124A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Decrease Until 0' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 23, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'do{-while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS125A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => \"Count a's'\",\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 24, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS126A', \n\t\t \t'difficulty' => 'easy', \n\t\t \t'problem_title' => 'Repeating Hello World' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 25, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\n\t\t \t//4:33PM OCT 6\n\n\t\t \t//ARRAYS NO JUGDGEMENT\n\n\n\t\t array(\n\t\t \t'problem_code' => 'ARR212A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Letters' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 26, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'letters['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR213A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Word' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 27, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'word['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR214A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Greater than or equal to 10' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 28, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR215A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Lowest Value and Highest Value' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 29, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR216A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Same Value' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 30, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR217A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Mean' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 31, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR218A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Count Even' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 32, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'integers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR219A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Count Odd' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 33, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'integers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR220A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Big Difference' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 34, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'difference['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR221A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Ten Run' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 35, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'multiples['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR222A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Sum 13' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 36, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR223A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Either 2 or 4' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 37, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR224A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Three Points' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 38, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR225A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Before Four' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 39, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR226A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Triple Triple' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 40, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\n\t\t //5:25PM OCT 6\n\n\n\n\n\n\t\t array(\n\t\t \t'problem_code' => 'SCS212A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Physics Grade' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 41, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'switch(-case'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS213A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Employee Salary' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 42, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS214A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Electricity Bill' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 43, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS215A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Jeepney Fare' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 44, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS216A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Age Definition' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 45, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS217A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Movie Tickets' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 46, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS218A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Election Time' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 47, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS219A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Vowels on a Word' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 48, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS220A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Consonants on a Word' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 49, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS221A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Bricks for a Wall' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 50, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\t\n\n\t\t // 6:10PM OCT 6\n\t\t ///////////////////////////AHHHHHHHHDITO LAST\n\t\t array(\n\t\t \t'problem_code' => 'SCS222A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Same not Sum' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 51, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS223A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Chocolate Bars',\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 52, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS224A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Blackjack' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 53, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS225A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Lucky Sum' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 54, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS226A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Close and Far' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 55, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif'\n\t\t \t\t),\n\t\t array(\n\n\t\t \t///MARKED BRUH\n\t\t \t'problem_code' => 'RCS212A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Bank investment' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 56, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS213A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Reverse with a Twist' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 57, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS214A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Code Count' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 58, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS215A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Triple Character' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 59, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS216A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Ending Y and Z' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 60, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS217A', \n\t\t \t'difficulty' => 'average',\n\t\t \t'problem_title' => 'Happy String' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 61, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS218A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Longest Substring' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 62, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS219A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'String Sum' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 63, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS220A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Base and Remove' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 64, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS221A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Mirror Image' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 65, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS222A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Is to Is not' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 66, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS223A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Largest Block' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 67, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS224A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Fibonacci Series' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 68, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS225A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Multiplication Table' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 69, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS226A', \n\t\t \t'difficulty' => 'average', \n\t\t \t'problem_title' => 'Printing Stars' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 70, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t ///////\n\t\t \n\t\t //71 j not specified\n\t\t array(\n\t\t \t'problem_code' => 'SCS312A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Workshop Programmer' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 71, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('\n\t\t \t\t),\n\n\t\t //72 j not specified\n\t\t array(\n\t\t \t'problem_code' => 'SCS313A', \n\t\t \t'difficulty' => 'hard',\n\t\t \t'problem_title' => 'Secret Message' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 72, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'switch(-case'\n\t\t \t\t),\n\n\t\t //73 j not specified\n\t\t array(\n\t\t \t'problem_code' => 'SCS314A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Playing Cards' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 73, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'switch(-case'\n\t\t \t\t),\n\n\t\t //CORRECT\n\t\t array(\n\t\t \t'problem_code' => 'SCS315A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Two Timer' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 74, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\n\t\t //CORRECT\n\t\t array(\n\t\t \t'problem_code' => 'SCS316A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => \"Millionaire's Game\",\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 75, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else'\n\t\t \t\t),\n\n\t\t \n\t\t array(\n\t\t \t'problem_code' => 'SCS317A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Circle Intersection' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 76, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else' //CORRECT\n\t\t \t\t),\n\n\t\t array(\n\t\t \t'problem_code' => 'SCS318A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Roman Numerals' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 77, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif(' //nested if else\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS319A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'BMI' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 78, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif(' //multiple if else\n\t\t \t\t),\n\t\t //CORRECT 79\n\t\t array(\n\t\t \t'problem_code' => 'SCS320A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Palindrome' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 79, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-else' //CORRECT\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'SCS321A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Money Converter' ,\n\t\t \t'weakness_id'=> 1, \n\t\t \t'feedback_id' => 80, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'if(-elseif('//multiple if else\n\t\t \t\t),\n\n\n\n\t\t //CORRECT TANAN RCS DIRI\n\t\t \n\t\t array(\n\t\t \t'problem_code' => 'RCS312A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Celsius and Fahrenheit' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 81, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'do{-while('\n\t\t \t\t),\n\n\t\t array(\n\t\t \t'problem_code' => 'RCS313A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Caesar Cipher' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 82, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS314A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Vignere Cipher' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 83, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS315A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Death Valley' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 84, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS316A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Word Count' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 85, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS317A', \n\t\t \t'difficulty' => 'hard',\n\t\t \t'problem_title' => 'Binary Logic' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 86, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'do{-while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS318A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Lucky Tickets' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 87, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS319A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Ali Baba' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 88, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS320A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Leap Years in Between' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 89, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS321A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Factorial' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 90, \n\t\t \t'time_limit' => 14401, \n\t\t \t'JUDGEMENTment' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS322A', \n\t\t \t'difficulty' => 'hard',\n\t\t \t'problem_title' => 'Diamond' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 91, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for(' //nested for loop\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS323A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Triangle' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 92, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('//nested for\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS324A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Diamond Word' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 93, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'while(-for(' //1 while and nested for\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS325A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Weather Forecast' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 94, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for('\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'RCS326A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Reverse Pig Latin' ,\n\t\t \t'weakness_id'=> 2, \n\t\t \t'feedback_id' => 95, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'for(' //number15 j not specified\n\t\t \t\t),\n\n\n\t\t //ALL ARRAYS WALAY JUDGEMENT\n\n\t\t array(\n\t\t \t'problem_code' => 'ARR312A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Josephus Problem' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 96, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'sequence[-for('\n\t\t \t\t),\n\n\n\t\t \n\t\t array(\n\t\t \t'problem_code' => 'ARR313A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => '8 Queens' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 97, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'configuration['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR314A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Clump' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 98, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR315A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Ascending Order' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 99, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\n\n\n\t\t \t//////OCT 7\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR316A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Descending Order' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 100, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR317A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Mirror Mirror' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 101, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR318A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Outer and Inner' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 102, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR319A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Balanced or Not Balanced' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 103, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR320A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'FIX 34' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 104, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers['//invsolved\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR321A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'FIX 45' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 105, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'numbers[' //invsolved\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR322A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'The Annoying Friend' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 106, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'words['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR323A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Spelling Bee' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 107, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'correctWords[-contestantWords['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR324A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Honor Students' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 108, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'grades['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR325A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Weather Forecast ' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 109, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'weatherForecast['\n\t\t \t\t),\n\t\t array(\n\t\t \t'problem_code' => 'ARR326A', \n\t\t \t'difficulty' => 'hard', \n\t\t \t'problem_title' => 'Intruder Alert ' ,\n\t\t \t'weakness_id'=> 3, \n\t\t \t'feedback_id' => 110, \n\t\t \t'time_limit' => 14401, \n\t\t \t'judgement' => 'loginSequences['\n\t\t \t\t)\n\t\t));\t\t \n }", "public function index()\n {\n //\n //\n $challengeDTArray = array();\n \n $challengeDT = array();\n array_push($challengeDT, \"Kamikase\");\n array_push($challengeDT, \"Explota blablabla\");\n array_push($challengeDT, \"0\");\n array_push($challengeDT, \"2\");\n array_push($challengeDTArray, $challengeDT);\n\n $challengeDT = array();\n array_push($challengeDT, \"adfafa\");\n array_push($challengeDT, \"dfadasfdasf blablabla\");\n array_push($challengeDT, \"0\");\n array_push($challengeDT, \"5\");\n array_push($challengeDTArray, $challengeDT);\n\n $challengeDT = array();\n array_push($challengeDT, \"adfadfadfasf\");\n array_push($challengeDT, \"nmhmhm blablabla\");\n array_push($challengeDT, \"0\");\n array_push($challengeDT, \"1\");\n array_push($challengeDTArray, $challengeDT);\n\n $challengeDT = array();\n array_push($challengeDT, \"rtrtr\");\n array_push($challengeDT, \"afggng blablabla\");\n array_push($challengeDT, \"0\");\n array_push($challengeDT, \"10\");\n array_push($challengeDTArray, $challengeDT);\n\n return response()->json($challengeDTArray);\n }", "function options(){\n $output = '';\n $r = getmeet();\n $penaltyarray = [];\n $count = 0;\n //isolate penalty column\n foreach ($r as $pen) {\n $penalty[] = $pen->penalty;\n $count++;\n }\n //mark x the first instance of a value with similarity\n for($i = 0; $i < $count-1; $i++){\n for($x = $i; $x < $count-1; $x++){\n if($penalty[$i] == $penalty[$x+1]){\n $penalty[$i] = \"x\";\n echo \"trying\";\n }\n }\n }\n //move to new array\n $new_arr = [];\n $new_count = 0;\n foreach($penalty as $a){\n if($a != 'x'){\n $new_arr[] = $a;\n $new_count++;\n }\n }\n //arrange the array in ascending order\n for($i = 0; $i < $new_count-1; $i++){\n for($x = $i; $x < $new_count-1; $x++){\n if($new_arr[$i] > $new_arr[$x+1]){\n $temp = $new_arr[$i];\n $new_arr[$i] = $new_arr[$x+1];\n $new_arr[$x+1] = $temp;\n }\n }\n }\n //pass into html entity\n foreach ($new_arr as $pen) {\n $output .= '<option>';\n $output .= $pen;\n $output .= '</option>';\n }\n $output .= '\n <option>PAID</option>\n <option>PRESENT</option>\n <option>CLEARED</option>';\n return $output;\n}", "public function getProblems(): array;", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $challenges = $em->getRepository('CatchmeBundle:Challenge')->findAll();\n\n return $this->render('@Catchme/challenge/index.html.twig', array(\n 'challenges' => $challenges,\n ));\n }", "function list_assignments() {\n global $id, $tool_content, $langWorks, $langChoice, $langGroupWorkDeadline_of_Submission,\n $langAddModulesButton, $langNoAssign, $langPassCode, $course_id, $course_code, $urlServer;\n\n $result = Database::get()->queryArray(\"SELECT * FROM assignment WHERE course_id = ?d ORDER BY title\", $course_id);\n if (count($result) == 0) {\n $tool_content .= \"<div class='col-sm-12'><div class='alert alert-warning'>$langNoAssign</div></div>\";\n } else {\n $tool_content .= \"<form action='insert.php?course=$course_code' method='post'>\" .\n \"<input type='hidden' name='id' value='$id'>\" .\n \"<div class='table-responsive'><table class='table-default'>\" .\n \"<tr class='list-header'>\" .\n \"<th style='width:20px;' class='text-center'>$langChoice</th>\" .\n \"<th class='text-start'>&nbsp;$langWorks</th>\" .\n \"<th width='150'>$langGroupWorkDeadline_of_Submission</th>\" .\n\n \"</tr>\";\n foreach ($result as $row) {\n if ($row->password_lock) {\n $exclamation_icon = \"&nbsp;&nbsp;<span class='fa fa-exclamation-triangle space-after-icon' data-toggle='tooltip' data-placement='right' data-html='true' data-title='$langPassCode'></span>\";\n } else {\n $exclamation_icon = '';\n }\n if (!$row->active) {\n $vis = 'not_visible';\n } else {\n $vis = '';\n }\n $description = empty($row->description) ? '' :\n \"<div class='margin-top: 10px;'>\" . mathfilter($row->description, 12 , \"../../courses/mathimg/\"). \"</div>\";\n $tool_content .= \"<tr class='$vis'>\" .\n \"<td class='text-center'><input name='work[]' value='$row->id' type='checkbox' /></td>\" .\n \"<td><a href='{$urlServer}modules/work/index.php?course=$course_code&amp;id=$row->id'>\" . q($row->title) . \"</a>$exclamation_icon $description</td>\" .\n \"<td class='text-center'>\".format_locale_date(strtotime($row->submission_date), 'short').\"</td>\" .\n \"</tr>\";\n }\n $tool_content .=\n \"</table></div>\" .\n \"<div class='d-flex justify-content-center mt-3'><input class='btn submitAdminBtn' type='submit' name='submit_work' value='$langAddModulesButton' /></div></th></form>\";\n }\n}", "public function testUpdateChallenge()\n {\n }", "public function getPreDefinedQuestions()\n {\n return [\n \"1\" => \"Select a Security Question\",\n \"2\" => \"What was your childhood nickname?\",\n \"3\" => \"What is the name of your favorite childhood friend?\",\n \"4\" => \"What was the name of your first stuffed animal?\",\n \"5\" => \"Where were you when you had your first kiss?\",\n \"6\" => \"What is the name of the company of your first job?\",\n \"7\" => \"What was your favorite place to visit as a child?\",\n \"8\" => \"What was your dream job as a child?\",\n \"9\" => \"What is your preferred musical genre?\",\n \"10\" => \"What is your favorite team?\",\n \"11\" => \"What is your father\\\"s middle name?\"\n ];\n }", "public function index()\n {\n $listChallenges = Challenge::orderBy('id','ASC')->get();\n $challenges=array();\n foreach ($listChallenges as $challenge) {\n $challengeLog=ChallengeLog::where(['user_id' => Auth::id(),'challenge_id' => $challenge->id])->count();\n if($challengeLog)\n $challenges[]=array(\"data\"=>$challenge,\"finished\"=>true);\n else \n $challenges[]=array(\"data\"=>$challenge,\"finished\"=>false);\n }\n return view('challenge.index',compact('challenges'))\n ->with('i', 1);\n }", "public function generateChallenge()\n {\n // Easy\n if (Captcha::$config['complexity'] < 4) {\n $numbers[] = mt_rand(1, 5);\n $numbers[] = mt_rand(1, 4);\n }\n // Normal\n elseif (Captcha::$config['complexity'] < 7) {\n $numbers[] = mt_rand(10, 20);\n $numbers[] = mt_rand(1, 10);\n }\n // Difficult, well, not really ;)\n else {\n $numbers[] = mt_rand(100, 200);\n $numbers[] = mt_rand(10, 20);\n $numbers[] = mt_rand(1, 10);\n }\n\n // Store the question for output\n $this->mathExercise = implode(' + ', $numbers) . ' = ';\n\n // Return the answer\n $this->response = array_sum($numbers);\n\n return $this->response;\n }", "public function indiquerChoix()\n {\n $categories = Categorie::all();\n $categoriesAge = CategorieAge::all();\n $ambiance = Ambiance::all();\n\n $questions = array('categoriesAge'=>$categoriesAge,'categories'=>$categories, 'ambiances'=>$ambiance);\n return json_encode($questions);\n }", "public function getNamaChallenge();", "public function index()\n {\n $exams = Exam::all();\n $difficultyLevels = Difficulty::all();\n $exam1 = Exam::with('questions')->get();\n $questions = Question::with('option')->get();\n // dd($difficultyLevels);\n return view('add-question.index', compact('questions'));\n }", "public function getChoices();", "public function testCreateChallenge()\n {\n }", "public function run()\n {\n $courses = [\n ['Math', '11', 'Magni Lindsey', '/img/Math11.jpg', 'Welcome to Math 11. This course will equip you with fundemental knowledage of basic mathematic operation and quadratic function. They are very important for all future science course.', '40$/hour', 'http://www.bcmath.ca/PC11/PC11main.htm'],\n ['Physics', '11', 'Virgee Harris', '/img/Physics11.jpg', 'Welcome to Physics 11. This course will teach you the basic concepts of motion, force and energy so that you will be clear about how the fundemental law of physiscs works around us.', '40$/hour', 'https://yungmingliu.wikispaces.com/BC+Physics+11'],\n ['Chemistry', '11', 'Virgil\tBarrett', '/img/Chemistry11.jpg','Welcome to Chemsitry 11. This course covers basic calculations in chemistry including mole concept, concentration, stoichiometry, classification of matter and periodic table.', '45$/hour', 'https://noteshelp.wordpress.com/chemistry-11/'],\n ['Math', '12', 'Eloise Page', '/img/Math12.jpg', 'Welcome to Math 12. This course is a good preparation course for future calculus. In this course, you will learn exponential and logarithmic functions, and various trigonometric identities.', '45$/hour', 'https://noteshelp.wordpress.com/math-12/'],\n ['Physics', '12', 'Adrienne\tBarber', '/img/Physics12.jpg', 'Welcome to Physics 12. This course will introduce you to more complex natural physical behaviors, such as momentum and impulse, circular motion and gravitation and electrical forces.', '50$/hour', 'https://noteshelp.wordpress.com/physics-12/'],\n ['Chemistry', '12', 'Peggy Olson', '/img/Chemistry12.jpg', 'Welcome to Chemsitry 12. Chemistry 12 will advance your knowledage of chemistry to multiple new areas. You will start to understand reaction kinetics, solubility equilibrium.', '45$/hour', 'https://noteshelp.wordpress.com/chemistry-12/'],\n ['Biology', '11', 'Ellary Anderson', '/img/Biology11.jpg', 'Welcome to Biology 11. This course will greatly expand your knowledage of living creature around us. You will learn protists, mycology, plant biology and animal biology.', '45$/hour', 'https://noteshelp.wordpress.com/biology-11/'],\n ['Biology', '12', 'Katey Sampertin', '/img/Biology12.jpg', 'Welcome to Biology 12. This course provide you much profound knowledage about DNA and RNA stucture and function. You will also start to understand how gene express themselves.', '50$/hour', 'https://noteshelp.wordpress.com/biology-12/']\n\n ];\n\n \n foreach ($courses as $key => $course) {\n Course::insert([\n 'created_at' => Carbon\\Carbon::now(),\n 'updated_at' => Carbon\\Carbon::now(),\n 'name' => $course[0],\n 'level' => $course[1],\n 'instructor' => $course[2],\n 'image' => $course[3],\n 'description' => $course[4],\n 'price' => $course[5],\n 'link'=>$course[6]\n ]);\n }\n }", "public function index()\n {\n /*member variables*/\n $options = \"\";\n $optionValue = \"\";\n /* confirm if user had logged in in before and started a survey*/\n $user = Auth::user();\n $answer = Answer::where('user_id','=',$user->id)->get()->last();\n\n if( $answer != \"\" ){\n $question_id = $answer->question_id;\n $answer_string = $answer->string;\n\n /*get next question using function getNextQuestion in answer controller*/\n $displayQuestion = app('App\\Http\\Controllers\\AnswerController')->getNextQuestion($question_id,$answer_string);\n\n return $displayQuestion;\n /* use post question to work */\n }else{\n /*if user has never done a the survey before get first question*/\n /*fetch every paths*/\n $paths = Path::get(['id', 'name', 'sequence']);\n If( sizeof($paths)>0 ) {\n // fetch path where sequence == 1\n $sequence = \"1\";\n $path_id = \"\";\n $paths = Path::where('sequence',$sequence)->get(['id', 'name', 'sequence']);\n foreach( $paths as $path ){\n $path_id = $path->id;\n }\n $questions = Question::where('path_id' , '=' ,$path_id/*[['sequence', '=', $sequence], ['path_id', '=', 1]]*/)\n ->get(['id', 'string', 'sequence', 'path_id', 'user_id', 'progress', 'is_dichotomous', 'is_optional', 'has_options']);\n foreach ($questions as $questions) {\n /* use question id to pluck options for this specific question id*/\n $question_id = $questions->id;\n $sequence = $questions->sequence;\n /* if has options get the options div displays */\n if( $questions->has_options == true ){\n $input_type = \"option\";\n /*get the div displays*/\n $optionValue = app('App\\Http\\Controllers\\InputController')->index($input_type,$question_id);\n /*get the options*/\n $options = Option::where('question_id', $question_id)->pluck('options_string');\n\n }elseif ( $questions->has_multiple == true ){\n\n echo(\"get has multiple values\");\n\n }else if ( $questions->has_options == false && $questions->has_multiple == false ){\n\n echo(\"both values of has multiple and has options is false\");\n\n }else{\n\n echo(\"no reasonable input type \");\n\n }\n /* creating a new collection instance to fit our required output*/\n $question = new Collection;\n\n $question->push([\n 'id' => $questions->id,\n 'string' => $questions->string,\n 'sequence' => $sequence,\n 'options' => $options,\n 'optionValue' => $optionValue,\n\n ]);\n $question = $question[0];\n $question = json_encode($question);\n\n return $question;\n\n }\n\n }\n else{\n echo \"CANNOT COMPLETE REQUEST\";\n }\n }\n\n\n }", "public function run()\n {\n $reasons = [ \n \"Annual Physical\",\n \"General Consultation\",\n \"Illness\",\n \"Infection Consultation\",\n \"New Patient Visit\",\n \"Acid Reflux / Heartburn\",\n \"Anemia\",\n \"Back Problems\",\n \"Bleeding Disorder\",\n \"Blood Pressure Testing\",\n \"Blood Work\",\n \"Bronchitis\",\n \"COVID-19 Antibody Test\",\n \"Chlamydia\",\n \"Cholesterol / Lipids Checkup\",\n \"Cholesterol Management\",\n \"Chronic Cough\",\n \"Chronic Illness\",\n \"Cold\",\n \"Cold Sores / Herpes Labialis\",\n \"Constipation\",\n \"Cough\",\n \"Diabetes Consultation\",\n \"ECG / EKG\",\n \"Ear Infection\",\n \"Electrocardiogram\",\n \"Elevated PSA\",\n \"Enlarged Lymph Nodes\",\n \"Erectile Dysfunction / Impotence / Male Sexual Dysfunction\",\n \"Eye Infection\",\n \"Fainting / Syncope\",\n \"Fatty Liver Disease\",\n \"Flu\",\n \"Frequent Urination\",\n \"General Follow Up\",\n \"Headache\",\n \"High Blood Pressure / Hypertension\",\n \"High Blood Sugar / Hyperglycemia\",\n \"High Cholesterol / Lipid Problem\",\n \"Hospital Discharge/Follow Up\",\n \"Hyperlipidemia\",\n \"Hyperthyroidism / Overactive Thyroid\",\n \"Hypogonadism\",\n \"Hypothyroidism / Underactive Thyroid\",\n \"Immigration Medical Examination\",\n \"Immunization\",\n \"Immunodeficiency\",\n \"Infection Follow Up\",\n \"Insomnia\",\n \"Iron Deficiency\",\n \"Kidney Stones\",\n \"Medication Review\",\n \"Migraine\",\n \"Nasal Congestion\",\n \"Pre-Surgery Checkup / Pre-Surgical Clearance\",\n \"Prescription / Refill\",\n \"Preventive Medicine Consultation\",\n \"Sexually Transmitted Disease (STD)\",\n \"Sleep Disorder\",\n \"Sore Throat\",\n \"Swelling in Neck\",\n \"Thyroid Evaluation\",\n \"Tiredness / Fatigue\",\n \"Type 2 Diabetes\",\n \"Urinary Urgency / Urge Incontinence\",\n ];\n \n \n foreach ($reasons as $reason) {\n DB::table('reasons')->insert([\n 'name' => $reason,\n 'created_at'=>date('Y-m-d H:i:s'),\n 'updated_at'=>date('Y-m-d H:i:s'), \n ]); \n }\n }", "public function getChallengesByActivity(){\n $query = '\n SELECT tc.id\n FROM `hotornot-dev`.tblChallenges as tc\n JOIN `hotornot-dev`.tblChallengeVotes as tcv\n ON tc.id = tcv.challenge_id\n WHERE is_verify != 1\n LIMIT 100\n ';\n $stmt = $this->prepareAndExecute( $query );\n $ids = $stmt->fetchAll( PDO::FETCH_OBJ );\n foreach( $ids as &$id ){\n $id = $id->id;\n }\n $ids = array_unique($ids);\n return $ids;\n\n }", "function get_faculty_selections($con) {\n\t$facs = get_faculties($con);\n\t$sel = '<option value=\"\"></option>';\n\tforeach ($facs as $id => $name) {\n\t\t$sel .= '<option value=\"'.$id.'\">'.$name.'</option>';\n\t}\n\treturn $sel;\n}", "function getChallengeName($challenge_id) {\n $challenges = challenges();\n return $challenges[$challenge_id]['name'];\n}", "public function getAnswers();", "public function run()\n {\n \\Illuminate\\Support\\Facades\\DB::table('question_options')->insert([\n [\n 'questionID' => 1,\n 'optionName' => 'Machine Learning'\n ],\n [\n 'questionID' => 1,\n 'optionName' => 'Web'\n ],\n [\n 'questionID' => 1,\n 'optionName' => 'User Experience'\n ],\n [\n 'questionID' => 1,\n 'optionName' => 'Food'\n ],\n [\n 'questionID' => 2,\n 'optionName' => 'Audio Processing'\n ],\n [\n 'questionID' => 2,\n 'optionName' => 'Digital Image Processing'\n ],\n [\n 'questionID' => 2,\n 'optionName' => 'Big Data processing'\n ],\n [\n 'questionID' => 2,\n 'optionName' => 'Small Data processing'\n ],\n [\n 'questionID' => 3,\n 'optionName' => 'Ancestor Interest'\n ],\n [\n 'questionID' => 3,\n 'optionName' => 'Another Insect'\n ],\n [\n 'questionID' => 3,\n 'optionName' => 'Artificial Intelligence'\n ],\n [\n 'questionID' => 3,\n 'optionName' => 'Alive Intergalactic'\n ],\n [\n 'questionID' => 4,\n 'optionName' => 'stdio.h'\n ],\n [\n 'questionID' => 4,\n 'optionName' => 'Bootstrap'\n ],\n [\n 'questionID' => 4,\n 'optionName' => 'Jquery'\n ],\n [\n 'questionID' => 4,\n 'optionName' => 'OpenCV'\n ],\n [\n 'questionID' => 10,\n 'optionName' => 'Amerika'\n ],\n [\n 'questionID' => 10,\n 'optionName' => 'Belanda'\n ],\n [\n 'questionID' => 10,\n 'optionName' => 'Jepang'\n ],\n [\n 'questionID' => 10,\n 'optionName' => 'Indonesia'\n ],\n [\n 'questionID' => 10,\n 'optionName' => 'Swedia'\n ],\n [\n 'questionID' => 11,\n 'optionName' => 'Austronesia'\n ],\n [\n 'questionID' => 11,\n 'optionName' => 'Melayu'\n ],\n [\n 'questionID' => 11,\n 'optionName' => 'Austrik'\n ],\n [\n 'questionID' => 11,\n 'optionName' => 'Austro-Asiatik'\n ],\n [\n 'questionID' => 11,\n 'optionName' => 'jawa'\n ],\n [\n 'questionID' => 11,\n 'optionName' => 'sunda'\n ],\n [\n 'questionID' => 11,\n 'optionName' => 'batak'\n ],\n [\n 'questionID' => 12,\n 'optionName' => 'Setelah Sumpah Pemuda'\n ],\n [\n 'questionID' => 12,\n 'optionName' => 'Setelah Hari Pancasila'\n ],\n [\n 'questionID' => 12,\n 'optionName' => 'Setelah Proklamasi Kemerdekaan Indonesia'\n ],\n ]);\n }", "public function __construct()\n {\n parent::__construct();\n $this->challenges = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "public function showParticipatedChallenge() {\n\n if (Auth::guest()) {\n $response = array(\"status\" => false,\n \"error\" => \"unauthorized\");\n } else {\n\n $freelancer = Freelancer::find(Auth::user()->user_id);\n $challenges = $freelancer->challenges()->orderBy('updated_at', 'desc')->get();\n foreach ($challenges as $challenge) {\n\n $average = $freelancer->get_average_marks($challenge->challenge_id);\n $challenge->markAverage = $average == -1 ? '-' : number_format($average, 2);\n }\n }\n // dd($challenge);\n return view('challenges.indexWithMark', compact('challenges', 'criterions', 'freelancer'));\n }", "function mfcs_get_log_problems_list_options($option = NULL, $type = NULL, $hidden = FALSE, $disabled = FALSE) {\n $options = array();\n $options_all = array();\n\n if ($hidden) {\n $options_all[MFCS_LOG_PROBLEMS_NONE] = 'None';\n }\n\n $options_all[MFCS_LOG_PROBLEMS_INSERT] = 'Insert';\n $options_all[MFCS_LOG_PROBLEMS_UPDATE] = 'Update';\n $options_all[MFCS_LOG_PROBLEMS_DELETE] = 'Delete';\n $options_all[MFCS_LOG_PROBLEMS_RESYNC] = 'Re-Synchronize';\n $options_all[MFCS_LOG_PROBLEMS_IGNORE] = 'Ignore';\n $options_all[MFCS_LOG_PROBLEMS_UNIGNORE] = 'Unignore';\n $options_all[MFCS_LOG_PROBLEMS_RECHECK] = 'Re-Check';\n $options_all[MFCS_LOG_PROBLEMS_REASSIGN_VENUE_COORDINATOR] = 'Re-assign Venue Coordinator';\n $options_all[MFCS_LOG_PROBLEMS_REASSIGN_REQUESTER] = 'Re-assign Requester';\n $options_all[MFCS_LOG_PROBLEMS_REASSIGN_REBUILD_CACHE] = 'Rebuild Cache';\n\n if ($option == 'select') {\n $options[''] = '- Select -';\n }\n\n if ($type == 'requests') {\n foreach (array(MFCS_LOG_PROBLEMS_NONE, MFCS_LOG_PROBLEMS_IGNORE, MFCS_LOG_PROBLEMS_UNIGNORE, MFCS_LOG_PROBLEMS_RECHECK, MFCS_LOG_PROBLEMS_REASSIGN_VENUE_COORDINATOR, MFCS_LOG_PROBLEMS_REASSIGN_REQUESTER, MFCS_LOG_PROBLEMS_REASSIGN_REBUILD_CACHE) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($type == 'basic') {\n foreach (array(MFCS_LOG_PROBLEMS_NONE, MFCS_LOG_PROBLEMS_INSERT, MFCS_LOG_PROBLEMS_UPDATE, MFCS_LOG_PROBLEMS_DELETE, MFCS_LOG_PROBLEMS_RESYNC, MFCS_LOG_PROBLEMS_IGNORE, MFCS_LOG_PROBLEMS_UNIGNORE, MFCS_LOG_PROBLEMS_RECHECK) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n else {\n foreach ($options_all as $option_id => $option_name) {\n $options[$option_id] = $option_name;\n }\n }\n\n asort($options);\n\n return $options;\n}", "public function run()\n {\n $data = [\n [\n 'title' => 'Общие и финансовые вопросы',\n 'questions' => [\n [\n 'general' => true,\n 'title' => 'Как я могу узнать, какой у меня подключен тарифный план и до какого числа оплачен интернет?',\n 'description' => 'Ознакомиться с этой информацией можно несколькими способами: - В личном кабинете в разделе «Интернет – Услуги». - Для владельцев Apple разработано удобное приложение “SkyNet Личный кабинет”. Найти приложение можно в магазине приложений AppStore по запросу \"SkyNet. Требования: iPhone, iPod, iPad с операционной системой iOS 7.1 и выше. - Обратиться по телефону в Отдел Поддержки Пользователей SkyNet (тел.: 386-20-20)'\n ],\n [\n 'general' => true,\n 'title' => 'Подключение банковской карты в Личном кабинете',\n 'description' => 'Заходим в Личный кабинет, в раздел «Автоматическая оплата картой». Нажимаем «Подключить карту». Заполняем все поля. Имя держателя карты вводится заглавными латинскими буквами. Для не именных карт указываем «NO NAME». Нажимаем «Подтвердить». Возвращаемся в Личный кабинет. Нажимаем «Активировать карту». На карте резервируются две суммы: — 1 рубль для проверки активности карты; — Случайная сумма от 0,01 до 9,99 рублей. Данную сумму (три цифры без запятых) необходимо ввести в поле «Сумма авторизации (в копейках)» в течение 15 минут. Сумма вводится в формате кода, например: для суммы 5 р. 56 коп. необходимо ввести — 556; Если Вы не получили SMS с суммой авторизации, пожалуйста, обратитесь в банк-держатель карты. Нажимаем «Подтвердить». После регистрации карты зарезервированные суммы возвращаются на банковскую карту. Нажимаем «Вернуться в личный кабинет». Карта успешно подключена! Теперь Вы можете оплатить через «Разовое пополнение» или включить «Автопополнение».'\n ],\n [\n 'general' => true,\n 'title' => 'Как подключить оповещения в Telegram от SkyNet?',\n 'description' => 'Каждый абонент сети SkyNet может пользоваться услугой информирования в Telegram. Это можно сделать следующим образом. Прежде всего Вам потребуется установить мессенджер Telegram на устройство. Это может быть смартфон по управлением ОС iOS или Android, а так же устройство на ОС Windows или MAC OS. Ссылки на загрузку приложения: OS Android; iOS; Windows Phone; Для Android: Откройте Play Market на Вашем устройстве В поиске введите «Telegram» или «Телеграмм» Нажмите кнопку «Установить» Запустите приложение. После этого введите номер своего мобильного телефона. На указанный Вами номер поступит СМС-уведомление с кодом активации приложения. Введите код в соответствующее поле. Для iOS. Откройте AppStore на Вашем устройстве. В поиске введите «Telegram» или «Телеграмм» Нажмите кнопку «Установить» После этого откройте приложение. Введите Ваш номер телефона. Затем введите номер своего мобильного телефона. На указанный Вами номер поступит СМС-уведомление с кодом активации приложения. Введите код в соответствующее поле. Для ОС Windows и MAC OS: Загрузите клиент с официального сайта программы. После этого запустите процесс установки. Подключить оповещения от любимого провайдера SkyNet можно следующим образом: 1. Пройдите по ссылке и нажмите кнопку «Join». 2. - Запустите Telegram; - Нажмите поиск (кнопка лупа). В поиске введите «skntbot» - Нажмите кнопку «Start» - После этого разрешите приложению использовать Ваш номер телефона, нажав кнопку «OK» - Затем нажмите кнопку «Продолжить» После этого Вы можете использовать функции нашего бота. Он будет оповещать Вас о: Балансе своего счета; Предстоящих списаниях и зачислении средств; Ремонтных работах. Обратите внимание! Ваш номер телефона, указанный в Telegram, так же должен быть указан в Личном кабинете SkyNet в разделе «Настройка SMS-оповещения».'\n ],\n [\n 'general' => true,\n 'title' => 'Я внес средства на лицевой счет, как я могу узнать об их поступлении?',\n 'description' => '- В личном кабинете в разделе «Баланс и платежи» - Через приложение «SkyNet Личный кабинет» (для владельцев Apple iOS) - Вы можете подключить услугу «SMS-чек» в личном кабинете и после внесения денежных средств вам на телефон будет приходить SMS-сообщение об их поступлении.'\n ],\n [\n 'title' => 'Я хочу сменить тариф. Как это сделать?',\n 'description' => 'Сменить тариф Вы можете в личном кабинете. Для смены тарифа в личном кабинете выбираете раздел «Интернет» -> «Услуги». В разделе «Услуги» нажимаете «Сменить текущий/будущий тариф», после этого откроется таблица с тарифами. В данной таблице выбираете желаемый тариф и нажимаете «Отправить»'\n ],\n [\n 'title' => 'Как я могу узнать пароль от личного кабинета?',\n 'description' => 'Пароль от личного кабинета предоставляется каждому клиенту при подключении. Если он был утерян, Вы можете его восстановить несколькими способами: - При входе в личный кабинет нажать кнопку «Забыли пароль» - на Ваш номер телефона придет SMS с новым паролем, сменить его Вы можете в любой момент в личном кабинете в разделе «Сменить пароль» - Обратиться в Отдел Поддержки Пользователей по телефону 386-20-20 или через онлайн-консультант.'\n ],\n [\n 'title' => 'Как я могу оплатить интернет без комиссии?',\n 'description' => 'Произвести оплату без комиссии Вы можете через терминалы Сбербанка в любом отделении банка, а также банковской картой в личном кабинете или на нашем сайте.'\n ],\n [\n 'title' => 'Я пропустил оплату, интернет не работает, но хотелось бы оплатить услуги банковской картой. Как я могу это сделать?',\n 'description' => '- Вы можете активировать «Отложенный платеж» в личном кабинете. Через 15 минут доступ в интернет восстановится, и можно будет оплатить услуги банковской картой через наш сайт. - Если Вы уже воспользовались услугой «Отложенный платеж», но оплатить не успели – Вы можете привязать банковскую карту к договору в личном кабинете в разделе «Оплата банковской картой» и после этого оплатить. Также, Вы можете подключить в личном кабинете «Автоплатеж» и более не беспокоиться об оплате – средства будут списываться с Вашей банковской карты автоматически.'\n ],\n [\n 'title' => 'Как привязать банковскую карту к договору в личном кабинете?',\n 'description' => 'Для того что бы привязать карту нужно зайти в Личный кабинет, в раздел «Оплата банковской картой» и нажать кнопку «Подключить карту». Далее: 1. Заполняем все поля; - Произойдёт резервирование средств на сумму 1 рубля для проверки активности карты. - Далее резервируется случайная сумма от 0,01 до 9,99 (с учётом копеек), после этого процедура регистрации карты переходит в режим ожидания ввода данной суммы, срок ожидания ограничен по времени - 2 часа. 2. Нажимаем «Вернуться в личный кабинет»; 3. Нажимаем «Активировать карту»; 4. В строке «Сумма авторизации» вводим сумму, которая была зарезервирована. Сумма вводится в формате кода, например: для суммы 5 р. 56 коп. необходимо ввести - 556; 5. Нажимаем «Подтвердить». После успешной регистрации карты, зарезервированные суммы возвращаются на банковскую карту.'\n ],\n [\n 'title' => 'Я случайно оплатил на неверный номер договора, что делать?',\n 'description' => 'Вам нужно написать заявление на info@sknt.ru, либо приехать в офис с паспортом и чеком. В заявлении должно быть указано: 1. Ф.И.О. полностью 2. Паспортные данные 3. Дата оплаты 4. Верный ID 5. Неверный ID 6. Сумма к зачислению 7. Число 8. Подпись 9. Копия чека (это может быть скан или четкая фотография) На почте заявление рассматривается от 1 до 7 дней в порядке очереди, но как правило это происходит быстрее, в течение 1-2 дней. В офисе денежные средства переведут сразу при Вас.'\n ],\n [\n 'title' => 'Как добавить номер телефона в Личном кабинете?',\n 'description' => 'Чтобы указать номер телефона в Личном кабинете: 1. Слева, в разделе «SMS-услуги» выбираем «Мой телефон» 2. В поле «Текущий номер телефона для оповещений» указываем номер телефона и нажимаем кнопку «Сохранить».'\n ],\n [\n 'title' => 'Я оплатил банковской картой с сайта, но деньги не дошли, почему?',\n 'description' => '— чтобы выяснить это, нам потребуется «Идентификатор транзакции», который отображается после проведения платежа (выделен красным на рисунке ниже). Вы можете передать его нам любым удобным для вас способом: – обращением из ЛК; – по почте info@sknt.ru; – через чат с нашего сайта; – по телефону 386–2020 (круглосуточно). Если Вы вдруг не сохранили «Идентификатор транзакции», необходимо обращаться в банк, который выпустил Вашу карту. Заметим, что данный процесс может занимать значительное время (в зависимости от банка, время реакции может различаться), поэтому настоятельно рекомендуем сохранять его до поступления Вашего платежа на счёт.'\n ],\n ]\n ],\n [\n 'title' => 'Техническая поддержка: Интернет',\n 'questions' => [\n [\n 'general' => true,\n 'title' => 'Я подключил кабель интернета в новое устройство, но Интернет не заработал. Почему?',\n 'description' => 'Я подключил кабель интернета в новое устройство, но Интернет не заработал. Почему? Необходимо зарегистрировать Ваше устройство в сети, для этого потребуется Физический (MAC) адрес нового оборудования. Физический адрес Вашего устройства нужно указать в Личном кабинете. · Зайдите в Личный кабинет; · Зайдите в раздел «Услуги»; · Нажмите кнопку «Сменить мак-адрес»; · В поле для ввода укажите физический адрес Вашего устройства, затем нажмите «Сохранить». Так же Вы можете зарегистрировать новое устройство в приложении «SkyNet Личный кабинет». После регистрации нового устройства доступ появится в течение 10 минут.'\n ],\n [\n 'general' => true,\n 'title' => 'Как узнать Физический (MAC) адрес моего компьютера?',\n 'description' => 'Windows 7 Необходимо открыть меню Пуск; Затем выбрать Панель управления; После этого Сеть и интернет; Далее Центр управления сетями и общим доступом, там нужно выбрать Изменение параметров адаптера; Нажмите левой кнопкой мыши дважды по значку Подключение по локальной сети; в выпадающем меню выберите пункт Состояние, кнопка Сведения; В открывшемся окне найдите строчку Физический адрес. Windows 8/8.1/10 Необходимо нажать на клавиатуре одновременно клавишу \"Windows\" и английскую клавишу \"X\"; В открывшемся списке выберите Панель управления; После этого Сеть и интернет; Далее Центр управления сетями и общим доступом, там нужно выбрать Изменение параметров адаптера; Нажмите левой кнопкой мыши дважды по значку Ethernet; В выпадающем меню выберите пункт Состояние, кнопка Сведения; В открывшемся окне найдите строчку Физический адрес. Mac OS X 10.5 и новее Необходимо перейти в Системные настройки; Далее Сеть, после этого нужно выбрать подключение Ethernet; Затем Дополнительно, дальше Ethernet; В поле Идентификатор Ethernet находится MAC-адрес.'\n ],\n [\n 'title' => 'Как можно сменить IP-адрес?',\n 'description' => 'Внешний IP-адрес можно сменить в личном кабинете в разделе «Интернет» → «Услуги».'\n ],\n [\n 'title' => 'Какие порты блокируются в сети SkyNet?',\n 'description' => 'В нашу сеть закрыт доступ из глобальной сети по следующим портам: 68 – порт DHCP; 135, 137, 138, 139 – порты NETBIOS; 445 – порт MICROSOFT-DS. Так же закрыт доступ из глобальной сети для порта 53 (UDP). Это означает, что из интернета нельзя сделать запрос к DNS-серверам пользователей нашей сети, зато сами пользователи по-прежнему могут отправлять такие запросы в интернет и получать ответ. Это обусловлено тем, что иногда пользователи некорректно настраивают свои домашние сервера и совершают неумышленные сетевые атаки на сторонние ресурсы, приводящие к отключению или перезагрузке сетевого оборудования. Если вы все-таки хотите настроить у себя дома полноценный DNS-сервер, рекомендуем ознакомиться с разделом «Хостинг DNS» в личном кабинете.'\n ],\n [\n 'general' => true,\n 'title' => 'Настройка роутера Dlink DIR-615S',\n 'description' => 'Подключение и обновление ПО роутера Кабель сети SkyNetTelecom соедините с портом INTERNET (WAN) на роутере; Стационарные компьютеры внутренней сети соедините с портами LAN на роутере. ВНИМАНИЕ! Категорически запрещается соединять кабель сети SkyNet с портами LAN. Настройка интернета и доступа к Wi-Fi После подключения роутера к компьютеру откройте браузер (Firefox, Google Chrome, Opera или Safari) и в адресной строке наберите: 192.168.0.1 Появится страница авторизации. Введите пароль «admin», который в дальнейшем будете использовать для настройки роутера, и нажмите «Save» После входа на главную страницу нажмите «Статус». В пункте «Сетевая статистика» найдите «WAN» и соответствующее значение «MAC». MAC-адрес необходим для регистрации роутера в сети SkyNetTelecom. Узнать о способах регистрации устройства можно здесь. Зайдите на вкладку «Сеть», выберите «WAN» Далее нажмите на имя соединения. Следуйте настройкам согласно рисунку и нажмите «Применить» В пункте «Wi-Fi» зайдите в основные настройки. Установите все как на представленном рисунке и нажмите «Применить». После возврата в главное меню в окне предупреждения нажмите кнопку «Сохранить». Далее выберите в разделе «Wi-Fi» пункт «Настройка безопасности». В пункте «Сетевая аутентификация» из выпадающего списка выберите «WPA-PSK/WPA2-PSK mixed». Введите пароль (не менее 8 символов) в пункте «Ключ шифрования PSK». Он в дальнейшем будет использоваться для ограничения доступа к Вашей беспроводной сети. Остальные настройки осуществите, как указано на рисунке. Нажмите «Применить». После возврата в главное меню в окне предупреждения нажмите кнопку «Сохранить» Настройка IPTV Зайдите в пункт «Начало», там выберите раздел «Мастер настройки IPTV» Выберите порт(ы), к которому будет подключена приставка, и нажмите «Сохранить» После возврата в главное меню в окне предупреждения нажмите кнопку «Сохранить» Зайдите в раздел «Дополнительно», выберите вкладку «Разное». Установите все как на представленном рисунке и нажмите «Применить». Если ваше устройство не поддерживает Multicast (SmartTV с OS TIZEN, мобильные устройства), необходимо включить сервер UDP-to-HTTP Proxy. На вкладке «Разное» должны быть следующие настройки После внесения изменений нажмите «Применить». Настройка удаленного доступа Зайдите в раздел «Дополнительно», выберите вкладку «Удаленный доступ к устройству». Нажмите кнопку «Добавить» В появившемся окне установите следующие настройки: После внесения изменений нажмите «Применить». Настроив функцию таким образом, мы можем гарантировать, что подключиться к роутеру для удаленной настройки сможет только сотрудник SkyNetTelecom.'\n ],\n [\n 'title' => 'Настройка роутера Zyxel',\n 'description' => 'Подключение и настройка · кабель сети SkyNet Telecom соедините с портом «ИНТЕРНЕТ» (WAN) на роутере; · стационарные компьютеры внутренней сети соедините с портами «ДОМАШНЯЯ СЕТЬ» (LAN) на роутере. ВНИМАНИЕ! Категорически запрещается соединять кабель сети SkyNet Telecom с портами LAN. После подключения роутера к компьютеру откройте браузер (Firefox, Google Chrome, Opera или Safari) и в адресной строке наберите: 192.168.1.1 Появится страница быстрой настройки, выберите «Веб-конфигуратор» В открывшимся окне найдите поле «MAC-адрес». Это значение необходимо для регистрации роутера в сети SkyNet Telecom. Узнать о способах регистрации устройства можно здесь. Зайдите на вкладку «Интернет» Затем на вкладке «Подключения» зайдите в «Broadbandconnection» Убедитесь, что все настройки соответствуют указанным на картинке. После внесения изменений, нажмите «Применить» Настройка Wi-Fi Зайдите на вкладку «Сеть Wi-Fi» Во вкладке «Точка доступа» установите следующие настройки и нажмите «Применить» НастройкаIPTV Для работы IPTV по кабелю и по Wi-Fi необходимы следующие настройки: Зайдите на вкладку «Домашняя сеть» На вкладке «IGMP Proxy» должны быть следующие настройки После внесения изменений нажмите «Применить» Если ваше устройство не поддерживаетMulticast (SmartTVс OS TIZEN, мобильные устройства), необходимо включить сервер UDP-to-HTTP Proxy. На вкладке «Серверudpxy» должны быть следующие настройки После внесения изменений нажмите «Применить». Обновление и установка компонентов Некоторых компонентов может не хватать для работы, а некоторые компоненты не нужны, поэтому их можно удалить. Для этого зайдите на вкладку «Система» На вкладке «Обновление» нажмите кнопку«Показать компоненты» оставьте галочки только на следующих и нажмите «Обновить». · ПлатформаNDMS; · IPv6 · UDP-HTTPпрокси(udpxy) · Модуль управления маршрутизатором через облачную службу · ИнтерфейсWi-Fi; · СлужбаIGMP/PPPoEproxy; · СерверDHCP; · СлужбаUPnP; · БиблиотекаSSL. Некоторые компоненты могут отсутствовать на разных моделях роутеров. Настройка удаленного доступа Зайдите на вкладку «Безопасность» на вкладке «Межсетевой экран» нажмите кнопку «Добавить правило» в появившемся окне установите следующие настройки: Нажмите «Сохранить» Настроив функцию таким образом, мы можем гарантировать, что подключиться к роутеру для удаленной настройки сможет только сотрудник SkyNetTelecom.'\n ],\n [\n 'title' => 'Настройка роутера TP-Link',\n 'description' => 'Подключение роутера Настройка роутера предоставлена с целью облегчения подключения нескольких компьютеров к локальной и интернет-сети в пределах квартиры. кабель сети SkyNet Telecom соедините с портомWAN (выделен другим цветом) на роутере; стационарные компьютеры иприставки IPTV внутренней сети соедините с портами LAN на роутере. ВНИМАНИЕ! Категорически запрещается соединять кабель сети SkyNet Telecom с портами LAN. Настройка интернета и доступа к Wi-Fi После подключения роутера к компьютеру откройте браузер (Firefox, Google Chrome, Opera или Safari), в адресной строке наберите: 192.168.0.1 Появится страница авторизации. Введите «admin»в два поля и нажмите «Вход». Зайдите на вкладку «Состояние». В разделе «WAN» найдите поле«MAC-адрес». Это значение необходимо для регистрации роутера в сети SkyNet Telecom. Узнать о способах регистрации устройства можно здесь. Зайдите на вкладку «Сеть». В разделе «WAN» в поле «Тип WAN соединения» выберите из списка «ДинамическийIP-адрес». Если изменения внесены, нажмите кнопку «Сохранить». Если потребуется, перезагрузите роутер. Зайдите на вкладку «Беспроводной режим». В разделе «Настройки беспроводного режима» установите настройки,аналогичные представленным на рисунке. После внесения изменения, нажмите кнопку «Сохранить». Если потребуется, перезагрузите роутер. В разделе «Защита беспроводного режима» выберите шифрование данных «WPA-Personal/WPA2-Personal (Рекомендуется)».В поле «Версия» из выпадающего списка выберите «WPA2-Personal» и в поле «Шифрование»из выпадающего списка выберите «AES» В поле «Пароль PSK» введите ключ защиты.Он в дальнейшем будет использоваться как пароль для ограничения доступа к Вашей беспроводной сети. По окончании настроек нажмите на кнопку «Сохранить», чтобы применить внесенные изменения. Если потребуется,перезагрузите роутер. Настройка IPTV Зайдите на вкладку «Сеть», в раздел «IPTV». В поле «Режим» из выпадающего списка выберите «Мост». В поле «Порт для IPTV» выберите тот порт(ы), к которому будет подключена IPTV приставка.'\n ],\n [\n 'title' => 'Настройка роутера Asus',\n 'description' => 'Подключение роутера кабель сети SkyNet Telecom соедините с портом INTERNET (выделен отдельным цветом) на роутере; стационарные компьютеры внутренней сети соедините с портами LAN на роутере. ВНИМАНИЕ! Категорически запрещается соединять кабель сети SkyNet Telecom с портами LAN. Настройка интернета После подключения роутера к компьютеру откройте браузер (Firefox, Google Chrome, Opera или Safari) и в адресной строке наберите: 192.168.1.1 Появится страница авторизации. Введите «admin» в два поля и нажмите «Вход». Зайдите в меню «Интернет» во вкладку «Подключение» Убедитесь, что все настройки соответствуют указанным на картинке. После внесения изменений, нажмите «Применить». При желании Вы можете использовать функцию клонирования MAC-адреса, если до этого Ваш компьютер был подключен к нашей сети напрямую. Это избавит Вас от необходимости звонить в службу поддержки при подключении интернет-кабеля к роутеру. Либо вы можете внести MAC-адрес нового устройства в личном кабинете в разделе интернет –услуги – сменить мак адрес. Настройка Wi-Fi Зайдите в меню «Беспроводная сеть» Введите желаемое название беспроводной сети в поле «SSID». Далее установите режим защиты как показано на картинке, придумайте ключ сети и запишите его в поле «Предварительный ключWPA». Нажмите кнопку «Применить» Настройка IPTV Для работы IPTV по кабелю и по Wi-Fi необходимы следующие настройки: Зайдите в разделе «Локальная сеть» на вкладку «IPTV» За трансляцию IPTV отвечает функция «Включить многоадресную маршрутизацию (IGMP Proxy)» и «Включить IGMP Snooping». Установите параметры в соответствии с изображением. Примечание: на некоторых младших моделях роутеров может отсутствовать параметр «Включить IGMP Snooping». В этом случае достаточно установки только первого параметра.'\n ],\n [\n 'title' => 'Настройка роутера D-Link',\n 'description' => 'Подключение и обновление ПО роутера кабель сети SkyNet Telecom соедините с портом INTERNET (WAN) на роутере; стационарные компьютеры внутренней сети соедините с портами LAN на роутере. ВНИМАНИЕ! Категорически запрещается соединять кабель сети SkyNet с портами LAN. Настройка интернета и доступа к Wi-Fi После подключения роутера к компьютеру откройте браузер (Firefox, Google Chrome, Opera или Safari) и в адресной строке наберите: 192.168.0.1 Появится страница авторизации. Введите пароль «admin», который в дальнейшем будете использовать для настройки роутера,и нажмите «Save» После входа на главную страницу нажмите «Расширенные настройки». В пункте «Сеть» найдите и выберите «WAN». Нажмите на предложенное подключении WAN для его редактирования. Следуйте настройкам согласно рисунку. При желании Вы можете использовать функцию клонирования MAC-адреса, если до этого Ваш компьютер был подключен к нашей сети напрямую. Это избавит Вас от необходимости звонить в службу поддержки при подключении интернет-кабеля к роутеру. Либо вы можете внести MAC-адрес нового устройства в личном кабинете в разделе интернет –услуги – сменить мак адрес. После возврата в главное меню в окне предупреждения нажмите кнопку «Сохранить». В пункте «Wi-Fi» зайдите в основные настройки. Установите все как на представленном рисунке и нажмите «Изменить». После возврата в главное меню в окне предупреждения нажмите кнопку «Сохранить». Далее выберите в разделе «Wi-Fi» пункт«Настройка безопасности». В пункте «Сетевая аутентификация» из выпадающего списка выберите «WPA-PSK/WPA2-PSK mixed». Введите пароль в пункте «Ключ шифрования PSK». Он в дальнейшем будет использоваться для ограничения доступа к Вашей беспроводной сети. Остальные настройки осуществите, как указано на рисунке.Нажмите «Изменить». После возврата в главное меню в окне предупреждения нажмите кнопку «Сохранить» Настройка IPTV Зайдите в пункт «Мастер настройкиIPTV» Выберите порт(ы), к которому будет подключена приставка, и нажмите «Изменить» После возврата в главное меню в окне предупреждения нажмите кнопку «Сохранить»'\n ],\n [\n 'general' => true,\n 'title' => 'Я замеряю скорость по кабелю, и она ниже тарифной, почему так?',\n 'description' => 'Выделим три момента: Удалённость ресурса от Вас Когда сайт за пределами нашей сети, на пример, в Лондоне, то скорость будет изменяться в зависимости от пройденного сигналом расстояния и количества различных узлов связи до ресурса. Не все сегменты этого пути принадлежат провайдеру, а в таком случае гарантировать скорость мы сможем в пределах нашей сети. Сайты для измерения скорости Любой сайт измерения скорости – это чьё-то оборудование с ограниченной полосой пропускания. В тот момент, когда возникает нагрузка от большого количества пользователей, сайт делит свои ресурсы между всеми. Можно измерить скорость трижды подряд и получить совершенно разные результаты. И браузер, и загружаемый для замера скорости файл используют ресурсы вашего устройства: процессор, память, жёсткий диск и браузер. Точность результатов измерения может зависеть от этих характеристик. Так же обратите внимание на местоположение сервера, ведь чтобы получить более реальные показатели, он должен находиться в Санкт-Петербурге. Технические особенности При передаче данных в сети, определённая их часть всегда тратится на технические нужды, такие, как адрес отправителя и получателя, размер пакета, флаги, время жизни пакета и т.д. Это не зависит от провайдера. Это свойство работы Операционной Системы (компьютера,планшета, роутера) с различными сетевыми протоколами. Все эти технические данные всегда добавляются к скачиваемой вами информации, из-за чего отображаемый показатель скорости может быть до 6% ниже заявленной. Если вы видите значительную разницу между тарифной и фактической скоростями, пожалуйста, обратитесь в нашу службу поддержки для диагностики. Мы поможем!'\n ],\n ]\n ],\n [\n 'title' => 'Техническая поддержка: Цифровое ТВ',\n 'questions' => [\n [\n 'general' => true,\n 'title' => 'Я хочу подключить Цифровое ТВ.',\n 'description' => 'Цифровое ТВ доступно на тарифах: Вода, Вода HD, Огонь и Огонь HD. Просматривать Цифровое телевидение можно несколькими способами: На мониторе компьютера: загрузите и установите VLC-плеер, затем загрузите и запустите плейлист со списком каналов. Для просмотра на телевизоре SAMSUNG с функцией SMART TV: загрузите и установите приложение SkyNet.TV в магазине приложений SAMSUNG APPS. Данное приложение совместимо только с телевизорами выпуска 2013 – 2015 годов. Узнать какого года выпуска ваш телевизор можно здесь. Для просмотра на экране любого другого телевизора необходима IPTV-приставка.'\n ],\n [\n 'general' => true,\n 'title' => 'Как настроить роутер для просмотра Цифрового телевидения?',\n 'description' => 'Прежде всего роутер должен поддерживать функцию – Multicast (IGMP). Если Вы используете нашу IPTV приставку при подключении Интернета через роутер, рекомендуем на последнем настроить выделение порта под ТВ. TP-link: В адресной строке браузера необходимо ввести 192.168.0.1 (192.168.1.1); В поле Имя пользователя нужно ввести admin, в поле пароль admin; Заходим в раздел \"Сеть\"; Выбираем подпункт \"Мост\" или \"IPTV\"; В строке - \"Порт LAN, соединенный в режиме \"Мост\" с WAN\" выбираем нужный нам порт под IPTV приставку. D-link: В адресной строке браузера необходимо ввести 192.168.0.1 (192.168.1.1); В поле Имя пользователя нужно ввести admin, в поле пароль admin (либо оставить пустым); На главной странице веб-интерфейса выбираем раздел \"IP Телевидение\" и подраздел \"Мастер настройки IPTV\" или “IPTV”; Далее щелкаем по нужному порту для IPTV. ZyXEL: микропрограмма NDMS V1 В адресной строке браузера необходимо ввести 192.168.1.1; В поле Имя пользователя нужно ввести admin, в поле пароль - 1234; Слева в категориях выбираем \"Домашняя сеть\", далее подгруппа \"IP-телевидение; Выбираем \"Назначить разъем LAN\" в строке \"Режим TVport\"; Ниже в \"Разъем для ресивера IPTV\" выбираем нужным нам LAN порт. микропрограмма NDMS V2 В адресной строке браузера необходимо ввести 192.168.1.1; В поле Имя пользователя нужно ввести admin, в поле пароль - 1234; В панели значков выбираем значок глобуса \"Интернет\"; Далее выбираем активное подключение в списке \"Подключения к интернету и другим сетям\"; В новом окне ставим галочку в строке \"Использовать разъем\" под нужным LAN портом. Upvel: В адресной строке браузера необходимо ввести 192.168.10.1; В поле Имя пользователя нужно ввести admin, в поле пароль - admin; На главной странице веб-интерфейса нажимаем на \"Настройки\"; Далее настройки VLAN; Ставим галочку напротив \"Включить VLAN\"; Напротив нужного для нас LAN порта - \"Ethernet Port #\" ставим галочку и выбираем под; категорией \"Forwarding Rule\" выбираем из списка тип \"Bridge\", под категорией \"Priority\" в случае лагов, можно поднимать приоритет до значения \"7\", NetGear: В адресной строке браузера необходимо ввести 192.168.1.1; В поле Имя пользователя нужно ввести admin, в поле пароль - password; В левой части главной страницы, есть \"Меню быстрого перехода\", там выбираем \"Настройки\", далее пункт \"Параметры интернет-порта\"; В строке \"Перенаправить IPTV-поток для приставки на\" выбираем нужным нам LAN порт. ASUS: В адресной строке браузера необходимо ввести 192.168.1.1; В поле Имя пользователя нужно ввести admin, в поле пароль - admin; На главной странице веб-интерфейса, в левой части в списке выбирайте \"Локальная сеть\"; Сверху в открывшемся окне выбираем категорию \"IPTV\". В строке \"Выбор порта IPTV STB\"; выбираем нужный нам LAN порт из предложенного списка.'\n ],\n [\n 'general' => true,\n 'title' => 'Как настроить IPTV на телевизорах Samsung (Tizen)',\n 'description' => 'Один из способов просмотра IPTV — приложение SkyNet.TV на Samsung Smart TV для моделей, выпущенных после 2013 года. Установить приложение можно следующим образом: На телевизоре SAMSUNG SMART TV нажимаем на кнопку SMART HUB; Переходим в раздел ПРИЛОЖЕНИЯ и выбираем иконку SAMSUNG APPS; В поиске набираем латиницей «SkyNet»; Нажимаем «УСТАНОВИТЬ» бесплатное приложение «SkyNet»; Запускаем его; Наслаждаемся множеством каналов и отличной картинкой. С 2015 года компания Samsung выпускает телевизоры с операционной системой Tizen, которая не поддерживает функцию multicast. Для воспроизведения требуется дополнительное оборудование – роутер с поддержкой функции udpxy. В качестве такого устройства можно выбрать ZyXEL Keenetic Lite III. Настроить его можно следующим образом: В адресную строку браузера необходимо ввести адрес роутера: 192.168.1.1. Для входа в настройки потребуется авторизация (по умолчанию имя пользователя «admin», пароль такой же). В веб-интерфейсе необходимо открыть пункт Домашняя сеть. Выбрать вкладку Сервер udpxy Если при этом на роутере включен multicast (IGMP proxy), появится предупреждение, что одновременно использовать функции невозможно. В этом же окне есть кнопка для отключения IGMP Proxy. Нажав ее, можно будет продолжить настройку. При включении функции udpxy роутер автоматически предложит номер TCP-порта (по умолчанию – 4022), этот номер необходимо запомнить - он потребуется для дальнейшей настройки приложения на телевизоре. Нажимаем кнопку Применить и перезагружаем роутер. Далее потребуется настройка приложения. Выбираем пункт Меню, далее Настройки → Видео и аудио → Udp прокси → Включить. В появившемся окне нужно ввести адрес роутера и номер выбранного порта (192 - 168 - 1 - 1 - 4022)'\n ],\n ]\n ]\n ];\n\n foreach ($data as $key => $value) {\n $type = factory(QuestionType::class)->create([\n 'published' => true,\n 'title' => $value['title'],\n ]);\n foreach ($value['questions'] as $question) {\n factory(Question::class)->create(array_merge($question, [\n 'published' => true,\n 'question_type_id' => $type->id,\n ]));\n }\n }\n }", "function homework_individual()\n {\n \tglobal $db, $PLACEWEB_CONFIG, $problems_array, $equations_array;\n \t\n\t\t$sql = \"SELECT * FROM smartroom_hw\";\n\t\t\t//$result = mysql_query($query, $db) or die('Error count query:'.mysql_error());\n\t\t\t//$homework = mysql_fetch_array($result, MYSQL_ASSOC);\n\t\t\n\t\t$homework = mysql_query($sql, $db) or die('An error happened');\n\n\t\t$hwIndividualCollection = array();\n\t\t\n\t\t//while ($hw = mysql_fetch_array($result, MYSQL_ASSOC))\n\t\twhile(($hw=mysql_fetch_assoc($homework)) != null) \n\t\t{\n\t\t\t//print_r($hw);\n\t\t\t\n\t\t\t// clean up space after comma\n\t\t\t$cleaned_db_principles = trim($hw['principles']);\n\t\t\t$cleaned_db_principles = str_replace(', ', ',', $cleaned_db_principles);\n\t\t\t\n\t\t\t$probPrinciplesNames = explode(\",\", $cleaned_db_principles);\n\t\t\t$probEquationsIs = explode(\",\", $hw['equations']);\n\n\t\t\t$probPrinciplesInTargetFormat = array();\n\t\t\t$probEquationsInTargetFormat = array();\n\n\t\t\tforeach($probPrinciplesNames as $pn)\n\t\t\t{\n\t\t\t\t// some clean up\n\t\t\t\t$pn = stripcslashes($pn);\n\t\t\t\t$pn=trim($pn);\n\t\t\t\n\t\t\t\t// formatting to expected format\n\t\t\t\t$probPrinciplesNames = array(\n\t\t\t\t\t'name'=>$pn\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// add ony if not empty\n\t\t\t\tif($pn){\n\t\t\t\t\t$probPrinciplesInTargetFormat[]=$probPrinciplesNames;\n\t\t\t\t}\n\t\t\t} // end loop principles\n\t\t\t\n\t\t\t// build equations array\n\t\t\tfor ($i=0;$i<count($probEquationsIs);$i++) \n\t\t\t{\n\t\t\t\t// index = EQ_ID - 1\n\t\t\t\t$index = $probEquationsIs[$i]-1;\n\t\t\t\t// get equation expression\n\t\t\t\t$probEquationsNames= array(\n\t\t\t\t\t'name'=>$equations_array[$i]['name']\n\t\t\t\t);\n\t\t\t\t//echo \"<br/>\".$probEquationsIs[$i].'. ---'.addslashes($equations_array[$index]['name']);\n\t\t\t\t$probEquationsInTargetFormat[]=$probEquationsNames;\n\t\t\t}\n\t\t\t\n\t\t\t$hwIndividual = array(\n\t\t\t\t'studentId'=>$hw['username'],\n\t\t\t\t'problemName'=>$hw['problem_name'],\n\t\t\t\t'principles'=>$probPrinciplesInTargetFormat,\n\t\t\t\t'equations'=>$probEquationsInTargetFormat,\n\t\t\t);\n\t\t\t\n\t\t\t$hwIndividualCollection[]=$hwIndividual;\n\t\t}\n\t\t\n\t\techo json_encode($hwIndividualCollection);\n }", "function _recommends_req_steps() {\n return array(\n 1 => array(\n 'form' => 'recommends_req_wizard_student_info',\n ),\n 2 => array(\n 'form' => 'recommends_req_wizard_schools_info',\n ),\n 3 => array(\n 'form' => 'recommends_req_wizard_courses_info',\n ),\n 4 => array(\n 'form' => 'recommends_req_wizard_verification',\n ),\n );\n}", "public function getPlayersProblem(Request $request){\n \n $p1_id = $request->input('player1_id');\n $p2_id = $request->input('player2_id');\n\n $p1_solved_rounds = User::find($p1_id)->battles()\n ->where('is_solved', '!=', '0')\n ->get();\n\n $p2_solved_rounds = User::find($p2_id)->battles()\n ->where('is_solved', '!=', '0')\n ->get();\n\n /* setting query to exclude the solved problems */\n $solved = array();\n foreach ($p1_solved_rounds as $round) {\n $new_array = array('id', '!=', $round->problem_id);\n array_push($solved, $new_array);\n }\n foreach ($p2_solved_rounds as $round) {\n $new_array = array('id', '!=', $round->problem_id);\n array_push($solved, $new_array);\n }\n \n /* getting all the unsolved problem */\n $problems = DB::table('multiplayer_problems')->where($solved)->get();\n \n /* get random problems */\n $problem_code_array = [];\n if(count($problems)) {\n foreach ($problems as $problem) {\n array_push($problem_code_array, $problem->problem_code);\n }\n $selected = array_rand($problem_code_array,1);\n }else{\n $problems = DB::table('multiplayer_problems')->get();\n\n foreach ($problems as $problem) {\n array_push($problem_code_array, $problem->problem_code);\n }\n $selected = array_rand($problem_code_array,1);\n }\n return $problem_code_array[$selected];\n }", "function isChallengeName($challenge_name) {\n foreach (challenges(true) as $key => $challenge) {\n if ($challenge_name == $challenge['name']) {\n return true;\n }\n }\n return false;\n}", "public function getGameChallengeList($format=\"html\")\n\t{\n\t\t$db = new mysql_db();\n\n\t\t$result = $db->query(\"CALL GetGameChallengeList(1, 0,-1);\");\n\t\t\n\t\tif($db->num_rows($result) == 0)\n\t\t{\n\t\t\theader (\"Content-Type:text/html\");\n\t\t\tprint \"No records found.\";\n\t\t}\n\t\telseif($format == \"xml\")\n\t\t{\n\t\t\theader (\"Content-Type:text/xml\");\n\t\t\t$xml = $db->MYSQL2XML($result, \"ThinkFunProject\", \"game_challenge\");\n\t\t\tprint $xml;\n\t\t}\n\t\telseif($format == \"html\")\n\t\t{\n\t\t\theader (\"Content-Type:text/html\");\n\t\t\tprint \"<HTML>\\n\";\n\t\t\tprint \"<BODY>\\n\";\n\t\t\t\t$html = $db->MYSQL2HTML($result, \"ThinkFunProject\", \"game_challenge\");\n\t\t\t\tprint $html;\n\t\t\tprint \"</BODY>\\n\";\n\t\t\tprint \"</HTML>\\n\";\n\t\t}\n\t}", "public function run()\n {\n //\n DB::table('options')->delete();\nOption::create(['id'=>1, 'question_id' => 1, 'desc' => 'Influencia de la Sociedad sobre los grupos marginados .', 'area' =>2]);\nOption::create(['id'=>2, 'question_id' => 1, 'desc' => 'Influencia de la música rock en la vida moderna.', 'area' =>5]);\nOption::create(['id'=>3, 'question_id' => 1, 'desc' => 'Como dirigir y organizar el personal de una empresa.', 'area' =>8]);\nOption::create(['id'=>4, 'question_id' => 1, 'desc' => 'Sistemas de tratamiento médico para adictos a las drogas.', 'area' =>11]);\n\nOption::create(['id'=>5, 'question_id' => 2, 'desc' => 'Estado Actual de la ciencia colombiana.', 'area' =>1]);\nOption::create(['id'=>6, 'question_id' => 2, 'desc' => 'Los orígenes de la música moderna.', 'area' =>5]);\nOption::create(['id'=>7, 'question_id' => 2, 'desc' => 'Los orígenes y causas de la Segunda Guerra Mundial.', 'area' =>6]);\n\nOption::create(['id'=>8, 'question_id' => 2, 'desc' => 'Literatura Colombiana en la actualidad.', 'area' =>7]);\nOption::create(['id'=>9, 'question_id' => 3, 'desc' => 'La electro-mecánica.', 'area' =>3]);\nOption::create(['id'=>10, 'question_id' => 3, 'desc' => 'La música.', 'area' =>5]);\nOption::create(['id'=>11, 'question_id' => 3, 'desc' => 'Los computadores.', 'area' =>9]);\nOption::create(['id'=>12, 'question_id' => 3, 'desc' => 'Temas políticos, religiosos o filosóficos .', 'area' =>12]);\n\nOption::create(['id'=>13, 'question_id' => 4, 'desc' => 'Investigar sobre conductores o campos magnéticos.', 'area' =>1]);\nOption::create(['id'=>14, 'question_id' => 4, 'desc' => 'Realizar un estudio sociológico de las necesidades de energía eléctrica.', 'area' =>2]);\nOption::create(['id'=>15, 'question_id' => 4, 'desc' => 'Dirigir la construcción de las redes de distribución de electricidad.', 'area' =>3]);\nOption::create(['id'=>16, 'question_id' => 4, 'desc' => 'Dibujar esas mismas redes, diseñándolas sobre el papel.', 'area' =>4]);\n\nOption::create(['id'=>17, 'question_id' => 5, 'desc' => 'Sobre progresos tecnológicos de la humanidad.', 'area' =>2]);\nOption::create(['id'=>18, 'question_id' => 5, 'desc' => 'Sobre historia de mi país o del mundo.', 'area' =>3]);\nOption::create(['id'=>19, 'question_id' => 5, 'desc' => 'Sobre educación de niños o jóvenes.', 'area' =>10]);\nOption::create(['id'=>20, 'question_id' => 5, 'desc' => 'Sobre el cuerpo humano y como prevenir las enfermedades.', 'area' =>11]);\n\nOption::create(['id'=>21, 'question_id' => 6, 'desc' => 'Todo para dibujantes.', 'area' =>4]);\nOption::create(['id'=>22, 'question_id' => 6, 'desc' => 'Libros.', 'area' =>7]);\nOption::create(['id'=>23, 'question_id' => 6, 'desc' => 'Programas para computadores.', 'area' =>9]);\nOption::create(['id'=>24, 'question_id' => 6, 'desc' => 'Medicamentos.', 'area' =>11]);\n\nOption::create(['id'=>25, 'question_id' => 7, 'desc' => 'Investigar en un laboratorio sobre las causas de una enfermedad.', 'area' =>1]);\nOption::create(['id'=>26, 'question_id' => 7, 'desc' => 'Dirigir la administración.', 'area' =>8]);\nOption::create(['id'=>27, 'question_id' => 7, 'desc' => 'Mejorar los programas informáticos para alguna investigación.', 'area' =>9]);\nOption::create(['id'=>28, 'question_id' => 7, 'desc' => 'Dar consejos a los pacientes para que prevengan las enfermedades.', 'area' =>10]);\n\nOption::create(['id'=>29, 'question_id' => 8, 'desc' => 'De la psicología de las personas.', 'area' =>2]);\nOption::create(['id'=>30, 'question_id' => 8, 'desc' => 'De la historia de las diversas civilizaciones.', 'area' =>6]);\nOption::create(['id'=>31, 'question_id' => 8, 'desc' => 'De aplicaciones de computadores.', 'area' =>9]);\nOption::create(['id'=>32, 'question_id' => 8, 'desc' => 'De estrategia y tácticas de guerra.', 'area' =>13]);\n\nOption::create(['id'=>33, 'question_id' => 9, 'desc' => 'Un gran pintor.', 'area' =>4]);\nOption::create(['id'=>34, 'question_id' => 9, 'desc' => 'Un gran músico.', 'area' =>5]);\nOption::create(['id'=>35, 'question_id' => 9, 'desc' => 'Un gran pedagogo .', 'area' =>10]);\nOption::create(['id'=>36, 'question_id' => 9, 'desc' => 'Un conductor experto.', 'area' =>13]);\n\nOption::create(['id'=>37, 'question_id' => 10, 'desc' => 'Experto en biología genética.', 'area' =>1]);\nOption::create(['id'=>38, 'question_id' => 10, 'desc' => 'Experto en sanidad ambiental.', 'area' =>11]);\nOption::create(['id'=>39, 'question_id' => 10, 'desc' => 'Experto en leyes sociales o laborales.', 'area' =>12]);\nOption::create(['id'=>40, 'question_id' => 10, 'desc' => 'Experto desactivando explosivos o manipulando sustancias peligrosas.', 'area' =>13]);\n\nOption::create(['id'=>41, 'question_id' => 11, 'desc' => 'Investigar sobre el comportamiento del hombre en grupo.', 'area' =>2]);\nOption::create(['id'=>42, 'question_id' => 11, 'desc' => 'Ser catedrático de literatura o lengua.', 'area' =>7]);\nOption::create(['id'=>43, 'question_id' => 11, 'desc' => 'Formar profesionales de la enseñanza como docente de pedagogía.', 'area' =>10]);\nOption::create(['id'=>44, 'question_id' => 11, 'desc' => 'Ser catedrático de derecho.', 'area' =>12]);\n\nOption::create(['id'=>45, 'question_id' => 12, 'desc' => 'Hacer los dibujos y diseños artísticos.', 'area' =>4]);\nOption::create(['id'=>46, 'question_id' => 12, 'desc' => 'Confeccionar los mapas geográficos o redactar los temas históricos.', 'area' =>6]);\nOption::create(['id'=>47, 'question_id' => 12, 'desc' => 'Dirigir la distribución, venta o comercialización de los libros.', 'area' =>8]);\nOption::create(['id'=>48, 'question_id' => 12, 'desc' => 'Llevar relaciones públicas con los grandes clientes.', 'area' =>12]);\n\nOption::create(['id'=>49, 'question_id' => 13, 'desc' => 'Ser el ingeniero mecánico de pruebas y mantenimiento.', 'area' =>3]);\nOption::create(['id'=>50, 'question_id' => 13, 'desc' => 'Escribir un reportaje para una revista especializada.', 'area' =>7]);\nOption::create(['id'=>51, 'question_id' => 13, 'desc' => 'Controlar los gastos e ingresos económicos relacionados con la carrera.', 'area' =>8]);\nOption::create(['id'=>52, 'question_id' => 13, 'desc' => 'Ser piloto de uno de los carros.', 'area' =>13]);\n\nOption::create(['id'=>53, 'question_id' => 14, 'desc' => 'Asistir a conciertos o exhibiciones musicales.', 'area' =>5]);\nOption::create(['id'=>54, 'question_id' => 14, 'desc' => 'Enterarme de la historia o geografía de ese país.', 'area' =>6]);\nOption::create(['id'=>55, 'question_id' => 14, 'desc' => 'Esforzarme por aprender su idioma.', 'area' =>7]);\nOption::create(['id'=>56, 'question_id' => 14, 'desc' => 'Estudiar sus modalidades organización económico-empresarial.', 'area' =>8]);\n\nOption::create(['id'=>57, 'question_id' => 15, 'desc' => 'Estudiar sobre una nueva forma de energía investigando en un laboratorio.', 'area' =>1]);\nOption::create(['id'=>58, 'question_id' => 15, 'desc' => 'Estudiar la forma de mejorar un aparato electrónico.', 'area' =>3]);\nOption::create(['id'=>59, 'question_id' => 15, 'desc' => 'Estudiar nuevas formas de venta en una empresa.', 'area' =>8]);\nOption::create(['id'=>60, 'question_id' => 15, 'desc' => 'Estudiar formas de lograr programas más rápidos y seguros para computadores.', 'area' =>9]);\n\nOption::create(['id'=>61, 'question_id' => 16, 'desc' => 'Conclusiones sobre estudios de física o química.', 'area' =>1]);\nOption::create(['id'=>62, 'question_id' => 16, 'desc' => 'Un estudio sobre el contraste de luces y sombras en la pintura.', 'area' =>4]);\nOption::create(['id'=>63, 'question_id' => 16, 'desc' => 'Un estudio sobre costumbres de tribus antiguas.', 'area' =>6]);\nOption::create(['id'=>64, 'question_id' => 16, 'desc' => 'Un estudio sobre educación o aprendizaje infantil.', 'area' =>10]);\n\nOption::create(['id'=>65, 'question_id' => 17, 'desc' => 'Afinar instrumentos musicales.', 'area' =>5]);\nOption::create(['id'=>66, 'question_id' => 17, 'desc' => 'Resolver los problemas que me plantea el hacer un difícil programa para un computador.', 'area' =>9]);\nOption::create(['id'=>67, 'question_id' => 17, 'desc' => 'Ser maestro de Educación General Básica.', 'area' =>10]);\nOption::create(['id'=>68, 'question_id' => 17, 'desc' => 'Ayudar a aliviar el dolor físico de la gente.', 'area' =>11]);\n\nOption::create(['id'=>69, 'question_id' => 18, 'desc' => 'Encargado de un reportaje semanal sobre encuestas de opinión social.', 'area' =>2]);\nOption::create(['id'=>70, 'question_id' => 18, 'desc' => 'Encargado de un reportaje semanal sobre cuestiones económicas.', 'area' =>8]);\nOption::create(['id'=>71, 'question_id' => 18, 'desc' => 'Encargado de un reportaje semanal sobre aspectos relacionados con la enseñanza escolar.', 'area' =>10]);\nOption::create(['id'=>72, 'question_id' => 18, 'desc' => 'Encargado de un reportaje semanal en un país en guerra.', 'area' =>13]);\n\nOption::create(['id'=>73, 'question_id' => 19, 'desc' => 'Fabricar aparatos para que personas discapacitadas se valgan por sí mismos.', 'area' =>3]);\nOption::create(['id'=>74, 'question_id' => 19, 'desc' => 'Ser escritor en un periódico.', 'area' =>7]);\nOption::create(['id'=>75, 'question_id' => 19, 'desc' => 'Dar clases para elevar el nivel cultural de la gente, niños o adultos.', 'area' =>10]);\nOption::create(['id'=>76, 'question_id' => 19, 'desc' => 'Ser el portavoz de un grupo para defender sus propuestas ante la alcaldía.', 'area' =>12]);\n\nOption::create(['id'=>77, 'question_id' => 20, 'desc' => 'Comprobar una teoría sociológica encuestando a la gente.', 'area' =>2]);\nOption::create(['id'=>78, 'question_id' => 20, 'desc' => 'Reparar una TV de alta definición.', 'area' =>3]);\nOption::create(['id'=>79, 'question_id' => 20, 'desc' => 'Ilustrar con dibujos una publicación.', 'area' =>4]);\nOption::create(['id'=>80, 'question_id' => 20, 'desc' => 'Componer música.', 'area' =>5]);\n\nOption::create(['id'=>81, 'question_id' => 21, 'desc' => 'Desarrollar los dibujos publicitarios.', 'area' =>4]);\nOption::create(['id'=>82, 'question_id' => 21, 'desc' => 'Seleccionar el nuevo personal que accede a los trabajos administrativos.', 'area' =>8]);\nOption::create(['id'=>83, 'question_id' => 21, 'desc' => 'Ser el asesor de una serie de divulgación sobre el cuerpo humano.', 'area' =>11]);\nOption::create(['id'=>84, 'question_id' => 21, 'desc' => 'Presentar un noticiero.', 'area' =>12]);\n\nOption::create(['id'=>85, 'question_id' => 22, 'desc' => 'Organizar la decoración de los espacios libres.', 'area' =>4]);\nOption::create(['id'=>86, 'question_id' => 22, 'desc' => 'Organizar la sección de librería.', 'area' =>7]);\nOption::create(['id'=>87, 'question_id' => 22, 'desc' => 'Programar sistemas de venta y controlarlos por computador.', 'area' =>9]);\nOption::create(['id'=>88, 'question_id' => 22, 'desc' => 'Vigilar los posibles robos y detener a los culpables.', 'area' =>13]);\n\nOption::create(['id'=>89, 'question_id' => 23, 'desc' => 'Ser un experto en energía solar o nuclear.', 'area' =>1]);\nOption::create(['id'=>90, 'question_id' => 23, 'desc' => 'Ser un experto en música folclórica o moderna.', 'area' =>5]);\nOption::create(['id'=>91, 'question_id' => 23, 'desc' => 'Ser concejal o congresista.', 'area' =>12]);\nOption::create(['id'=>92, 'question_id' => 23, 'desc' => 'Ser miembro de un equipo de rescate en una montaña alta.', 'area' =>13]);\n\nOption::create(['id'=>93, 'question_id' => 24, 'desc' => 'La importancia de las matemáticas en la investigación científica.', 'area' =>1]);\nOption::create(['id'=>94, 'question_id' => 24, 'desc' => 'La importancia de tener una concepción filosófica o teológica del mundo y de la vida.', 'area' =>2]);\nOption::create(['id'=>95, 'question_id' => 24, 'desc' => 'La importancia de expresarse con precisión y elegancia en el uso de la lengua oral o escrita.', 'area' =>7]);\nOption::create(['id'=>96, 'question_id' => 24, 'desc' => 'La importancia del uso adecuado de medicamentos para conservar la salud.', 'area' =>11]);\n\nOption::create(['id'=>97, 'question_id' => 25, 'desc' => 'Conocer a fondo las diversas formas de racismo .', 'area' =>2]);\nOption::create(['id'=>98, 'question_id' => 25, 'desc' => 'Conocer a fondo culturas o civilizaciones antiguas.', 'area' =>6]);\nOption::create(['id'=>99, 'question_id' => 25, 'desc' => 'Resolver problemas lógicos para terminar un programa de computador.', 'area' =>9]);\nOption::create(['id'=>100, 'question_id' => 25, 'desc' => 'Atender a los clientes importantes en una empresa para solucionar sus dudas.', 'area' =>12]);\n\nOption::create(['id'=>101, 'question_id' => 26, 'desc' => 'Especializarme en construcción de puentes.', 'area' =>3]);\nOption::create(['id'=>102, 'question_id' => 26, 'desc' => 'Especializarme en estudio de mapas y geografía.', 'area' =>6]);\nOption::create(['id'=>103, 'question_id' => 26, 'desc' => 'Especializarme en asistencia de la salud.', 'area' =>11]);\nOption::create(['id'=>104, 'question_id' => 26, 'desc' => 'Realizar prácticas de vuelo y paracaidismo.', 'area' =>13]);\n\nOption::create(['id'=>105, 'question_id' => 27, 'desc' => 'Demostrar matemáticamente la existencia de un nuevo elemento en la composición del átomo.', 'area' =>1]);\nOption::create(['id'=>106, 'question_id' => 27, 'desc' => 'Profundizar en el conocimiento de la filosofía moderna o actual.', 'area' =>2]);\nOption::create(['id'=>107, 'question_id' => 27, 'desc' => 'Demostrar a una empresa la necesidad de mecanizar sus sistemas de información y procesos de datos.', 'area' =>9]);\nOption::create(['id'=>108, 'question_id' => 27, 'desc' => 'Competir en pruebas que requieren prolongado esfuerzo físico.', 'area' =>13]);\n\nOption::create(['id'=>109, 'question_id' => 28, 'desc' => 'Libros de historia o geografía.', 'area' =>6]);\nOption::create(['id'=>110, 'question_id' => 28, 'desc' => 'Obras de teatro o novelas.', 'area' =>7]);\nOption::create(['id'=>111, 'question_id' => 28, 'desc' => 'Temas de organización empresarial o de economía.', 'area' =>8]);\nOption::create(['id'=>112, 'question_id' => 28, 'desc' => 'Programas informáticos.', 'area' =>9]);\n\nOption::create(['id'=>113, 'question_id' => 29, 'desc' => 'Ser el especialista en estudios de tendencias culturales, de costumbres y moda.', 'area' =>2]);\nOption::create(['id'=>114, 'question_id' => 29, 'desc' => 'Organizar la sección instrumentos musicales.', 'area' =>5]);\nOption::create(['id'=>115, 'question_id' => 29, 'desc' => 'Administrar la economía de la empresa.', 'area' =>8]);\nOption::create(['id'=>116, 'question_id' => 29, 'desc' => 'Organizar la sección de libros de textos escolares.', 'area' =>10]);\n\nOption::create(['id'=>117, 'question_id' => 30, 'desc' => 'Compositor musical conocido.', 'area' =>5]);\nOption::create(['id'=>118, 'question_id' => 30, 'desc' => 'Novelista conocido.', 'area' =>7]);\nOption::create(['id'=>119, 'question_id' => 30, 'desc' => 'Medico conocido.', 'area' =>11]);\nOption::create(['id'=>120, 'question_id' => 30, 'desc' => 'Militar conocido.', 'area' =>13]);\n\nOption::create(['id'=>121, 'question_id' => 31, 'desc' => 'Trabajar en un laboratorio para conseguir mejores productos.', 'area' =>1]);\nOption::create(['id'=>122, 'question_id' => 31, 'desc' => 'Montar un nuevo sistema de riego y encargarme de su mantenimiento.', 'area' =>3]);\nOption::create(['id'=>123, 'question_id' => 31, 'desc' => 'Vender los productos y administración de la finca.', 'area' =>8]);\nOption::create(['id'=>124, 'question_id' => 31, 'desc' => 'Cuidar de la salud de los animales y evitar epidemias.', 'area' =>11]);\n\nOption::create(['id'=>125, 'question_id' => 32, 'desc' => 'Un ensayo teórico sobre los orígenes de la religión, o el concepto de nación.', 'area' =>2]);\nOption::create(['id'=>126, 'question_id' => 32, 'desc' => 'Un nuevo sistema electrónico de control de calidad.', 'area' =>3]);\nOption::create(['id'=>127, 'question_id' => 32, 'desc' => 'Una novela o libro de poesía.', 'area' =>7]);\nOption::create(['id'=>128, 'question_id' => 32, 'desc' => 'Guía de consejos para un entrevistador o presentador de televisión.', 'area' =>12]);\n\nOption::create(['id'=>129, 'question_id' => 33, 'desc' => 'Diseñar los programas de impresión automática de los pasajes de avión.', 'area' =>9]);\nOption::create(['id'=>130, 'question_id' => 33, 'desc' => 'Organizar cursos de capacitación y actualización de los conocimientos de los empleados.', 'area' =>10]);\nOption::create(['id'=>131, 'question_id' => 33, 'desc' => 'Servicios médicos del aeropuerto.', 'area' =>11]);\nOption::create(['id'=>132, 'question_id' => 33, 'desc' => 'Buen trato a pasajeros y clientes.', 'area' =>12]);\n\nOption::create(['id'=>133, 'question_id' => 34, 'desc' => 'Aparatos electrónicos aplicados a la empresa o industria.', 'area' =>3]);\nOption::create(['id'=>134, 'question_id' => 34, 'desc' => 'Pintura.', 'area' =>4]);\nOption::create(['id'=>135, 'question_id' => 34, 'desc' => 'Música moderna.', 'area' =>5]);\nOption::create(['id'=>136, 'question_id' => 34, 'desc' => 'Computadores aplicados a la educación o empresas.', 'area' =>9]);\n\nOption::create(['id'=>137, 'question_id' => 35, 'desc' => 'Trabajar en temas de urbanismo o edificación.', 'area' =>3]);\nOption::create(['id'=>138, 'question_id' => 35, 'desc' => 'Dirigir estudios sobre recursos naturales o artísticos de la región.', 'area' =>6]);\nOption::create(['id'=>139, 'question_id' => 35, 'desc' => 'Trabajar en planificación educativo.', 'area' =>10]);\nOption::create(['id'=>140, 'question_id' => 35, 'desc' => 'Dirigir los equipos de rescate de los bomberos o policías.', 'area' =>13]);\n\nOption::create(['id'=>141, 'question_id' => 36, 'desc' => 'Quienes se interesan por problemas planteados en las ciencias exactas.', 'area' =>1]);\nOption::create(['id'=>142, 'question_id' => 36, 'desc' => 'Se dedican al teatro o dibujo artístico.', 'area' =>4]);\nOption::create(['id'=>143, 'question_id' => 36, 'desc' => 'Aficionados a la literatura.', 'area' =>7]);\nOption::create(['id'=>144, 'question_id' => 36, 'desc' => 'Quienes tratan de aumentar el nivel cultural de otras personas a través de la enseñanza.', 'area' =>10]);\n\nOption::create(['id'=>145, 'question_id' => 37, 'desc' => 'Un libro sobre el ser humano .', 'area' =>2]);\nOption::create(['id'=>146, 'question_id' => 37, 'desc' => 'Un libro de técnicas para pintura o escultura.', 'area' =>4]);\nOption::create(['id'=>147, 'question_id' => 37, 'desc' => 'Un atlas de geografía mundial o de mi país.', 'area' =>6]);\nOption::create(['id'=>148, 'question_id' => 37, 'desc' => 'Un libro de medicina sobre el cuerpo humano.', 'area' =>11]);\n\nOption::create(['id'=>149, 'question_id' => 38, 'desc' => 'Investigar sobre la vida animal o vegetal en el océano.', 'area' =>1]);\nOption::create(['id'=>150, 'question_id' => 38, 'desc' => 'Ser miembro de una orquesta importante.', 'area' =>5]);\nOption::create(['id'=>151, 'question_id' => 38, 'desc' => 'Investigar sobre algunos hechos históricos importantes.', 'area' =>6]);\nOption::create(['id'=>152, 'question_id' => 38, 'desc' => 'Defender en juicio los derechos de otras personas.', 'area' =>12]);\n\nOption::create(['id'=>153, 'question_id' => 39, 'desc' => 'Tomar fotos o hacer dibujos sobre lo que vamos observando.', 'area' =>4]);\nOption::create(['id'=>154, 'question_id' => 39, 'desc' => 'Administrar los fondos o economía del grupo.', 'area' =>8]);\nOption::create(['id'=>155, 'question_id' => 39, 'desc' => 'Ser el portavoz del grupo ante los periodistas o corresponsales de radio.', 'area' =>12]);\nOption::create(['id'=>156, 'question_id' => 39, 'desc' => 'Intervenir Activamente en las acciones de mayor riesgo.', 'area' =>13]);\n\nOption::create(['id'=>157, 'question_id' => 40, 'desc' => 'Dirigir el montaje de las piezas eléctricas o partes delicadas del motor.', 'area' =>3]);\nOption::create(['id'=>158, 'question_id' => 40, 'desc' => 'Diseñar los dibujos de nuevos modelos.', 'area' =>4]);\nOption::create(['id'=>159, 'question_id' => 40, 'desc' => 'Hacer los estudios de posibilidades económicas de nuevos modelos.', 'area' =>8]);\nOption::create(['id'=>160, 'question_id' => 40, 'desc' => 'Atender a los accidentados en una empresa.', 'area' =>11]);\n\nOption::create(['id'=>161, 'question_id' => 41, 'desc' => 'Presentar un programa sobre la ciencia en la actualidad.', 'area' =>1]);\nOption::create(['id'=>162, 'question_id' => 41, 'desc' => 'Investigar la influencia de la propaganda en las costumbres de la gente o sobre sus hábitos de consumo.', 'area' =>2]);\nOption::create(['id'=>163, 'question_id' => 41, 'desc' => 'Presentar un programa sobre edificación y cuidado del entorno urbanístico.', 'area' =>3]);\nOption::create(['id'=>164, 'question_id' => 41, 'desc' => 'Ser el protagonista de una escena muy arriesgada en una película.', 'area' =>13]);\n\nOption::create(['id'=>165, 'question_id' => 42, 'desc' => 'Dirigir cursos de especialización o enseñanza para los empleados.', 'area' =>10]);\nOption::create(['id'=>166, 'question_id' => 42, 'desc' => 'Realizar las revisiones médicas para comprobar la salud de los nuevos asegurados.', 'area' =>11]);\nOption::create(['id'=>167, 'question_id' => 42, 'desc' => 'Hacer visitas comerciales para captar nuevos clientes.', 'area' =>12]);\nOption::create(['id'=>168, 'question_id' => 42, 'desc' => 'Ir a los lugares donde ha habido accidentes para dar un informe del accidente .', 'area' =>13]);\n\nOption::create(['id'=>169, 'question_id' => 43, 'desc' => 'Nuevas formas de energía.', 'area' =>1]);\nOption::create(['id'=>170, 'question_id' => 43, 'desc' => 'Objetos antiguos .', 'area' =>6]);\nOption::create(['id'=>171, 'question_id' => 43, 'desc' => 'Algún idioma moderno.', 'area' =>7]);\nOption::create(['id'=>172, 'question_id' => 43, 'desc' => 'Primeros auxilios en casos de un accidente.', 'area' =>11]);\n\nOption::create(['id'=>173, 'question_id' => 44, 'desc' => 'Buscar hechos y datos que confirmen una teoría sobre la influencia del ambiente social en el nivel cultural de la gente.', 'area' =>2]);\nOption::create(['id'=>174, 'question_id' => 44, 'desc' => 'Buscar nuevos datos que den a conocer mejor un famoso hecho histórico.', 'area' =>6]);\nOption::create(['id'=>175, 'question_id' => 44, 'desc' => 'Buscar datos estadísticos que ayuden a decidir la política económica de una empresa.', 'area' =>8]);\nOption::create(['id'=>176, 'question_id' => 44, 'desc' => 'Trabajar con niños que tengan dificultades de aprendizaje en la lectura.', 'area' =>10]);\n\nOption::create(['id'=>177, 'question_id' => 45, 'desc' => 'Dirigir y organizar su construcción.', 'area' =>3]);\nOption::create(['id'=>178, 'question_id' => 45, 'desc' => 'Ser el experto en geografía regional, para asesorar a los ingenieros.', 'area' =>6]);\nOption::create(['id'=>179, 'question_id' => 45, 'desc' => 'Informatizar la gestión económica o los cálculos estadísticos.', 'area' =>9]);\nOption::create(['id'=>180, 'question_id' => 45, 'desc' => 'Convencer a los afectados por embargos, para llegar a un entendimiento sobre compensaciones económicas.', 'area' =>12]);\n\nOption::create(['id'=>181, 'question_id' => 46, 'desc' => 'Dar clases de dibujo o pintura.', 'area' =>4]);\nOption::create(['id'=>182, 'question_id' => 46, 'desc' => 'Dar clases de música.', 'area' =>5]);\nOption::create(['id'=>183, 'question_id' => 46, 'desc' => 'Dar clases de geografía o historia.', 'area' =>6]);\nOption::create(['id'=>184, 'question_id' => 46, 'desc' => 'Dar clases de actividades atléticas como karate o lucha libre.', 'area' =>13]);\n\nOption::create(['id'=>185, 'question_id' => 47, 'desc' => 'Los seres humanos en los grupos.', 'area' =>2]);\nOption::create(['id'=>186, 'question_id' => 47, 'desc' => 'Historia de la pintura.', 'area' =>4]);\nOption::create(['id'=>187, 'question_id' => 47, 'desc' => 'Estudios literarios.', 'area' =>7]);\nOption::create(['id'=>188, 'question_id' => 47, 'desc' => 'Estudios leyes .', 'area' =>12]);\n\nOption::create(['id'=>189, 'question_id' => 48, 'desc' => 'La teoría evolucionista sobre el origen del hombre.', 'area' =>2]);\nOption::create(['id'=>190, 'question_id' => 48, 'desc' => 'Nuevas formas de expresión musical.', 'area' =>5]);\nOption::create(['id'=>191, 'question_id' => 48, 'desc' => 'Un nuevo lenguaje informático.', 'area' =>9]);\nOption::create(['id'=>192, 'question_id' => 48, 'desc' => 'Las teorías sobre el origen del cáncer.', 'area' =>11]);\n\nOption::create(['id'=>193, 'question_id' => 49, 'desc' => 'Construir alguna cosa o arreglarla.', 'area' =>3]);\nOption::create(['id'=>194, 'question_id' => 49, 'desc' => 'Tocar algún instrumento o escuchar música.', 'area' =>5]);\nOption::create(['id'=>195, 'question_id' => 49, 'desc' => 'Leer novelas.', 'area' =>7]);\nOption::create(['id'=>196, 'question_id' => 49, 'desc' => 'Enseñar a un compañero un tema de clase que no entendió.', 'area' =>10]);\n\nOption::create(['id'=>197, 'question_id' => 50, 'desc' => 'Mezclar productos en un laboratorio para encontrar otro nuevo.', 'area' =>1]);\nOption::create(['id'=>198, 'question_id' => 50, 'desc' => 'Dibujar comics o caricaturas.', 'area' =>4]);\nOption::create(['id'=>199, 'question_id' => 50, 'desc' => 'Probar o mejorar un programa de computador.', 'area' =>9]);\nOption::create(['id'=>200, 'question_id' => 50, 'desc' => 'Orientar a otros para que acierten en su elección profesional.', 'area' =>10]);\nOption::create(['id'=>201, 'question_id' => 51, 'desc' => 'A estudios de otras lenguas.', 'area' =>7]);\nOption::create(['id'=>202, 'question_id' => 51, 'desc' => 'A organizar y dirigir empresas propias.', 'area' =>8]);\nOption::create(['id'=>203, 'question_id' => 51, 'desc' => 'A los computadores.', 'area' =>9]);\nOption::create(['id'=>204, 'question_id' => 51, 'desc' => 'A los submarinos', 'area' =>13]);\nOption::create(['id'=>205, 'question_id' => 52, 'desc' => 'Investigar sobre la formación de la tierra.', 'area' =>1]);\nOption::create(['id'=>206, 'question_id' => 52, 'desc' => 'Formar parte de un grupo musical.', 'area' =>5]);\nOption::create(['id'=>207, 'question_id' => 52, 'desc' => 'Dirigir la contabilidad de una empresa.', 'area' =>8]);\nOption::create(['id'=>208, 'question_id' => 52, 'desc' => 'Ser presentador de programas de televisión.', 'area' =>12]);\n\n\n }", "public static function getDecisionDropdown() {\n\n $decisions = Decision::orderBy('decision', 'ASC')->get();\n\n $decisions_for_dropdown = [];\n foreach($decisions as $decision) {\n $decisions_for_dropdown[$decision->id] = $decision->decision;\n }\n\n return $decisions_for_dropdown;\n }", "public function add_completion_rules() {\r\n $mform = $this->_form;\r\n $items = array();\r\n\r\n $group = array();\r\n $group[] = $mform->createElement('advcheckbox', 'completionpass', null, get_string('completionpass', 'quiz'),\r\n array('group' => 'cpass'));\r\n $mform->disabledIf('completionpass', 'completionusegrade', 'notchecked');\r\n $group[] = $mform->createElement('advcheckbox', 'completionattemptsexhausted', null,\r\n get_string('completionattemptsexhausted', 'quiz'),\r\n array('group' => 'cattempts'));\r\n $mform->disabledIf('completionattemptsexhausted', 'completionpass', 'notchecked');\r\n $mform->addGroup($group, 'completionpassgroup', get_string('completionpass', 'quiz'), ' &nbsp; ', false);\r\n $mform->addHelpButton('completionpassgroup', 'completionpass', 'quiz');\r\n $items[] = 'completionpassgroup';\r\n return $items;\r\n }", "function scorm_get_attempts_array(){\n $attempts = array(0 => get_string('nolimit','scorm'),\n 1 => get_string('attempt1','scorm'));\n\n for ($i=2; $i<=6; $i++) {\n $attempts[$i] = get_string('attemptsx','scorm', $i);\n }\n\n return $attempts;\n}", "function getPendingChallengesUsers($mysqli, $currentUser)\n{\n\tif($stmt = $mysqli->prepare(\"SELECT * FROM PENDING_CHALLENGE WHERE User_ID_2 = ?; \"))\n\t{\n\t\t$stmt->bind_param('i', $currentUser);\n $stmt->execute();\n $stmt->store_result();\n\t\t$data = array();\n\n\t\t$stmt->bind_result($id, $userid1, $userid2);\n\n\t\twhile ($stmt->fetch())\n {\n\t\t\tarray_push($data,array(\"userID1\"=>$userid1));\n }\n }\n else\n {\n return false;\n }\n\treturn $data;\n}", "public function scenarios()\n {\n $scenarios = parent::scenarios();\n// return [\n// 'select' => ['title', 'difficulty', 'updateType', 'modelScenario', 'correctAnswers', 'answerOptionsArray'],\n// ];\n $scenarios['select'] = ['title', 'difficulty', 'updateType', 'modelScenario', 'correctAnswers', 'answerOptionsArray','answer_id'];\n $scenarios['string'] = ['title', 'difficulty', 'updateType', 'modelScenario','answer_text'];\n $scenarios['numeric'] = ['title', 'difficulty', 'updateType', 'modelScenario','answer_number'];\n return $scenarios;\n }", "function laboratorist_options($lab_scientist) {\r\n\t\tglobal $db;\r\n\t\t$query = 'SELECT * from laboratorist WHERE store_id=\"'.$_SESSION['store_id'].'\" ORDER by laboratorist_name ASC';\r\n\t\t$result = $db->query($query) or die($db->error);\r\n\t\t$options = '';\r\n\t\tif($lab_scientist != '') { \r\n\t\t\twhile($row = $result->fetch_array()) { \r\n\t\t\t\tif($sample_id == $row['sample_id']) {\r\n\t\t\t\t$options .= '<option selected=\"selected\" value=\"'.$row['laboratorist_id'].'\">'.$row['laboratorist_name'].' ('.$row['laboratorist_manual_id'].')</option>';\r\n\t\t\t\t} else { \r\n\t\t\t\t$options .= '<option value=\"'.$row['laboratorist_id'].'\">'.$row['laboratorist_name'].' ('.$row['laboratorist_manual_id'].')</option>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { \r\n\t\t\twhile($row = $result->fetch_array()) { \r\n\t\t\t\t$options .= '<option value=\"'.$row['laboratorist_id'].'\">'.$row['laboratorist_name'].' ('.$row['laboratorist_manual_id'].')</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t\techo $options;\t\r\n\t}", "public function getChallengeDesc()\n {\n return $this->challengeDesc;\n }", "function getDecisionTeamTeaches() {\n\n global $CFG;\n\n $sql = \"SELECT team.*\n FROM {$CFG->prefix}block_courseprefs_teamteach team,\n {$CFG->prefix}block_courseprefs_teachers teach\n WHERE team.tt_sectionsid = teach.sectionsid\n AND teach.usersid = \" . $this->id . \"\n AND teach.primary_flag = 1\n AND team.approval_flag = 1\n AND team.status = 'todo'\";\n\n $results = get_records_sql($sql);\n $teamteaches = array();\n\n // Return an empty array if there are no records to process\n if (!$results) {\n return $teamteaches;\n }\n\n foreach ($results as $result) {\n $teamteaches[$result->id] = new CoursePrefsTeamTeach($result->usersid, \n $result->sectionsid, $result->tt_sectionsid, $result->status,\n $result->approval_flag, $result->id);\n }\n\n return $teamteaches;\n }", "public function show($id)\n {\n if($id && $id > 0){\n if(Auth::user()->role == 'admin'){\n $challenge = Challenge::find($id);\n } else{\n $challenge = Challenge::where('id',$id)->where('company_id', Auth::user()->id)->first();\n // $challenge = DB::table('challenge')\n // ->join('builds', 'builds.id', '=', 'challenge.build_id')\n // ->select('challenge.*')\n // ->where('challenge.id', $id)\n // ->where('builds.company_id', Auth::user()->id)\n // ->first();\n }\n if($challenge){\n\n $build = Builds::select('id','build_text')->where('challenge_id', $challenge->id)->first();\n $challenge->build_name = '--';\n if($build && !empty($build) && $build->build_text != ''){\n $challenge->build_name = $build->build_text;\n }\n $user = Users::select('id','name')->where('id', $challenge->company_id)->first();\n $challenge->company_name = '--';\n if($user && !empty($user) && $user->user_text != ''){\n $challenge->company_name = $user->user_text;\n }\n $challenge->category_name = '--';\n // $challenge->employee_name = '--';\n // if(!empty($build)){\n $category = Categories::select('category_name')->where('id', $challenge->category_id)->first();\n \n if($category && !empty($category) && $category->category_name != ''){\n $challenge->category_name = $category->category_name;\n }\n // $employee = Employee::select('full_name', 'is_deleted')->where('id', $build->employee_id)->first();\n \n // if($employee && !empty($employee) && $employee->full_name != ''){\n // if($employee->is_deleted == '0'){\n // $challenge->employee_name = $employee->full_name;\n // } else {\n // $challenge->employee_name = 'Employee deleted';\n // }\n // }\n // }\n\n $user = Users::select('name')->where('id', $challenge->company_id)->first();\n $challenge->company_name = '--';\n if($user && !empty($user) && $user->name != ''){\n $challenge->company_name = $user->name;\n }\n\n return view('challenge.show',compact('challenge'));\n } else {\n return redirect()->route('challenge.index')->with('errors','No challenge Found.');\n }\n \n } else {\n return redirect()->route('challenge.index')->with('errors','No challenge Found.');\n }\n }", "public function create()\n {\n $challengecategories=Challengecategory::all();\n return view('challenge.create',['challengecategories'=>$challengecategories]);\n }", "public function biuldTeamsOptions() {// Connection data (server_address, database, name, poassword)\r\n \r\n $sql = \"select Team_Id,Team_Name from teams \";\r\n $html=\"\";\r\n $result=array();\r\n try {\r\n $result= $this->query($sql);\r\n }\r\n \r\n catch (PDOException $e) {\r\n \r\n return($e->getMessage());\r\n }\r\n \r\n\r\n \r\n \r\n \r\n $html = '<option value=\"0\"></option>';\r\n foreach ($result as $row) {\r\n\r\n $html.='<option value=\"'.$row['Team_Id'].'\">'.$row['Team_Name'].'</option>';\r\n\r\n\r\n \r\n }\r\n \r\n\r\n \r\n \r\n $html.='';\r\n\r\n return $html;\r\n \r\n }", "public function options()\n\t{\n\n\t $tr = new GoogleTranslate('tr');\n\t $tr->setTarget('ru');\n\n\t $options = \\App\\Option::all();\n\t $text = '';\n\n\t foreach ($options as $option) {\n\t $text .= ' | '.$option->id.'=='.$option->title;\n\t }\n\n\t $ru = $tr->translate($text);\n\t $options2 = [];\n\t $options2 = explode(' | ', $ru);\n\t unset($options2[0]);\n\n\t foreach ($options2 as $option2) {\n\t list($id, $title) = explode('==', $option2);\n\t $option_data = $options->firstWhere('id', $id);\n\t $option_data->title = trim($title);\n\t $option_data->slug = str_slug(trim($title));\n\t $option_data->save();\n\t }\n\n\t echo 'The End!';\n\t}", "abstract public function GetProblems();", "public function index()\n {\n if(Auth::user()->role == 'admin'){\n $challenge = Challenge::latest()->paginate(5);\n } else{\n $challenge = Challenge::where('company_id', Auth::user()->id)->latest()->paginate(5);\n // $challenge = DB::table('challenge')\n // ->leftJoin('builds', 'builds.id', '=', 'challenge.build_id')\n // ->select('challenge.*')\n // ->where('builds.company_id', Auth::user()->id)\n // ->get();\n }\n return view('challenge.index',compact('challenge'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function create()\n {\n if (!Gate::allows('course_create')) {\n return abort(401);\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 $learned = [];\n $courses = Course::pluck('title', 'id');\n $coursesRaw = Course::all();\n\n foreach ($coursesRaw as $course) {\n if ($course->learned && $course->learned != 'null') {\n foreach (json_decode($course->learned) as $learnItem) {\n $learned[$learnItem] = $learnItem;\n }\n }\n }\n $learned_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 $learned_ar[$learnItem] = $learnItem;\n }\n }\n }\n $teachersToSelect = [];\n $allTeachers = User::role('teacher')->select('ar_first_name', 'ar_last_name', 'first_name', 'last_name', 'id')->get();\n\n foreach ($allTeachers as $key => $teachers) {\n $teachersToSelect[$teachers->id] = $teachers->full_name;\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 $allYears = Year::get();\n $yearsToSelect = [];\n foreach ($allYears as $key => $year) {\n $yearsToSelect[$year->id] = $year->year;\n }\n \n $countriesToSelect = [];\n $countries = Country::get();\n foreach ($countries as $key => $country) {\n $countriesToSelect[$country->id] = $country->getDataFromColumn('name');\n }\n \n $videos = Media::where('type', 'upload')->where('model_id', null)->pluck('file_name', 'id');\n\n if (count($videos) == 0) {\n $videos = ['' => 'No videos available'];\n }\n // $EduSystem = [];\n\n return view('backend.courses.create', compact('yearsToSelect','countriesToSelect','videos', 'teachersToSelect', 'categoriesToSelect', 'courses', 'learned', 'academies', 'learned_ar'));\n }", "function daedalus_manage_outcomes_form($form) {\n\n // When loading the page after a failed submit, a user should\n // not have to reload all the textfields they filled in. This\n // checks the post data values and adds a boolean at index to\n // tell the autocomplete to hide the value or not.\n\n $show_prereq = array(); $show_covering = array();\n foreach ($form['post'] as $key => $value) {\n\n if (strpos($key, 'prereq') !== FALSE) {\n\n if (trim($value) != '') {\n $show_prereq[] = TRUE;\n }\n else {\n $show_prereq[] = FALSE;\n }\n\n }\n elseif (strpos($key, 'covering') !== FALSE) {\n\n if (trim($value) != '') {\n $show_covering[] = TRUE;\n }\n else {\n $show_covering[] = FALSE;\n }\n\n }\n\n }\n\n // Get all setting for the page.\n $result = db_query(\"SELECT setting, value\n FROM {dae_settings}\n WHERE setting='checkmark' OR\n setting='question mark' OR\n setting='question mark2' OR\n setting='exclamation mark' OR\n setting='title each autocomplete textfield' OR\n setting='autocomplete iteration' OR\n setting='manage courses' OR\n setting='manage learning outcomes' OR\n setting='learning outcome rank iteration' OR\n setting='tag cloud max font size' OR\n setting='tag cloud height percent' OR\n setting='show tag cloud settings' OR\n setting='tag seperate character' OR\n setting='manage term reviews'\");\n\n $page_settings = array();\n while ($row = db_fetch_array($result)) {\n $page_settings[$row['setting']] = $row['value'];\n }\n\n // Get the outcome information once, so there\n // is no need for multiple database accesses\n // throughout the script.\n $page_outcomes = array();\n $result = db_query(\"SELECT * FROM {dae_slo}\");\n while ($row = db_fetch_array($result)) {\n $page_outcomes[$row['id']]['slo_text'] = $row['slo_text'];\n $page_outcomes[$row['id']]['slo_rank'] = $row['slo_rank'];\n }\n\n global $base_url;\n\n // Get the images\n $check_src = $base_url . '/' . $page_settings['checkmark'];\n $question2_src = $base_url . '/' . $page_settings['question mark2'];\n $exclamation_src = $base_url . '/' . $page_settings['exclamation mark'];\n $show_help = '<img class=\"show-help\" src=\"' . $base_url . '/' . $page_settings['question mark'] . '\" alt=\"?\" />';\n\n // URL Information\n $page_url = $help_url = $page_settings['manage learning outcomes'];\n $course_url = $base_url . '/' . $page_settings['manage courses'];\n\n // URL Parameters\n $page_url_length = sizeof(explode('/', $page_url));\n $page_url = $base_url . '/' . $page_url;\n\n $param = array();\n $param[0] = arg(0+$page_url_length);\n $param[1] = arg(1+$page_url_length);\n $param[2] = arg(2+$page_url_length);\n $param[3] = arg(3+$page_url_length);\n\n // Name some of the parameters\n // to help with code clarity..\n $selected_slo_id = $param[0];\n $tags = $param[1];\n $sort_type = $param[2];\n\n drupal_set_title(t('Manage Learning Outcomes !help', array('!help' => $show_help)));\n\n // Get access information\n $build_access = user_access('daedalus build');\n\n $form = array();\n\n // Add the hidden help form. Paramaters are\n // (help url, show border, show break).\n $form = daedalus_help_form($help_url, 1, 1);\n\n // Only execute code if magellan database tables are installed.\n // This will popup a session timeout warning if the user is a\n // Magellan advisor and they are in session\n if (module_exists('magellan')) {\n\n // Determine the user id\n global $user;\n $user_id = $user->uid;\n\n // If the current user is a Magellan Advisor determine\n // if there is a current advising session open.\n if (magellan_advisor($user_id)) {\n\n $result = db_query(\"SELECT id, add_time FROM {mag_advisor_session} WHERE advisor_id=%d\", $user_id);\n while ($row = db_fetch_array($result)) {\n $session_id = $row['id'];\n $add_time = $row['add_time'];\n }\n\n // Get the session name.\n $current_session = $_COOKIE[session_name()];\n\n // If in session, set the user name as\n // to the selected students username.\n if ($session_id == $current_session) {\n\n // Get the current session time\n $session_time = db_result(db_query(\"SELECT session_time\n FROM {mag_session_log}\n WHERE advisor_id=%d\n AND session_id='%s'\", $user_id, $session_id ));\n\n // Add the session timeout warning.\n $form[] = daedalus_session_timeout_warning($session_time, $add_time, 'browse_learning_outcomes', 'advisor');\n\n }\n\n }\n\n // If the current user is a Magellan Support determine\n // if there is a current support session open.\n if (magellan_support($user_id)) {\n\n $result = db_query(\"SELECT id, add_time FROM {mag_support_session} WHERE support_id=%d\", $user_id);\n while ($row = db_fetch_array($result)) {\n $session_id = $row['id'];\n $add_time = $row['add_time'];\n }\n\n // Get the session name.\n $current_session = $_COOKIE[session_name()];\n\n // If in session, set the user name as\n // to the selected students username.\n if ($session_id == $current_session) {\n\n // Get the current session time\n $session_time = db_result(db_query(\"SELECT session_time FROM {mag_session_log} WHERE support_id=%d AND session_id='%s'\", $user_id, $session_id ));\n\n // Add the session timeout warning.\n $form[] = daedalus_session_timeout_warning($session_time, $add_time, 'browse_learning_outcomes', 'support');\n\n }\n\n }\n\n }\n\n // If the url says to delete something, see what to delete,\n // inform user, and delete appropriate relationship\n if ($param[1] == 'delete') {\n\n if (is_numeric($param[3]) || $param[2] == 'this') {\n\n switch ($param[2]) {\n\n case 'covering':\n\n db_query(\"DELETE FROM {dae_course_slo} WHERE course_id=%d and slo_id=%d\", $param[3], $selected_slo_id);\n\n break;\n\n case 'prereq':\n\n db_query(\"DELETE FROM {dae_prereq_slo} WHERE target=%d and pre_slo=%d\", $selected_slo_id, $param[3]);\n\n // Calculate new slo rank after removal\n daedalus_calculate_slo_rank();\n\n break;\n\n case 'tag':\n\n db_query(\"DELETE FROM {dae_slo_tag} WHERE slo_id=%d and tag_id=%d\", $selected_slo_id, $param[3]);\n\n break;\n\n case 'this':\n\n // Must give a confirmation before deleting a learning outcome\n drupal_set_title(t('Delete Confirmation !help', array('!help' => $show_help)));\n\n $this_message = '<br />' . t('Are you sure you want to delete the learning outcome');\n $this_message .= ' <strong><u>' . $page_outcomes[$selected_slo_id]['slo_text'] . '</u></strong>? ' . t('This can not be undone.');\n $this_message .= '<br /><br /><ul>';\n $this_message .= '<li>' . t('This will delete all references to prerequisite learning outcomes.') . '</li>';\n $this_message .= '<li>' . t('This will delete all references to any associated courses..') . '</li>';\n $this_message .= '</ul><br />' . t('Are you sure you want to continue?');\n\n $form[] = array(\n '#value' => $this_message,\n '#type' => 'item',\n );\n\n $form['delete-forward'] = array(\n '#type' => 'submit',\n '#value' => t('I understand the consequences. Delete this learning outcome forever.'),\n );\n\n $form['delete-reverse'] = array(\n '#type' => 'submit',\n '#value' => t('On second thought, I better not. Take me back'),\n );\n\n break;\n\n }\n\n }\n else {\n drupal_set_message(t('An error has occurred. Please contact a system administrator'), 'error');\n }\n\n }\n\n elseif ($param[0] == 'rank') {\n\n /**\n * Dr. Blouin's Sudo Code\n *\n * Sorting Slo (cron job)\n *\n * 1. Reset all ranks to -1 (or NULL)\n * x <- SELECT ALL SLOs of rank 0\n * r <- 0\n * while x != 0\n * x <- All SLOs which rank == NULL ^ has 1+ prerequisites of rank r\n * Assign rank r+1 to all SLOs E(subset) x\n * r <- r+1\n *\n * Quick & Dirty rank assignment of SLOs (real time)\n * Caution: A SLO x is updated/created with 1+ prerequisite\n * r <- min(union of ranks of all prerequiste of x)\n * Assign x the rank of 1\n *\n * [optimally recursivly apply Q+D reranking to all post-requisite of x and get rid of the cron job.]\n *\n * Q. Can php make system calls or spawn new processes?\n *\n */\n\n drupal_set_title(t('Rank Calculation !help', array('!help' => $show_help)));\n\n $rank_depth = $page_settings['learning outcome rank iteration'];\n\n $form[] = array(\n '#type' => 'item',\n '#title' => t('If marked as valid the learning outcome (preslo) has an assigned prerequisite student learing outcome'),\n '#description' => t('Valid learning outcomes are given the rank of the iteration + 1'),\n );\n\n $form['new-depth'] = array(\n '#title' => t('Set new rank iteration depth'),\n '#type' => 'select',\n '#options' => array(\n '5' => t('5'),\n '6' => t('6'),\n '7' => t('7'),\n '8' => t('8'),\n '9' => t('9'),\n '10' => t('10'),\n '11' => t('11'),\n '12' => t('12'),\n '13' => t('13'),\n '14' => t('14'),\n '15' => t('15'),\n '16' => t('16'),\n '17' => t('17'),\n '18' => t('18'),\n '19' => t('19'),\n '20' => t('20'),\n '21' => t('21'),\n '22' => t('22'),\n '23' => t('23'),\n '24' => t('24'),\n '25' => t('25'),\n ),\n '#default_value' => $rank_depth,\n );\n\n $form['submit-depth'] = array(\n '#type' => 'submit',\n '#value' => t('Submit rank depth'),\n );\n\n $preslo_ids = array();\n\n // Select all SLO's with a prerequisite SLO\n $result = db_query(\"SELECT DISTINCT target FROM {dae_prereq_slo} ORDER BY target\");\n while ($row = db_fetch_array($result)) {\n $preslo_ids[] = $row['target'];\n }\n\n if ($preslo_ids) {\n\n // Set all SLO ranks to -1\n db_query(\"UPDATE {dae_slo} SET slo_rank=-1\");\n\n // Select all SLO's\n $result = db_query(\"SELECT DISTINCT id FROM {dae_slo} ORDER BY id\");\n while ($row = db_fetch_array($result)) {\n $slo_ids[] = $row['id'];\n }\n\n // Create an array of SLO's that have no prerequisite SLO's\n // and make the query to set each slo to a rank of zero.\n $rank_zero = array_diff($slo_ids, $preslo_ids);\n\n // Create the placeholders for each id that will be updated.\n $query_placeholders = implode(' OR ', array_fill(0, count($rank_zero), 'id=%d'));\n\n db_query(\"UPDATE {dae_slo} SET slo_rank=0 WHERE \" . $query_placeholders, $rank_zero);\n\n // I think this is a slight variation to Christians sudo code. Here the list of all SLO's\n // that have a prerequisite SLO are iterated checking to see if the have a prerequisite SLO\n // at the current iteration depth. If a prereq SLO is found the current SLO is given a rank\n // of the iteration plus 1.\n for ($i=0; $i <= $rank_depth; $i++) {\n\n $title = 'Iteration - ' . $i;\n\n $values = '';\n\n foreach ($preslo_ids as $id) {\n\n $values .= '<li>ID: ' . $id . ' Preslos: ';\n\n $result = db_query(\"SELECT * FROM {dae_prereq_slo} WHERE target=%d\", $id);\n while ($row = db_fetch_array($result)) {\n\n $values .= $row['pre_slo'] . ', ';\n\n if (db_result(db_query(\"SELECT COUNT(*) FROM {dae_slo} WHERE slo_rank=%d AND id=%d\", $i, $row['pre_slo']))) {\n\n $values .= ' <-- VALID</li>';\n\n $valid = TRUE;\n\n db_query(\"UPDATE {dae_slo} SET slo_rank=%d WHERE id=%d\", ($i+1), $id);\n\n break;\n\n }\n\n }\n\n if (!$valid) {\n $values .= '</li>';\n }\n else {\n $valid = FALSE;\n }\n\n }\n\n $form[] = array(\n '#title' => check_plain($title),\n '#type' => 'item',\n '#value' => '<ul>' . $values . '</ul>',\n );\n\n }\n\n }\n else {\n\n // Set all SLO ranks to 0\n db_query(\"UPDATE {dae_slo} SET slo_rank=0\");\n\n }\n\n }\n\n elseif ($param[0] == 'tag' || $param[0] == 'split' || $param[0] == 'merge' || $param[0] == 'delete' || $param[0] == 'remove') {\n\n switch ($param[0]) {\n\n // Tag the outcomes selected\n // from the tag cloud.\n case 'tag':\n\n // Include the pages JavaScript file.\n drupal_add_js(drupal_get_path('module', 'daedalus') . '/javascript/daedalus_manage_outcome_tags.js');\n\n drupal_set_title(t('Tag Learning Outcomes !help', array('!help' => $show_help)));\n\n $slos_to_tag = explode('_', $param[1]);\n\n natcasesort($slos_to_tag);\n\n foreach ($slos_to_tag as $v) {\n $selected .= '<li>' . $page_outcomes[$v]['slo_text'] . '</li>';\n }\n\n $form[] = array(\n '#type' => 'item',\n '#title' => t('Selected Learning Outcomes'),\n '#value' => '<ul>' . $selected . '</ul>',\n );\n\n $form['tags-to-add'] = array(\n '#type' => 'textfield',\n '#title' => t('Add Tags'),\n '#autocomplete_path' => 'autocomp/tag',\n '#description' => '[<a class=\"show-tag-help\">' . t('info') . '</a>]',\n );\n\n $form['tags-add-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Tag'),\n );\n\n break;\n\n // Split the outcomes selected\n // from the tag cloud.\n case 'split':\n\n drupal_set_title(t('Splitting learning outcome !help', array('!help' => $show_help)));\n\n // Both of these are required. But the required field isn't being used,\n // because it's not nescessary for them to have values if the user is\n // switching the operation they're doing.\n $form['split-a'] = array(\n '#type' => 'textfield',\n '#title' => t('New Learning Outcome #1'),\n '#required' => TRUE,\n );\n $form['split-b'] = array(\n '#type' => 'textfield',\n '#title' => t('New Learning Outcome #2'),\n '#required' => TRUE,\n '#description' => t('You may create two new learning outcomes or select the original learning outcome and one created outcome.'),\n );\n $form['button-split-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Split'),\n );\n\n break;\n\n // Merge the outcomes selected\n // from the tag cloud.\n case 'merge':\n\n drupal_set_title(t('Merging 2 learning outcomes !help', array('!help' => $show_help)));\n\n $merging_tags = explode('_', $param[1]);\n\n if (count($merging_tags) == 2) {\n\n $merge_message = t('Merging the following learning outcomes:') . '<ul>';\n $merge_message .= '<li>' . $page_outcomes[$merging_tags[0]]['slo_text'] . '</li>';\n $merge_message .= '<li>' . $page_outcomes[$merging_tags[1]]['slo_text'] . '</li></ul>';\n\n $form[] = array(\n '#type' => 'item',\n '#value' => $merge_message,\n );\n\n $form['new-merged'] = array(\n '#title' => t('Enter new learning outcome'),\n '#type' => 'textfield',\n '#autocomplete_path' => 'autocomp/slo',\n '#required' => TRUE,\n '#description' => t('You may enter an entirly new learning outcome or select one of the two being merged.'),\n );\n\n $form['button-merge-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Merge'),\n );\n\n }\n else{\n drupal_set_message(t('An error occured, please contact a system administrator.'), 'error');\n }\n\n break;\n\n // Delete selected outcomes\n // from the tag cloud.\n case 'delete':\n\n drupal_set_title(t('Delete Learning Outcomes !help', array('!help' => $show_help)));\n\n $deleting = array();\n\n $slo_ids = explode('_', $param[1]);\n\n foreach ($slo_ids as $id) {\n $deleting[] = $page_outcomes[$id]['slo_text'];\n }\n\n if ($deleting) {\n\n natcasesort($deleting);\n\n $delete_message = t('Are you sure you want to delete the following learning outcomes?') . '<ul>';\n\n foreach ($deleting as $slo_text) {\n $delete_message .= '<li>' . $slo_text . '</li>';\n }\n\n $delete_message .= '</ul><strong><b><u>' . t('This can not be undone.') . '</u></b></strong>';\n\n $form[] = array(\n '#type' => 'item',\n '#value' => $delete_message,\n );\n\n $form['button-delete-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n );\n\n }\n\n break;\n\n // Remove multiple tags from SLOs\n // selected from the tag cloud.\n case 'remove':\n\n drupal_set_title(t('Remove Multiple Tags !help', array('!help' => $show_help)));\n\n $slo_ids = explode('_', $param[1]);\n $tag_ids = explode('_', $param[2]);\n\n if (count($tag_ids) > 1) {\n $tag_plural = \"'s\";\n }\n\n if (count($slo_ids) > 1) {\n $slo_plural = \"'s\";\n }\n\n foreach ($tag_ids as $id) {\n $tag_list .= '\"' . db_result(db_query(\"SELECT tag_label FROM {dae_tag} WHERE id=%d\", $id)) . '\" ';\n }\n\n $remove_message = t('Are you sure you want to remove the selected tag!plural ',\n array('!plural' => $tag_plural));\n\n $remove_message .= '<b>' . $tag_list . '</b>' . t(' from the following learning outcome!plural?.',\n array('!plural' => $slo_plural)) . '<ul>';\n\n foreach ($slo_ids as $sid) {\n $remove_message .= '<li>' . $page_outcomes[$sid]['slo_text'] . '</li>';\n }\n\n $remove_message .= '</ul><strong><b><u>' . t('This can not be undone.') . '</u></b></strong>';\n\n $form[] = array(\n '#type' => 'item',\n '#value' => $remove_message,\n );\n\n $form['button-remove-multiple-forward'] = array(\n '#type' => 'submit',\n '#value' => t('Remove Multiple Tags'),\n );\n\n break;\n\n }\n\n // Add cancel button using the\n // URL parameter as the lablel.\n if (!is_numeric($param[0]) && $param[0] != 'selected') {\n\n $form[] = array(\n '#type' => 'item',\n '#value' => '<small><a href=\"' . $page_url . '\">' . t('cancel !p0', array('!p0' => $param[0])) . '</a></small><br/><br/><hr><br/>',\n );\n\n }\n\n }\n\n elseif ($param[0] == 'courses') {\n\n // Display autocomplete course box to submit for slo display\n if (!$param[1]) {\n\n // Based on the settings make a textfield\n $form['course-slos'] = array(\n '#type' => 'textfield',\n '#title' => t('View learning outcomes by selecting a course'),\n '#autocomplete_path' => 'autocomp/course',\n );\n\n $form['view-by-course'] = array(\n '#type' => 'submit',\n '#value' => t('Submit course'),\n );\n\n $form['view-by-tags'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n );\n\n $form[] = array(\n '#type' => 'item',\n '#value' => '<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />',\n );\n\n }\n else {\n\n ///////////////////////////////////////////////////////////////////////////////////\n ///////////////////////////////////////////////////////////////////////////////////\n // View By Course /////////////////////////////////////////////////////////////////\n $selected_course_info = db_fetch_array(db_query(\"SELECT id, course_name FROM {dae_course} WHERE course='%s'\", $param[1]));\n $selected_course_name = $selected_course_info['course_name'];\n $selected_course_id = $selected_course_info['id'];\n\n $form['view-by-tags'] = array(\n '#type' => 'submit',\n '#value' => t('View by tags'),\n );\n\n $form['course-display'] = array(\n '#type' => 'item',\n '#title' => t('Selected course'),\n '#value' => $param[1] . ' - ' . $selected_course_name,\n );\n\n $selected_slos = array();\n\n $result = db_query(\"SELECT slo_id FROM {dae_course_slo} WHERE course_id=%d\", $selected_course_id);\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['slo_id']] = $page_outcomes[$row['slo_id']]['slo_text'];\n }\n\n if ($selected_slos) {\n\n asort($selected_slos);\n\n $form['checkboxes'] = array(\n '#type' => 'checkboxes',\n '#options' => $selected_slos,\n );\n\n $form['button-merge-top'] = array(\n '#type' => 'submit',\n '#value' => t('Merge'),\n );\n $form['button-delete-top'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n );\n $form['button-split-top'] = array(\n '#type' => 'submit',\n '#value' => t('Split'),\n );\n $form['button-tag-top'] = array(\n '#type' => 'submit',\n '#value' => t('Tag'),\n );\n\n }\n else {\n\n $form['view-by-course'] = array(\n '#type' => 'submit',\n '#value' => t('View by course'),\n '#weight' => -10,\n );\n\n $form['tags'] = array(\n '#value' => '<ul><li><i>' . t('No matches found') . '</i></li></ul>',\n '#type' => 'item',\n );\n\n }\n\n }\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n ////////////////////////////////////////////////////////////////////////////\n ////// /////////////////////////////////////////\n ////// TAG CLOUD /////////////////////////////////////////\n////// /////////////////////////////////////////\n ///// If the passed learning outcome isn't an id, then change it.\n //// Here the tag cloud is created and the selected tag string.\n elseif (!is_numeric($param[0]) && $build_access) {\n\n $i = 0; $cloud_string = '';\n\n // If a tag is not selected display the entire tag cloud\n if ($param[0] != 'selected') {\n\n $tag_array = array();\n $min = -1; $max = -1;\n\n // Create the tag array\n $result = db_query(\"SELECT * FROM {dae_tag} ORDER BY tag_label\");\n while ($row = db_fetch_array($result)) {\n\n $tag_count = db_result(db_query(\"SELECT COUNT(*) FROM {dae_slo_tag} WHERE tag_id=%d\", $row['id']));\n\n $tag_array[$i]['tag_id'] = $row['id'];\n $tag_array[$i]['label'] = $row['tag_label'];\n $tag_array[$i]['count'] = $tag_count;\n $i++;\n\n // Store the min and max tag count to\n // help calculate the tag cloud text size.\n if ($min == -1) {\n $min = $max = $tag_count;\n }\n elseif ($tag_count < $min && $tag_count != 0) {\n $min = $tag_count;\n }\n elseif ($tag_count > $max) {\n $max = $tag_count;\n }\n\n }\n\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // Make sure we don't divide by 0\n if ($max == $min && $max > 1) {\n $min = $max-1;\n }\n elseif ($max == $min && $max == 1) {\n $max++;\n }\n\n // Log scale formula found online\n $weight = (log($value['count'])-log($min))/(log($max)-log($min));\n\n switch ($weight) {\n case ($weight == 0):\n $font_size = 8 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0 && $weight <= 0.4):\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.4 && $weight <= 0.6):\n $font_size = 23 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.6 && $weight <= 0.8):\n $font_size = 30 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.8 && $weight <= 1.0):\n $font_size = 38 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n }\n\n // Show the number of times the SLO has been tagged.\n $par_count = '<small><small>(' . $value['count'] . ')</small></small>';\n\n if ($value['count'] == 0) {\n $cloud_string .= '<a style=\"color: #8B0000\"><b>#' . $value['label'] . '</b></a>' . $par_count . ' &nbsp;';\n }\n else {\n\n if ($param[0] == 'alpha') {\n\n $cloud_url = $page_url . '/selected/' . $value['tag_id'] . '/' . $param[0];\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n else {\n\n $cloud_url = $page_url . '/selected/' . $value['tag_id'];\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n\n }\n\n }\n\n }\n\n }\n else {\n\n // Else a tag has been selected so narrow the tags in the\n // cloud tag accoring to the select tag. tag tag tag.\n\n $label_index = array();\n\n // Make a list of ids and their tag labels to reduce\n // the amount of database access required for the script.\n $result = db_query(\"SELECT * FROM {dae_tag} ORDER BY tag_label\");\n while ($row = db_fetch_array($result)) {\n $label_index[$row['id']] = $row['tag_label'];\n }\n\n // If the tags are not delimited by an underscore\n // select the results with only the singel tag.\n if (!strrpos($tags, '_')) {\n\n // Deselect all tags\n $selected_tags = '<a href=\"' . $page_url . '/' . $sort_type . '\">#' . $label_index[$tags] . '</a>';\n\n // Get all the slo id's.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d ORDER BY slo_id\", $tags);\n while ($row = db_fetch_array($result)) {\n $slo_array[] = $row['slo_id'];\n }\n\n $result_tag = array();\n\n // Create the query string placeholder to select the slos.\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'slo_id=%d'));\n\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE \" . $slo_placeholders . \" ORDER BY tag_id\", $slo_array);\n while ($row = db_fetch_array($result)) {\n\n if ($row['tag_id'] != $tags) {\n $result_tag[] = $row['tag_id'];\n }\n\n }\n\n if ($result_tag) {\n\n $ordered_tags = array();\n\n // Create the query string placeholder to select the tags again in alphabetical order.\n $tag_placeholders = implode(' OR ', array_fill(0, count($result_tag), 'id=%d'));\n\n $result = db_query(\"SELECT id FROM {dae_tag} WHERE \" . $tag_placeholders . \" ORDER BY tag_label\", $result_tag);\n while ($row = db_fetch_array($result)) {\n $ordered_tags[] = $row['id'];\n }\n\n foreach ($ordered_tags as $current_tag) {\n\n $slo_array1 = array(); $slo_array2 = array();\n//@todo Figure out some fancy sql to merge these queries to get the tag count\n // Calculate the total number of\n // SLO's associated the first tag.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Calculate the total number of SLO's\n // associated with the current tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $current_tag);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n//$bill_count = 0;\n//$result = db_query(\"select distinct slo_id from {dae_slo_tag} where tag_id=%d and slo_id in (SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d)\", $tags, $current_tag);\n//while ($row = db_fetch_array($result)) {\n// $bill_count++;\n//}\n // Combine each lists make sure there are no duplicate\n // entries and the number of matching items is the count.\n $temp_slos = array_intersect($slo_array1, $slo_array2);\n $temp_slos = array_unique($temp_slos);\n $tag_count = count($temp_slos);\n//echo \"Current_Tag = $current_tag Tags = $tags TagCOUNT $tag_count BillCOUNT $bill_count<br />\";\n $tag_array[$current_tag]['tag_id'] = $current_tag;\n $tag_array[$current_tag]['count'] = $tag_count;\n $tag_array[$current_tag]['label'] = $label_index[$current_tag];\n\n // Store the min and max tag count to\n // help calculate the tag cloud text size.\n if (!$min) {\n $min = $max = $tag_count;\n }\n elseif ($tag_count < $min) {\n $min = $tag_count;\n }\n elseif ($tag_count > $max) {\n $max = $tag_count;\n }\n\n }\n\n // Create the tag cloud\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // Make sure we don't divide by 0\n if ($max == $min && $max > 1) {\n $min = $max-1;\n }\n elseif ($max == $min && $max == 1) {\n $max++;\n }\n\n $weight = (log($value['count'])-log($min))/(log($max)-log($min));\n\n switch ($weight) {\n case ($weight == 0):\n $font_size = 8 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0 && $weight <= 0.4):\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.4 && $weight <= 0.6):\n $font_size = 23 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.6 && $weight <= 0.8):\n $font_size = 30 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.8 && $weight <= 1.0):\n $font_size = 38 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n }\n\n $par_count = '<small><small>(' . $value['count'] . ')</small></small>';\n\n if ($value['count'] == 0) {\n $cloud_string .= '<a style=\"color: #8B0000\"><b>#' . $value['label'] . '</b></a>' . $par_count . ' &nbsp;';\n }\n else {\n\n $cloud_url = $page_url . '/selected/' . $tags . '_' . $value['tag_id'] . '/' . $sort_type;\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n\n }\n\n }\n\n }\n\n }\n else {\n\n // Now the url parameter has more than one tag\n // selected. Turn the tags into an array of tags.\n $tags = explode('_', $tags);\n\n // Create the selected tag string with a twist. When two tags or more\n // have been selected, the selected tags string now has the option of\n // deselecting one of the tags or all of them.\n if (count($tags) == 2) {\n\n // Remove 1st tag.\n $url1 = $page_url . '/selected/' . $tags[1] . '/' . $sort_type;\n $selected_tags = '<a href=\"' . $url1 . '\">#' . $label_index[$tags[0]] . '</a>';\n\n // Remove 2nd tag.\n $url2 = $page_url . '/selected/' . $tags[0] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url2 . '\">#' . $label_index[$tags[1]] . '</a>';\n\n // Deselect all tags\n $selected_tags .= '<br /><b><a href=\"' . $page_url . '/' . $sort_type . '\">' . t('deselect all') . '</a></b>';\n\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d OR tag_id=%d ORDER BY slo_id\", $tags[0], $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array[] = $row['slo_id'];\n }\n\n // Remove duplicate values.\n $slo_array = array_unique($slo_array);\n\n // Create the query string placeholder to select the slos.\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'slo_id=%d'));\n\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE \" . $slo_placeholders . \" ORDER BY tag_id\", $slo_array);\n while ($row = db_fetch_array($result)) {\n\n // Make sure not to add the selected tags.\n if (!in_array($row['tag_id'], $tags)) {\n $result_tag[] = $row['tag_id'];\n }\n\n }\n\n if ($result_tag) {\n\n // Create the query string placeholder to select the tags again in alphabetical order.\n $tag_placeholders = implode(' OR ', array_fill(0, count($result_tag), 'id=%d'));\n\n $result = db_query(\"SELECT id FROM {dae_tag} WHERE \" . $tag_placeholders . \" ORDER BY tag_label\", $result_tag);\n while ($row = db_fetch_array($result)) {\n $ordered_tags[] = $row['id'];\n }\n\n foreach ($ordered_tags as $current_tag) {\n\n $slo_array1 = array(); $slo_array2 = array(); $slo_array3 = array();\n\n // Calculate the total number of\n // SLO's associated with Tag 1.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 2.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Calculate the total number of SLO's\n // associated with the current tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $current_tag);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Combine each lists make sure there are no duplicate\n // entries and the number of matching items is the count.\n $temp_slos = array_intersect($slo_array1, $slo_array2);\n $temp_slos = array_intersect($slo_array3, $temp_slos);\n $temp_slos = array_unique($temp_slos);\n $tag_count = count($temp_slos);\n\n if ($tag_count > 0) {\n $tag_array[$current_tag]['tag_id'] = $current_tag;\n $tag_array[$current_tag]['count'] = $tag_count;\n $tag_array[$current_tag]['label'] = $label_index[$current_tag];\n\n // Store the min and max tag count to\n // help calculate the tag cloud text size.\n if (!$min) {\n $min = $max = $tag_count;\n }\n elseif ($tag_count < $min) {\n $min = $tag_count;\n }\n elseif ($tag_count > $max) {\n $max = $tag_count;\n }\n\n }\n\n }\n\n // Create the tag cloud\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // Make sure we don't divide by 0\n if ($max == $min && $max > 1) {\n $min = $max-1;\n }\n elseif ($max == $min && $max == 1) {\n $max++;\n }\n\n $weight = (log($value['count'])-log($min))/(log($max)-log($min));\n\n switch ($weight) {\n case ($weight == 0):\n $font_size = 8 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0 && $weight <= 0.4):\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.4 && $weight <= 0.6):\n $font_size = 23 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.6 && $weight <= 0.8):\n $font_size = 30 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.8 && $weight <= 1.0):\n $font_size = 38 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n }\n\n // Show the number of times the SLO has been tagged.\n $par_count = '<small><small>(' . $value['count'] . ')</small></small>';\n\n $cloud_url = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $value['tag_id'] . '/' . $sort_type;\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n\n }\n\n }\n\n }\n elseif (count($tags) == 3) {\n\n // Remove 1st tag.\n $url1 = $page_url . '/selected/' . $tags[1] . '_' . $tags[2] . '/' . $sort_type;\n $selected_tags = '<a href=\"' . $url1 . '\">#' . $label_index[$tags[0]] . '</a>';\n\n // Remove 2nd tag.\n $url2 = $page_url . '/selected/' . $tags[0] . '_' . $tags[2] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url2 . '\">#' . $label_index[$tags[1]] . '</a>';\n\n // Remove 3rd tag.\n $url3 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url3 . '\">#' . $label_index[$tags[2]] . '</a>';\n\n // Deselect all tags\n $selected_tags .= '<br /><b><a href=\"' . $page_url . '/' . $sort_type . '\">' . t('deselect all') . '</a></b>';\n\n $result = db_query(\"SELECT slo_id\n FROM {dae_slo_tag}\n WHERE tag_id=%d OR tag_id=%d OR tag_id=%d\n ORDER BY slo_id\", $tags[0], $tags[1], $tags[2]);\n\n while ($row = db_fetch_array($result)) {\n $slo_array[] = $row['slo_id'];\n }\n\n $slo_array = array_unique($slo_array);\n\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'slo_id=%d'));\n\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE \" . $slo_placeholders . \" ORDER BY tag_id\", $slo_array);\n while ($row = db_fetch_array($result)) {\n\n // Make sure not to add the selected tags.\n if (!in_array($row['tag_id'], $tags)) {\n $result_tag[] = $row['tag_id'];\n }\n\n }\n\n if ($result_tag) {\n\n $tag_placeholders = implode(' OR ', array_fill(0, count($result_tag), 'id=%d'));\n\n $result = db_query(\"SELECT id FROM {dae_tag} WHERE \" . $tag_placeholders . \" ORDER BY tag_label\", $result_tag);\n while ($row = db_fetch_array($result)) {\n $ordered_tags[] = $row['id'];\n }\n\n foreach ($ordered_tags as $current_tag) {\n\n $slo_array1 = array(); $slo_array2 = array(); $slo_array3 = array(); $slo_array4 = array();\n\n // Calculate the total number of\n // SLO's associated with Tag 1.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 2.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 3.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Calculate the total number of SLO's\n // associated with the current tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $current_tag);\n while ($row = db_fetch_array($result)) {\n $slo_array4[] = $row['slo_id'];\n }\n\n // Combine each lists make sure there are no duplicate\n // entries and the number of matching items is the count.\n $temp_slos = array_intersect($slo_array1, $slo_array2);\n $temp_slos = array_intersect($slo_array3, $temp_slos);\n $temp_slos = array_intersect($slo_array4, $temp_slos);\n $temp_slos = array_unique($temp_slos);\n $tag_count = count($temp_slos);\n\n if ($tag_count > 0) {\n $tag_array[$current_tag]['tag_id'] = $current_tag;\n $tag_array[$current_tag]['count'] = $tag_count;\n $tag_array[$current_tag]['label'] = $label_index[$current_tag];\n\n // Store the min and max tag count to\n // help calculate the tag cloud text size.\n if (!$min) {\n $min = $max = $tag_count;\n }\n elseif ($tag_count < $min) {\n $min = $tag_count;\n }\n elseif ($tag_count > $max) {\n $max = $tag_count;\n }\n\n }\n\n }\n\n // Create the tag cloud\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // Make sure we don't divide by 0\n if ($max == $min && $max > 1) {\n $min = $max-1;\n }\n elseif ($max == $min && $max == 1) {\n $max++;\n }\n\n $weight = (log($value['count'])-log($min))/(log($max)-log($min));\n\n switch ($weight) {\n case ($weight == 0):\n $font_size = 8 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0 && $weight <= 0.4):\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.4 && $weight <= 0.6):\n $font_size = 23 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.6 && $weight <= 0.8):\n $font_size = 30 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n case ($weight > 0.8 && $weight <= 1.0):\n $font_size = 38 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n break;\n }\n\n $par_count = '<small><small>(' . $value['count'] . ')</small></small>';\n\n $cloud_url = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '_' . $value['tag_id'] . '/' . $sort_type;\n\n $cloud_string .= $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '</b></a>' . $big_end . '' . $par_count . ' &nbsp;';\n\n }\n\n }\n\n }\n\n }\n elseif (count($tags) == 4) {\n\n // Remove 1st tag.\n $url1 = $page_url . '/selected/' . $tags[1] . '_' . $tags[2] . '_' . $tags[3] . '/' . $sort_type;\n $selected_tags = '<a href=\"' . $url1 . '\">#' . $label_index[$tags[0]] . '</a>';\n\n // Remove 2nd tag.\n $url2 = $page_url . '/selected/' . $tags[0] . '_' . $tags[2] . '_' . $tags[3] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url2 . '\">#' . $label_index[$tags[1]] . '</a>';\n\n // Remove 3rd tag.\n $url3 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[3] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url3 . '\">#' . $label_index[$tags[2]] . '</a>';\n\n // Remove 4th tag.\n $url4 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url4 . '\">#' . $label_index[$tags[3]] . '</a>';\n\n // Deselect all tags\n $selected_tags .= '<br /><b><a href=\"' . $page_url . '/' . $sort_type . '\">' . t('deselect all') . '</a></b>';\n\n $result = db_query(\"SELECT slo_id\n FROM {dae_slo_tag}\n WHERE tag_id=%d OR tag_id=%d OR tag_id=%d OR tag_id=%d\n ORDER BY slo_id\", $tags[0], $tags[1], $tags[2], $tags[3]);\n\n while ($row = db_fetch_array($result)) {\n $slo_array[] = $row['slo_id'];\n\n }\n\n $slo_array = array_unique($slo_array);\n\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'slo_id=%d'));\n\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE \" . $slo_placeholders . \" ORDER BY tag_id\", $slo_array);\n while ($row = db_fetch_array($result)) {\n\n // Make sure not to add the selected tags.\n if (!in_array($row['tag_id'], $tags)) {\n $result_tag[] = $row['tag_id'];\n }\n\n }\n\n if ($result_tag) {\n\n $tag_placeholders = implode(' OR ', array_fill(0, count($result_tag), 'id=%d'));\n\n $result = db_query(\"SELECT id FROM {dae_tag} WHERE \" . $tag_placeholders . \" ORDER BY tag_label\", $result_tag);\n while ($row = db_fetch_array($result)) {\n $ordered_tags[] = $row['id'];\n }\n\n foreach ($ordered_tags as $current_tag) {\n\n $slo_array1 = array(); $slo_array2 = array(); $slo_array3 = array();\n $slo_array4 = array(); $slo_array5 = array();\n\n // Calculate the total number of\n // SLO's associated with Tag 1.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 2.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 3.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Calculate the total number of\n // SLO's associated with Tag 4.\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[3]);\n while ($row = db_fetch_array($result)) {\n $slo_array4[] = $row['slo_id'];\n }\n\n // Calculate the total number of SLO's\n // associated with Tag 1. the current tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $current_tag);\n while ($row = db_fetch_array($result)) {\n $slo_array5[] = $row['slo_id'];\n }\n\n // Combine each lists make sure there are no duplicate\n // entries and the number of matching items is the count.\n $temp_slos = array_intersect($slo_array1, $slo_array2);\n $temp_slos = array_intersect($slo_array3, $temp_slos);\n $temp_slos = array_intersect($slo_array4, $temp_slos);\n $temp_slos = array_intersect($slo_array5, $temp_slos);\n $temp_slos = array_unique($temp_slos);\n $tag_count = count($temp_slos);\n\n if ($tag_count > 0) {\n $tag_array[$current_tag]['tag_id'] = $current_tag;\n $tag_array[$current_tag]['count'] = $tag_count;\n $tag_array[$current_tag]['label'] = $label_index[$current_tag];\n }\n\n }\n\n // Create the tag cloud\n if ($tag_array) {\n\n foreach ($tag_array as $value) {\n\n // If there are any tag cloud values at this point just make\n // the tag size 15 and call it a !&^#%@ #&&)(#* day!\n $font_size = 15 + ($page_settings['tag cloud max font size'] * 2);\n $big_open = '<div class=\"cloud-item\" style=\"font-size: ' . $font_size . 'px;\">';\n $big_end = '</div>';\n\n $cloud_url = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '_' . $tags[3] . '_' . $value['tag_id'] . '/' . $sort_type;\n\n $cloud_string .= '&nbsp;' . $big_open . '<a href=\"' . $cloud_url . '\" ><b>#' . $value['label'] . '<b/></a>' . $big_end . ' <small>(' . $value['count'] . ')</small>&nbsp;';\n\n }\n\n }\n\n }\n\n }\n elseif (count($tags) == 5) {\n\n // Remove 1st tag.\n $url1 = $page_url . '/selected/' . $tags[1] . '_' . $tags[2] . '_' . $tags[3] . '_' . $tags[4] . '/' . $sort_type;\n $selected_tags = '<a href=\"' . $url1 . '\">#' . $label_index[$tags[0]] . '</a>';\n\n // Remove 2nd tag.\n $url2 = $page_url . '/selected/' . $tags[0] . '_' . $tags[2] . '_' . $tags[3] . '_' . $tags[4] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url2 . '\">#' . $label_index[$tags[1]] . '</a>';\n\n // Remove 3rd tag.\n $url3 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[3] . '_' . $tags[4] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url3 . '\">#' . $label_index[$tags[2]] . '</a>';\n\n // Remove 4th tag.\n $url4 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '_' . $tags[4] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url4 . '\">#' . $label_index[$tags[3]] . '</a>';\n\n // Remove 5th tag.\n $url5 = $page_url . '/selected/' . $tags[0] . '_' . $tags[1] . '_' . $tags[2] . '_' . $tags[3] . '/' . $sort_type;\n $selected_tags .= '&nbsp;&nbsp;<a href=\"' . $url5 . '\">#' . $label_index[$tags[4]] . '</a>';\n\n // Deselect all tags\n $selected_tags .= '<br /><b><a href=\"' . $page_url . '/' . $sort_type . '\">deselect all</a></b>';\n\n }\n\n }\n\n }\n\n if ($cloud_string) {\n // Add the line height daedalus setting here since the value\n // (as far as I know) can not be retrieved within a css file.\n $cloud_display = '<div class=\"cloud\" style=\"line-height: ' . $page_settings['tag cloud height percent'] . '%;\">' . $cloud_string . '</div>';\n }\n else {\n $cloud_display = '<div class=\"cloud\"><div class=\"cloud-item\" style=\"font-size: 13px;\"><b>' . t('#No matches found') . '</b></div></div>';\n $hide_info = TRUE;\n }\n\n // Hide buttons if no SLOs\n if (!$hide_info) {\n\n // Display buttons according to the sort order\n if ($build_access) {\n\n if ($param[0] == 'alpha' || $param[2] == 'alpha') {\n $form['order-rank'] = array(\n '#type' => 'submit',\n '#value' => t('Order by rank')\n );\n }\n else {\n $form['order-alpha'] = array(\n '#type' => 'submit',\n '#value' => t('Order alphabetically')\n );\n }\n\n }\n\n $form['view-by-course'] = array(\n '#type' => 'submit',\n '#value' => t('View by course'),\n );\n\n $form['calculate-rank'] = array(\n '#type' => 'submit',\n '#value' => t('Calculate rank'),\n );\n\n // Some debugging information for adjusting the appearance of\n // the tag cloud form of buttons. No setting, just change it\n // to true when you want to change the database values based\n // on visual cues instead of guessing the numbers.\n if ($page_settings['show tag cloud settings']) {\n\n $form['increase-percent'] = array(\n '#type' => 'submit',\n '#value' => t('Increase spacing'),\n );\n $form['decrease-percent'] = array(\n '#type' => 'submit',\n '#value' => t('Decrease spacing'),\n\n );\n $form['increase-max'] = array(\n '#type' => 'submit',\n '#value' => t('Increase font'),\n );\n $form['decrease-max'] = array(\n '#type' => 'submit',\n '#value' => t('Decrease font'),\n );\n }\n\n }\n\n $form['tags'] = array(\n '#title' => t('Tags to narrow search ') . '<small>(<i>' . t('red tags are not linked to a student learning outcome') . '</i>)</small>',\n '#value' => $cloud_display,\n '#type' => 'item',\n );\n\n if ($param[0] == 'selected') {\n $form['selected'] = array(\n '#title' => t('Selected tags'),\n '#value' => $selected_tags,\n '#type' => 'item',\n );\n\n }\n\n if ($tags) {\n\n if (is_array($tags)) {\n\n // Combine the arrays according to the amount of tags selected\n if (count($tags) == 2) {\n\n // Get the slo ids using the 1st tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 2nd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n $slo_array = array_intersect($slo_array1, $slo_array2);\n\n }\n\n elseif (count($tags) == 3) {\n\n // Get the slo ids using the 1st tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 2nd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 3rd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n $slo_array = array_intersect($slo_array1, $slo_array2);\n $slo_array = array_intersect($slo_array3, $slo_array);\n\n }\n\n elseif (count($tags) == 4) {\n\n // Get the slo ids using the 1st tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 2nd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 3rd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 4th tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[3]);\n while ($row = db_fetch_array($result)) {\n $slo_array4[] = $row['slo_id'];\n }\n\n $slo_array = array_intersect($slo_array1, $slo_array2);\n $slo_array = array_intersect($slo_array3, $slo_array);\n $slo_array = array_intersect($slo_array4, $slo_array);\n\n }\n\n elseif (count($tags) == 5) {\n\n // Get the slo ids using the 1st tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[0]);\n while ($row = db_fetch_array($result)) {\n $slo_array1[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 2nd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[1]);\n while ($row = db_fetch_array($result)) {\n $slo_array2[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 3rd tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[2]);\n while ($row = db_fetch_array($result)) {\n $slo_array3[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 4th tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[3]);\n while ($row = db_fetch_array($result)) {\n $slo_array4[] = $row['slo_id'];\n }\n\n // Get the slo ids using the 5th tag\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d\", $tags[4]);\n while ($row = db_fetch_array($result)) {\n $slo_array5[] = $row['slo_id'];\n }\n\n $slo_array = array_intersect($slo_array1, $slo_array2);\n $slo_array = array_intersect($slo_array3, $slo_array);\n $slo_array = array_intersect($slo_array4, $slo_array);\n $slo_array = array_intersect($slo_array5, $slo_array);\n\n }\n\n // Get the SLO's from the selected array\n if ($sort_type == 'alpha') {\n\n foreach ($slo_array as $sid) {\n $selected_slos[$sid] = $page_outcomes[$sid]['slo_text'];\n }\n\n asort($selected_slos);\n\n }\n else {\n\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'id=%d'));\n\n $result = db_query(\"SELECT * FROM {dae_slo} WHERE \" . $slo_placeholders . \" ORDER BY slo_rank ASC, slo_text ASC\", $slo_array);\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['id']] = $row['slo_text'] . ' <small>(' . $row['slo_rank'] . ')</small>';\n }\n\n }\n\n }\n else {\n\n // Use the $slo array created earlier\n if ($sort_type == 'alpha') {\n\n foreach ($slo_array as $sid) {\n $selected_slos[$sid] = $page_outcomes[$sid]['slo_text'];\n }\n\n asort($selected_slos);\n\n }\n else {\n\n $slo_placeholders = implode(' OR ', array_fill(0, count($slo_array), 'id=%d'));\n\n $result = db_query(\"SELECT * FROM {dae_slo} WHERE \" . $slo_placeholders . \" ORDER BY slo_rank ASC, slo_text ASC\", $slo_array);\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['id']] = $row['slo_text'] . ' <small>(' . $row['slo_rank'] . ')</small>';\n }\n\n }\n\n }\n\n }\n else {\n\n // Make a list of every slo as a checkbox\n if ($param[0] == 'alpha') {\n\n $result = db_query(\"SELECT id, slo_text FROM {dae_slo} ORDER BY slo_text\");\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['id']] = $row['slo_text'];\n }\n\n }\n else {\n\n $result = db_query(\"SELECT * FROM {dae_slo} ORDER BY slo_rank ASC, slo_text ASC\");\n while ($row = db_fetch_array($result)) {\n $selected_slos[$row['id']] = $row['slo_text'] . ' <small>(' . $row['slo_rank'] . ')</small>';\n }\n\n }\n\n }\n\n // When all the SLOs are selected it may be a long list. Here we can\n // display the function buttons at the top as well as the bottom.\n // Only show the top select buttons if there are no tags selected or\n // there are more than 10 learning outcomes displayed.\n if (!$hide_info) {\n\n if (!$tags || (count($selected_slos) >= 14)) {\n\n $form['button-merge-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Merge'),\n );\n\n $form['button-delete-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n );\n\n $form['button-split-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Split'),\n );\n\n $form['button-tag-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Tag'),\n );\n\n // If a tag is selected the user may\n // now remove muliple tags from the\n // checked learning outcomes.\n if ($param[0] == 'selected') {\n\n $form['remove-multiple-bot'] = array(\n '#type' => 'submit',\n '#value' => t('Remove Multiple Tags'),\n );\n\n }\n\n }\n\n }\n\n $form['checkboxes'] = array(\n '#type' => 'checkboxes',\n '#options' => $selected_slos,\n );\n\n if ($selected_slos) {\n\n $form['button-merge-top'] = array(\n '#type' => 'submit',\n '#value' => t('Merge'),\n );\n\n $form['button-delete-top'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n );\n\n $form['button-split-top'] = array(\n '#type' => 'submit',\n '#value' => t('Split'),\n );\n\n $form['button-tag-top'] = array(\n '#type' => 'submit',\n '#value' => t('Tag'),\n );\n\n if ($param[0] == 'selected') {\n\n $form['remove-multiple-top'] = array(\n '#type' => 'submit',\n '#value' => t('Remove Muliple Tags'),\n );\n\n // Pass hidden tags to the submit function. Create\n // a list of tag ids delimited by an underscore.\n if (is_array($tags)) {\n $form['tag_list'] = array( '#type' => 'value', '#value' => implode('_', $tags) );\n }\n else {\n $form['tag_list'] = array( '#type' => 'value', '#value' => $tags );\n }\n\n }\n\n }\n\n }\n\n //////////////////////////////////////////////////////////////////////////\n //////////////////////////////////////////////////////////////////////////\n //// ////////////////////////////////\n //// MANAGE STUDENT LEARNING OUTCOMES ////////////////////////////////\n //// ////////////////////////////////\n ////\n /// Linked from Browse Learning Outcomes, when $slo_id is numeric then\n // everything above is bypassed and we come to this last section of code.\n elseif (is_numeric($param[0])) {\n\n // Include the pages JavaScript file.\n drupal_add_js(drupal_get_path('module', 'daedalus') . '/javascript/daedalus_manage_outcomes.js');\n\n $selected_slo_text = $page_outcomes[$selected_slo_id]['slo_text'];\n\n // Get the course information once, so there\n // is no need for multiple database accesses\n // throughout the script.\n $page_courses = array();\n $result = db_query(\"SELECT * FROM {dae_course}\");\n while ($row = db_fetch_array($result)) {\n $page_courses[$row['id']]['course_code'] = $row['course_code'];\n $page_courses[$row['id']]['course_number'] = $row['course_number'];\n $page_courses[$row['id']]['course_name'] = $row['course_name'];\n $page_courses[$row['id']]['course'] = $row['course'];\n $page_courses[$row['id']]['mapped'] = $row['mapped'];\n $page_courses[$row['id']]['viewable'] = $row['viewable'];\n }\n\n // Get the access arguments\n $build_outcomes_access = user_access('daedalus build learning outcomes');\n $delete_slo_access = user_access('daedalus delete slo');\n $manage_access = user_access('daedalus manage');\n\n // Set the title\n drupal_set_title(t('@slo !help', array('@slo' => html_entity_decode($selected_slo_text), '!help' => $show_help)));\n\n // Set form weights\n $weight['core'] = -10;\n $weight['suggest'] = 0;\n $weight['prereq'] = 10;\n $weight['postreq'] = 20;\n $weight['covering'] = 30;\n $weight['tags'] = 40;\n $weight['taughtrev'] = 50;\n $weight['prereqrev'] = 60;\n $weight['covercomm'] = 70;\n\n ////////////////////////////////////////////////////////////////////////////\n // Core Settings\n ////////////////////////////////////////////////////////////////////////////\n\n if ($build_outcomes_access) {\n\n $form['tags']['new_tags'] = array(\n '#type' => 'textfield',\n '#title' => t('Enter new tags'),\n '#autocomplete_path' => 'autocomp/tag',\n '#description' => '[<a class=\"show-tag-help\">' . t('info') . '</a>]',\n );\n\n $form['core'] = array(\n '#type' => 'fieldset',\n '#title' => t('Core Settings'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#required' => TRUE,\n '#weight' => $weight['core'],\n );\n\n $form['core']['slo_text'] = array(\n '#title' => t('Learning Outcome Text'),\n '#type' => 'textarea',\n '#required' => TRUE,\n '#default_value' => html_entity_decode($selected_slo_text),\n '#rows' => 2,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Prerequisite Learning Outcomes\n ////////////////////////////////////////////////////////////////////////////\n\n $prereq_slos = $preslo_ids = array();\n\n $result = db_query(\"SELECT pre_slo FROM {dae_prereq_slo} WHERE target = %d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n\n $prereq_slos[$row['pre_slo']] = $page_outcomes[$row['pre_slo']]['slo_text'];\n\n // An array to compare against the suggested slos.\n $preslo_ids[] = $row['pre_slo'];\n\n }\n\n natsort($prereq_slos);\n $prereqs_display = '';\n\n foreach ($prereq_slos as $id => $text) {\n\n $prereqs_display .= '<li>';\n $course_display = ''; // Reset the course display\n\n // Add each course where the assumed learning outcome is taught.\n $result = db_query(\"SELECT course_id FROM {dae_course_slo} WHERE slo_id=%d\", $id);\n while ($row = db_fetch_array($result)) {\n\n // Get the course and split this value to from\n // the url parameter for viewing the course.\n $url = $course_url . '/' . str_replace(' ', '/', $page_courses[$row['course_id']]['course']);\n\n $course_display .= '[<a href=\"' . $url . '\">' . $page_courses[$row['course_id']]['course'] . '</a>] '; // Leave the space at the end.\n\n }\n\n // Display the rank for users that have\n // build access, admin and builder type.\n if ($build_access) {\n $prereqs_display .= '<a href=\"' . $page_url . '/' . $id .'\">' . $text . '</a> <small><small> ' . $course_display . '(' . $page_outcomes[$id]['slo_rank'] . ')</small></small> ';\n }\n else {\n $prereqs_display .= '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '</small></small> ';\n }\n\n // Link to delete relationship\n if ($delete_slo_access) {\n\n // Do not wrap this message with the t()\n // this is displayed through JavaScript.\n $message = 'Are you sure you want to remove the prerequisite learning outcome \\'' . $text . '\\'?';\n\n $slo_url = $page_url . '/' . $param[0] . '/delete/prereq/' . $id;\n\n $prereqs_display .= '<a href=\"' . $slo_url . '\" class=\"removable\" message=\"' . $message . '\"><strong>delete</strong></a>';\n\n }\n\n $prereqs_display .= '</li>';\n\n }\n\n // Notify if no matches were found.\n if (!$prereqs_display) {\n $prereqs_display = '<li><i>' . t('No matches found') . '</i></li>';\n $prereqs_flag = TRUE;\n }\n\n if (!$prereqs_flag || $manage_access) {\n\n $form['prereq'] = array(\n '#type' => 'fieldset',\n '#title' => t('Prerequiste Learning Outcomes'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#description' => '&nbsp;&nbsp;&nbsp; ' . t('What the student is assumed to know before learning this outcome.'),\n '#weight' => $weight['prereq'],\n );\n\n $form['prereq'][] = array(\n '#type' => 'item',\n '#value' => '<ul>' . $prereqs_display . '</ul>',\n '#weight' => $weight['prereq']-3,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Postrequisite Learning Outcomes (Why do I need to know that?)\n ////////////////////////////////////////////////////////////////////////////\n\n $postreq_slos = array();\n\n $result = db_query(\"SELECT target FROM {dae_prereq_slo} WHERE pre_slo = %d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $postreq_slos[$row['target']] = $page_outcomes[$row['target']]['slo_text'];\n }\n\n natsort($postreq_slos);\n $postreqs_display = '';\n\n foreach ($postreq_slos as $id => $text) {\n\n $postreqs_display .= '<li>';\n $course_display = ''; // Reset the course display\n\n // Add each course where the assumed learning outcome is taught.\n $result = db_query(\"SELECT course_id FROM {dae_course_slo} WHERE slo_id=%d\", $id);\n while ($row = db_fetch_array($result)) {\n\n // Get the course and split this value to from\n // the url parameter for viewing the course.\n $url = $course_url . '/' . str_replace(' ', '/', $page_courses[$row['course_id']]['course']);\n\n $course_display .= '[<a href=\"' . $url . '\">' . $page_courses[$row['course_id']]['course'] . '</a>] ';\n\n }\n\n if ($build_access) {\n $postreqs_display .= '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '(' . $page_outcomes[$id]['slo_rank'] . ')</small></small></li>';\n }\n else {\n $postreqs_display .= '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '</small></small></li>';\n }\n\n }\n\n // Notify if no matches were found.\n if (!$postreqs_display) {\n $postreqs_display = '<li><i>' . t('No matches found') . '</i></li>';\n $postreqs_flag = TRUE;\n }\n\n // Only display the postrequisite SLOs\n // if there are some to display.\n if (!$postreqs_flag) {\n\n $form['postreq'] = array(\n '#type' => 'fieldset',\n '#title' => t('Why do I need to know that?'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#description' => '&nbsp;&nbsp;&nbsp; ' . t('These are the student\n learning outcome(s) that directly require this student learning outcome.'),\n '#weight' => $weight['postreq'],\n );\n\n $form['postreq'][] = array(\n '#type' => 'item',\n '#value' => '<ul>' . $postreqs_display . '</ul>',\n '#weight' => $weight['postreq']-3,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Courses Covering This Learning Outcome\n ////////////////////////////////////////////////////////////////////////////\n\n $courses_covering = array(); $prereq_courses = array();\n\n $result = db_query(\"SELECT course_id FROM {dae_course_slo} WHERE slo_id = %d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $courses_covering[$row['course_id']] = $page_courses[$row['course_id']]['course'];\n }\n\n natsort($courses_covering);\n $covering_display = '';\n\n // List of courses covering\n foreach ($courses_covering as $id => $text) {\n\n $covering_display .= '<li>';\n\n // Seperate the string to get the course\n // code[0] and number[1] for the URL.\n $course_info = explode(' ', $text);\n\n // Make the url for editing the course\n $course_edit_url = $base_url . '/' . $page_settings['manage courses'] . '/' . $course_info[0] . '/' . $course_info[1];\n\n $covering_display .= '<a href=\"' . $course_edit_url . '\">' . $text . '</a>';\n\n // If user has permission to delete links, the link to delete the relationship should be visible\n if ($delete_slo_access) {\n\n // Do not wrap this message with the t()\n // this is displayed through JavaScript.\n $message = 'Are you sure you no longer want \\'' . $text . '\\' to cover this learning outcome?';\n\n $url = $page_url . '/' . $param[0] . '/delete/covering/' . $id;\n\n $covering_display .= ' - <a href=\"' . $url . '\" class=\"removable\" message=\"' . $message . '\"><strong>delete</strong></a>';\n\n }\n\n $covering_display .= '</li>';\n\n // Retrieve the the prereq course information to determine\n // the suggested learning outcome later in the script.\n $result = db_query(\"SELECT prereq_id FROM {dae_prereq_course} WHERE course_id=%d\", $id);\n while ($row = db_fetch_array($result)) {\n $prereq_courses[$row['prereq_id']] = $row['prereq_id'];\n }\n\n }\n\n // Notify that no matches were found.\n if (!$covering_display) {\n $covering_display = '<li><i>' . t('No matches found') . '</i></li>';\n $covering_flag = 1;\n }\n\n if (!$covering_flag || $manage_access) {\n\n $form['covering'] = array(\n '#type' => 'fieldset',\n '#title' => t('Courses Covering This Learning Outcome'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#weight' => $weight['covering'],\n );\n\n $form['covering'][] = array(\n '#type' => 'item',\n '#value' => '<ul>' . $covering_display . '</ul>',\n '#weight' => $weight['covering']-1,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Courses Covering && Prerequisite Learning Outcome Textfields\n ////////////////////////////////////////////////////////////////////////////\n\n if ($build_outcomes_access) {\n\n for ($i = 0; $i < $page_settings['autocomplete iteration']; $i++) {\n\n // The settings for the first will be\n // different for all the remaining.\n if ($i == 0) {\n\n // Not hidden\n $ishid_prereq = $ishid_covering = 'no';\n\n // Singular opening titles\n $prereq_title = t('Prerequisite learning outcome');\n $covering_title = t('Course covering learning outcome');\n\n $prereq_description = '[<a class=\"show-preslo-help\">' . t('info') . '</a>]';\n\n }\n else {\n\n // See if the textfield is hidden\n if ($show_prereq[$i] == TRUE) {\n $ishid_prereq = 'no';\n }\n else {\n $ishid_prereq = 'yes';\n }\n\n if ($show_covering[$i] == TRUE) {\n $ishid_covering = 'no';\n }\n else {\n $ishid_covering = 'yes';\n }\n\n // Hidden field titles with iteration number.\n // If each text field is to be be titled or not.\n if ($page_settings['title each autocomplete textfield']) {\n $prereq_title = '<small>' . t('Prerequisite learning outcome') . ' (' . ($i+1) . ')</small>';\n $covering_title = '<small>' . t('Course covering learning outcome') . ' (' . ($i+1) . ')</small>';\n }\n else {\n $prereq_title = $covering_title = '';\n }\n\n $prereq_description = '';\n\n }\n\n $form['prereq'][\"prereq_$i\"] = array(\n '#type' => 'textfield',\n '#title' => $prereq_title,\n '#maxlength' => 255,\n '#size' => 115,\n '#description' => $prereq_description,\n '#prefix' => '<div class=\"hide-prereq-slo\" is_hidden=\"' . $ishid_prereq . '\"><blockquote>',\n '#suffix' => '</blockquote></div>',\n '#autocomplete_path' => 'autocomp/slo',\n '#weight' => $weight['prereq']+($i/1000),\n );\n\n $form['covering'][\"covering_$i\"] = array(\n '#type' => 'textfield',\n '#title' => $covering_title,\n '#autocomplete_path' => 'autocomp/course',\n '#prefix' => '<div class=\"hide-covering-course\" is_hidden=\"' . $ishid_covering . '\"><blockquote>',\n '#suffix' => '</blockquote></div>',\n '#weight' => $weight['covering'] + ($i/1000),\n );\n\n // Make the buttons that will unhide 1 hidden textfield\n // at the end of the textfields. (as per javascript)\n if ($i == ($page_settings['autocomplete iteration'] - 1)) {\n\n $form['prereq'][] = array(\n '#type' => 'item',\n '#value' => '<input type=\"submit\" class=\"add-prereq-slo add-another\" value=\"Add another\">',\n '#weight' => $weight['prereq'] + 1,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n $form['covering'][] = array(\n '#type' => 'item',\n '#value' => '<input type=\"submit\" class=\"add-covering-course add-another\" value=\"Add another\">',\n '#weight' => $weight['covering']+1,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n }\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Tags\n ////////////////////////////////////////////////////////////////////////////\n\n $current_tags = array();\n\n //generate a list of current tags\n $result = db_query(\"SELECT DISTINCT tag_id FROM {dae_slo_tag} WHERE slo_id = %d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $current_tags[$row['tag_id']] = db_result(db_query(\"SELECT tag_label FROM {dae_tag} WHERE id = %d\", $row['tag_id']));\n }\n\n natsort($current_tags);\n $tags_display = '';\n\n foreach ($current_tags as $tid => $label) {\n\n // Add the tag capitalized.\n $tags_display .= '<li>' . ucwords($label);\n\n // Give link to delete relationship\n if ($delete_slo_access) {\n\n // Do not wrap this message with the t()\n // this is displayed through JavaScript.\n $message = 'Are you sure you want to remove the tag \\'' . $label . '\\' from this learning outcome?';\n\n $url = $page_url . '/' . $param[0] . '/delete/tag/' . $tid;\n\n $tags_display .= ' - <a href=\"' . $url . '\" class=\"removable\" message=\"' . $message . '\"><strong>' . t('delete') . '</strong></a>';\n\n }\n\n $tags_display .= '</li>';\n\n }\n\n // Notify if no matches were found\n if (!$tags_display) {\n $tags_display = '<li><i>' . t('No matches found') . '</i></li>';\n $currtag_flag = TRUE;\n }\n\n if ($build_outcomes_access) {\n\n if (!$currtag_flag || $manage_access) {\n $form['tags'] = array(\n '#type' => 'fieldset',\n '#title' => t('Tags'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#weight' => $weight['tags'],\n );\n\n $form['tags'][] = array(\n '#type' => 'item',\n '#value' => '<ul>' . $tags_display . '</ul>',\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n }\n\n $form['tags']['new_tags'] = array(\n '#type' => 'textfield',\n '#title' => t('Tags'),\n '#description' => '[<a class=\"show-tag-help\">' . t('info') . '</a>]',\n '#weight' => $weight['tags'],\n '#cols' => 2,\n '#autocomplete_path' => 'autocomp/tag',\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote><br />',\n );\n }\n\n // At this point if all the flags are TRUE then a user will see nothing\n // when selecting a learning outcome. Create a message informing the\n // user that there are no prerequiste courses or SLOS\n if ($covering_flag && $prereqs_flag && $postreqs_flag && $currtag_flag && !$manage_access) {\n\n $form[] = array(\n '#type' => 'item',\n '#value' => '<ul><li><i>' . t('This learning outcome has not been assigned any values.') . '</i></li></ul>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Suggested Prerequisite Learning Outcomes\n ////////////////////////////////////////////////////////////////////////////\n\n // Set the user access to\n // view suggested outcomes.\n if ($manage_access) {\n\n $suggested_slos = array(); $suggested_outcomes = array(); $suggest_array = array();\n//COMBINE INTO MYSQL JOIN....\n if ($prereq_courses) {\n\n foreach ($prereq_courses as $id) {\n\n $result = db_query(\"SELECT slo_id FROM {dae_course_slo} WHERE course_id=%d AND slo_id <> %d\", $id, $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $suggested_slos[$row['slo_id']] = $row['slo_id'];\n }\n\n }\n\n }\n\n if ($current_tags) {\n\n foreach ($current_tags as $tid => $label) {\n\n $result = db_query(\"SELECT slo_id FROM {dae_slo_tag} WHERE tag_id=%d AND slo_id <> %d\", $tid, $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $suggested_slos[$row['slo_id']] = $row['slo_id'];\n }\n\n }\n\n }\n\n if (count($suggested_slos)) {\n\n // Remove any duplicates that are already prereq SLOs.\n $suggested_slos = array_diff($suggested_slos, $preslo_ids);\n\n // Count the SLOs again as the all may have\n // been removed with the array_diff execution.\n if (count($suggested_slos)) {\n\n sort($suggested_slos);\n\n $suggested_slo_placeholders = implode(' OR ', array_fill(0, count($suggested_slos), 'id=%d'));\n\n // The formatting of this query is important, make\n // sure there is a space between the WHERE and ORDER.\n // If the space is removed it will run into the placeholder.\n $result = db_query(\"SELECT id, slo_text\n FROM {dae_slo}\n WHERE \" . $suggested_slo_placeholders .\n \" ORDER BY slo_rank ASC, slo_text ASC\", $suggested_slos);\n while ($row = db_fetch_array($result)) {\n $suggested_outcomes[$row['id']] = $row['slo_text'];\n }\n\n foreach ($suggested_outcomes as $id => $text) {\n\n // reset the course display\n $course_display = '';\n\n // Add each course where the assumed learning outcome is taught.\n $result = db_query(\"SELECT course_id FROM {dae_course_slo} WHERE slo_id=%d\", $id);\n while ($row = db_fetch_array($result)) {\n\n // Get the course and split this value to from\n // the url parameter for viewing the course.\n $url = $course_url . '/' . str_replace(' ', '/', $page_courses[$row['course_id']]['course']);\n\n $course_display .= '[<a href=\"' . $url . '\">' . $page_courses[$row['course_id']]['course'] . '</a>] ';\n\n }\n\n if ($build_access) {\n $suggest_array[$id] = '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '(' . $page_outcomes[$id]['slo_rank'] . ')</small></small>';\n }\n else {\n $suggest_array[$id] = '<a href=\"' . $page_url . '/' . $id . '\">' . $text . '</a> <small><small> ' . $course_display . '</small></small>';\n }\n\n }\n\n $form['suggest'] = array(\n '#type' => 'fieldset',\n '#title' => t('Suggested Prerequiste Learning Outcomes'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#weight' => $weight['suggest'],\n );\n\n $form['suggest']['suggestboxes'] = array(\n '#type' => 'checkboxes',\n '#options' => $suggest_array,\n '#weight' => $weight['suggest']-3,\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n $form['suggest']['submit-slo-suggestions'] = array(\n '#type' => 'submit',\n '#value' => t('Save suggestions'),\n '#weight' => $weight['suggest']-1,\n '#prefix' => '<br /><blockquote>',\n '#suffix' => '</blockquote><br /><br />',\n );\n\n }\n\n }\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Term Reviews Rating this Learning Outcome as Taught\n ////////////////////////////////////////////////////////////////////////////\n if (user_access('daedalus browse term reviews')) {\n\n // Table heading for the Term Review dropdowns.\n $table_header = '<table>\n <tr>\n <th><b>' . t('Ranking') . '</b></th>\n <th><b>' . t('Course') . '</b></th>\n <th><b>' . t('Instructor') . '</b></th>\n <th><b>' . t('Term') . '</b></th>\n <th><b>' . t('Academic Year') . '</b></th>\n </tr>';\n\n $review_info = array();\n $result = db_query(\"SELECT term_review_form_id FROM {dae_term_review_ratings} WHERE slo=%d AND type='taught'\", $selected_slo_id);\n\n while ($row = db_fetch_array($result)) {\n $review_info[$row['term_review_form_id']] = db_result(db_query(\"SELECT year FROM {dae_term_review_form} WHERE id=%d\", $row['term_review_form_id']));\n }\n\n // This function sorts an array such that array indices maintain their correlation\n // with the array elements they are associated with. This is used mainly when\n // sorting associative arrays where the actual element order is significant.\n asort($review_info);\n\n if ($review_info) {\n\n $review_list = $table_header;\n\n $form['taughtrev'] = array(\n '#type' => 'fieldset',\n '#title' => '&nbsp;&nbsp;&nbsp; ' . t('Term Reviews Rating this Learning Outcome as Taught'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#weight' => $weight['taughtrev'],\n );\n\n // Foreach term Review ID\n foreach ($review_info as $rid => $year) {\n\n // Calculate the Average Coverage Rating for each Term Review.\n $result = db_query(\"SELECT rating FROM {dae_term_review_ratings} WHERE term_review_form_id=%d\", $rid);\n $i = 0;\n $total = 0;\n\n while ($row = db_fetch_array($result)) {\n $total += $row['rating'];\n $i++;\n }\n\n if ($i == 0) {\n $rating = '<img src=\"' . $question2_src . '\" alt=\"?\" />';\n }\n elseif (round($total / $i) >= 1) {\n $rating = '<img src=\"' . $check_src . '\" alt=\"?\" />';\n }\n else {\n $rating = '<img src=\"' . $exclamation_src . '\" alt=\"!\" />';\n }\n\n // Display Extra Review Information\n $extra_info = db_fetch_array(db_query(\"SELECT course, instructor, term FROM {dae_term_review_form} WHERE id=%d\", $rid));\n $course_id = $extra_info['course'];\n $instructor = $extra_info['instructor'];\n $term = $extra_info['term'];\n\n $course = $page_courses[$course_id]['course'] . ' - ' . $page_courses[$course_id]['course_name'];\n\n $url = $base_url . '/' . $page_settings['manage term reviews'] . '/' . $rid;\n\n $disp_course = '<a href=\"' . $url . '\">' . ucwords($course) . '</a>';\n\n $review_list .= \"<tr>\n <th>\" . $rating . \"</th>\n <th>\" . $disp_course . \"</th>\n <th>\" . $instructor . \"</th>\n <th>\" . $term . \"</th>\n <th>\" . $year . \"/\" . ($year+1) . \"</th>\n </tr>\";\n }\n\n $form['taughtrev'][] = array(\n '#type' => 'item',\n '#value' => $review_list . '</table>',\n '#weight' => $weight['taughtrev'],\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Term Reviews Rating this Learning Outcome as Prerequisite\n ////////////////////////////////////////////////////////////////////////////\n $review_info = array();\n $result = db_query(\"SELECT term_review_form_id FROM {dae_term_review_ratings} WHERE slo=%d AND type='prereq'\", $selected_slo_id);\n\n while ($row = db_fetch_array($result)) {\n $review_info[$row['term_review_form_id']] = db_result(db_query(\"SELECT year FROM {dae_term_review_form} WHERE id=%d\", $row['term_review_form_id']));\n }\n\n asort($review_info );\n\n if ($review_info) {\n\n $review_list = $table_header;\n\n $form['prereqrev'] = array(\n '#type' => 'fieldset',\n '#title' => '&nbsp;&nbsp;&nbsp; ' . t('Term Reviews Rating this Learning Outcome as a Prerequisite'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#weight' => $weight['prereqrev'],\n );\n\n // Foreach term Review ID and Year\n foreach ($review_info as $rid => $year) {\n\n $i = $total = 0;\n\n // Calculate the Average Coverage Rating for each Term Review\n $result = db_query(\"SELECT rating FROM {dae_term_review_ratings} WHERE term_review_form_id=%d\", $rid);\n while ($row = db_fetch_array($result)) {\n $total += $row['rating'];\n $i++;\n }\n\n if ($i == 0) {\n $rating = '<img src=\"' . $question2_src . '\" alt=\"?\" />';\n }\n elseif (round($total / $i) >= 1) {\n $rating = '<img src=\"' . $check_src . '\" alt=\"?\" />';\n }\n else {\n $rating = '<img src=\"' . $exclamation_src . '\" alt=\"!\" />';\n }\n\n // Display Extra Review Information\n $extra_info = db_fetch_array(db_query(\"SELECT course, instructor, term FROM {dae_term_review_form} WHERE id=%d\", $rid));\n $course_id = $extra_info['course'];\n $instructor = $extra_info['instructor'];\n $term = $extra_info['term'];\n\n $course = $page_courses[$course_id]['course'] . ' - ' . $page_courses[$course_id]['course_name'];\n\n $url = $base_url . '/' . $page_settings['manage term reviews'] . '/' . $rid;\n\n $disp_course = '<a href=\"' . $url . '\">' . ucwords($course) . '</a>';\n\n $review_list .= \"<tr>\n <th>\" . $rating . \"</th>\n <th>\" . $disp_course . \"</th>\n <th>\" . $instructor . \"</th>\n <th>\" . $term . \"</th>\n <th>\" . $year . \"/\" . ($year+1) . \"</th>\n </tr>\";\n }\n\n $form['prereqrev'][] = array(\n '#type' => 'item',\n '#value' => $review_list . '</table>',\n '#weight' => $weight['prereqrev'],\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Average Coverage Rating and Comments\n ////////////////////////////////////////////////////////////////////////////\n\n $act_total = $max_total = 0;\n\n // Calculate the Average Coverage Rating for the Term Reviews\n $result = db_query(\"SELECT rating FROM {dae_term_review_ratings} WHERE slo=%d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $act_total += $row['rating'];\n $max_total += 2;\n }\n\n if ($max_total > 0) {\n\n $avg_cover = round( ( ($act_total / $max_total) * 100 ), 2 ) . '%';\n\n $form['covercomm'] = array(\n '#type' => 'fieldset',\n '#title' => '&nbsp;&nbsp;&nbsp; ' . t('Term Coverage Rating and Comments'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#weight' => $weight['covercomm'],\n );\n\n $form['covercomm'][] = array(\n '#title' => t('Average Coverage Rating'),\n '#value' => t($avg_cover),\n '#type' => 'item',\n '#weight' => $weight['covercomm'],\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n $review_info = array();\n $result = db_query(\"SELECT term_review_form_id FROM {dae_term_review_ratings} WHERE slo=%d\", $selected_slo_id);\n while ($row = db_fetch_array($result)) {\n $review_info[$row['term_review_form_id']] = db_result(db_query(\"SELECT year FROM {dae_term_review_form} WHERE id=%d\", $row['term_review_form_id']));\n }\n\n asort($review_info);\n\n $review_comm = '<ul>';\n\n // Foreach term Review ID and Year\n foreach ($review_info as $rid => $year) {\n\n // Get SLO comments\n $comment = db_result(db_query(\"SELECT comment\n FROM {dae_term_review_ratings}\n WHERE term_review_form_id=%d\n AND slo=%d\", $rid, $selected_slo_id));\n\n if ($comment) {\n\n // Display Extra Review Information\n $review_row = db_fetch_array(db_query(\"SELECT course, term FROM {dae_term_review_form} WHERE id=%d\", $rid));\n $review_course_id = $reveiw_row['course'];\n $term = $review_row['term'];\n\n $url = $base_url . '/' . $page_settings['manage term reviews'] . '/' . $rid;\n\n $disp_comment = '<a href=\"' . $url . '\">' . ucwords($comment) . '</a>';\n\n $review_comm .= '<li>' . $disp_comment . ' &nbsp;&nbsp;&nbsp;&nbsp;(' . $year . '/' . ($year+1) . ' ' . $term . ' ' . $page_courses[$review_course_id]['course'] . ')';\n\n }\n\n }\n\n if ($review_comm == '<ul>') {\n $review_comm .= '<li>' . t('No matches found') . '</li></ul>';\n }\n else {\n $review_comm .= '</ul>';\n }\n\n $form['covercomm'][] = array(\n '#type' => 'item',\n '#title' => t('Term Review Learning Outcome Comments'),\n '#value' => $review_comm,\n '#weight' => $weight['covercomm'],\n '#prefix' => '<blockquote>',\n '#suffix' => '</blockquote>',\n );\n\n }\n\n }\n\n if ($build_outcomes_access) {\n\n $form['submit-slo-changes'] = array(\n '#type' => 'submit',\n '#value' => t('Update Learning Outcome'),\n '#weight' => max($weight)+50,\n );\n\n }\n\n if ($delete_slo_access) {\n\n $form['delete-slo'] = array(\n '#type' => 'submit',\n '#value' => t('Delete Learning Outcome'),\n '#weight' => max($weight)+51,\n );\n\n }\n\n // Lengthen the form when building to prevent the\n // tag autocomplete results from being cut off.\n if ($build_access) {\n\n $form[] = array(\n '#type' => 'item',\n '#value' => '<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />',\n '#weight' => max($weight) + 100,\n );\n\n }\n\n }\n\n // Submit hidden information to pass\n // to the validate and submit hooks.\n $form['pass-manage-learning-outcomes'] = array( '#type' => 'value', '#value' => $page_settings['manage learning outcomes'], );\n $form['pass-autocomplete-iteration'] = array( '#type' => 'value', '#value' => $page_settings['autocomplete iteration'], );\n $form['pass-tag-seperate-character'] = array( '#type' => 'value', '#value' => $page_settings['tag seperate character'], );\n $form['pass-tag-cloud-height-percent'] = array( '#type' => 'value', '#value' => $page_settings['tag cloud height percent'], );\n $form['pass-tag-cloud-max-font-size'] = array( '#type' => 'value', '#value' => $page_settings['tag cloud max font size'], );\n\n return $form;\n\n}", "public function run()\n {\n \n $dataArr= [\n [1, 3, 'Newspaper', 'Inform from Newspaper'],\n [2, 3, 'Online Marketing', 'Inform From Online Marketing'],\n [3, 3, 'Facebook', 'Inform From Facebook'],\n [4, 1, 'Admission', 'Admission Test'],\n [5, 1, 'Transfer Certificate', 'Transfer Certificate'],\n [6, 1, 'Re-Admission', 'Re-Admission'],\n [7, 1, 'Confirmation Inquiry', 'You give students a question, its answer and the method of reaching this answer. Their goal is to build investigation and critical-thinking skills, learning how the specific method works.'],\n [8, 1, 'Structured Inquiry', 'You give students an open question and an investigation method. They must use the method to craft an evidence-backed conclusion.'],\n [9, 1, 'Guided Inquiry', 'You give students an open question. Typically in groups, they design investigation methods to reach a conclusion.'],\n [10, 1, 'Open Inquiry', 'You give students time and support. They pose original questions that they investigate through their own methods, and eventually present their results to discuss and expand.'],\n [11, 2, 'General complaint', 'A student may submit a complaint regarding staff, faculty, or other student. Complainant must submit their concern via the preliminary complaint form.'],\n [12, 2, 'ADA grievance/accommodation', 'ADA grievance/accommodation'],\n [13, 2, 'Academic Misconduct allegation', 'A student should be informed of any academic misconduct allegation by their instructor.'],\n [14, 2, 'Sexual Assault', 'Sexual harassment is a serious problem for students at all educational levels.'],\n [15, 2, 'Domestic and Interpersonal Violence', 'Domestic and Interpersonal Violence'],\n [16, 2, 'Sexual Harassment, and Other Discrimination', 'Sexual Harassment, and Other Discrimination'],\n [17, 2, 'Appeals regarding grades and student conduct', 'A student may only appeal a capricious grade, or student conduct expulsion or suspension.'],\n [18, 4, 'Teacher', 'Reference by teacher'],\n [19, 4, 'Student', 'Student'],\n [20, 4, 'Institution Committee', 'Institution Committee']\n ];\n foreach ($dataArr as $data) { \n $store = new SmSetupAdmin();\n $store->id = $data[0];\n $store->type = $data[1];\n $store->name = $data[2];\n $store->description = $data[3]; \n $store->save();\n }\n\n\n\n }", "public function run()\n {\n //\n $courses = [\n [\n 'specialization_id' => '6',\n 'name' => 'Dasar Pemrograman',\n 'description' => '',\n ],\n [\n 'specialization_id' => '6',\n 'name' => 'Struktur Data',\n 'description' => '',\n ],\n [\n 'specialization_id' => '4',\n 'name' => 'Sistem Digital',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Pemrograman Berorientasi Objek',\n 'description' => '',\n ],\n [\n 'specialization_id' => '8',\n 'name' => 'Aljabar Linier',\n 'description' => '',\n ],\n [\n 'specialization_id' => '8',\n 'name' => 'Komputasi Numerik',\n 'description' => '',\n ],\n [\n 'specialization_id' => '8',\n 'name' => 'Matematika Diskrit ',\n 'description' => '',\n ],\n [\n 'specialization_id' => '4',\n 'name' => 'Organisasi Komputer ',\n 'description' => '',\n ],\n [\n 'specialization_id' => '7',\n 'name' => 'Sistem Basis Data',\n 'description' => '',\n ],\n [\n 'specialization_id' => '6',\n 'name' => 'Perancangan dan Analisis Algoritma',\n 'description' => '',\n ],\n [\n 'specialization_id' => '4',\n 'name' => 'Sistem Operasi',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Kecerdasan Buatan',\n 'description' => '',\n ],\n [\n 'specialization_id' => '7',\n 'name' => 'Manajemen Basis Data',\n 'description' => '',\n ],\n [\n 'specialization_id' => '8',\n 'name' => 'Probabilitas dan Statistik',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Analisis dan Perancangan Sistem Informasi',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Perancangan Perangkat Lunak',\n 'description' => '',\n ],\n [\n 'specialization_id' => '5',\n 'name' => 'Grafika Komputer',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Kecerdasan Komputasional',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Pemrograman Web',\n 'description' => '',\n ],\n [\n 'specialization_id' => '4',\n 'name' => 'Jaringan Komputer',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Manajemen Proyek Perangkat Lunak',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Interaksi Manusia dan Komputer',\n 'description' => '',\n ],\n [\n 'specialization_id' => '2',\n 'name' => 'Pemrograman Jaringan',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Rekayasa Kebutuhan',\n 'description' => '',\n ],\n [\n 'specialization_id' => '8',\n 'name' => 'Teori Graf dan Otomata',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Pemrograman Berbasis Kerangka Kerja',\n 'description' => '',\n ],\n [\n 'specialization_id' => '2',\n 'name' => 'Keamanan Informasi dan Jaringan',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Pemorgraman Perangkat Bergerak',\n 'description' => '',\n ],\n [\n 'specialization_id' => '6',\n 'name' => 'Pengembangan Analisis Algoritma',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Pemrograman Berbasis Antarmuka',\n 'description' => '',\n ],\n [\n 'specialization_id' => '4',\n 'name' => 'Jaringan Nirkabel',\n 'description' => '',\n ],\n [\n 'specialization_id' => '4',\n 'name' => 'Teknologi antar Jaringan',\n 'description' => '',\n ],\n [\n 'specialization_id' => '4',\n 'name' => 'Perancangan Keamanan Sistem dan Jaringan',\n 'description' => '',\n ],\n [\n 'specialization_id' => '4',\n 'name' => 'Teknologi IoT',\n 'description' => '',\n ],\n [\n 'specialization_id' => '8',\n 'name' => 'Pemodelan dan Simulasi',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Analisis Data Multivariat',\n 'description' => '',\n ],\n [\n 'specialization_id' => '8',\n 'name' => 'Riset Operasi',\n 'description' => '',\n ],\n [\n 'specialization_id' => '5',\n 'name' => 'Teknik Pengembangan Game',\n 'description' => '',\n ],\n [\n 'specialization_id' => '5',\n 'name' => 'Realitas Virtual dan Augmentasi',\n 'description' => '',\n ],\n [\n 'specialization_id' => '5',\n 'name' => 'Sistem Game',\n 'description' => '',\n ],\n [\n 'specialization_id' => '5',\n 'name' => 'Animasi Komputer dan Pemodelan 3D',\n 'description' => '',\n ],\n [\n 'specialization_id' => '5',\n 'name' => 'Game Cerdas',\n 'description' => '',\n ],\n [\n 'specialization_id' => '5',\n 'name' => 'Jaringan Multimedia',\n 'description' => '',\n ],\n [\n 'specialization_id' => '2',\n 'name' => 'Komputasi Awan',\n 'description' => '',\n ],\n [\n 'specialization_id' => '2',\n 'name' => 'Komputasi Bergerak',\n 'description' => '',\n ],\n [\n 'specialization_id' => '2',\n 'name' => 'Sistem Terdistribusi',\n 'description' => '',\n ],\n [\n 'specialization_id' => '2',\n 'name' => 'Forensik Digital',\n 'description' => '',\n ],\n [\n 'specialization_id' => '2',\n 'name' => 'Komputasi Grid dan Paralel',\n 'description' => '',\n ],\n [\n 'specialization_id' => '2',\n 'name' => 'Komputasi Pervasif dan Jaringan Sensor',\n 'description' => '',\n ],\n [\n 'specialization_id' => '2',\n 'name' => 'Kompresi Data',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Data Mining',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Pengolahan Citra Digital',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Komputasi Biomedik',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Robotika',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Sistem Temu Kembali Informasi',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Visi Komputer',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Analisis Jejaring Sosial ',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Deep Learning',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Sistem Enterprise',\n 'description' => '',\n ],\n [\n 'specialization_id' => '7',\n 'name' => 'Rekayasa Pengetahuan',\n 'description' => '',\n ],\n [\n 'specialization_id' => '7',\n 'name' => 'Audit Sistem',\n 'description' => '',\n ],\n [\n 'specialization_id' => '7',\n 'name' => 'Tata Kelola Teknologi Informasi ',\n 'description' => '',\n ],\n [\n 'specialization_id' => '7',\n 'name' => 'Basis Data Terdistribusi',\n 'description' => '',\n ],\n [\n 'specialization_id' => '7',\n 'name' => 'Big Data',\n 'description' => '',\n ],\n [\n 'specialization_id' => '7',\n 'name' => 'Sistem Informasi Geografis',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Arsitektur Perangkat Lunak',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Penjaminan Mutu Perangkat Lunak',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Evolusi Perangkat Lunak',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Konstruksi Perangkat Lunak',\n 'description' => '',\n ],\n [\n 'specialization_id' => '1',\n 'name' => 'Pengantar Logika dan Pemrograman',\n 'description' => '',\n ],\n [\n 'specialization_id' => '7',\n 'name' => 'Pengantar Teknologi Basis Data',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Pengantar Proses Mining',\n 'description' => '',\n ],\n [\n 'specialization_id' => '5',\n 'name' => 'Pengantar Pengembangan Game',\n 'description' => '',\n ],\n [\n 'specialization_id' => '3',\n 'name' => 'Pengantar Sistem Cerdas',\n 'description' => '',\n ],\n ];\n DB::table('courses')->insert($courses);\n }", "function mfcs_get_reviewer_decision_list_options($option = NULL, $restriction = 0, $hidden = FALSE, $disabled = FALSE) {\n $options = array();\n $options_all = array();\n\n if ($hidden) {\n $options_all[MFCS_REVIEW_DECISION_NONE] = 'None';\n $options_all[MFCS_REVIEW_DECISION_CLOSE] = 'Close';\n $options_all[MFCS_REVIEW_DECISION_CANCEL] = 'Cancel';\n $options_all[MFCS_REVIEW_DECISION_UNCANCEL] = 'Uncancel';\n $options_all[MFCS_REVIEW_DECISION_REASSIGN_COORDINATOR] = 'Re-Assign Venue Coordinator';\n $options_all[MFCS_REVIEW_DECISION_OVERRIDE] = 'Override';\n $options_all[MFCS_REVIEW_DECISION_MOVE] = 'Move';\n $options_all[MFCS_REVIEW_DECISION_REASSIGN_REQUESTER] = 'Re-Assign Requester';\n $options_all[MFCS_REVIEW_DECISION_MANAGER_RECHECK] = 'Manager Recheck';\n $options_all[MFCS_REVIEW_DECISION_AMENDMENT] = 'Amendment';\n }\n\n if ($disabled) {\n $options_all[MFCS_REVIEW_DECISION_WAIVE] = 'Waive';\n }\n\n $options_all[MFCS_REVIEW_DECISION_APPROVE] = 'Approve';\n $options_all[MFCS_REVIEW_DECISION_COMMENT] = 'Comment';\n $options_all[MFCS_REVIEW_DECISION_COMMENT_ALL] = 'Comment';\n $options_all[MFCS_REVIEW_DECISION_DENY] = 'Deny';\n $options_all[MFCS_REVIEW_DECISION_REQUIREMENT] = 'Requirement';\n $options_all[MFCS_REVIEW_DECISION_AVAILABLE] = 'Available';\n $options_all[MFCS_REVIEW_DECISION_UNAVAILABLE] = 'Unavailable';\n $options_all[MFCS_REVIEW_DECISION_ISSUES] = 'Issues';\n $options_all[MFCS_REVIEW_DECISION_ISSUES_NONE] = 'No Issues';\n\n if ($option == 'select' || $option == 'review_step') {\n $options[''] = '- Select -';\n }\n\n if (!is_int($restriction)) {\n $restriction = MFCS_RESTRICTION_DECISION_NONE;\n }\n\n if ($restriction == MFCS_RESTRICTION_DECISION_NONE) {\n foreach ($options_all as $option_id => $option_name) {\n $options[$option_id] = $option_name;\n }\n\n // these options are hidden from the users.\n if ($option == 'review_step') {\n unset($options[MFCS_REVIEW_DECISION_AMENDMENT]);\n unset($options[MFCS_REVIEW_DECISION_WAIVE]);\n }\n\n asort($options);\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_REQUESTER) {\n if (array_key_exists(MFCS_REVIEW_DECISION_COMMENT_ALL, $options_all)) {\n $options[MFCS_REVIEW_DECISION_COMMENT_ALL] = $options_all[MFCS_REVIEW_DECISION_COMMENT_ALL];\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_VENUE_COORDINATOR) {\n foreach (array(MFCS_REVIEW_DECISION_AVAILABLE, MFCS_REVIEW_DECISION_UNAVAILABLE, MFCS_REVIEW_DECISION_COMMENT, MFCS_REVIEW_DECISION_REQUIREMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_REVIEWER) {\n foreach (array(MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_APPROVER) {\n foreach (array(MFCS_REVIEW_DECISION_APPROVE, MFCS_REVIEW_DECISION_DENY, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_MANAGER) {\n foreach (array(MFCS_REVIEW_DECISION_AVAILABLE, MFCS_REVIEW_DECISION_UNAVAILABLE, MFCS_REVIEW_DECISION_APPROVE, MFCS_REVIEW_DECISION_DENY, MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_REQUIREMENT, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_ADMINISTER) {\n foreach (array(MFCS_REVIEW_DECISION_AVAILABLE, MFCS_REVIEW_DECISION_UNAVAILABLE, MFCS_REVIEW_DECISION_APPROVE, MFCS_REVIEW_DECISION_DENY, MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_REQUIREMENT, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_COMMENT_ONLY) {\n if (array_key_exists(MFCS_REVIEW_DECISION_COMMENT, $options_all)) {\n $options[MFCS_REVIEW_DECISION_COMMENT] = $options_all[MFCS_REVIEW_DECISION_COMMENT];\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_FINANCER) {\n foreach (array(MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_COMMENT, MFCS_REVIEW_DECISION_REQUIREMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_INSURER) {\n foreach (array(MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_COMMENT, MFCS_REVIEW_DECISION_REQUIREMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n\n\n return $options;\n}", "public function getChallenge()\n {\n return $this->challenge;\n }", "function languagelesson_key_cloze_answers($answers) {\n $keyedAnswers = array();\n foreach ($answers as $answer) {\n // Only look at the actual answers, not custom feedback (saved to its own answer record).\n if ($answer->answer) {\n $atext = $answer->answer;\n list($num, $text) = explode('|', $atext);\n $answer->answer = $text;\n $keyedAnswers[$num] = $answer;\n }\n }\n return $keyedAnswers;\n}", "function sendChallenge($data) {\n $ChallengeData = createChallengeDataObj();\n $challengeID = $ChallengeData->createChallenge($data);\n if($challengeID) {\n return array(\"challengeID\" => $challengeID);\n }else {\n return array(\"challengeID\" => \"error\");\n }\n }", "public function option_fields() {\n\n // Only need to initiate the array once per page-load\n if ( ! empty( $this->option_metabox ) ) {\n return $this->option_metabox;\n }\n\n $completion_badge_array = EMS_OP_Tool::wpbadger_award_choose_badge ();\n\n $this->fields = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Content version number', 'op_tool' ),\n\t\t\t\t'desc' => __( 'increase this version number after any change to the content of this resource', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'content_version',\n\t\t\t\t'type' => 'text_small',\n\t\t\t\t// 'repeatable' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Completion badge', 'op_tool' ),\n\t\t\t\t'desc' => __( 'select the badge to be awarded for the completion of this OP Tool', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'completion_badge_id',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => $completion_badge_array,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Badge evidence text', 'op_tool' ),\n\t\t\t\t'desc' => __( 'this text will be displayed when someone follows the evidence link of a completion badge', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'badge_evidence_text',\n\t\t\t\t'type' => 'textarea_small',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Badge admin email text', 'op_tool' ),\n\t\t\t\t'desc' => __( 'the text that will appear in the email to the Administrator the user elected to inform', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'badge_notify_admin_text',\n\t\t\t\t'type' => 'textarea_small',\n\t\t\t),\n\t\t\t/*array(\n\t\t\t 'id' => $prefix . 'ems_admin_contacts_group',\n\t\t\t 'type' => 'group',\n\t\t\t 'description' => __( 'The EMS admin contacts for each institution (to be sent notifications when their students complete)', 'op_tool' ),\n\t\t\t 'options' => array(\n\t\t\t 'group_title' => __( 'Institution {#}', 'op_tool' ), // since version 1.1.4, {#} gets replaced by row number\n\t\t\t 'add_button' => __( 'Add Another Institution', 'op_tool' ),\n\t\t\t 'remove_button' => __( 'Remove Institution', 'op_tool' ),\n\t\t\t 'sortable' => true, // beta\n\t\t\t ),\n\t\t\t\t'show_names' => true,\n\t\t\t // Fields array works the same, except id's only need to be unique for this group. Prefix is not needed.\n\t\t\t 'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => __( 'Institution', 'op_tool' ),\n\t\t\t\t\t\t//'desc' => __( 'enter the intitution\\'s name', 'op_tool' ),\n\t\t\t\t\t\t'id' => $prefix . 'institution_name',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t// 'repeatable' => true,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => __( 'EMS admin\\'s email address', 'op_tool' ),\n\t\t\t\t\t\t//'desc' => __( 'enter the email address of the person who deals with EMS OPT certificates', 'op_tool' ),\n\t\t\t\t\t\t'id' => $prefix . 'institution_admin_email',\n\t\t\t\t\t\t'type' => 'text_email',\n\t\t\t\t\t\t// 'repeatable' => true,\n\t\t\t\t\t),\n\t\t\t ),\n\t\t\t),*/\n );\n\n $this->option_metabox = array(\n 'id' => 'option_metabox',\n 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),\n 'show_names' => true,\n 'fields' => $this->fields,\n );\n\n return $this->option_metabox;\n }", "public function getCourses()\n {\n return array(\n 1 => \"Kids Stage I (Pre School)\",\n 2 => \"Kids Stage II (Grade 01)\",\n 3 => \"Kids Stage III (Grade 02 - 05)\",\n 4 => \"School IT Syllabus (Grade 06 - 09)\",\n 5 => \"O/L ICT (Grade 09 - 11)\",\n 6 => \"A/L IT\",\n 7 => \"A/L GIT\",\n 8 => \"MS Office\",\n 9 => \"Graphic Designer\",\n 10 => \"Hardware & Networking\",\n 11 => \"Software Engineering\",\n 12 => \"Web Designing\",\n 13 => \"Type Setting\"\n );\n }", "function outputTestAnswers(){\n if($_SERVER[\"REQUEST_METHOD\"] == \"GET\"){\n $con = mysqli_connect('localhost', 'root', '', 'online-examination-system');\n if($con == false){\n die(\"Error: Could not connect: \".mysqli_connect_errno());\n }else{\n foreach($_GET as $key => $value){\n $test_id = $key;\n $query = \"\n SELECT * \n FROM question_details\n WHERE test_id = '$test_id';\n \";\n\n $result = mysqli_query($con, $query);\n\n if(!$result){\n die(\"Error : Could Not Connect \");\n }else{\n $student = $_COOKIE[\"student_loggedIn\"];\n $query = \"\n SELECT student_response\n FROM responses\n WHERE test_id = '$test_id' AND student_id = '$student'\n \";\n $result2 = mysqli_query($con, $query);\n $row2 = mysqli_fetch_array($result2, MYSQLI_NUM);\n $response = $row2[0];\n\n while($row = mysqli_fetch_array($result, MYSQLI_NUM)){\n $question_number = $row[1];\n $question = $row[2];\n $correct_answer = $row[7];\n $options = '';\n $attempted_answer = $response[$question_number - 1];\n if($correct_answer == $attempted_answer){\n for($i = 3; $i < 7; $i++){\n if($row[$i] != \"NULL\"){\n $color = 'bg-white';\n if($i-2 == $correct_answer){\n $color = 'bg-success text-white';\n }\n $add = '\n <div class=\"col-sm-6\" >\n <input type=\"text\" class=\"form-control '.$color.' \" id=\"'.$question_number.$i.'\" value=\"'.($i-2).') '.$row[$i].'\" style=\"border:none;\" disabled>\n </div>\n ';\n $options .= $add;\n }\n }\n }else{\n for($i = 3; $i < 7; $i++){\n if($row[$i] != \"NULL\"){\n $color = 'bg-white';\n if($i-2 == $correct_answer){\n $color = 'bg-success text-white';\n }\n if($i-2 == $attempted_answer){\n $color = 'bg-danger text-white';\n }\n $add = '\n <div class=\"col-sm-6\" >\n <input type=\"text\" class=\"form-control '.$color.' \" id=\"'.$question_number.$i.'\" value=\"'.($i-2).') '.$row[$i].'\" style=\"border:none;\" disabled>\n </div>\n ';\n $options .= $add;\n }\n }\n }\n \n\n \n $HTML = '\n <div class=\"form-group border border-dark rounded\" style=\"padding:2%; border\">\n <label for=\"'.$question_number.'\" style=\"font-size:20px;\">'.$question_number.'. '.$question.'</label>\n <div class=\"row \" style=\"font-size:20px\">\n '.$options.'\n </div>\n </div>\n ';\n echo $HTML;\n }\n }\n }\n }\n }\n\n }", "public function changeSwappAcceptanceDataProvider(){\n\n // scenarios data\n // 2 means that response to request should be 200 or 304\n // 3 means that response to request needs to be 304\n // 4 means that response to request should be 404\n return [\n \"1. case: \" => [34, \"ACCEPTED\", 2],\n \"1b. case: \" => [34, \"ACCEPTED\", 3],\n \"2. case: \" => [\"8\", \"DECLINED\", 2],\n \"3. case: \" => [\"num\", \"ACCEPTED\", 4],\n \"4. case: \" => [null, \"DECLINED\", 4],\n \"5. case: \" => [array(5,1122), \"ACCEPTED\", 4],\n \"6. case: \" => [12, \"declined\", 2],\n \"7. case: \" => [66, \"Declined\", 2],\n \"8. case: \" => [12, 5, 4],\n \"9. case: \" => [12, \"UNKNOWN\", 4],\n ];\n }", "public function run() {\n DB::table('choices')->insert(\n array(\n array(\n 'id' => 1,\n 'question_id' => 1,\n 'choice_id' => 1,\n 'content' => 'Contenu 1',\n 'status' => 'yes'\n ),\n array(\n 'id' => 2,\n 'question_id' => 1,\n 'choice_id' => 2,\n 'content' => 'Contenu 2',\n 'status' => 'no'\n ),\n array(\n 'id' => 3,\n 'question_id' => 2,\n 'choice_id' => 1,\n 'content' => 'Contenu 3',\n 'status' => 'yes'\n ),\n array(\n 'id' => 4,\n 'question_id' => 2,\n 'choice_id' => 2,\n 'content' => 'Contenu 4',\n 'status' => 'no'\n ),\n array(\n 'id' => 5,\n 'question_id' => 3,\n 'choice_id' => 1,\n 'content' => 'Contenu 5',\n 'status' => 'yes'\n ),\n array(\n 'id' => 6,\n 'question_id' => 3,\n 'choice_id' => 2,\n 'content' => 'Contenu 6',\n 'status' => 'no'\n ),\n array(\n 'id' => 7,\n 'question_id' => 3,\n 'choice_id' => 3,\n 'content' => 'Contenu 7',\n 'status' => 'yes'\n ),\n )\n );\n }", "function show_requirements( $coursesTaken )\n{\n/*\n\t$reqs = file(\"reqs.txt\");\n\techo \"<br/>Here is the progress on required courses:<br/>\";\n\t\n\t$electives = array();\n\tfor ($i = 0; $i < count( $reqs ); $i++ ):\n\t\n\t\t$reqFields = explode ( \":\" , $reqs[$i] ); // separate class name from classes\n\t\t$classFields = explode (\"|\", $reqFields[1] ); // separate classes (for electives)\n\t\t\n\t\t$again = true;\n\t\tfor ($j = 0; $j < count( $classFields ) && $again == true; $j++ ):\n\t\t\n\t\t\t$class = explode ( \",\", $classFields[$j] );\n\t\t\t\n\t\t\t\n\t\t\tfor ($k = 0; $k < count($coursesTaken) && $again == true; $k++):\n\t\n\t\t\t\t$studentClassInfo = explode( \":\" ,$coursesTaken[$k] );\n\t\t\t\t\n\t\t\t\t$classNumber1 = trim( $studentClassInfo[1] );\n\t\t\t\t$classNumber2 = trim( $class[1] );\n\n\t\t\t\t\n\t\t\t\t//for handling repeated electives\n\t\t\t\tif ( ( strcmp( $class[0], $studentClassInfo[0] ) == 0 ) && ( $classNumber1 == $classNumber2 ) )\n\t\t\t\t{\n\t\t\t\t\t//match class\n\t\t\t\t\t$again = false;\n\t\t\t\t\tif ( preg_match( \"/Elec/\", $reqFields[0] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( in_array( $classNumber1, $electives ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$again = true;\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\tarray_push( $electives, $classNumber1 );\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\t\n\t\t\tendfor;\n\t\t\t\n\t\tendfor;\n\t\t\n\t\tif ( $again == true )\n\t\t{\n\t\t\techo \"N - $reqFields[0]<br/>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( strcmp( $studentClassInfo[4][0], \"C\" ) < 0 )\n\t\t\t{\n\t\t\t\techo \"S - Class: $studentClassInfo[0]$studentClassInfo[1] Term: $studentClassInfo[2] Grade: $studentClassInfo[4] - $reqFields[0]<br/>\";\n\t\t\t}\n\t\t\telseif ( strcmp( $studentClassInfo[4][0], \"C\" ) == 0 )\n\t\t\t{\n\t\t\t\tif ( strcmp( $studentClassInfo[4][1], \"-\") == 0 )\n\t\t\t\t{\n\t\t\t\t\techo \"N - $reqFields[0]<br/>\";\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"S - Class: $studentClassInfo[0]$studentClassInfo[1] Term: $studentClassInfo[2] Grade: $studentClassInfo[4] - $reqFields[0]<br/>\";\n\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"N - $reqFields[0]<br/>\";\n\t\t\t}\n\t\t}\n\tendfor;\n\t*/\n\n}", "public function run() {\n DB::table('complaint_victims')->truncate();\n\n $complaint_victims = array(\n [\"complaint_id\" => 1, \"client_id\" => 101],\n [\"complaint_id\" => 2, \"client_id\" => 102],\n [\"complaint_id\" => 3, \"client_id\" => 103],\n [\"complaint_id\" => 4, \"client_id\" => 104],\n [\"complaint_id\" => 5, \"client_id\" => 105],\n [\"complaint_id\" => 6, \"client_id\" => 106],\n [\"complaint_id\" => 6, \"client_id\" => 107],\n [\"complaint_id\" => 6, \"client_id\" => 108],\n [\"complaint_id\" => 7, \"client_id\" => 109],\n [\"complaint_id\" => 8, \"client_id\" => 110],\n [\"complaint_id\" => 9, \"client_id\" => 111],\n [\"complaint_id\" => 9, \"client_id\" => 112],\n //no victim for 10 (illegal gambling site lang)\n [\"complaint_id\" => 11, \"client_id\" => 113],\n [\"complaint_id\" => 11, \"client_id\" => 114],\n [\"complaint_id\" => 11, \"client_id\" => 115],\n [\"complaint_id\" => 11, \"client_id\" => 116],\n [\"complaint_id\" => 11, \"client_id\" => 117],\n //no victim for 12 (counterfeiting lang)\n [\"complaint_id\" => 13, \"client_id\" => 118],\n [\"complaint_id\" => 13, \"client_id\" => 119],\n [\"complaint_id\" => 13, \"client_id\" => 120],\n [\"complaint_id\" => 13, \"client_id\" => 121],\n [\"complaint_id\" => 13, \"client_id\" => 122],\n //no victim for 14 and 15 (drugs dealers spotted)\n [\"complaint_id\" => 16, \"client_id\" => 123],\n [\"complaint_id\" => 17, \"client_id\" => 124],\n [\"complaint_id\" => 18, \"client_id\" => 125],\n [\"complaint_id\" => 18, \"client_id\" => 126],\n [\"complaint_id\" => 19, \"client_id\" => 127],\n [\"complaint_id\" => 20, \"client_id\" => 128],\n [\"complaint_id\" => 20, \"client_id\" => 129],\n [\"complaint_id\" => 20, \"client_id\" => 130],\n //no victim for 21 (druglord released)\n [\"complaint_id\" => 22, \"client_id\" => 131],\n [\"complaint_id\" => 23, \"client_id\" => 132],\n [\"complaint_id\" => 24, \"client_id\" => 133],\n [\"complaint_id\" => 24, \"client_id\" => 134],\n [\"complaint_id\" => 25, \"client_id\" => 135],\n [\"complaint_id\" => 26, \"client_id\" => 136],\n [\"complaint_id\" => 27, \"client_id\" => 137],\n [\"complaint_id\" => 27, \"client_id\" => 138],\n [\"complaint_id\" => 27, \"client_id\" => 139],\n //no victim for 28 (caught drug dealing)\n [\"complaint_id\" => 29, \"client_id\" => 140],\n [\"complaint_id\" => 30, \"client_id\" => 141],\n [\"complaint_id\" => 31, \"client_id\" => 142],\n [\"complaint_id\" => 32, \"client_id\" => 143],\n //no victim for 33 phony license\n [\"complaint_id\" => 34, \"client_id\" => 144],\n [\"complaint_id\" => 35, \"client_id\" => 145],\n [\"complaint_id\" => 36, \"client_id\" => 146],\n [\"complaint_id\" => 37, \"client_id\" => 147],\n [\"complaint_id\" => 38, \"client_id\" => 148],\n [\"complaint_id\" => 39, \"client_id\" => 149],\n [\"complaint_id\" => 40, \"client_id\" => 150],\n [\"complaint_id\" => 41, \"client_id\" => 151],\n [\"complaint_id\" => 42, \"client_id\" => 152],\n [\"complaint_id\" => 43, \"client_id\" => 153],\n [\"complaint_id\" => 44, \"client_id\" => 154],\n [\"complaint_id\" => 45, \"client_id\" => 155],\n [\"complaint_id\" => 46, \"client_id\" => 156],\n //no victim for 47 (caught prosti+drugs)\n [\"complaint_id\" => 48, \"client_id\" => 157],\n [\"complaint_id\" => 49, \"client_id\" => 158],\n [\"complaint_id\" => 50, \"client_id\" => 159],\n [\"complaint_id\" => 51, \"client_id\" => 160],\n [\"complaint_id\" => 52, \"client_id\" => 161],\n [\"complaint_id\" => 52, \"client_id\" => 162],\n [\"complaint_id\" => 52, \"client_id\" => 163],\n [\"complaint_id\" => 53, \"client_id\" => 164],\n [\"complaint_id\" => 54, \"client_id\" => 165],\n [\"complaint_id\" => 55, \"client_id\" => 5], \n //[\"complaint_id\" => 56, \"client_id\" => 6], no victim because arson\n [\"complaint_id\" => 57, \"client_id\" => 2],\n [\"complaint_id\" => 58, \"client_id\" => 7],\n [\"complaint_id\" => 59, \"client_id\" => 8],\n //no victim for 60 (seen abduction)\n //no victim for 61 (abortion)\n [\"complaint_id\" => 62, \"client_id\" => 428],\n [\"complaint_id\" => 63, \"client_id\" => 430],\n [\"complaint_id\" => 64, \"client_id\" => 432],\n [\"complaint_id\" => 65, \"client_id\" => 434],\n [\"complaint_id\" => 66, \"client_id\" => 411],\n [\"complaint_id\" => 67, \"client_id\" => 413],\n [\"complaint_id\" => 68, \"client_id\" => 415],\n [\"complaint_id\" => 69, \"client_id\" => 417],\n [\"complaint_id\" => 70, \"client_id\" => 419],\n //no victim for 71 (abandoned building set on fire)\n [\"complaint_id\" => 72, \"client_id\" => 421],\n [\"complaint_id\" => 73, \"client_id\" => 22],\n [\"complaint_id\" => 74, \"client_id\" => 23],\n [\"complaint_id\" => 75, \"client_id\" => 27],\n [\"complaint_id\" => 76, \"client_id\" => 423],\n [\"complaint_id\" => 77, \"client_id\" => 424],\n //no victim for 78-79 (counterfeiting lang)\n [\"complaint_id\" => 80, \"client_id\" => 425],\n \n [\"complaint_id\" => 81, \"client_id\" => 166],\n [\"complaint_id\" => 82, \"client_id\" => 166],\n [\"complaint_id\" => 83, \"client_id\" => 167],\n [\"complaint_id\" => 84, \"client_id\" => 167],\n [\"complaint_id\" => 85, \"client_id\" => 168],\n [\"complaint_id\" => 86, \"client_id\" => 169],\n [\"complaint_id\" => 87, \"client_id\" => 170],\n [\"complaint_id\" => 88, \"client_id\" => 171],\n [\"complaint_id\" => 89, \"client_id\" => 172],\n [\"complaint_id\" => 90, \"client_id\" => 173],\n [\"complaint_id\" => 91, \"client_id\" => 174],\n [\"complaint_id\" => 92, \"client_id\" => 175],\n [\"complaint_id\" => 93, \"client_id\" => 176],\n [\"complaint_id\" => 94, \"client_id\" => 177],\n [\"complaint_id\" => 95, \"client_id\" => 178],\n [\"complaint_id\" => 96, \"client_id\" => 179],\n [\"complaint_id\" => 97, \"client_id\" => 180],\n [\"complaint_id\" => 98, \"client_id\" => 181],\n [\"complaint_id\" => 99, \"client_id\" => 182],\n [\"complaint_id\" => 100, \"client_id\" => 183],\n [\"complaint_id\" => 101, \"client_id\" => 184],\n [\"complaint_id\" => 102, \"client_id\" => 185],\n [\"complaint_id\" => 103, \"client_id\" => 186],\n [\"complaint_id\" => 104, \"client_id\" => 187],\n [\"complaint_id\" => 105, \"client_id\" => 188],\n [\"complaint_id\" => 106, \"client_id\" => 189],\n [\"complaint_id\" => 107, \"client_id\" => 190],\n [\"complaint_id\" => 108, \"client_id\" => 191],\n [\"complaint_id\" => 109, \"client_id\" => 192],\n [\"complaint_id\" => 110, \"client_id\" => 193],\n [\"complaint_id\" => 111, \"client_id\" => 194],\n [\"complaint_id\" => 112, \"client_id\" => 195],\n [\"complaint_id\" => 113, \"client_id\" => 196],\n [\"complaint_id\" => 114, \"client_id\" => 197],\n [\"complaint_id\" => 115, \"client_id\" => 198],\n [\"complaint_id\" => 116, \"client_id\" => 199],\n [\"complaint_id\" => 117, \"client_id\" => 200],\n [\"complaint_id\" => 118, \"client_id\" => 201],\n [\"complaint_id\" => 119, \"client_id\" => 202],\n [\"complaint_id\" => 120, \"client_id\" => 203],\n [\"complaint_id\" => 121, \"client_id\" => 204],\n [\"complaint_id\" => 122, \"client_id\" => 205],\n [\"complaint_id\" => 123, \"client_id\" => 206],\n [\"complaint_id\" => 124, \"client_id\" => 207],\n [\"complaint_id\" => 125, \"client_id\" => 208],\n [\"complaint_id\" => 126, \"client_id\" => 209],\n [\"complaint_id\" => 127, \"client_id\" => 210],\n [\"complaint_id\" => 128, \"client_id\" => 211],\n [\"complaint_id\" => 129, \"client_id\" => 212],\n [\"complaint_id\" => 130, \"client_id\" => 213],\n );\n\n // Uncomment the below to run the seeder\n DB::table('complaint_victims')->insert($complaint_victims);\n }", "private function questionList()\n {\n \t$requiredQuestions = [];\n\n \tfor ($x = 1; $x <= count($this->questions); $x++) {\n \t\t$requiredQuestions[ config('constants.questionInputPrefix') . $x] = 'required';\n \t}\n\n \treturn $requiredQuestions;\n }", "function alternatives()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $questionArray, \"SELECT ID FROM eZQuiz_Alternative WHERE QuestionID='$this->ID' ORDER BY ID\" );\r\n\r\n for ( $i = 0; $i < count( $questionArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZQuizAlternative( $questionArray[$i][$db->fieldName( \"ID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "function getAnswers($strName,$arrRule) {\n\t\tglobal $LANG;\n\t\t$arrCurQuestion = $this->arrPrevQuestions[stripslashes($arrRule['field'])];\n\t\tif (in_array($arrCurQuestion['question_type'],array(1,2,3,4,5,23))) {\n\t\t\tif (!$this->blnLocalization) {\n\t $arrOutput[] = '<select name =\"'.$strName.'[value]\" onChange=\"submit();\")>';\n\t if (in_array($arrCurQuestion['question_type'],array(1,3)) && $arrCurQuestion['answers_allow_additional']) {\n\t $arrOutput[] = '<option value=\"\">'.$LANG->getLL('conditions_none').'</option>';\n\t }\n\t\t\t}\n if (in_array($arrCurQuestion['question_type'],array(1,2,3,23))) {\n $arrOptions = $this->answersArray($arrCurQuestion['answers']);\n } elseif ($arrCurQuestion['question_type']==4) {\n $arrOptions = array(1 => $LANG->getLL('conditions_false'),2 => $LANG->getLL('conditions_true'));\n } else {\n $arrOptions = array(1 => $LANG->getLL('conditions_no'),2 => $LANG->getLL('conditions_yes'));\n }\n foreach($arrOptions as $intKey => $strValue) {\n if ($arrRule['value']==$intKey) {\n $strSelected = 'selected=\"selected\"';\n } else {\n $strSelected = '';\n }\n if (!$this->blnLocalization) {\n \t$arrOutput[] = '<option value=\"'.$intKey.'\" '.$strSelected.'>'.$strValue.'</option>';\n } else {\n \tif ($strSelected=='selected=\"selected\"') {\n \t\t$arrOutput[] = '<input type=\"hidden\" name=\"'.$strName.'[value]\" value=\"'.$intKey.'\" />';\n \t\t$arrOutput[] = $strValue;\n \t}\n }\n }\n if (!$this->blnLocalization) {\n \t$arrOutput[] = '</select>';\n }\n if (in_array($arrCurQuestion['question_type'],array(1,3)) && $arrCurQuestion['answers_allow_additional']) {\n $arrOutput[] = '<br />'.$LANG->getLL('conditions_or').' <input name =\"'.$strName.'[value2]\" type=\"text\" value=\"'.$arrRule['value2'].'\" />';\n }\n } elseif (in_array($arrCurQuestion['question_type'],array(7,10,11,12,13,14,15))) {\n $arrOutput[] = '<input name =\"'.$strName.'[value]\" type=\"text\" value=\"'.$arrRule['value'].'\" />';\n }\n return $arrOutput;\n }", "public function run()\n {\n $question = HouseQuestion::create([\n 'title' => 'What will happen to the Night King?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Lives',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Dies',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will we see Ice Spiders?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Please, God, no.',\n 'house_question_id' => $question->id\n ]);\n\n\n $question = HouseQuestion::create([\n 'title' => 'Cleganebowl?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'The Mountain wins',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'The Hound wins',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Draw',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Won\\'t take place',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'How many times will we hear the phrase \"Winter has come.\"?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Never',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Fewer than 5 times',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Between 5 and 10 times',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'More than 10 times',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will Jon ride a dragon (excluding Daenerys)?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will Tyrion ride a dragon?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will Arya ride a dragon?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will King\\'s Landing still be standing when the season is over?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Which character will be the first to die this season?',\n ]);\n foreach (\\App\\Character::all() as $character) {\n HouseQuestionOption::create([\n 'label' => $character->name,\n 'house_question_id' => $question->id\n ]);\n\n }\n foreach (\\App\\HouseCharacter::all() as $character) {\n HouseQuestionOption::create([\n 'label' => $character->name,\n 'house_question_id' => $question->id\n ]);\n }\n\n $question = HouseQuestion::create([\n 'title' => 'Which character will be the last to die this season?',\n ]);\n foreach (\\App\\Character::all() as $character) {\n HouseQuestionOption::create([\n 'label' => $character->name,\n 'house_question_id' => $question->id\n ]);\n\n }\n foreach (\\App\\HouseCharacter::all() as $character) {\n HouseQuestionOption::create([\n 'label' => $character->name,\n 'house_question_id' => $question->id\n ]);\n }\n }", "public function optionalMode(): array\n { \n $rows = $this->conn()\n ->run(\"SELECT \n questions.id, \n questions.question, \n options.content, \n options.is_correct \n FROM questions \n RIGHT JOIN options \n ON options.question_id = questions.id \n LIMIT 40\")\n ->fetchAll(\\PDO::FETCH_ASSOC);\n \n $questions = [];\n\n foreach($rows as $row){ \n $questions[$row['id']]['question'] = $row['question'];\n $questions[$row['id']]['options'][] = [\n 'content' => $row['content'],\n 'is_correct' => $row['is_correct'],\n ];\n if($row['is_correct']){\n $questions[$row['id']]['answer'] = $row['content'];\n }\n }\n\n $response['data'] = array_values($questions);\n $response['total'] = count($response['data']);\n\n return $response; \n\n }", "public function getChallenges(Request $request){\n\n $user = Auth::user(); \n $game= Game::where(\"player2ID\",\"=\",$user->id)->where(\"gameState\",\"=\",\"challenge\")->latest(\"created_at\")->first();\n\n if($game != null){\n $challenger = User::where('id','=',$game->player1ID)->first();\n $game->challenger = $challenger->name;\n } \n if($game == null){\n return response()->json([\n 'success' => false,\n 'data' => $game\n ]);\n }\n return response()->json([\n 'success' => true,\n 'data' => $game\n\n ]);\n}", "public function run()\n {\n Model::unguard();\n \n $courses = [\n \t//certificate in computer science programme courses\n \t[\n 'title'=> 'Citizenship and leadership',\n 'code'=> 'GST 119',\n 'unit'=> 2,\n 'programme_id'=> 1,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Use of English',\n 'code'=> 'GST 111',\n 'unit'=> 2,\n 'programme_id'=> 1,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Elementary Mathematics',\n 'code'=> 'GST 112',\n 'unit'=> 2,\n 'programme_id'=> 1,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Operating System',\n 'code'=> 'CST 113',\n 'unit'=> 2,\n 'programme_id'=> 1,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Introduction to internet',\n 'code'=> 'CST 114',\n 'unit'=> 2,\n 'programme_id'=> 1,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Introduction to Computer',\n 'code'=> 'CST 115',\n 'unit'=> 2,\n 'programme_id'=> 1,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Microsoft Word',\n 'code'=> 'CST 116',\n 'unit'=> 2,\n 'programme_id'=> 1,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Microsoft Power Point',\n 'code'=> 'CST 117',\n 'unit'=> 2,\n 'programme_id'=> 1,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Microsoft Excel',\n 'code'=> 'CST 118',\n 'unit'=> 2,\n 'programme_id'=> 1,\n 'semester_id'=> 1\n \t],\n\n \t// diploma In computer science programme courses first semester\n\n \t[\n 'title'=> 'Networking',\n 'code'=> 'DCS 204',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Data Communication',\n 'code'=> 'DCS 205',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Spreadsheet',\n 'code'=> 'DCS 207',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Database Management',\n 'code'=> 'DCS 208',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 1\n \t],\n \t[\n 'title'=> 'Microsoft Power Point',\n 'code'=> 'DCS 210',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 1\n \t],\n\n \t// diploma In computer science programme courses second semester\n\n \t[\n 'title'=> 'Communication Skill',\n 'code'=> 'DCS 201',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 2\n \t],\n \t[\n 'title'=> 'Business Mathematics',\n 'code'=> 'DCS 202',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 2\n \t],\n \t[\n 'title'=> 'Microsoft Word',\n 'code'=> 'DCS 203',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 2\n \t],\n \t[\n 'title'=> 'Corel Draw',\n 'code'=> 'DCS 206',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 2\n \t],\n \t[\n 'title'=> 'Microsoft Publisher',\n 'code'=> 'DCS 209',\n 'unit'=> 2,\n 'programme_id'=> 3,\n 'semester_id'=> 2\n \t],\n // certificate In computer engineering programme courses\n\n [\n 'title'=> 'Hardware Assembling',\n 'code'=> 'CCE 111',\n 'unit'=> 2,\n 'programme_id'=> 2,\n 'semester_id'=> 1\n ],\n [\n 'title'=> 'Trouble shooting and Hardware Maintenace',\n 'code'=> 'CCE 112',\n 'unit'=> 2,\n 'programme_id'=> 2,\n 'semester_id'=> 1\n ],\n [\n 'title'=> 'Software Installation',\n 'code'=> 'CCE 113',\n 'unit'=> 2,\n 'programme_id'=> 2,\n 'semester_id'=> 1\n ],\n [\n 'title'=> 'Operating System',\n 'code'=> 'CCE 114',\n 'unit'=> 2,\n 'programme_id'=> 2,\n 'semester_id'=> 1\n ],\n ];\n foreach ($courses as $course) {\n \n \t$registeredCourse = Course::firstOrCreate([\n \t\t'code'=>$course['code'],\n \t\t'title'=>$course['title'],\n \t\t'unit'=>$course['unit'],\n \t\t'semester_id'=>$course['semester_id'],\n \t]);\n\n \t$registeredCourse->programmeCourses()->firstOrCreate([\n \t\t'programme_id'=>$course['programme_id']\n \t]);\n }\n }", "public function options(): array\n {\n return ['' => trans('site::messages.select_no_matter')]\n + AuthorizationStatus::query()->whereHas('authorizations', function ($query) {\n \n })->orderBy('id')->pluck('name', 'id')->toArray();\n }", "public function run()\n {\n // Insertion dans la table CHOICES\n DB::table('questions')->insert([\n\n //QCM 1 : 15 questions : Niveau première\n [ \n 'content' => 'Isaac Newton était un savant anglais.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un homme politique américain.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un musicien de jazz.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un premier ministre israélien.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 3 premiers ministres.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 5 premiers ministres.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 7 premiers ministres.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : L\\'appel du général de Gaulle à ne pas capituler.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : Le débarquement allié en Normandie.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : L\\'armistice de la Seconde Guerre mondiale.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1968 par John Kennedy.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1969 par Neil Amstrong.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1971 par Martin Luther King.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le président des États-Unis John Kennedy a été mêlé à l\\'affaire dite du Watergate.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le président des États-Unis Richard Nixon a été mêlé à l\\'affaire dite du Watergate.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n //QCM 2 : 12 questions : Niveau première\n [ \n 'content' => 'La première République française a été proclamée en 1792.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'La première République française a été proclamée en 1789.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'La première République française a été proclamée en 1794.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Louis XVI s\\'est fait arrêter à Versailles par les sans-culotte.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était élu par les députés et sénateurs.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était élu au suffrage universel.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était nommé par le Conseil d\\'État.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Louis XIII.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Louis XIV.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Napoléon 1er.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [\n 'content' => 'Christophe Colomb a découvert l\\'Amérique en 1492.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Christophe Colomb a découvert l\\'Amérique en 1515.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n //QCM 3 : 15 questions : Niveau terminale\n [ \n 'content' => 'Le procès de Nuremberg a eu lieu en 1945.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le procès de Nuremberg a eu lieu en 1948.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'La révocation de l\\'Édit de Nantes a instauré le rattachement de la Vendée à la France.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'La révocation de l\\'Édit de Nantes a instauré l\\'interdiction du protestantisme.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le conflit des Malouines a opposé le Royaume-Uni au Chili.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le conflit des Malouines a opposé le Royaume-Uni à l\\'Argentine.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Macédoine.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Egypte.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Grèce.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Henri IV était issu de la famille des Bourbons.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Henri IV était issu de la famille des Artois.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"L\\'éveillé\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Grande âme\".',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Indépendant\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Sage dans ses paroles\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n //QCM 4 : 12 questions : Niveau terminale\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1791.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1789.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1790.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Afrique.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Amérique du Sud.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Asie.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1515.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1615.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1415.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Noir et Blanc.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Marron.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Blanc.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n \t]);\n }", "public function addSubmittedExercise() {\n\n\t\t//$answers_from_current_user = xaseAnswer::where(array('user_id' => $this->dic->user()->getId(), 'question_id' => $this->xase_question->getId()))->get();\n\n\n\t\t$all_items_assisted_exercise = xaseQuestion::where(array( 'assisted_exercise_id' => $this->assisted_exercise->getId() ))->get();\n\n\t\t$answers_from_current_user = xaseQuestionTableGUI::getAllUserAnswersFromAssistedExercise($all_items_assisted_exercise, $this->dic, $this->dic->user());\n\n\t\t/*\n\t\t * @var xaseAnswer $answers_from_current_user\n\t\t */\n\t\tforeach ($answers_from_current_user as $answer_from_current_user) {\n\t\t\tif (is_array($answers_from_current_user)) {\n\t\t\t\t$answer_from_current_user_object = xaseAnswer::where(array( 'id' => $answer_from_current_user['id'] ))->first();\n\t\t\t\t$answer_from_current_user_object->setAnswerStatus(xaseAnswer::ANSWER_STATUS_CAN_BE_VOTED);\n\t\t\t\t$answer_from_current_user_object->setSubmissionDate(date('Y-m-d H:i:s'));\n\t\t\t\t$answer_from_current_user_object->setIsAssessed(0);\n\t\t\t\t$answer_from_current_user_object->store();\n\t\t\t} else {\n\t\t\t\t$answer_from_current_user_object = xaseAnswer::where(array( 'id' => $answers_from_current_user['id'] ));\n\t\t\t\t$answer_from_current_user_object->setAnswerStatus(xaseAnswer::ANSWER_STATUS_CAN_BE_VOTED);\n\t\t\t\t$answer_from_current_user_object->setSubmissionDate(date('Y-m-d H:i:s'));\n\t\t\t\t$answer_from_current_user_object->setIsAssessed(0);\n\t\t\t\t$answer_from_current_user_object->store();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tilUtil::sendSuccess($this->obj_facade->getLanguageValue('success_message_exercise_submitted'), true);\n\t\t$this->obj_facade->getCtrl()->redirectByClass(xaseQuestionGUI::class, xaseQuestionGUI::CMD_INDEX);\n\t}", "public static function getDifficultiesEN()\n\t\t{\n\t\t\t$connection = Connection::getConnection();\n\t\t\t$statement = $connection->prepare(\"SELECT id,name_en as name FROM difficulty\");\n\t\t\t$statement->setFetchMode(PDO::FETCH_ASSOC);\n\t\t\t$statement->execute();\n\n\t\t\t$content = [];\n\n\t\t\twhile ($row = $statement->fetch()) {\n\t\t\t\t//$content[$row[\"id\"]] = $row;\n\t\t\t\t$content[] = $row;\n\t\t\t}\n\n\t\t\treturn $content;\n\t\t}", "function send_western_course_options($connection) {\n $query = \"SELECT course_code FROM wcs_course ORDER BY course_code\";\n $result = mysqli_query($connection, $query);\n while ($row = mysqli_fetch_assoc($result)) {\n echo '<option value=\"' . $row['course_code'] . '\">' . $row['course_code'] . \"</option>\";\n }\n mysqli_free_result($result);\n}", "public function get_dropdown_list() {\n /* convert things like &gt; to > etc */\n foreach ($this->allanswers as $key => $value) {\n $this->allanswers[$key] = htmlspecialchars_decode($value);\n }\n // Make the key and value the same in the array.\n $selectoptions = array_combine($this->allanswers, $this->allanswers);\n return $selectoptions;\n }" ]
[ "0.67737657", "0.6739907", "0.658204", "0.6509952", "0.6406085", "0.6403637", "0.6285946", "0.6017328", "0.5779878", "0.57571054", "0.573014", "0.56934375", "0.5672583", "0.5650767", "0.5619192", "0.56161255", "0.5585756", "0.55799186", "0.55638087", "0.54865414", "0.5483321", "0.5482546", "0.5447043", "0.54240197", "0.5397337", "0.5388702", "0.5373093", "0.532756", "0.53242123", "0.53240967", "0.5320584", "0.5308384", "0.53004175", "0.52992386", "0.5293694", "0.52867717", "0.5284495", "0.5276279", "0.5245073", "0.5234897", "0.5229877", "0.521505", "0.52097934", "0.51851654", "0.51592547", "0.5144675", "0.512079", "0.5113601", "0.5099193", "0.50962186", "0.50855803", "0.5083831", "0.5082533", "0.508079", "0.5079507", "0.5078237", "0.50767636", "0.5074344", "0.50691897", "0.50672615", "0.5066193", "0.5036653", "0.5036234", "0.50325006", "0.50278294", "0.5018301", "0.50075394", "0.50001514", "0.49921453", "0.49910557", "0.4979475", "0.49761292", "0.4964306", "0.49640837", "0.49615029", "0.49581143", "0.49574164", "0.49539867", "0.49519032", "0.4948277", "0.49445832", "0.4943355", "0.49419966", "0.49121466", "0.490886", "0.49087274", "0.49080488", "0.4902808", "0.48995438", "0.48978165", "0.4897393", "0.48968852", "0.48908922", "0.48842335", "0.48817948", "0.48709223", "0.48607314", "0.485541", "0.48526227", "0.48481685", "0.48400348" ]
0.0
-1
Get all records in a table with optional column selection
public function getAll($columns = array('*')) { return $this->model->get($columns); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function selectAll() {\n\t\treturn $this->select(array_keys($this->table->columns));\n\t}", "public function select($columns = array('*'));", "function adv_select($table, array $where = null, array $fields = null, $order = '', $limit = null, $offset = null);", "public function select($columns);", "public abstract function get_columns($table);", "public function fetchAll()\n {\n return $this->tableGateway->select();\n }", "public function fetchAll()\n {\n return $this->tableGateway->select();\n }", "function selectAll() {\n $query = $this->getStatement(\n \"SELECT * FROM `$this->table` WHERE 1 ORDER BY id\"\n );\n $query->execute();\n return $query->fetchAll();\n }", "public function select($table, $fields, $where, $order, $start);", "public function table_get_all($table);", "public function fetchAll(){\n $resultSet = $this->tableGateway->select();\n return $resultSet;\n }", "public function fetchAll($params = [])\n { \n var_dump($params);\n return $this->table->tableGateway->select();\n }", "public function selectAll();", "abstract public function columnListQuery($table);", "public function fetchAll()\n { \n $resultSet = $this->tableGateway->select();\n return $resultSet;\n }", "public static function selectAll() {\n $select = self::select(Option::getTableName());\n\n return self::getInstanceData($select);\n }", "public function select($cols = null);", "public function all($columns = ['*']);", "public abstract function getColumns($table);", "public function findAll( array $columns = ['*'] );", "public static function all()\n {\n self::select(self::tableName());\n return self::fetchAll();\n }", "public function select($table, array $fields = null);", "function select($where = false){\n $query=\"SELECT * FROM \". $this->tableName ;\n $separator=\" WHERE \";\n if ($where){\n foreach ( $where as $key => $value){\n\t$query .= $separator . $key . \" = '\" . $value . \"'\";\n\t$separator = \" AND \";\n }\n }\n $query .= \";\";\n \n $results = array();\n $res = $this->dbh->query($query);\n while ($row = $res->fetch_assoc()){\n array_push($results, $row);\n }\n return $results;\n }", "public function selectAll($table)\n {\n return $this->_db->fetchAll('SELECT * FROM ' . $table);\n }", "public function select($table_name, $fields = array(), $where = array(), $order_by = '')\r\n {\r\n }", "public static function all($columns = ['*']);", "public function getAll($columns);", "public function selectAll($table){\n $requete = \"SELECT * FROM $table\";\n $result = array();\n foreach($this->_dbh->query($requete) as $raw){\n array_push($result,$raw);\n }\n return $result;\n }", "public abstract function fetchAll($table);", "abstract public function tableColumns();", "public function get(){\n $this->query = \"SELECT \".$this->select.\" FROM $this->table WHERE \";\n $wheres = $this->mergeWhere().\" OR \".$this->mergeOrWhere();\n $query = $this->query.$wheres;\n $statement = $this->prepare($query);\n $statement->execute($this->bindings);\n return $statement->fetchAll();\n }", "function getFields($table,$fields=\"\",$condition=\"\",$limit=\"\",$calculateRows=false,$fastHint=false);", "public function getAllByTable($connection, $tablename, $select, $limit, $offset, $where);", "function find($table, $where=\"1=1\", $fields=\"*\", $orderBy=\"1\"){\n\t\tActiveRecord::sql_item_sanizite($table);\n\t\tActiveRecord::sql_sanizite($fields);\n\t\tActiveRecord::sql_sanizite($orderBy);\n\t\t$q = $this->query(\"select $fields from $table where $where order by $orderBy\");\n\t\t$results = array();\n\t\twhile($row=$this->fetch_array($q)){\n\t\t\t$results[] = $row;\n\t\t}\n\t\treturn $results;\n\t}", "protected function tableRows()\n {\n $tbody = DB::table($this->argument('table'))->get();\n\n return $tbody->map(function ($field) {\n return $this->selectRowByField($field);\n });\n }", "static function selectAll() : Array {\r\n $selectAll = \"SELECT * FROM Orders;\";\r\n\r\n self::$db->query($selectAll);\r\n self::$db->execute();\r\n return self::$db->resultSet();\r\n }", "public function getList(array $columns = SELECT_ALL);", "function getDataListWhere($table,$fields = null,$where = null,$order = null,$limit_start,$limit_limit) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order,$limit_start,$limit_limit);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadAssocList();\r\n\t}", "public function select()\n {\n $cols = $this->getColsAsFields();\n return $this->gateway->select($cols);\n }", "function get_all_records(){\n\t\tglobal $db;\n\t\t$sql=\"SELECT * FROM $this->table order by id asc\";\n\t\t$db->query($sql);\n\t\t$row=$db->fetch_assoc_all();\n\t\treturn $row;\n\t}", "public static function db_select_all( $table, $where=null, $col=null )\n {\n $return = array();\n \n if( empty($table) )\n {\n throw new Exception(\"Method `db_select_all` MUST have a valid table parameter\");\n }\n $stmt = self::db_select($table, $where, $col);\n \n if( !is_object($stmt) ) { return false; }\n \n while( $row = $stmt->fetch(PDO::FETCH_ASSOC) )\n {\n $return[] = $row;\n }\n return $return;\n }", "public function all(): ResultSetContract;", "public function getAll()\n {\n $sql = \"SELECT * FROM `%s`\";\n $this->_sql[] = sprintf($sql, $this->_table);\n $this->_parameters[] = array();\n return $this->run();\n }", "abstract public function listColumns();", "public function select($tables, array $columns, array $conditions = [], array $options = []): array;", "function getAllRows($select, $tblName, $where = NULL , $and = NULL , $orderFeild = 'created_at' , $ordering = 'DESC')\n{\n global $conn;\n $rowStmt = $conn->prepare(\"SELECT $select FROM $tblName\n $where $and ORDER BY $orderFeild $ordering\");\n $rowStmt->execute();\n $rows = $rowStmt->fetchAll();\n return $rows;\n}", "public function fetchAll()\n {\n $result = $this->select();\n return $result;\n }", "public function findAll(array $columns = ['*']);", "protected function select($table, $colums, $where)\n {\n $query = \"\";\n $data = [];\n \n if (isset($where)){\n $query = \"SELECT $colums from $table WHERE $where\";\n }else{\n $query = \"SELECT $colums from $table\";\n }\n \n $result = $this->db->query($query);\n \n if(!is_bool($result))\n {\n if ($result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) {\n $data[] = $row;\n }\n $result->free();\n }\n }\n\n return $data;\n }", "public function selectAll()\n {\n $sql = \"SELECT idagenda, visita_idvisita, horario_idhorario, created, modified\n FROM \" . $this->schema . \".\" . $this->table;\n }", "function select($table, $where = null, $params = array())\n {\n\n $defaults = array(\n 'fields' => '*',\n 'group' => NULL,\n 'order' => NULL,\n 'limit' => NULL,\n 'offset' => 0,\n 'join' => ''\n );\n\n $params = array_merge($defaults, $params);\n\n /**\n * JOIN\n */\n if (is_array($params['join'])) {\n $join = '';\n foreach ($params['join'] as $k => $v) {\n if (is_numeric($k)) {\n $join .= \" $v\";\n } else {\n if ($k[0] == '*') {\n $join .= ' left';\n $k = ltrim($k, '*');\n } else {\n $join .= ' inner';\n }\n $join .= \" join {$this->prefix}{$k} {$k} on {$v}\";\n }\n }\n } else {\n $join = $params['join'];\n }\n\n /**\n * FIELDS\n */\n if (!is_array($params['fields'])) {\n $params['fields'] = explode(\",\", $params['fields']);\n }\n\n $fields = array();\n\n foreach ($params['fields'] as $k => $v) {\n\n // Allow * and functions\n if (preg_match('/(\\*|[A-Z]+\\([^\\)]+\\)|[a-z]+\\([^\\)]+\\)|SQL_CALC_FOUND_ROWS.*)/', $v)) {\n $r = str_replace('`', '``', $v);\n } else {\n $r = \"`\" . implode('`.`', explode(\".\", str_replace('`', '``', $v))) . \"`\";\n }\n\n if (!is_numeric($k)) {\n $r .= sprintf(\" as `%s`\", str_replace('`', '``', $k));\n }\n\n //$fields[] = $r;\n $params['fields'][$k] = $r;\n }\n\n list($where, $bindings) = $this->_where($where);\n\n $sql = sprintf(/** @lang text */\n \"SELECT %s FROM `%s` %s %s %s\",\n implode(\", \", $params['fields']),\n $this->prefix . $table,\n $table,\n $join,\n !empty($where) ? 'WHERE ' . $where : '');\n\n if ($params['group']) {\n if (is_array($params['group'])) {\n throw new \\Exception('not implemented');\n } else {\n $sql .= sprintf(' GROUP BY %s', $params['group']);\n }\n }\n\n if (!empty($params['order'])) {\n if (is_array($params['order'])) {\n $params['order'] = implode(' ', $params['order']);\n }\n $sql .= sprintf(' ORDER BY %s', $params['order']);\n }\n\n if ($params['limit']) {\n $sql .= sprintf(' LIMIT %d,%d', $params['offset'], $params['limit']);\n }\n\n $query = $this->query($sql);\n\n $query->exec($bindings);\n\n return $query;\n }", "public function getAllFrom($fields,$table,$where=null,$orderby=null,$sort=null,$limit=null,$offset=null,$fetchOne=FALSE){\r\n\r\n $_orderby = !empty($orderby) ? \"order by $orderby\" : \"\";\r\n $_limit = !empty($limit) ? \"limit $limit\" : \"\";\r\n $_offset = !empty($offset) ? \"offset $offset\" : \"\";\r\n\r\n $stmp = $this->connection->prepare(\"SELECT $fields FROM $table $where $_orderby $sort $_limit $_offset\");\r\n \r\n $stmp->execute();\r\n if(!$fetchOne)\r\n return $stmp->fetchAll();\r\n else\r\n return $stmp->fetch();\r\n\r\n }", "public function selectAll(): array\n {\n return $this->pdoConnection->query('SELECT * FROM ' . $this->table, \\PDO::FETCH_CLASS, $this->className)->fetchAll();\n }", "function get_all_array($db,$tblname,$options=NULL)\n{\n if (isset($options)) {\n foreach ($options as $key => $value) {\n switch ($key) {\n case 'columns':\n\tif (is_array($value)) {\n\t $columns = $value;\n\t} else {\n\t $columns[] = $value;\n\t}\n\tbreak;\n case 'sort':\n\tif (is_array($value)) {\n\t $orderparts = $value;\n\t} else {\n\t $orderparts[] = $value;\n\t}\n\tbreak;\n\t\n case 'where':\n\tif (is_array($value)) {\n\t $whereparts = $value;\n\t} else {\n\t $whereparts[] = $value;\n\t}\n\tbreak;\n\t\n default:\n\t# code...\n\t break;\n }\n }\n }\n \n $sql_a = Array(); /* initialize the sql query */\n $sql_a[] = \"SELECT\";\n $sql_a[] = (!empty($columns) ? join(\", \",$columns) : \"*\");\n $sql_a[] = \"FROM $tblname\";\n if (!empty($whereparts)) $sql_a[] = \" WHERE \".join(\" AND \",$whereparts);\n if (!empty($orderparts)) $sql_a[] = \" ORDER BY \".join(\",\",$orderparts);\n $sql_s = join(\" \",$sql_a);\n $result=$db->query($sql_s) or\n die(\"In \".__FILE__.\"@\".__LINE__.\" \".__FUNCTION__.\n\t\"Fatal error in query: $sql: (\".$db->errno.\") \".$db->error);\n $all_rows = Array();\n if ($result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) {\n $all_rows[] = $row;\n }\n }\n $result->free();\n return $all_rows;\n}", "public function getAll()\n {\n return $this->queryBuilder->select($this->table);\n }", "public function select($table, $where = null, $orderBy = null, $limit = null, $fields = '*', $params = array()) {\r\n\t\tif (is_array($fields)) {\r\n\t\t\t$fields = implode(',', $fields);\r\n\t\t}\r\n\t\t$sql = 'SELECT ' . $fields . ' FROM ' . $table . '';\r\n\t\t$sql .= $this->createWhereClause($where, $params);\r\n\t\tif (!empty($orderBy)) {\r\n\t\t\tif (is_array($orderBy)) {\r\n\t\t\t\t$orderBy = implode(',', $orderBy);\r\n\t\t\t}\r\n\t\t\t$sql .= ' ORDER BY ' . $orderBy;\r\n\t\t}\r\n\t\tif (!empty($limit)) {\r\n\t\t\tif (is_array($limit)) {\r\n\t\t\t\t$limit = implode(',', $limit);\r\n\t\t\t}\r\n\t\t\t$sql .= ' LIMIT ' . $limit;\r\n\t\t}\r\n\t\t$stmt = $this->prepare($sql);\r\n\t\t$stmt->execute($params);\r\n\t\t$results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t$stmt->closeCursor();\r\n\t\t$stmt = null;\r\n\t\treturn $results;\r\n\t}", "public function get(array $columns = ['*'], int $limit = 0, int $offset = 0);", "function listColumns($tablename);", "function getRecords($columnParameterArray){\n\t\t\t\n\t\t}", "public function select_only($columns)\r\n {\r\n return call_user_func_array(array($this,'select'), func_get_args());\r\n }", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "public function getTableWhere() {}", "public static function selectAll() {\n $select = self::select(Post::getTableName());\n\n return self::getInstanceData($select);\n }", "public function getRecords($table, $where=false){// method getRecords body start\n\t\t\n\t\tif($where){\n\t\t\t$where = $this->makeWhere($where);\n\t\t}\n\t\t$query = \"SELECT * FROM $table \".$where;\n\t\treturn $this->exeQuery($query);\n\t\t\n\t}", "public function select_all()\n {\n // TODO: Limit to id_user\n $query = $this->db->get($this->table);\n return $query;\n }", "public function select(bool $all = true) : array;", "abstract protected function columns();", "function getDataRowWhere($table,$fields = null,$where = null,$order = null) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadObject();\r\n\t}", "public function selectAll($table)\n { $sql=\"select * from {$table}\";\n $statement = $this->pdo->prepare($sql);\n\n $statement->execute();\n\n return $statement->fetchAll(PDO::FETCH_CLASS);\n }", "public function all($columns = ['*'])\n {\n\n }", "public function select($table, $rows = \"*\", $where = null, $order = null, $limit = null){\n\t\t$q = 'SELECT '.$rows.' FROM '.$table;\n\t\tif($where != null){\n\t\t\t$q .= ' WHERE '.$where;\n\t\t}\n\t\tif($order != null){\n\t\t\t$q .= ' ORDER BY '.$order;\n\t\t}\n\t\tif ($limit != null){\n\t\t\t$q .= ' LIMIT '.$limit;\n\t\t}\n\t\t$result = mysqli_query($this->mysqli,$q);\n\t\twhile ($row = mysqli_fetch_assoc($result)){\n\t\t\t$data[] = $row;\n\t\t}\n\t\treturn $data;\n\t}", "public function select($params = []) {\n\t\t\t// Get the target table\n\t\t\t$table = $params['table'] ?? $this->table;\n\t\t\t// Get columns names [col1, col2, col3] => \"col1, col2, col3\"\n\t\t\t$columns = isset($params['columns']) ? implode(', ', $params['columns']) : '*';\n\t\t\t// Get WHERE condition\n\t\t\t$where = $this->get_where_condition($params['where'] ?? []);\n\t\t\t// Get the params to bind\n\t\t\t$bindings = $this->bindings;\n\n\t\t\t// Execute the query and return results\n\t\t\treturn $this->query(\"SELECT $columns FROM $table $where\", $bindings);\n\t\t}", "public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t ;\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }", "public function all(array $columns = ['*']): Collection;", "public function returning($columns);", "function selectData($table, $where)\n {\n $sql = \"\";\n $record = array();\n $condition = \"\";\n foreach ($where as $key => $value) {\n $condition .= $key . \"= ? and \";\n }\n $condition = substr($condition, 0, -5);\n $sql .= \"select * from $table where $condition\";\n $result = $this->conn->prepare($sql);\n $result->execute(array_values($where));\n if ($result->rowCount() > 0) {\n $row = $result->fetch(PDO::FETCH_ASSOC);\n return $row;\n } else {\n return false;\n }\n $this->conn = null;\n }", "public function getAll()\n {\n return $this->prepare(DB::findAll($this->table));\n }", "public function selectAll($tableName)\n\t{\n\t $sql = \"SELECT * FROM $tableName\";\n\t return $this->select($sql);\n\t}", "function select($columns)\n{\n\t$this->tryModify();\n\t$this->query['select'] = is_array($columns)? $columns : explode(',', $columns);\n\t$this->execute();\n\t$rows = $this->db->fetchAll($this->result);\n\t$this->close();\n\t$this->query['select'] = array('*');\n\treturn $rows;\n}", "public function select(string $table, string $columns, string $where = \"\", array $bindings = array()): PDOStatement;", "public function all()\r\n {\r\n return $this->db->table($this->table)->get();\r\n }", "public function fetchAll()\r\n {\r\n $sql = new Sql($this->dbAdapter);\r\n $select = $sql->select();\r\n $select\r\n ->from(array('a_s' => $this->table))\r\n ->order('a_s.sector_order ASC');\r\n \r\n $selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result = $execute->toArray();\r\n return $result;\r\n }", "function selectAll ($tablename) {\n\t\tif (!isset($this->tables[$tablename]))\n\t\t\t$this->loadTable($tablename);\n\t\treturn $this->tables[$tablename];\t\n\t}", "function getRecords($table, $fields=\"\", $condition=\"\", $orderby=\"\", $single_row=false) //$condition is array \n\t{\n//\t\tif($fields != \"\")\n//\t\t{\n//\t\t\t$this->db->select($fields);\n//\t\t}\n\n $rs = $this->db->table($table);\n\n\t\tif($orderby != \"\")\n\t\t{\n $rs->orderBy($orderby,'DESC');\n\t\t}\n\n\t\tif($condition != \"\")\n\t\t{\n\t\t\t$rs->getWhere($condition);\n\t\t}\n\t\t\n\t\tif($single_row)\n\t\t{ \n\t\t\treturn $rs->get()->getResultArray();\n\t\t}\n\t\treturn $rs->get()->getResultArray();\n\n\t}", "function get_all( $limit = false, $offset = false ) {\n\n\t\t// where clause\n\t\t$this->custom_conds();\n\n\t\t// from table\n\t\t$this->db->from($this->table_name);\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\t\t\n\t\treturn $this->db->get();\n\t}", "abstract protected function getColumns(): array;", "abstract protected function _getColumnNames($rs);", "public function get($table, $vars=array())\n {\n \t// public function select($table, $cols=\"*\", $where=\"\", $orderby=\"\", $limit=-1, $offset=-1){\n \t$keys = $this->keys;\n\t \textract( array_merge( array(\n\t \t\t/* Defaults */\n\t\t \t'cols' \t\t\t\t\t=> '* ',\n\t\t \t\t'make_array'\t\t=> false, // not yet\n\t\t \t\t'cols_adv'\t\t\t=> false,\n\t\t \t'where' \t\t\t\t=> false,\n\t\t\t \t'where_adv' \t\t=> false,\n\t\t\t 'orderby'\t\t\t\t=> false,\n\t\t\t 'limit'\t\t\t\t\t=> false,\n\t\t\t 'offset'\t\t\t\t=> false,\n\t\t\t 'leftjoin'\t\t\t\t=> false,\n\t\t\t \t'leftjoinor'\t\t=> false,\n\t\t\t 'groupby'\t\t\t\t=> false,\n\t\t\t 'limit'\t\t\t\t\t=> false,\n 'count_rows'\t\t\t=> false,\n 'row_number' => false,\n\t\t\t), $vars ) );\n\n if($row_number){\n $limit = array(1, $row_number-1);\n // $offset = $row_number-1;\n }\n\n if($count_rows){\n if($offset){\n $count_rows_q = \", (SELECT @rownum:=\" . $offset . \") r \";\n }else{\n $count_rows_q = \", (SELECT @rownum:=0) r \";\n }\n $table .= $count_rows_q;\n if(trim($cols) == \"*\"){\n $cols .= ', @rownum:=@rownum+1 AS no';\n }else if($cols && is_array($cols)){\n $cols[] = ', @rownum:=@rownum+1 AS no';\n }\n }\n\n\n\t\t\t\t\t\t\t$query = array();\n\t\t\t\t\t\t\t$query[] = $keys['select'];\n\t\t\t\t\t\t\t$query[] = $this->makeCols($cols);\n\t\t\t($cols_adv) ?\t$query[] = $this->makeColsAdv($cols_adv) : false;\n/* \t\t\t\t\t\t\t$query[] = $this->makeArrayCols($cols); // not yet */\n\t\t\t\t\t\t\t$query[] = $this->makeTable($table);\n\t\t\t($leftjoin) ?\t$query[] = $this->makeLeftJoin($leftjoin) : false;\n\t\t\t($leftjoinor) ?\t$query[] = $this->makeLeftJoinOr($leftjoinor) : false;\n\t\t\t($where) ? \t\t$query[] = $this->makeWhere($where) : false;\n\t\t\t($groupby) ? \t$query[] = $this->makeGroupby($groupby) : false;\n\t\t\t($orderby) ? \t$query[] = $this->makeOrderby($orderby) : false;\n\t\t\t($limit) ? \t\t$query[] = $this->makeLimit($limit) : false;\n\n\t\t\t$query = implode($query);\n\t\t\t$this->lastQ = $query;\n\t\t\tif($this->cache){\n\t $data = $this->mysqli_cached_query($query);\n\t }else{\n \t$data = mysqli_query($this->mysql, $query);\n\t if(!$data){ echo \"ERROR: \" . mysqli_error($this->mysql); }\n\t $this->setReturn('array');\n \t $data = $this->sqlReturn($data);\n \t }\n \t ($cols_adv) ?\t$array_columns = $this->parseColsAdv($cols_adv) : $array_columns = array();\n \t foreach($data as $row_k => $row){\n \t \tforeach($array_columns as $key => $ac){\n \t \t\tif(!array_key_exists($key, $data[$row_k])){\n \t \t\t\tif(isset($data[$row_k][$ac])){\n\t \t \t\t\t$data[$row_k][$key] = explode(\":-:\",$data[$row_k][$ac]);\n\t \t \t\t}else{\n\t\t \t \t\t$data[$row_k][$key] = array();\n\t \t \t\t}\n\t \t \t\t$data[$row_k][$key] = array_unique($data[$row_k][$key]);\n\t \t \t\tunset($data[$row_k][$ac]);\n \t \t\t}else{\n\t \t \t\t$data[$row_k][$ac] = explode(\":-:\",$data[$row_k][$ac]);\n\t \t \t\t$data[$row_k][$ac] = array_unique($data[$row_k][$ac]);\n \t \t\t}\n \t \t}\n \t }\n \t return $data;\n\n\n }", "function selTableDataDesc($table,$optfield=\"\", $pdo){\n $qry = ($optfield!=\"\")? \"SELECT * FROM \".$table.\" ORDER BY \".$optfield.\" DESC\": \"SELECT * FROM \".$table;\n //echo $qry;\n $result = array();\n $stm = $pdo->query($qry);\n $rows = $stm->fetchAll(PDO::FETCH_ASSOC);\n foreach($rows as $row) {\n array_push($result,$row);\n }\n return $result;\n}", "public function queryAll() {\r\n $sql = \"SELECT * FROM $this->table\";\r\n $stmt = ConnectionFactory::prepare($sql);\r\n $stmt->execute();\r\n return $stmt->fetchAll();\r\n }", "function createSelect($_table, $_value, $_colum)\n{\n\n $_prev_par= false;\n $_query = \"SELECT * FROM $_table\";\n\n foreach ($_value as $_key => $_value)\n {\n if ($_value != \"\")\n {\n if ($_prev_par)\n {\n $_query.= \" AND \";\n }\n else\n {\n $_query.= \" WHERE \";\n }\n\n $_query.= $_colum[$_key].\" = '$_value'\";\n $_prev_par = true;\n }\n }\n $_query.=\";\";\n\n return $_query;\n}", "public function select($table, $cols=\"*\", $where=\"\", $orderby=\"\", $limit=-1, $offset=-1){\n $query = \"\";\n $query .= \"SELECT \";\n if($cols != \"*\"){\n if(is_array($cols)){\n $query .= implode(\",\", $cols);\n }else{\n $query .= $cols;\n }\n }else{\n $query .= \"*\";\n }\n $query .= \" FROM \";\n $query .= \"\" . $table . \"\";\n\n if($where != \"\"){\n $query .= \" WHERE \";\n if(is_array($where)){\n\t $count = count($where);\n\t foreach($where as $key => $value){\n\t $count--;\n\t $query .= $key . \"='\" . $value . \"'\";\n\t if($count > 0){\n\t $query .= \" AND \";\n\t }\n\t }\n }else{\n\t $query .= $where;\n }\n }\n if($orderby!=\"\"){\n \t$query .= \" ORDER BY \" . $orderby;\n }\n if($limit > 0 AND $offset < 1){\n $query .= \" LIMIT \" . $limit;\n }\n if($limit > 0 AND $offset > 0){\n\t $query .= \" LIMIT \" . $offset . \",\" . $limit;\n }\n if($this->cache){\n\t $data = $this->mysqli_cached_query($query);\n\t return $data;\n\t }else{\n \t$data = mysqli_query($this->mysql, $query);\n\t if(!$data) die(\"ERROR: \" . mysqli_error($this->mysql));\n \t return $this->sqlReturn($data);\n \t }\n }", "public function getQueryFields ($table);", "public function all($cols = ['*']);", "private function Select()\n {\n $return = false;\n $action = $this->Action();\n $columns = $this->Columns();\n $table = $this->Table();\n $where = (Checker::isArray($this->Where(), false))?$this->Where():array(Where::QUERY => \"\", Where::VALUES => array());\n $order = (Checker::isString($this->Order()))?$this->Order():\"\";\n $limit = (Checker::isInt($this->Limit()))?\" LIMIT \".$this->Limit():\"\";\n if($columns && $table && Checker::isArray($where, false))\n {\n $return[Where::QUERY] = \"$action $columns FROM $table\".$where[Where::QUERY].\"$order$limit\";\n\n if(Checker::isArray($where, false) && isset($where[Where::VALUES])) $return[Where::VALUES] = $where[Where::VALUES];\n else $return[Where::VALUES] = array();\n }\n return $return;\n }", "abstract public function get_rows();", "public function select_all($tbl){\r\n\t\t $this->db->query('select * from '.$tbl);\r\n\t\t return $this->db->result();\r\n\t\t }", "public function get_data($getTable, $select)\n\t{\t\n\t\t$this->db->distinct();\n\t\t$this->db->select($select);\n\t\treturn $this->db->get($getTable);\n\t}", "public function getAll()\n {\n return $this->db->table($this->tableName)->select('*')->findAll();\n }", "function columns($table)\n{\n\treturn $this->drv->columns($table);\n}", "abstract protected function columns(): array;" ]
[ "0.7195091", "0.68152326", "0.67870235", "0.66686285", "0.6666978", "0.6649126", "0.6649126", "0.6611617", "0.6579524", "0.6561538", "0.65535975", "0.65409034", "0.65321434", "0.6507035", "0.6437925", "0.6398151", "0.63508904", "0.6344888", "0.63421124", "0.6325506", "0.6305017", "0.6290063", "0.6265878", "0.6256073", "0.6244086", "0.6239592", "0.62079066", "0.6196994", "0.61927634", "0.6181338", "0.6178908", "0.6170644", "0.6159945", "0.6146144", "0.61431724", "0.61431444", "0.60877043", "0.6075408", "0.6075105", "0.6074374", "0.6062212", "0.6052741", "0.6045322", "0.60305655", "0.6025348", "0.6023058", "0.60218704", "0.6019599", "0.6004031", "0.6003834", "0.59968156", "0.5992405", "0.5991736", "0.59813976", "0.5972791", "0.59686524", "0.5966855", "0.5961892", "0.5959569", "0.59528416", "0.595028", "0.5949003", "0.59484327", "0.5939849", "0.5934737", "0.5927929", "0.59263957", "0.5922983", "0.5921863", "0.59198105", "0.5918551", "0.59075946", "0.5894667", "0.58916616", "0.58838284", "0.58821005", "0.58768386", "0.5866666", "0.5865802", "0.5865542", "0.5864819", "0.5863388", "0.58564395", "0.58548015", "0.58476305", "0.58472294", "0.5837379", "0.5834901", "0.5834103", "0.5833745", "0.5832024", "0.5831467", "0.58287877", "0.5828722", "0.58283246", "0.58170736", "0.58153486", "0.58022875", "0.58009946", "0.5798896", "0.57980275" ]
0.0
-1
Adds a new record with the values specified in the argument
public function create(array $data) { return $this->model->create($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\n\t\t// update the DB table appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\t$this->_data[$key] = $record;\n\n\t\t$this->store();\n\t}", "function addNew($rec)\r\n\t\t{\r\n\t\t\t// Create associative array of key fields and data values\r\n\t\t\t$data = array(\"idMedicalRecord\"=>$rec[0],\"medicalRec_weight\"=>$rec[1],\"medicalRec_height\"=>$rec[2],\"medicalRec_bloodPressure\"=>$rec[3],\"medicalRec_temperature\"=>$rec[4],\"medicalRec_bloodIronLevel\"=>$rec[5],\"medicalRec_time\"=>$rec[6],\"medicalRec_date\"=>$rec[7],\"medicalRec_medicalHistory\"=>$rec[8],\"medicalRec_rejectionReason\"=>$rec[9]);\r\n\t\t\t// Bind values to object's attributes\r\n\t\t\t$this->bind($data);\r\n\t\t\t// Add new values to table in database\r\n\t\t\t$this->insert();\r\n\t\t}", "function dbase_add_record($dbase_identifier, $record)\n{\n}", "public function addRecord()\n {\n $rec = new Record($this, true);\n $rec->markForInsert();\n $this->records[] = $rec;\n return $rec;\n }", "public function add(Record $record)\n {\n $this->list[] = $record;\n }", "public function createRecord(array $data = array());", "public function createRecord();", "public function pushRecord()\r\n {\r\n\r\n }", "public function add() {\n $fields_definition = '';\n $fields_values = '';\n foreach ($this->fields as $name => $value) {\n $fields_definition .= '`' . $name . '`, ';\n $fields_values .= '\\''. $value . '\\', ';\n }\n\n $fields_definition = chop($fields_definition, ', ');\n $fields_values = chop($fields_values, ', ');\n\n $query = 'INSERT INTO `' . $this->table . '`'\n . ' (' . $fields_definition\n . ' ) VALUES ( ' . $fields_values . ' )';\n\n return $this->connection->query($query);\n }", "function add_row()\n\t{\n\t\t$args = func_get_args();\n\t\t$this->rows[] = $this->_prep_args($args);\n\t}", "function add($record)\n {\n $data = get_object_vars($record);\n $this->rest->initialize(array('server' => REST_SERVER));\n $this->rest->option(CURLOPT_PORT, REST_PORT);\n $retrieved = $this->rest->post('recipe/maintenance/item/id/' . $record->menu_id.'-'.$record->inventory_id, $data);\n }", "public function addRecord($pObject) {\r\n $this->records[] = $pObject;\r\n }", "public function addRecords($paramsValues,$params){\n \n $this->params = $params;\n $this->paramsValues = $paramsValues;\n\n $result = $this->insertRecords();\n\n return array (\n 'success' => true,\n 'results' => $result != false ? $this->recordsAdded : $this->noRecords\n );\n }", "public function createRecord(array $data);", "public function add();", "public function add();", "function Add($name, $value)\r\n\t{\r\n\t\tif (is_array($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data[$name] = $value;\t\r\n\t\t}\t\r\n\t\telse if (is_object($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data->$name = $value;\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error(\"A DataRow of base type, cannot have fields added.\",E_USER_ERROR);\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function addRecords($recordArray)\n\t{\n\t\tif (count($recordArray) >= 1)\n\t\t{\n\t\t\t$this->dataSet = $recordArray;\n\t\t}\n\t}", "function add( $obj )\r\n\t{\r\n\t\tif ( $this->signUseID == true) {\r\n\t\t\t$pos = $obj->primary_key_value();\r\n\t\t\t$this->data[ $pos ] = $obj;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$this->data[] = $obj;\r\n\t\t}\r\n\t}", "public function add($record, $key = NULL)\n\t{\n\t\tprint $key . ' ' . $record;\n\t\tforeach ($this->_data as $val) {\n\t\t\tif ($val === $record) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\tif (isset ($key)) {\n\t\t\tif (isset ($this->_data [$key])) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$this->_data [$key] = $record;\n\n\t\t\treturn TRUE;\n\t\t}\n\t\t$this->_data [] = $record;\n\n\t\treturn TRUE;\n\t}", "public function addScoreRecordList(\\sc\\score\\ScoreRecord $value){\n return $this->_add(2, $value);\n }", "public function insert(...$field_values);", "public function add(array $parameters);", "function add($input = array(), $rID){\n $this->delete_by('OrderId', $rID);\n \n //now cycle through and add all new records\n if (count($input))\n {\n //submit query\n foreach ($input as $k => $array)\n {\n if ($array['Qty'] >= 1)\n {\n $array['OrderId'] = $rID;\n $r[$k] = $this->save($array);\n }\n \n }\n \n }\n \n return $r;\n }", "function createRecord($array){\n parent::createRecord($array);\n }", "function Add() \n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$insertFields = \"\";\n\t\t$insertValues = \"\";\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t$blobs = array();\n\t\t//\tprepare parameters\t\t\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\tif( isset($this->{$fld['varname']}) )\n\t\t\t{\n\t\t\t\t$this->Value[ $fieldname ] = $this->{$fld['varname']};\n\t\t\t}\n\t\t\t\n\t\t\tforeach($this->Value as $field => $value)\n\t\t\t{\n\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t$insertFields.= $this->_connection->addFieldWrappers( $fieldname ).\",\";\n\t\t\t\t$insertValues.= $this->PrepareValue($value,$fld[\"type\"]) . \",\";\n\t\t\t\t\n\t\t\t\tif( $this->_connection->dbType == nDATABASE_Oracle || $this->_connection->dbType == nDATABASE_DB2 || $this->_connection->dbType == nDATABASE_Informix )\n\t\t\t\t{\n\t\t\t\t\tif( IsBinaryType( $fld[\"type\"] ) )\n\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t\t\t\n\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Informix && IsTextType( $fld[\"type\"] ) )\n\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//\tprepare and exec SQL\n\t\tif( $insertFields != \"\" && $insertValues != \"\" )\t\t\n\t\t{\n\t\t\t$insertFields = substr($insertFields, 0, -1);\n\t\t\t$insertValues = substr($insertValues, 0, -1);\n\t\t\t$dalSQL = \"insert into \".$this->_connection->addTableWrappers( $this->m_TableName ).\" (\".$insertFields.\") values (\".$insertValues.\")\";\n\t\t\t$this->Execute_Query($blobs, $dalSQL, $tableinfo);\n\t\t}\n\t\t//\tcleanup\t\t\n\t $this->Reset();\n\t}", "abstract public function insertRecord($tableName, $record);", "public function add($value);", "public function add($value);", "function add_a_record()\n {\n /**\n * @var str IP Address for the A record\n * @var int TTL for the A record\n * @var str Hostname for the A record\n * @var str Regex to Validate IPv4 Addresses\n */\n $ip = Null;\n $ttl = Null;\n $host = Null;\n $hnregex = \"/(([a-zA-Z0-9](-*[a-zA-Z0-9]+)*).)+\" . $this->domainnames[$this->domain_id]['name'] . \"/\";\n $shnregex = \"/^(([a-zA-Z0-9](-*[a-zA-Z0-9]+)*).)/\";\n while (!is_string($ip)) {\n $ip = filter_var(readline(\"IP Address: \"), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\n }\n while (!is_int($ttl)) {\n $ttl = filter_var(readline(\"TTL [300]: \"), FILTER_VALIDATE_INT);\n $ttl = (!is_bool($ttl)) ? $ttl : 300;\n }\n while (!is_string($host)) {\n $hosttmp = readline(\"Hostname for new A record: \");\n if (filter_var($hosttmp, FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $hnregex)))) {\n $host = $hosttmp;\n } elseif (filter_var($hosttmp, FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $shnregex)))) {\n $host = filter_var($hosttmp . \".\" . $this->domainnames[$this->domain_id]['name'], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $hnregex)));\n }\n }\n\n foreach ($this->domains as $d) {\n if ($d->name == $this->domainnames[$this->domain_id]['name']){\n $domain = $d;\n }\n }\n\n $record = array(\n 'name' => $host,\n 'type' => 'A',\n 'ttl' => $ttl,\n 'data' => $ip);\n\n printf(\"\\nYou would like to add the following record:\\n\");\n printf(\"Type: %s\\n\", $record['type']);\n printf(\"Name: %s\\n\", $record['name']);\n printf(\"IP: %s\\n\", $record['data']);\n printf(\"TTL: %s\\n\", $record['ttl']);\n\n $proceed = readline(\"Type \\\"Y\\\" or \\\"y\\\" to proceed: \");\n\n if (strtolower($proceed) === 'y') {\n $hostentry = $domain->record($record);\n try {\n $response = $hostentry->create();\n printf(\"Created!\\n\");\n } catch (Exception $e) {\n printf(\"%s\\n\", $e);\n }\n } else {\n printf(\"ABORTED!\\n\");\n }\n }", "public function createRecord()\n {\n $sql = sprintf(\n \"INSERT INTO %s (%s) values (%s)\", \"Cubans\",\n implode(\", \", array_keys($this->arrayKeysValues())),\n \":\" . implode(\", :\", array_keys($this->arrayKeysValues()))\n );\n $statement = $this->connect->prepare($sql);\n\t\t$statement->execute($this->arrayKeysValues());\n }", "public function add($data = array())\n {\n return $this->db->insert($this->tableName, $data);\n }", "public function addChild(Doctrine_Record $record);", "function add($table, $data = array()) {\n $this->connect();\n $field_list = '';\n $value_list = '';\n foreach ($data as $key => $value) {\n $field_list .= $key . ',';\n $value_list .= \"'\" . $value . \"'\" . ',';\n }\n $sql = 'INSERT INTO ' . $table . ' (' . trim($field_list, ',') . ') VALUES (' . trim($value_list, ',') . ')';\n return mysqli_query($this->_conn, $sql);\n }", "function log_record_add($rec, $sort, $type, $record) {\n $pid = $type.':'.$rec.'.'.$sort;\n if (strlen($record) > 0) {\n lr_set($pid, $record);\n } else {\n lr_clear($pid);\n }\n}", "public function recInsert($record) {\n $conn = Query::connect();\n $col = $conn->SelectLimit(\"select*from \".static::getTable(),1);\n $sql = $conn->GetInsertSQL($col,$record);\n $rs = $conn->Execute($sql);\n return $conn->ErrorNo();\n }", "function addRecord()\n {\n global $invenArray;\n // Add the new information into the array\n $invenArray[] = array($_POST[\"empID\"],$_POST[\"fName\"],$_POST[\"lName\"],$_POST[\"truckNum\"],$_POST[\"phoneNum\"],$_POST[\"yrsOfSen\"]);\n // The sort will be on the first column (part number) so use this to re-order the displays\n sort($invenArray);\n // Save the updated array in its session variable\n $_SESSION[\"serializedArray\"] = urlencode(serialize($invenArray));\n }", "public function addItem($params){\n $sql = \"insert into fruit_table (name) values (:name)\";\n $sth = $this->parent->db->prepare($sql);\n // Key = value pair\n $sth->execute(array(\":name\"=>$params[\"name\"]));\n }", "function add($_data = null)\n\t{\n\t\tif (empty($_data['fields']) AND empty($_data['table'])){\n\t\t return FALSE;\n\t\t}\n\t\t\n\t\t$data = array();\n\t\tforeach($_data['fields'] as $k => $d)\n\t\t{\n\t\t\t$data[$k] = $d;\n\t\t}\n\t\t\n\t\t$ret =\t$this->db->insert($_data['table'], $data);\n\t\n\t\t\n\t\tlog_message('info','SQL Query: ' . $this->db->last_query());\n\t\n\t\t$this->__insert_id = $this->db->insert_id();\n\t\treturn $ret;\n\t}", "public function add($data)\n {\n }", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function addRecord($level, $message, array $context = array())\n {\n parent::addRecord($level, $message, $context);\n }", "public function insert($newrecord)\n {\n global $debug;\n global $warn;\n global $connection;\n\n if ($this->list === null)\n $this->list = array($newrecord->getId() => $newrecord);\n else\n { // list is not empty\n $offset = 0;\n foreach($this->list as $key => $record)\n {\n if ($newrecord->compare($record) < 0)\n { // new record sorts before current record\n $before = array_slice($this->list, 0, $offset, true);\n $after = array_slice($this->list, $offset, null, true);\n $this->list = $before +\n array($newrecord->getId() => $newrecord) +\n $after;\n $newrecord = null;\n break;\n }\n $offset++;\n }\n if ($newrecord)\n { // add to end\n $this->list[$newrecord->getId()] = $newrecord;\n } // add to end\n } // list is not empty\n $this->information['count'] = count($this->list);\n }", "private function crud_post($record = null) {\n $key = $record['id'];\n\n if (!isset($key)) {\n $this->response(array('error' => 'Create: No supply specified'), 406);\n return;\n }\n\n if ($this->supplies->exists($key)) {\n $this->response(array('error' => 'Create: Supply ' . $key . ' already exists'), 406);\n return;\n }\n\n $this->supplies->add($record);\n\n $oops = $this->db->error();\n if (empty($oops['code']))\n $this->response(array('ok'), 200);\n else\n $this->response($oops, 400);\n }", "public function add(array $entry);", "function CustomAdd(&$values, &$keys, &$error, $inline, &$pageObject)\n{\n\n\t\tcalendar_AddRecord($values);\n\nreturn false;\n;\t\t\n}", "function add_newuser($user) {\n global $DB;\n $DB->insert_record('report_user_statistics', $user, false);\n}", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "public function add(){\n $tab = DB::table('student');\n $res = $tab -> insert(['name' => '小黑', 'age' => '18']);\n }", "public function add($data)\n {\n return $this->db->table($this->tableName)->insert($data)->execute();\n }", "public function Add(){\n $insert =[\n 'RankNo'=>32132,\n 'UserName'=>$UserName,\n 'NickName'=>123,\n 'MoneyNum'=>32131,\n 'Signature'=>32132131,\n 'WeChatID'=>3213123,\n 'Status'=>$Status,\n 'head_img'=>$head_img\n ];\n return $this->insert($insert);\n }", "public function add() {\n $insertData = $this->data;\n $keepNullFields = [\n 'estimator_id', 'date_requested', 'date_service', 'class_id',\n 'date_service', 'lat', 'lng'\n ];\n foreach ($keepNullFields as $field) {\n if (!$insertData[$field]) {\n $insertData[$field] = null;\n }\n }\n $model = new ReferralModel;\n $ref = $model->create();\n $ref->set($insertData);\n $ref->save();\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request created successfully',\n 'data' => $ref->asArray()\n ]);\n }", "public function testaddOneRecord()\n\t{\n\t\t$this->assertEquals(1,1);\n\t}", "function add($data){\n if(array_key_exists($data['id'], $this->fields)){\n exit(\"Field with ID: '\".$data['id'].\"' already exists.\");\n }\n if(!isset($data['validate'])){\n $data['validate'] = false;\n }\n if(!isset($data['inline'])){\n $data['inline'] = null;\n }\n if(!isset($data['value'])){\n $data['value'] = null;\n }\n if(!isset($data['readonly'])){\n $data['readonly'] = false;\n }\n\n $this->fields[$data['id']] = $data;\n }", "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function add($item);", "public function add($item);", "public function insert(&$key, $record, $flags = 0) {\n return UPS_SUCCESS;\n }", "public function newRecord($domain, array $parameters)\n {\n $this->checkParameters($parameters);\n\n return $this->processQuery(\n $this->buildRecordsQuery($domain, null, RecordsActions::ACTION_ADD, $parameters)\n );\n }", "function addRecord($con, $inpTeam, $inpEnv, $inpTech, $inpType, $inpInitial, $inpFinal, $totSavings, $inpCause, $inpSteps, $inpDate, $inpProj, $userID)\n\t{\n\t\t$stmt_insert = $con->prepare(\"INSERT INTO costsavings (csCause, csSteps, csDate, csSavings, csInitial, csFinal, teamID, techID, envID, typeID, projectID, userID) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\");\n\t\t$stmt_insert->bind_param(\"sssdddiiiiii\", $inpCause, $inpSteps, $inpDate, $totSavings, $inpInitial, $inpFinal, $inpTeam, $inpTech, $inpEnv, $inpType, $inpProj, $userID);\n\t\t$stmt_insert->execute() or die(mysqli_error($con));\n\n\t\t$msgDisplay = successAlert(\"Successfully inserted a new record.\");\n\n\t\treturn $msgDisplay;\n\t}", "function add($table_name, $data_array)\n\t{\n\n\t}", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "public function add($data)\r\n {\r\n $data = $this->sanitize($data);\r\n\r\n return $this->db->table($this->table)->insertGetId($data);\r\n\r\n }", "public function addItem($params)\r\n\t{ \t\t\r\n\t\t$this->setData($params)\r\n\t\t ->save()\r\n\t\t ;\t\r\n\t\treturn $this;\t\t\r\n\t}", "public function addField();", "public final function _addInstance(AutoRecord $record)\n {\n $this->_recordInstances[$record->getTableName()][$record->getPrimaryKeyValue()] = $record;\n }", "public function createNewRecord() {\n try {\n // Define classes that we need to use.\n $phoneUtil = PhoneNumberUtil::getInstance();\n $phoneNumberCarrier = PhoneNumberToCarrierMapper::getInstance();\n // Define PhoneNumber instance.\n $phoneNumber = $phoneUtil->parse($this->number);\n // Check if phone number is valid.\n if ($phoneUtil->isValidNumber($phoneNumber)) {\n // Get phone number parameters.\n $countryCode = $phoneUtil->getRegionCodeForNumber($phoneNumber);\n $carrier = $phoneNumberCarrier->getNameForNumber($phoneNumber, $countryCode);\n $countryDialingCode = $phoneNumber->getCountryCode();\n $subscriberNumber = $phoneNumber->getNationalNumber();\n\n // We will return this data to the view.\n $data = [\n 'mno' => $carrier,\n 'country_dialing_code' => $countryDialingCode,\n 'subscriber_number' => $subscriberNumber,\n 'country_code' => $countryCode,\n ];\n\n // Save new record into database.\n $record = Records::create([\n 'phone_number' => $this->number,\n 'data' => json_encode($data),\n ]);\n\n return $record;\n }\n } catch (NumberParseException $e) {\n throw new NumberParseException($e, $e->getMessage());\n }\n }", "public function createRecord($request){\n\t}", "function updateRecords($record) {\n\t$nameStr = \"\";\n\t$valueStr = \"\";\n\t$count = 1;\n\tforeach($record as $name => $value) {\n\t\t$nameStr .= \"`$name`\";\n\t\t$valueStr .= \"'$value'\";\n\t\tif ($count < count($record)) {\n\t\t\t$nameStr .= \", \";\n\t\t\t$valueStr .= \", \";\n\t\t}\n\t\t$count++;\n\t}\n\t$sql = \"INSERT INTO track_visitors ($nameStr) VALUES ($valueStr)\";\n\techo $sql;\n\treturn $sql;\n}", "public function testAddOneRecord() {\n $data = ['line' => 1];\n $line = $this->db->add(new DateTime('2015-07-07 09:00:00.000001 -0000'), $data);\n $this->assertEquals(1, $line);\n\n // Check that the data file has the right contents\n $this->assertEquals('2015-07-07 09:00:00.000001 {\"line\":1}'.\"\\n\", file_get_contents(self::$dir.'/2015/07/07.txt'));\n\n // Check that the meta file has the right contents\n $this->assertEquals('1', trim(file_get_contents(self::$dir.'/2015/07/07.meta')));\n\n // Check that the \"lastshard.txt\" file has the right contents\n $this->assertEquals('2015-07-07', file_get_contents(self::$dir.'/lastshard.txt'));\n }", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function insert($listOfValue);", "public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }", "public function newRecord($data,$module=\"Leads\") {\r\n \r\n \r\n //if(count($data)&lt;=0)return \"\";\r\n $records = [];\r\n try{\r\n \r\n $record = ZCRMRecord::getInstance( $module, null );\r\n foreach($data as $d=>$v)\r\n $record->setFieldValue($d, $v);\r\n \r\n\r\n $records[] = $record;\r\n \r\n $zcrmModuleIns = ZCRMModule::getInstance($module);\r\n $bulkAPIResponse=$zcrmModuleIns->createRecords($records); // $recordsArray - array of ZCRMRecord instances filled with required data for creation.\r\n $entityResponses = $bulkAPIResponse->getEntityResponses();\r\n \r\n foreach($entityResponses as $entityResponse){\r\n if(\"success\"==$entityResponse->getStatus()){\r\n $createdRecordInstance=$entityResponse->getData();\r\n return $createdRecordInstance->getEntityId();\r\n \r\n }\r\n else{\r\n $file_names = __DIR__.\"/zoho_ERROR_ADDNEW_log.txt\";\r\n \t\t\t\t file_put_contents($file_names, (json_encode($entityResponses)).PHP_EOL , FILE_APPEND | LOCK_EX);\t\r\n \t\t\t\t return \"-1\";\r\n }\r\n }\r\n \r\n \r\n }catch(Exception $e){\r\n $file_names = __DIR__.\"/zoho_ERROR_ADDNEW_log.txt\";\r\n\t\t\t\t file_put_contents($file_names, $e.PHP_EOL , FILE_APPEND | LOCK_EX);\t\r\n return \"\";\r\n }\r\n \r\n \r\n }", "public function add($entity);", "public function create_record() {\n $class = get_called_class();\n\n if ($this->does_exist()) {\n return false;\n }\n\n $db = DB::connect();\n\n $attributes = '';\n $values = '';\n\n // Loop through all the attributes to get the attributes and values\n foreach (get_object_vars($this) as $key => $value) {\n // We dont add the id of the object, as it is autoincremented\n if ($value == null) {\n continue;\n }\n\n $attributes = $attributes . \" $key,\";\n\n // We cannot add an object to sql statemnt. if the value is an object, get the id of it\n if (gettype($value) == 'object') {\n $value = $value->id;\n } elseif (gettype($value) === 'string') {\n $value = \"'\" . $value . \"'\";\n }\n\n $values = $values . \" $value,\";\n\n }\n\n // Delete the last comma\n $attributes = substr_replace($attributes, \" \", -1);\n $values = substr_replace($values, \" \", -1);\n\n $sql = $db->prepare(\"INSERT INTO \" . $class . \" (\" . $attributes . \") VALUES (\" . $values . \")\");\n $sql->execute();\n\n return true;\n }", "function add_record(){\r\n\t\t//This is done because of the \"duplicate key\" issues due to multiple hits of PayPal return URL by PayPal\r\n\t\t$query = \"select id from risk_score where cart_id=$this->cart_id\";\r\n\t\t$result = mysql_query($query);\r\n\t\tif(mysql_error()!=\"\"){\r\n\t\t\treturn \"Error: An error occurred while checking if a record exists in risk_score for cart_id $cart_id. Error is: \".mysql_error();\r\n\t\t}\r\n\t\tif(mysql_num_rows($result)!=0){\r\n\t\t\t$row = mysql_fetch_assoc($result);\r\n\t\t\t$this->id = $row[\"id\"];\r\n\t\t\treturn $this->id;\r\n\t\t}\r\n\t\t\r\n\t\t$query = \"insert into risk_score(\r\n\t\t\t\t\t\torder_status, \r\n\t\t\t\t\t\tcart_id, \r\n\t\t\t\t\t\tip_address, \r\n\t\t\t\t\t\tip_location, \r\n\t\t\t\t\t\trisk_score, \r\n\t\t\t\t\t\thigh_purchase_activity, \r\n\t\t\t\t\t\tcountry_blacklisted, \r\n\t\t\t\t\t\tfree_provider_email, \r\n\t\t\t\t\t\tip_blacklisted, \r\n\t\t\t\t\t\tip_not_matches_country, \r\n\t\t\t\t\t\tfwd_num_not_match_site, \r\n\t\t\t\t\t\tmultiple_fwd_numbers, \r\n\t\t\t\t\t\tfwd_num_blacklisted, \r\n\t\t\t\t\t\tnew_member, \r\n\t\t\t\t\t\torder_over_20_dollars, \r\n\t\t\t\t\t\tover_2_nums_in_7_days, \r\n\t\t\t\t\t\tover_1_acct_credit_in_7_days,\r\n\t\t\t\t\t\tdocs_required\r\n\t\t\t\t\t)values(\r\n\t\t\t\t\t\t\".$this->order_status.\", \r\n\t\t\t\t\t\t\".$this->cart_id.\", \r\n\t\t\t\t\t\t'\".$this->ip_address.\"', \r\n\t\t\t\t\t\t'\".$this->ip_location.\"', \r\n\t\t\t\t\t\t\".$this->risk_score.\", \r\n\t\t\t\t\t\t'\".$this->high_purchase_activity.\"', \r\n\t\t\t\t\t\t'\".$this->country_blacklisted.\"', \r\n\t\t\t\t\t\t'\".$this->free_provider_email.\"', \r\n\t\t\t\t\t\t'\".$this->ip_blacklisted.\"', \r\n\t\t\t\t\t\t'\".$this->ip_not_matches_country.\"', \r\n\t\t\t\t\t\t'\".$this->fwd_num_not_match_site.\"', \r\n\t\t\t\t\t\t'\".$this->multiple_fwd_numbers.\"', \r\n\t\t\t\t\t\t'\".$this->fwd_num_blacklisted.\"', \r\n\t\t\t\t\t\t'\".$this->new_member.\"', \r\n\t\t\t\t\t\t'\".$this->order_over_20_dollars.\"', \r\n\t\t\t\t\t\t'\".$this->over_2_nums_in_7_days.\"', \r\n\t\t\t\t\t\t'\".$this->over_1_acct_credit_in_7_days.\"',\r\n\t\t\t\t\t\t'\".$this->docs_required.\"'\r\n\t\t\t\t\t)\";\r\n\t\t$result = mysql_query($query);\r\n\t\tif(mysql_error()==\"\"){\r\n\t\t\t$this->id = mysql_insert_id();\r\n\t\t\treturn $this->id;\r\n\t\t}else{\r\n\t\t\treturn \"Error: An error occurred while inserting Risk Score record.<br><br>\".mysql_error().\"<br><br>Query is: $query\";\r\n\t\t}\r\n\t\t\r\n\t}", "public function add($data)\n {\n $tableName = $this->getTableName();\n return $this->callChain('insert', [$tableName, $data], $this->getStorage());\n }", "public function add_entry($entry);", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n {\n }", "protected function _create()\n {\n $entry = $this->_db->createRow();\n foreach ($this->getFields() as $key => $value) {\n $entry->{$key} = $value;\n }\n return $entry->save();\n }", "function newRecord($vals=null){\n\t\treturn new Dataface_ViewRecord($this, $vals);\n\t}", "public function add( $data, $shard = NULL );", "public function add(...$items);", "public function addItem($key, $value);", "public function addValue($value);", "function make_record($id, $patient, $doctor, $rad, $type, $p_date, $t_date, $diag, $desc){\n\t$conn = connect();\n\t$sql = \"insert into radiology_record values (\".(string)$id.\", \".(string)$patient.\", \".(string)$doctor.\", \".(string)$rad.\", '\".(string)$type.\"', TO_DATE('\".(string)$p_date.\"', 'YYYY-MM-DD'), TO_DATE('\".(string)$t_date.\"', 'YYYY-MM-DD'), '\".(string)$diag.\"', '\".(string)$desc.\"')\";\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\toci_commit($conn);//_______________________________-----------------------------------------------------------------------------------------------\n\toci_free_statement($statement);\n\toci_close($conn);\n}", "public function add ($item) {\n $objData = get_object_vars($item);\n $keys = array_keys($objData);\n // Query time.\n $sql = 'INSERT INTO ' . $this->table . ' (' . implode(',', $keys) . ') VALUES (:' . implode(',:', $keys) . ')';\n $this->query($sql, $objData);\n // Update the item primary key if single before returning it.\n/*\n if (count($this->keys) === 1) {\n $pk = current($this->keys);\n $item->$pk = $this->pdo->lastInsertId();\n }\n*/\n return $item;\n }", "function add($item);", "public function addRow($data){\n $data = (array)$data;\n $this->counter++;\n $newRow = [];\n $newRow = array_merge($newRow, $this->saveMetaData($data));\n $newRow = array_merge($newRow, $this->saveGeoData($data));\n $newRow = array_merge($newRow, $this->saveCoreData($data));\n $this->rowData[]=$newRow;\n }", "function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}", "public function add(){\r\n\t\t//$this->auth->set_access('add');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function add_invoice_row() {\n\n $addFlag = false;\n\n // Set null values to check for and later insertion if required\n $data = array(\n 'category' => null,\n 'description' => null,\n 'amount' => null,\n 'mockInvoiceId' => $_POST[ 'mockInvoiceId' ]\n );\n\n // Check if there are any rows that have nothing in them\n $row = $this->mockinvoice_row_model->get_by( $data );\n\n // Add a new row if there are no blank ones already\n if ( empty( $row ) ) {\n // Add a new row with empty values\n $this->mockinvoice_row_model->save( $data );\n $addFlag = true;\n }\n\n\n // Send back if a new row was added\n $returnArray[] = array( 'rowAdded' => $addFlag );\n $this->json_library->print_array_json_unless_empty( $returnArray );\n }", "public function add(array $params) {\n $this->_list[$params['option_id']][$params['store_id']] = $params;\n }", "function addData($fields,$key = 'id') {\n\t\t$result = $this->add($fields,'$key','NULL');\n\t\tif($result) return $result;\n\t\treturn 0;\n\t}", "public function add_payer_record($data){\n\t\t$this->db->insert('tat_finance_payers', $data);\n\t\tif ($this->db->affected_rows() > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function add($data)\n {\n if(count($data) == 0) {\n return false;\n }\n\n return $this->db->table($this->table)->insert(array_merge($data, $this->getTimestamps()));\n }", "public function insertData (array $params);" ]
[ "0.742345", "0.70386", "0.67879176", "0.6571679", "0.65170425", "0.6398345", "0.6354458", "0.63368976", "0.63024306", "0.62564", "0.61829877", "0.6165277", "0.6156917", "0.6153917", "0.60866964", "0.60866964", "0.60536975", "0.6051793", "0.60477716", "0.6037026", "0.6010622", "0.59952354", "0.5988511", "0.5962001", "0.59462744", "0.5889501", "0.588018", "0.58769715", "0.58769715", "0.58566165", "0.5841505", "0.5841281", "0.5831189", "0.58202565", "0.5818414", "0.5806044", "0.5796176", "0.5793931", "0.57751954", "0.5756211", "0.57555735", "0.5744096", "0.5730444", "0.57300854", "0.56597316", "0.56551886", "0.5651683", "0.5651175", "0.5651175", "0.56484234", "0.5646976", "0.5642063", "0.56354785", "0.5629171", "0.5620245", "0.5607736", "0.5606391", "0.5606391", "0.5604863", "0.5599909", "0.55933017", "0.5587305", "0.5584243", "0.5577549", "0.5559745", "0.55586344", "0.555079", "0.55424654", "0.5534146", "0.55223453", "0.55143523", "0.550731", "0.54957443", "0.54903185", "0.5474726", "0.5468791", "0.5463946", "0.5462425", "0.5458411", "0.5452772", "0.54487884", "0.54487884", "0.54487884", "0.54455006", "0.5441547", "0.5441373", "0.54398745", "0.5424521", "0.5421651", "0.5421557", "0.541904", "0.54135495", "0.54112446", "0.54076433", "0.5406852", "0.5405888", "0.5405211", "0.5390549", "0.5389277", "0.5386125", "0.53858554" ]
0.0
-1
Record Update. First argument is data, second argument is id
public function update(array $data, $id) { return $this->model->where('id', $id)->update($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 update(array $data, $id);", "public function update(array $data, $id);", "public function update(array $data,$id);", "public function update($id, array $data);", "public function update($id, array $data);", "public function update($id, array $data);", "public function update($id, array $data);", "public function update($id, array $data);", "public static function update($data , $id)\n {\n self::_update(self::tableName(), $data, 'id = '. $id);\n }", "public abstract function updateById(int $id, array $data): void;", "public function update ($data,$id)\n\t{\n\t\treturn $this->save($data,$id);\n\t}", "public function update($data) {}", "public function update($data) {}", "function update($id, $data)\n {\n $this->db->where($this->id,$id);\n $this->db->update($this->table, $data);\n }", "public function update(array $data, int $id)\n {\n }", "public function update($record);", "public function update($id, Array $data)\r\n {\r\n }", "function update($id, $data)\n\t{\n\t\t$this->db->where($this->id, $id);\n\t\treturn $this->db->update($this->table, $data);\n\t}", "public function update(array $data, $id)\n {\n }", "public function update(array $data, $id)\n {\n }", "public function update_record($data, $id){\n\t\t$this->db->where('training_id', $id);\n\t\tif( $this->db->update('training',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function update($id, array $data)\n {\n }", "public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }", "public function update ($data, $id)\n\t{\n\t\treturn $this->db->update($data, $this->tableName, \"id='$id'\");\n\t}", "public function update_data($id, $data)\n {\n $this->builder->where('id', $id);\n $this->builder->update($data);\n }", "public function doRestUpdate($id, $data) {\t\t\n\t\t$model = $this->saveModel($this->loadOneModel($id), $data);\n $this->outputHelper(\n 'Record Updated',\n $model,\n 1\n );\n\t}", "public function update(array $data, $id): bool;", "public function update_record($data, $id){\n\t\t$this->db->where('award_id', $id);\n\t\tif( $this->db->update('awards',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function update($id, $data)\r\n {\r\n $id = $this->sanitize($id);\r\n $data = $this->sanitize($data);\r\n\r\n if($this->exists($id)){\r\n return $this->db->table($this->table)->where('id', $id)->update($data);\r\n }else{\r\n return -1; # To handle nonexistent records\r\n }\r\n }", "public function update($id, $data)\n {\n // TODO: Implement update() method.\n }", "public function update($data, $id)\n {\n return $this->model->find($id)->update($data);\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "function updateData($table,$data,$id){\n\t\treturn $this->db->update($table,$data,$id);\n\t}", "public function update(array $data, $id = null)\n {\n $record = $this->find($id);\n return $record->update($data);\n }", "public function updateById($data,$id)\r\n\t{\r\n\t\t$data = $this -> isValidUpdate($data);\r\n\t\tif(is_a($data,'H_Error')) {\r\n\t\t\treturn $data;\r\n\t\t} else {\r\n\t\t\treturn $this->getTable()->updateById($data, $id);\r\n\t\t} \r\n\t}", "public function update($id, $data) {\n\t\treturn $this->db->where('id', $id)->update($this->table, $data);\n\t}", "public function update(array $data, $id)\n {\n $record = $this->find($id);\n return $record->update($data);\n }", "public function update(array $data, $id)\n {\n $record = $this->find($id);\n return $record->update($data);\n }", "public function update(array $data, $id)\n {\n $record = $this->find($id);\n return $record->update($data);\n }", "public function update(array $data, $id)\n {\n $record = $this->find($id);\n return $record->update($data);\n }", "public static function update($id, $data){\n return false;\n }", "public function _update($id, $data)\n {\n $this->update($id, $data);\n }", "public function Update(array $data, $id)\n {\n $record = $this->model->findOrFail($id);\n $record->update($data);\n return $record;\n }", "function update($id, $data){\n $data['updated_at'] = date('Y-m-d H:i:s');\n\t\t$this->db->where('id', $id);\n\t\t$this->db->update($this->table, $data);\n\t}", "public function update(array $data, $id)\n {\n return $this->model->where(\"id\",\"=\",$id)->update($data);\n }", "public function update($id);", "public function update($id);", "public function update( $id, $data ) {\n $this->db->where( 'id', $id );\n return $this->db->update( $this->table(), $data );\n }", "public function update($data, $id)\n {\n $model = $this->get([], $id);\n \n return $model->update($data);\n }", "public function update($id, $type, $data, $userId);", "public function update(array $data, $id)\n {\n $record = $this->type->find($id);\n\n return $record->update($data);\n }", "public static function updateByID($data, $id) {\n\t if (!is_array($data)) return false;\n\t $data = self::_cookData($data);\n\t return self::_getDao()->update($data, intval($id));\n\t}", "public function update($id, $input);", "public function Update($data) {\n\n }", "public function update($id, $order_data);", "public function update($id) {\r\n //\r\n }", "public function update(array $data, $id)\n {\n $record = $this->machine->find($id);\n return $record->update($data);\n }", "public function update($id, array $data)\n {\n return $this->model->update($data);\n }", "public static function update($data, $id) {\n\t\tif (empty($data)) return false;\n\t\t$data = self::_cookData($data);\n\t\treturn self::_getDao()->update($data, intval($id));\n\t}", "function summons_details_update($data,$id)\n\t{\n\t$this->db->where('id', $id);\n\t$this->db->update('summons_details', $data);\n\t}", "public function update($id, array $data = [])\n {\n }", "public function update($data,$id){\n\t\t\n\t\t $this->db->where($this->pro->booking.\"_id\",$id);\n\t\t return $edit = $this->db->update($this->pro->prifix . $this->pro->booking,$data);\n\t}", "public function updateDetail(array $data, int $id): void\n {\n }", "public function update($table, $data, $id) {\n ksort($data);\n\n $fieldDetails = null;\n foreach($data as $key => $value) {\n $fieldDetails .= \"`$key` = :$key,\";\n }\n\n $fieldDetails = rtrim($fieldDetails, ',');\n\n $sth = $this->prepare(\"UPDATE $table SET $fieldDetails WHERE id = $id\");\n\n foreach($data as $key => $value) {\n $sth->bindValue(\":$key\", $value);\n }\n\n $sth->execute();\n }", "public static function updateById($id,$data){\n $model = static::findById($id);\n if ($model && $model->load($data) && $model->save()) {\n return true;\n }\n return false;\n }", "public function update($data, $id)\n\t{\n\t\t$this->db->where('id_paket_wisata', $id);\n\t\treturn $this->db->update('tbl_paket_wisata', $data);\n\t}", "public function update($id)\r\n {\r\n //\r\n }", "public function update($id) {\n //\n }", "public function update($id) {\n \n }", "public function update($id) {\n \n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id, $data)\n\t{\n\t\t$model = $this->model->find($id);\n\n\t\treturn $model->update($data);\n\t}", "public function update($id){\n\t\t//\n\t}", "public function update($id){\n\t\t//\n\t}", "public function update($id){\n //\n }", "function EditRecord($class, $id, $data)\r\n\t{\r\n\t\t$TotalArr = array();\r\n\t\tforeach($this->MyClasses[$class]['db'] as $key=>$value)\r\n\t\t{\r\n\t\t\tif(isset($data[$key]))\r\n\t\t\t{\r\n\t\t\t\t$TotalArr[$key] = $data[$key];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->update($this->MyClasses[$class]['table'], $TotalArr, array(\"id\"=>$id));\t\r\n\t}", "public function update($data, $id)\n { \n //Database data \n $this->db->where($this->aid, $id); \n $this->db->update($this->table, $data);\n $updateRow = $this->db->affected_rows();\n \n if ($updateRow > 0) {\n $this->db->query(\"UPDATE \".$this->table.\" SET `updated`='\".date('Y-m-d H:i:s').\"' WHERE \".$this->aid.\"='\".$id.\"' \");\n \n //Get Shippingslipnr\n $rowfield = $this->get($id,'shippingslipnr_prefix'); \n //Log Activity\n logActivity('Hardware Assignment Shipping Slip Updated [ID: ' . $id . ', ' . $rowfield->shippingslipnr_prefix . ']');\n } \n \n return $id;\n }", "public function update($id) {\n }", "public function update($id) {\n }", "public function update($id)\n {\n\n }", "public function update($id)\n {\n\n }" ]
[ "0.85064965", "0.85064965", "0.85064965", "0.85064965", "0.85064965", "0.818576", "0.818576", "0.8144553", "0.8031637", "0.8031637", "0.8031637", "0.8031637", "0.8031637", "0.8007974", "0.79502594", "0.79433423", "0.7860537", "0.7860537", "0.7845311", "0.7834879", "0.78309464", "0.78163695", "0.7814897", "0.7812817", "0.7812817", "0.77578497", "0.7724169", "0.76903546", "0.7679105", "0.76694953", "0.7667231", "0.7659673", "0.76192236", "0.761455", "0.76058644", "0.7599366", "0.75812185", "0.75812185", "0.75812185", "0.75812185", "0.75807834", "0.7564034", "0.753908", "0.7522045", "0.74947965", "0.74947965", "0.74947965", "0.74947965", "0.7486515", "0.7470122", "0.7466894", "0.74216473", "0.74148345", "0.73889536", "0.73889536", "0.7387263", "0.73785263", "0.7374406", "0.73701334", "0.7362733", "0.735776", "0.7357186", "0.7353341", "0.7318201", "0.73165363", "0.73100233", "0.7301845", "0.7301247", "0.7287554", "0.728418", "0.72816586", "0.72695434", "0.726401", "0.7255004", "0.7251967", "0.72436374", "0.72381324", "0.72381324", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7230071", "0.7226662", "0.7216389", "0.7216389", "0.7216109", "0.7212533", "0.72116417", "0.7207934", "0.7207934", "0.71955764", "0.71955764" ]
0.0
-1
Finding record with specified id with possibility of indicating specific columns
public function find($id, $columns = array('*')) { return $this->model->find($id, $columns); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($id, $columns = ['*']);", "public function find($id, $columns = ['*']);", "public function find($id, $columns = ['*']);", "function fetch_record($id)\n\n\t{\n\n\t\t\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD promotions::fetch_record() - PARAMETER LIST : ', $param_array);\n\n\n\n\t\t$condition = $this->primary_fld . \" = '\" . $id . \"'\";\n\n\t\t\n\n\t\t$res = database_manipulation::fetch_flds($this->cls_tbl, \"*\", $condition);\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD promotions::fetch_record() - Return Value : ', $res);\n\n\n\n\t\treturn $res;\n\n\t\n\n\t}", "public function returnDetailFindByPK($id);", "public function whereId($id);", "public function returnMoreFindByPK($id);", "public function find(int $id, $columns = ['*'])\n {\n\n }", "public function find( $id, $with = array(), $columns = array('*'));", "function db_find ($table, $fields = '*', $id) {\n return db_select(\"SELECT $fields FROM $table WHERE id = ?\", array($id), true);\n}", "function find($id=true,$fetch_type = \\PDO::FETCH_ASSOC)\n {\n $this->db->table($this->getTableFullName());\n if(is_string($id) || is_numeric($id)){\n $this->where($this->getPk(),'=',$id);\n }\n return $this->db->find($fetch_type);\n }", "public function selectById($id);", "public function selectById($id);", "protected static function where_is($id){\n\t\t$stmt = self::$db->prepare(self::$WHERE);\n\n\t\t$stmt->execute(array($id, $id));\n\n\t\t$data = $stmt->fetchAll();\n\n\t\t$stmt->closeCursor();\n\n\t\tswitch($id){ //A way of using a switch that a lot aren't used to, but it's fast and efficient.\n\t\t\tcase $data[0]['memid']:\n\t\t\t\treturn self::MEM_TBL;\n\n\t\t\tcase $data[0]['diskid']:\n\t\t\t\treturn self::DISK_TBL;\n\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}", "public function findById($column,$id, $table = \"\"){\n\n $target_table = !empty($table) ? $table : $this->table;\n \n $stmt = $this->db->prepare(\"SELECT * FROM $target_table WHERE $column = :target_id\");\n\n $stmt->execute([\"target_id\" => $id]);\n\n $data = $stmt->fetchAll();\n\n if($data){\n return $data;\n }\n return false;\n }", "public function get_record_by_ID($table, $keyColumnName, $id, $fields = \"*\",$limit=10){\n\t\t$i=0;\n\t\t///echo \"hello\";\n\t\tif(is_array($keyColumnName))\n\t\t{\n\t\t\tforeach($keyColumnName as $key=>$value) {\n\t\t\t\t$i++;\n\t\t\t\tif(count($keyColumnName)>$i)\n\t\t\t\t{\n\t\t\t\t\t$sets[] = $key.'='.$value.' AND';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sets[] = $key.'='.$value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sets = implode(' ', $sets);\n\t\t\t$sql = \"SELECT $fields FROM $table WHERE \".$sets.\" LIMIT $limit\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sets = $keyColumnName;\t\t\t\n\t\t\t$sql = \"SELECT $fields FROM $table WHERE $sets = '$id' LIMIT $limit\"; \n\t\t}\t\t\n $result = mysql_query($sql);\n $returnArray = array();\n\t\twhile($row = @mysql_fetch_assoc($result))\n\t\t{\n\t\t\t$returnArray[] = $row;\n\t\t}\t\t\n\t\treturn $returnArray;\n\n }", "public function find($id, $columns = ['*'])\n {\n return parent::find(Factory::resolve($id), $columns);\n }", "public function whereId(string $id): object;", "public function getEvent_matchById($id){\n\tif(!is_int($id)){return false;}\n\n\t$sql = \"SELECT * FROM $this->table WHERE ID=$id\";\n\n\treturn $this->query->query($sql);\n}", "public function _find($id, $columns = array('*')) {\n\t\treturn $this->query()->where(static::$key, '=', $id)->first($columns);\n\t}", "public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }", "public function find($id){\n return parent::find($this->table, $id);\n }", "public function find($id){\n return $this->db->find($this->table,$id);\n }", "abstract public function find($id);", "public static function find($id, $columns = ['*'])\n {\n $keyName = (new static)->getKeyName();\n if (is_array($keyName)) {\n $row = static::where($id)->first($columns);\n } else {\n $row = static::where($keyName, '=', $id)->first($columns);\n }\n\n// if (!$row) {\n// throw new NotFound('Cannot found model '.static::class);\n// }\n return $row;\n }", "public function returnFindByPK($id);", "function get_by_id($id) {\r\n $params=array('pm_id'=>$id);\r\n $data = $this->create_mapper($this->table)->where($params)->find_by();\r\n $ret_status = $data ? 1 : 'op_no_data';\r\n //处理关联代码表\r\n //filter_fk_name($data, array('cp_createuser|osp_user_id','cp_updateuser|osp_user_id'));\r\n\r\n return $this->format_ret($ret_status, $data);\r\n }", "abstract function find($id): array;", "function findProperty($id);", "public function getRecord($id = null);", "public function findWithData($id) {\n $qb = $this->getQueryBuilder();\n $qb\n ->addSelect('ap_r')\n ->addSelect('ap_t')\n ->addSelect('ap_ms')\n ->addSelect('ap_t_g')\n ->addSelect('ap_t_g_r')\n ->addSelect('ap_r_g')\n ->addSelect('ap_t_g_r_g')\n ->addSelect('ap_t_g_gd')\n ->addSelect('ap_to')\n ->addSelect('ap_oo')\n ->innerJoin('ap.tacticalObjective', 'ap_to')\n ->leftJoin('ap.operationalObjective', 'ap_oo')\n ->leftJoin('ap.responsibles', 'ap_r')\n ->leftJoin('ap_r.groups', 'ap_r_g')\n ->leftJoin('ap.timeline', 'ap_t')\n ->leftJoin('ap.managementSystem', 'ap_ms')\n ->leftJoin('ap_t.goals', 'ap_t_g')\n ->leftJoin('ap_t_g.responsibles', 'ap_t_g_r')\n ->leftJoin('ap_t_g.goalDetails', 'ap_t_g_gd')\n ->leftJoin('ap_t_g_r.groups', 'ap_t_g_r_g')\n ->andWhere('ap.id = :id')\n ->setParameter('id', $id)\n ;\n return $qb->getQuery()->getOneOrNullResult();\n }", "public function planFind($id);", "function contains_id($id, $data){\n return in_array($id, array_column($data, 'id'));\n}", "abstract public function getSpecificRow();", "function find($id);", "abstract protected function getWhereForRow($data);", "public function find($id) {\n $data = $this->db->fetchAssoc(\"SELECT * FROM $this->table WHERE id = ?\", [ $id ]);\n return $data ? $this->build($data) : FALSE;\n }", "public function hasPreviewColumn($id);", "public function find(int $id) ;", "public function find($arg) {\n if ($arg instanceof IFilterable) {\n $condition = $arg->resultFilter();\n } else {\n $condition = $this->getPrimaryKeyCondition($arg);\n }\n \n $this->_dataHandler->select('*', $this->_table, $condition);\n return $this->_dataHandler->fetchObject();\n }", "public function find($id) {\n $result = $this->getMapper()->getDbTable()->find($id);\n if (0 == count($result)) {\n return false;\n }\n\n $row = $result->current();\n $res=$this->setModel($row);\n\n return $res;\n }", "public function find($id, $columns = ['*'])\n {\n return $this->model()->findOrFail($id, $columns);\n }", "private function getRealMetadata($id) {\n $md = null;\n\n $dao = $this->getDao();\n $dar = $dao->searchById($id);\n if($dar->rowCount() === 1) { \n $md = $this->_createFromRow($dar->current());\n \n $md->setCanChangeName(true);\n $md->setCanChangeIsEmptyAllowed(true);\n $md->setCanChangeIsMultipleValuesAllowed(true);\n $md->setCanChangeDescription(true);\n }\n\n return $md;\n }", "public static function protectFind($id, $columns = ['*'])\n {\n $id = LuhnAlgorithm::originalId($id);\n return parent::find($id, $columns);\n }", "public function find($id, $columns = ['*'])\n {\n return $this ->model ->find($id, $columns);\n }", "function select_by_id($tbl, $cols='*', $value=null, $id='id', $limit=1){\n $where = 1;\n if(isset($value)) $where=\"$id='$value'\";\n $sql = \"SELECT $cols FROM $tbl WHERE $where LIMIT $limit\";\n $result = $this->execute($sql) or $this->error($sql);\n $row = $this->next($result,'{}');\n return $row;\n }", "public function recordExists($id)\n {\n return is_array($this->selectSingleFields($id, ['id'], false));\n }", "function getRecord($id) {\n\t\t$result = $this->select('id',\"`id` = '$id'\");\n\t\tif($result) return 1;\n\t\treturn '';\n\t}", "abstract protected function _doContains($id);", "function find($table, $where=\"1=1\", $fields=\"*\", $orderBy=\"1\"){\n\t\tActiveRecord::sql_item_sanizite($table);\n\t\tActiveRecord::sql_sanizite($fields);\n\t\tActiveRecord::sql_sanizite($orderBy);\n\t\t$q = $this->query(\"select $fields from $table where $where order by $orderBy\");\n\t\t$results = array();\n\t\twhile($row=$this->fetch_array($q)){\n\t\t\t$results[] = $row;\n\t\t}\n\t\treturn $results;\n\t}", "function find($id) {\n global $conn;\n\n $stmt = $conn->prepare(\"SELECT Addressln1, Addressln2, Del_id, Customer_id, Name, Postcode\n FROM Del_Adr WHERE Del_id = ?\");\n $stmt->execute([$id]);\n $stmt->setFetchMode(PDO::FETCH_CLASS, 'Del_Adr');\n return $stmt->fetch();\n }", "public static function find($id, $key = 'id');", "public function checkRecordIsExist ($field,$table,$idrecord,$opt=\"integer\");", "public static function find_by_id($id){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"SELECT * FROM \".$table.\" WHERE \".$keyColumn.\" = \".$id;\n $res = mysqli_query(static::$conn,$sql);\n $row = mysqli_fetch_object($res,get_called_class());\n return $row;\n }", "public function whereall() {\n\t\t\treturn 'id=id';\n\t\t}", "public function find( $id );", "function find($id) {\n global $conn;\n\n $stmt = $conn->prepare(\"SELECT Name, Surname, Email, Phone, Username, Customer_id\n FROM Customer WHERE Customer_id = ?\");\n $stmt->execute([$id]);\n $stmt->setFetchMode(PDO::FETCH_CLASS, 'Customer');\n return $stmt->fetch();\n }", "function findById($id);", "public function find($id, $columns = ['*'])\n {\n return $this->model->find($id, $columns);\n }", "public function find($id, $columns = ['*'])\n {\n return $this->model->find($id, $columns);\n }", "public function find($id, $columns = array('*'))\n\t{\n\t\t$this->where($this->model->getKeyName(), '=', $id);\n\n\t\treturn $this->first($columns);\n\t}", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public static function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "function select_data_by_id($tablename, $columnname, $columnid, $data = '*', $join_str = array()) {\n if($data!='*')\n \n $this->db->select($data);\n \n if (!empty($join_str)) {\n foreach ($join_str as $join) {\n if ($join['join_type'] == '') {\n $this->db->join($join['table'], $join['join_table_id'] . '=' . $join['from_table_id']);\n } else {\n $this->db->join($join['table'], $join['join_table_id'] . '=' . $join['from_table_id'], $join['join_type']);\n }\n }\n }\n $this->db->where($columnname, $columnid);\n $query = $this->db->get($tablename);\n if ($query->num_rows() > 0) {\n return $query->result_array();\n } else {\n return array();\n }\n }", "public function find($id, $columns = ['*'])\n {\n if (is_array($id) === true) {\n return $this->useKeys($id)->get($columns);\n }\n\n return $this->useKeys($id)->first($columns);\n }", "public function find($id, $columns = array()) {\n return $this->where('_id', '=', $this->convertKey($id))->first($columns);\n }", "function getByID($table,$field,$value);", "public function search($id);", "private function getExistingBasicInfo($id) \n {\n $this->db->select('title, firstname, surname, dob, gender, marital_status, height, weight, occupation');\n //where $id = GUID \n $this->db->where('GUID', $id);\n //from the users table\n $query = $this->db->get('users');\n return $query;\n \n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "public static function findWithDetail($id) {\n \treturn Ride::select('start_time', 'price', 'source_city.city as source_city', \n 'dest_city.city as dest_city', 'preferences.*', 'rides.nb_seats_offered', \n 'rides.luggage_size', 'rides.id', 'rides.car_id', 'users.first_name as driver_first_name', 'users.last_name as driver_last_name')\n ->join('cities as source_city', 'rides.source_city_id', 'source_city.id')\n ->join('cities as dest_city', 'rides.dest_city_id', 'dest_city.id')\n ->join('cars', 'rides.car_id', 'cars.id')\n ->join('users', 'cars.user_id', 'users.id')\n ->join('preferences', 'preferences.user_id', 'users.id')\n ->findOrFail($id);\n }", "public function find($id)\n\t{\n\t\treturn $this->fetchRow(array(\n\t\t\t$this->getAdapter()->quoteIdentifier($this->getPrimaryName()) . ' = ?' => $id\n\t\t));\n\t}", "public function sectionTableWhere() {}", "public function sectionTableWhere() {}", "function findById($db, $table, $primaryKey, $value, $options = '') {\n\t$query = 'SELECT * FROM ' . $table . ' WHERE ' . $primaryKey . '= :value ' . ' ' . $options ;\n\n\t$parameters = [\n\t\t'value' => $value\n\t];\n\n\t$result = runQuery($db, $query, $parameters);\n\n\treturn $result;\n}" ]
[ "0.6793225", "0.6793225", "0.6793225", "0.6300855", "0.62423134", "0.6169434", "0.6034686", "0.6003555", "0.59629774", "0.5959451", "0.5955715", "0.5893709", "0.5893709", "0.58448005", "0.5832788", "0.58151245", "0.5799856", "0.5788006", "0.5755599", "0.57365334", "0.5670615", "0.56684595", "0.5613373", "0.56088233", "0.56007797", "0.55890447", "0.55859715", "0.5583567", "0.55724055", "0.5568021", "0.55482495", "0.55454886", "0.552876", "0.5523708", "0.5504352", "0.54971904", "0.54547614", "0.54526824", "0.5450942", "0.5449576", "0.544861", "0.5445738", "0.5445523", "0.54382706", "0.543648", "0.5417596", "0.54074776", "0.5407101", "0.5404025", "0.5400406", "0.5388991", "0.53753525", "0.5366739", "0.53612214", "0.53595537", "0.535904", "0.53580457", "0.5349095", "0.5330163", "0.5330163", "0.53294885", "0.532532", "0.532532", "0.532532", "0.532532", "0.5316699", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.5316081", "0.53068227", "0.5301338", "0.5284395", "0.52708113", "0.5264523", "0.52627695", "0.52587074", "0.52496874", "0.5245706", "0.5232187", "0.5232187", "0.5227251" ]
0.0
-1
Check if $value is a string containing valid xml.
public function checkXmlString($value) { return new Result( $this->canParse($value), '{name} must be a valid xml document' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public static function is(mixed $value):bool\n {\n return is_string($value) && Str::isStart('<?xml',$value);\n }", "public static function isXml($str) {}", "private function prepare_xml_string($_xml_value)\n {\n $_result = FALSE;\n \n if ($_xml_value && is_string($_xml_value)) {\n $_validate_xml = (preg_match(\"@xml\\\":@\", $_xml_value) && preg_match(\"@<\\?xml\\sversion@\", $_xml_value) && preg_match(\"@BWL\\.iBIS\\.Contracts\\.Shipment\\.Shipment\\.xsd@\", $_xml_value) && preg_match(\"@.*<Shipment.*<\\/Shipment>.*@\", $_xml_value));\n if ($_validate_xml) {\n $_result = preg_replace('@\"}$@', '', $_xml_value);\n $_result = preg_replace('@^xml\"\\:\"@', '', $_result);\n }\n }\n \n return $_result;\n }", "protected function validateString($value){\n\t\treturn is_string($value);\n\t}", "public function checkString($value)\n {\n return $this->checkHasType($value, 'string');\n }", "public static function aString($value)\n {\n return (is_string($value))?:false;\n }", "public function isValid($value)\n {\n if ($value !== filter_var($value, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES)) {\n $this->addError(\n $this->translateErrorMessage(\n 'validator.text.notvalid',\n 'extbase'\n ),\n 1221565786\n );\n }\n }", "public static function isValidXml ($string) {\n try {\n DOMDocument::loadXML($string);\n return true;\n } \n catch (FrameEx $ex) {\n return false;\n }\n }", "private function checkString($value)\n {\n if (!preg_match(\"/^[a-zA-Z ]*$/\", $value))\n {\n echo \"ERRORE nella Stringa : \" . $value;\n throw new InvalidArgumentException();\n }\n return true;\n }", "public function isValueValid($value) {\n\t\treturn $value instanceof DataType\\TextType;\n\t}", "public function check(string $value): string\n {\n $this->validateStructure($value);\n return $value;\n }", "protected function isValueNormalizationRequired(mixed $value): bool\n {\n return \\is_string($value);\n }", "public function isLegalValue($value) {\n\t\tswitch ( true ) {\n\t\t\tcase strpos($value, \"\\0\") !== false:\n\t\t\tcase strpos($value, \"\\n\") !== false:\n\t\t\tcase strpos($value, \"\\r\") !== false:\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isValid($value)\n {\n if (!\\is_string($value)) {\n return false;\n }\n\n if (\\mb_strlen($value) > $this->length && $this->length != 0) {\n return false;\n }\n\n return true;\n }", "public function isXml() {}", "private function canBeString($value): bool\n {\n // https://stackoverflow.com/a/5496674\n return !is_array($value) && (\n (!is_object($value) && settype($value, 'string') !== false) ||\n (is_object($value) && method_exists($value, '__toString'))\n );\n }", "public abstract function isValid(string $value): bool;", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\PropertyValueType || $value instanceof DataType\\TextType || $value instanceof DataType\\URLType;\n\t}", "private function _escapeXml($value) {\n $from = array( \"&\", \"<\", \">\", \"'\", \"\\\"\"); \n $to = array( \"&amp;\", \"&lt;\", \"&gt;\", \"&#039;\", \"&quot;\");\n return str_replace($from, $to, $value);\n }", "public function isValid($value)\n {\n // $value could be a DOMDocument\n if ($value instanceof DOMDocument) {\n $doc = $value;\n }\n\n // $value could be an XML file or string\n if (is_string($value)) {\n $doc = new DOMDocument();\n if (!file_exists($value)) {\n try {\n $doc->loadXML($value);\n } catch (Exception $e) {\n return false;\n }\n } else {\n try {\n $doc->load($value);\n } catch (Exception $e) {\n return false;\n }\n }\n }\n\n if (!is_null($this->_xsd)) {\n try {\n $doc->schemaValidate($this->_xsd);\n } catch (Exception $e) {\n return false;\n }\n }\n\n return true;\n }", "protected final function __validateValue($name, $value) {\n\t\tif(array_key_exists($name, $this->attributes)) {\n\t\t\t$datatype = $this->__getAttributeByName($name)->getType();\n\t\t}\n\t\t\n\t\t// check if the attribute is required\n\t\t$required = $this->__getAttributeByName($name)->isRequired();\n\n\t\t// if the value is empty and not required return a success\n\t\tif(!$required && (strlen($value) == 0)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the value is required and empty return a fault\n\t\tif($required && (strlen($value) == 0)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif($datatype == \"UNDEFINED\") {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// check if the value is valid for the attribute\n\t\treturn preg_match(WAT_OP_AttributeTypes::getRegex($datatype), $value);\n\t}", "public static function is_xml(string $str)\n {\n if ( ! defined('LIBXML_COMPACT'))\n {\n throw new \\Exception('libxml is required to use Str::is_xml()');\n }\n\n $internal_errors = libxml_use_internal_errors();\n libxml_use_internal_errors(true);\n $result = simplexml_load_string($str) !== false;\n libxml_use_internal_errors($internal_errors);\n\n return $result;\n }", "private function assert($value): bool {\n\n //Assertion::notEmpty($value); // Must not be empty\n Assertion::minLength($value, self::MIN_LENGTH); // Must be at least 5 characters\n Assertion::maxLength($value, self::MAX_LENGTH); // Must be less than 10 characters\n Assertion::regex(self::FORMAT); // Must follow a format of alphanumeric characters or underscores\n return true;\n }", "private function canBeStored(string $value): bool\n {\n return strlen($value) <= 255;\n }", "function check( $value, $type='text' )\n {\n return Pgg_Validate::is( $value, $type );\n }", "public function testInvalidXml() {\r\n\t\t$xml=\"non xml string\";\r\n\t\t$actual = Response::xml($xml);\r\n\t\t\r\n\t\t$this->assertEquals($actual->success, 'false');\r\n\t}", "private function _isValidXML($xml){\n $doc = @simplexml_load_string($xml);\n if ($doc) {\n return true;\n } else {\n return false;\n }\n }", "abstract protected function isValidValue($value);", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\DataDownloadType;\n\t}", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\PublicationEventType;\n\t}", "function isString ($value)\r\n{\r\n\treturn is_string ($value);\r\n}", "abstract protected function validateValue($value);", "public function validate($value) {\n\t\t$isValid = false;\n\n\t\tif (is_scalar($value)) {\n\t\t\t$isValid = ($this->isValidCommonNotation($value)\n\t\t\t\t|| $this->isValidDotNotation($value)\n\t\t\t\t|| $this->isValidScientificNotation($value));\n\t\t}\n\n\t\tif (!$isValid) {\n\t\t\t$this->error($this->messageInvalid, $this->stringify($value));\n\t\t}\n\n\t\treturn $isValid;\n\t}", "function tidy_is_xml(tidy $object) {}", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_TOPIC,self::VALUE_AUTHOR,self::VALUE_SOURCE,self::VALUE_COLLECTIONCODE,self::VALUE_KEYWORDS,self::VALUE_AFFILIATION,self::VALUE_DATE));\n\t}", "public function my_custom_validation( string $value ): bool {\n\t\treturn strlen( $value ) <= 1;\n\t}", "public function isValidHtml($string) \n\t{\n\t\t$start = strpos($string, '<');\n\t\t$end = strrpos($string, '>',$start);\n\n\t\t$len=strlen($string);\n\t\t\n\t\tif ($end !== false) {\n\t\t\t$string = substr($string, $start);\n\t\t} else {\n\t\t\t$string = substr($string, $start, $len-$start);\n\t\t}\n\t\t\n\t\tlibxml_use_internal_errors(true);\n\t\tlibxml_clear_errors();\n\t\t$xml = simplexml_load_string($string);\n\t\t\n\t\treturn count(libxml_get_errors())==0;\n\t}", "function isvalid($value) {\n global $debugging;\n switch (true) {\n case (! parent::isvalid($value)):\n $this->error = \"File name must be short and simple\";\n if ($debugging > 1) {\n $this->error .= \" [\" . $value . \"]\";\n }\n return false;\n case (! $this->contentAccessValid()):\n $this->error = \"Content inaccessible\";\n if ($debugging > 1) {\n $this->error .= \" [\" . $this->filepath($value) . \"]\";\n }\n return false;\n default:\n return true;\n }\n }", "public function checkMatchesXmlStrict($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, false, false);\n }", "abstract public function validate(\n $value\n ): bool;", "public function validateValue($value)\n {\n return htmlspecialchars(trim($value));\n }", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\Comment;\n\t}", "private static function _isValidValue($type, $value){\n $value = self::_sanitizeValue($type, $value);\n if ($value != null){\n $nativeType = self::_getNativeType($type);\n if ($nativeType == 'ascii'){\n if (isset(self::$_extendedTypes[$type]['validate'])){\n if (!preg_match(self::$_extendedTypes[$type]['validate'], $value)){\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }", "protected function isValid($value) {\n if (!is_string($value)) {\n $this->addError('The given value was not a valid string.', 1450180930);\n return;\n }\n\n $recaptcha = new \\ReCaptcha\\ReCaptcha($this->options['secretKey']);\n $resp = $recaptcha->verify($value, $_SERVER['REMOTE_ADDR']);\n\n if ($resp->isSuccess() === false) {\n $this->addError('The captcha was not answered correctly. Please try again.', 1450180934);\n }\n }", "public function is_valid_xml( $xml ) {\n libxml_use_internal_errors( true );\n $doc = new \\DOMDocument( '1.0', 'utf-8' );\n $doc->loadXML( $xml );\n $errors = libxml_get_errors();\n return empty( $errors );\n }", "public function isValidXml(string $xml)\n\t{\n\t\t\\libxml_use_internal_errors(true);\n\t\t$doc = new DOMDocument('1.0', 'utf-8');\n\t\t$doc->loadXML($xml);\n\t\t$errors = \\libxml_get_errors();\n\t\treturn empty($errors);\n\t}", "public static function isValueValid($value) : bool\n {\n if (! is_string($value)) {\n return false;\n }\n \n if (preg_match('#^[a-z0-9]+$#i', $value) !== 1) {\n return false;\n }\n \n $hex = Hex::fromString(self::base62ToHex($value));\n \n return self::isHexValid($hex);\n }", "public function isValid($value)\n {\n if (!\\is_string($value)) {\n return false;\n }\n\n // no leading special characters\n $leading = \\mb_substr($value, 0, 1);\n if($leading === '_' || $leading === '.' || $leading === '-') {\n return false;\n }\n\n // Valid chars: A-Z, a-z, 0-9, underscore, period, hyphen, space\n if (\\preg_match('/[^A-Za-z0-9\\_\\.\\-]/', $value)) {\n return false;\n }\n\n if (\\mb_strlen($value) > 36) {\n return false;\n }\n\n return true;\n }", "public function html($value=''): bool\n\t{\n\t\treturn (strip_tags($value) != $value)? true:false;\n\t}", "public function getIsValidValue($value)\r\n {\r\n return true;\r\n }", "public function testValidXml() {\r\n\t\t$xml=\"<xml><test>works</test></xml>\";\r\n\t\t$actual = Response::xml($xml);\r\n\t\r\n\t\t$this->assertEquals($actual->test, 'works');\r\n\t}", "public function validateParameterValue($value) {\n switch ($this->getType()) {\n case self::TYPE_TEXT:\n return is_string($value) || is_numeric($value) || is_bool($value);\n case self::TYPE_NUMERIC:\n return is_numeric($value);\n case self::TYPE_BOOLEAN:\n return is_bool($value) || $value === 0 || $value === 1;\n case self::TYPE_DATE:\n return date_create_from_format(\"Y-m-d\", $value) ? true : false;\n case self::TYPE_DATE_TIME:\n return date_create_from_format(\"Y-m-d H:i:s\", $value) ? true : false;\n }\n }", "public static function validate($value);", "private function is_valid_xml($xml) {\n\n libxml_use_internal_errors(true);\n $doc = new DOMDocument('1.0', 'utf-8');\n $doc->loadXML($xml);\n\n $errors = libxml_get_errors();\n \n return empty($errors);\n }", "function is_valid_snmp_value($value)\n{\n $valid = strpos($value, 'at this OID') === FALSE &&\n strpos($value, 'No more variables left') === FALSE &&\n $value != 'NULL';\n\n return $valid;\n}", "function is_boolexpression($value) {\n preg_match('/^(([ \\-+><!01])|(&&)|(==)|(\\x7C\\x7C)|(!=)|(<=)|(>=)|(true)||(false))+$/i', $value, $result);\n\n return is_array($result) && !is_empty($result);\n }", "function validate ($type, $value)\n {\n \n if($type == \"link\") {\n return filter_var($value, FILTER_VALIDATE_URL);\n }\n if($type == \"picture\") {\n $ext = substr($value, strlen($value) - 4, 4);\n if($ext != \".png\" && $ext != \".jpg\" && $ext != \".gif\") return false;\n else return true;\n }\n if($type == \"int\") {\n return is_numeric($value);\n }\n if($type == \"string\") {\n return true;\n }\n if($type == \"date\") {\n if($value instanceof DateTime) return true;\n else return false;\n }\n }", "public static function isValid($value) : bool {\n\t\t\treturn (is_string($value) && preg_match('/^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/', $value));\n\t\t}", "public function validate($value) {\n return TRUE;\n }", "function is_valid($value) {\n\t\tif (isset($value) && trim($value) != \"\" && trim(strtolower($value)) != \"null\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function is_valid_setting( $value ) {\n\t\treturn strlen( $value ) < 10;\n\t}", "protected function validateType($value)\n {\n }", "public function validateValue($value)\n {\n }", "protected function checkValueParam(&$value)\n {\n if (isset($value)) {\n if (is_object($value)) {\n if (!method_exists($value, 'toRdfPhp')) {\n // Convert to a literal object\n $value = Literal::create($value);\n }\n $value = $value->toRdfPhp();\n } elseif (is_array($value)) {\n if (!isset($value['type'])) {\n throw new \\InvalidArgumentException(\n \"\\$value is missing a 'type' key\"\n );\n }\n\n if (!isset($value['value'])) {\n throw new \\InvalidArgumentException(\n \"\\$value is missing a 'value' key\"\n );\n }\n\n // Fix ordering and remove unknown keys\n $value = array(\n 'type' => strval($value['type']),\n 'value' => strval($value['value']),\n 'lang' => isset($value['lang']) ? strval($value['lang']) : null,\n 'datatype' => isset($value['datatype']) ? strval($value['datatype']) : null\n );\n } else {\n $value = array(\n 'type' => 'literal',\n 'value' => strval($value),\n 'datatype' => Literal::getDatatypeForValue($value)\n );\n }\n if (!in_array($value['type'], array('uri', 'bnode', 'literal'), true)) {\n throw new \\InvalidArgumentException(\n \"\\$value does not have a valid type (\".$value['type'].\")\"\n );\n }\n if (empty($value['datatype'])) {\n unset($value['datatype']);\n }\n if (empty($value['lang'])) {\n unset($value['lang']);\n }\n if (isset($value['lang']) and isset($value['datatype'])) {\n throw new \\InvalidArgumentException(\n \"\\$value cannot have both and language and a datatype\"\n );\n }\n }\n }", "protected function isValidValue($value)\r\n {\r\n return ($value instanceof Entity\\PluginValue);\r\n }", "private function strToBoolean($value) {\r\n\t\tif ($value && strtolower($value) === \"true\") {\r\n\t\t return true;\r\n\t\t} else {\r\n\t\t return false;\r\n\t\t}\r\n\t}", "public function checkMatchesXml($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, true, true);\n }", "private function validate($value,$type) {\n\t\tswitch($type) {\n\t\t\tcase \"varchar\":\n\t\t\t\treturn self::is_alphanum($value);\n\t\t\t\tbreak;\n\t\t\tcase \"int\":\n\t\t\t\treturn self::is_num($value);\n\t\t\t\tbreak;\n\t\t\tcase \"binary\":\n\t\t\t\treturn self::is_binary($value);\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tcase \"signed\":\n\t\t\t\treturn self::is_signed($value);\n\t\t\t\tbreak;\n\t\t\tcase \"file\":\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function run($value)\n {\n if ($value instanceof Date) {\n return true;\n }\n if (!is_string($value)) {\n return false;\n }\n if (preg_match(Date::ISO8601_REGEX, $value)) {\n return true;\n }\n\n return false;\n }", "public function isValid($value)\r\n {\r\n return true;\r\n }", "public static function isInvalid($value)\n {\n }", "final public function isType(string $value):bool\n {\n return $this->type() === $value;\n }", "public function validator($data) {\n $data = trim ( $data );\n \n if (strlen ( $data ) === 0) {\n $err = new LibXMLError ();\n $err->level = 3;\n $err->code = 4;\n $err->column = 1;\n $err->message = 'Start tag expected, \\'<\\' not found';\n $err->file = '';\n $err->line = 1;\n $error [] = $err;\n } else {\n libxml_use_internal_errors ( true );\n $doc = new DOMDocument ( '1.0', 'utf-8' );\n $doc->loadXML ( $data );\n $error = libxml_get_errors ();\n }\n return isset ( $error ) && count ( $error ) > 0 ? $error : $data;\n }", "abstract public function isValid(mixed $value): bool;", "private function isValidate($value)\n {\n phpFox::isUser(true);\n\n $strErr = \"\";\n if (empty($value['title']))\n $strErr .= Phpfox::getPhrase('musicsharing.please_enter_album_name') . '<br />';\n\n if (isset($_FILES['album_image']) && !empty($_FILES['album_image']['name']))\n {\n $image = $_FILES['album_image']['type'];\n\n if (!in_array($image, array(\"image/gif\", \"image/jpeg\", \"image/pjpeg\", \"image/png\")))\n {\n $strErr .= Phpfox::getPhrase('musicsharing.invalid_image_file_type');\n }\n }\n\n return $strErr;\n }", "private function isSerialized($value)\n {\n $data = @unserialize($value);\n if ($value === 'b:0;' || $data !== false) {\n return true;\n } else {\n return false;\n }\n }", "function xml_escape($value)\n{\n return htmlspecialchars(preg_replace('#[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]+#', '',\n $value), ENT_QUOTES);\n}", "public function isXml()\n\t{\n\t\treturn Str::contains($this->getHeaderLine('Content-Type'), '/xml');\n\t}", "protected function isValidValue($value)\n {\n return (!(is_null($value) || empty($value)));\n }", "abstract protected function checkValue( &$value );", "public function validate( $value )\n\t{\n\t\t$value = (string) $value;\n\t\t\n\t\tif( strlen( $value ) != 13 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$first_letter = substr( $value, 0, 1 );\n\t\t\n\t\tlist( $year, $month, $day ) = str_split( substr( $value, 1, 7 ), 2 );\n\t\tswitch( $first_letter )\n\t\t{\n\t\t\tcase '1':\n\t\t\t\t$year = '19' . $year;\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t$year = '19' . $year;\n\t\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t\t$year = '20' . $year;\n\t\t\t\tbreak;\n\t\t\tcase '6':\n\t\t\t\t$year = '20' . $year;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif( ! RPC_Date::validDate( $year . '-' . $month . '-' . $day ) ||\n\t\t RPC_Date::getTimestamp( $year . '-' . $month . '-' . $day ) >= RPC_Date::getTimestamp( date( 'Y-m-d' ) ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function passes($attribute, $value): bool\n {\n $trimmed = trim(html_entity_decode(strip_tags($value)), \"\\t\\n\\r\\0\\x0B\\xC2\\xA0\");\n\n return ! empty($trimmed);\n }", "public function isNodeValue($value) {\n\t\treturn ($value instanceof \\DOMElement);\n\t}", "protected function validateValue($value)\n {\n if (is_string($value) && strlen($value) < 2000) {\n if ($this->defaultScheme !== null && strpos($value, '://') === false) {\n $value = $this->defaultScheme . '://' . $value;\n }\n\n if (strpos($this->pattern, '{schemes}') !== false) {\n $pattern = str_replace('{schemes}', '(' . implode('|', $this->validSchemes) . ')', $this->pattern);\n } else {\n $pattern = $this->pattern;\n }\n\n if ($this->enableIDN) {\n $value = preg_replace_callback('/:\\/\\/([^\\/]+)/', function ($matches) {\n return '://' . idn_to_ascii($matches[1]);\n }, $value);\n }\n\n if (preg_match($pattern, $value)) {\n return null;\n }\n }\n\n return [$this->message, []];\n }", "public function isValid($value);", "public function isValid($value);", "function o_isString($value) {\n\t\t\treturn Obj::singleton()->isString($value);\n\t\t}", "public static function handle(string &$value): bool\n {\n if (preg_match('/^([a-z0-9A-Z_\\/\\-\\.\\@]+)$/', $value)) {\n return true;\n }\n\n return false;\n }", "function checkType ($value, $type) {\n\tswitch ($type) {\n\t\tcase STRING : $r = is_string ($value); break;\n\t\tcase BOOL : $r = is_bool ($value); break;\n\t\tcase NUMERIC : $r = is_int ($value); break;\n\t\tcase REAL : $r = (is_real ($value) or is_int ($value)); break;\n\t\tdefault : return new Error ('TYPE_NOT_RECOGNIZED'); \n\t}\n\t\n\tif ($r === true) {\n\t\treturn true;\n\t} else {\n\t\treturn new Error ('TYPE_MISMATCH_VALUE', $type, $value);\n\t}\n}", "public static function moduleValueIsValid($value):bool{\n\n\t\tif(!is_string($value)){\n\t\t\treturn false;\n\t\t}\n\n\t\t$value = trim($value);\n\n\t\t// hex notation\n\t\t// #rgb(a)\n\t\t// #rrggbb(aa)\n\t\t// #rrrrggggbbbb(aaaa)\n\t\t// ...\n\t\tif(preg_match('/^#[a-f\\d]+$/i', $value) && in_array((strlen($value) - 1), [3, 4, 6, 8, 9, 12, 16, 24, 32], true)){\n\t\t\treturn true;\n\t\t}\n\n\t\t// css (-like) func(...values)\n\t\tif(preg_match('#^(graya?|hs(b|la?)|rgba?)\\([\\d .,%]+\\)$#i', $value)){\n\t\t\treturn true;\n\t\t}\n\n\t\t// predefined css color\n\t\tif(preg_match('/^[a-z]+$/i', $value)){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function inputCleaner($value){\n\t $toBeTested\t\t= strip_tags($value);\n\t // Instead of using HTMLStripSpecialChars, I am using some Regex\n\t\t// to have a greater degree of control over the input.\n\t\t//\tThis regex checks the entire string for anything that\n\t\t//\tcould ruin our consistency.\n\t $regExp = (\"/[\\!\\\"\\£\\$\\%\\^\\&\\*\\(\\)\\;\\'\\,\\\"\\?]/ \");\n\t if(preg_match_all($regExp, $toBeTested,$matches)){\n\t \treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn $toBeTested;\n\t\t}\n\t}", "private function validate_xml($xml) {\n // Validate the inserted XML\n libxml_use_internal_errors(true);\n\n $doc = simplexml_load_string($xml);\n $xml_lines = explode(\"\\n\", $xml);\n\n if ($doc === FALSE) {\n $errors = libxml_get_errors();\n\n $exception = \"\";\n foreach ($errors as $error) {\n $exception .= XMLPatcher::display_xml_error($error, $xml_lines);\n }\n libxml_clear_errors();\n throw new XMLPatcherException(\"Invalid XML provided: \\n$exception\", 905);\n }\n }", "final public static function isValidInput($value):bool\n {\n $return = false;\n\n if(is_string($value))\n {\n $host = Base\\Uri::host($value);\n $return = (!empty($host) && in_array($host,static::$config['hostsValid'],true));\n }\n\n return $return;\n }", "public function testXmlString()\n {\n $dom = Dom::createFromString(file_get_contents(self::$fixture.'books.xml'));\n $this->assertInstanceOf(DOMDocument::class, $dom);\n $this->assertEquals('catalog', $dom->documentElement->localName);\n }", "protected function validateValue($value)\n {\n $result = null;\n\n $params = ['attribute' => $this->attributes, 'value' => $value];\n\n if (!is_string($value)) {\n return ['SID variable type is invalid.', $params];\n }\n\n if (!is_array($this->prefix)) {\n $this->prefix = [$this->prefix];\n }\n\n foreach ($this->prefix as $prefix) {\n $prefixLength = strlen($prefix);\n\n if (strlen($value) === $prefixLength + NoteHelper::UUID_LENGTH) {\n if (substr($value, 0, $prefixLength) === $prefix) {\n return null;\n } else {\n $result = ['SID prefix is invalid.', $params];\n }\n } else {\n $result = ['SID length is invalid.', $params];\n }\n }\n\n return $result;\n }", "public function validateValue()\n {\n return (preg_match('/' . $this->preference->value . '/', $this->value) == 1 ? true : false);\n }", "public function testBuildFixedAttributeThrowsExceptionWhenAttributeAndValueIsInvalid(\n string $value\n ): void\n {\n $this->expectException(InvalidValueException::class);\n $this->expectExceptionMessage(\\sprintf(\n '\"%s\" is an invalid string datatype.', \n $value\n ));\n \n $this->sut->buildFixedAttribute($value);\n }", "public function isValid($value)\n {\n $this->_setValue($value);\n\n // tolerate empty values\n if (!isset($value)) {\n return true;\n }\n\n // ensure that only string values are valid.\n if (is_numeric($value)) {\n $value = (string) $value;\n }\n if (!is_string($value)) {\n $this->_error(static::INVALID_TYPE);\n return false;\n }\n\n // validate permitted characters, but do not complain about unset values\n if (preg_match(\"/[^a-z0-9_\\- ]/i\", $value)) {\n $this->_error(self::ILLEGAL_CHARACTERS);\n return false;\n }\n\n return true;\n }", "private function checkStrict($value)\n {\n if ($value === 'true' or $value === 'false') {\n return true;\n } else {\n return false;\n }\n }", "private function nullable($value)\n {\n return is_null($value) || $value === '';\n }" ]
[ "0.8002327", "0.71103334", "0.7067282", "0.68364906", "0.6763932", "0.6472597", "0.6328236", "0.6327211", "0.62225926", "0.6182329", "0.6166959", "0.61632055", "0.6118536", "0.60252935", "0.6019838", "0.5986828", "0.5981469", "0.59632045", "0.5916067", "0.5884107", "0.5870995", "0.586718", "0.5862719", "0.5860678", "0.58538955", "0.5831406", "0.5824897", "0.5823293", "0.58187866", "0.58035105", "0.5796348", "0.579281", "0.57666445", "0.5766039", "0.57467574", "0.574507", "0.57327414", "0.57290924", "0.57216513", "0.5714369", "0.57010007", "0.56998205", "0.5694731", "0.5692888", "0.5680689", "0.56754047", "0.5670098", "0.5653835", "0.56416625", "0.5611551", "0.56076866", "0.5607397", "0.5604397", "0.5600406", "0.55790323", "0.55773574", "0.55713814", "0.5569922", "0.556127", "0.5560244", "0.5557011", "0.5550771", "0.5547879", "0.5543776", "0.55421823", "0.5540848", "0.553012", "0.55247563", "0.55206996", "0.5516121", "0.5510087", "0.55025405", "0.54850125", "0.5477646", "0.547528", "0.54685056", "0.5466826", "0.54625946", "0.5460878", "0.54508436", "0.54507285", "0.5444968", "0.5441658", "0.5438904", "0.5436201", "0.5436201", "0.5421842", "0.54130936", "0.541198", "0.54015005", "0.53937835", "0.53920346", "0.53899634", "0.5387231", "0.5376775", "0.53764355", "0.5373004", "0.5370449", "0.5369594", "0.53666294" ]
0.80281806
0
Check that $value and $against are semantically the same.
public function checkMatchesXmlAdvanced($value, $against, $skipWhite, $ignoreCase) { if (defined('HHVM_VERSION')) { throw new BadMethodCallException('XML validation is not implemented in HHVM'); } if (!class_exists(XmlInspector::class)) { throw new BadMethodCallException( 'XML validation needs the excemel library. Run `composer require moccalotto/exemel` to install' ); } $message = '{name} must match the given XML document'; $context = compact('against', 'skipWhite', 'ignoreCase'); $valueXmlInspector = null; if (is_a($value, SimpleXMLElement::class)) { $valueXmlInspector = new XmlInspector($value); $success = $valueXmlInspector->sameAs($against, $skipWhite, $ignoreCase); return new Result($success, $message, $context); } if (!is_string($value)) { return new Result(false, $message, $context); } if (!$this->canParse($value)) { return new Result(false, $message, $context); } $valueXmlInspector = new XmlInspector(new SimpleXMLElement($value)); $success = $valueXmlInspector->sameAs($against, $skipWhite, $ignoreCase); return new Result($success, $message, $context); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkIdenticalTo($value, $against)\n {\n return new AssertionResult($value === $against, '{name} must be identical to {0}', [$against]);\n }", "public function checkMatchesXmlStrict($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, false, false);\n }", "public function checkMatchesXmlWithCase($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, true, false);\n }", "public function checkMatchesXml($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, true, true);\n }", "public function containsSame(mixed $value): bool\n {\n return $this->isOk() && $this->value === $value;\n }", "public function isEqualTo(IValueHolder $other)\n {\n $lefthand_value = $this->getValue();\n $righthand_value = $other->getValue();\n $lefthand_count = 0;\n $righthand_count = 0;\n $are_equal = true;\n\n if (is_array($lefthand_value)) {\n $lefthand_count = count($lefthand_value);\n }\n if (is_array($righthand_value)) {\n $righthand_count = count($righthand_value);\n }\n\n if (0 < $lefthand_count && $lefthand_count === $righthand_count) {\n foreach ($lefthand_value as $idx => $text) {\n if ($righthand_value[$idx] !== $text) {\n $are_equal = false;\n }\n }\n } elseif ($lefthand_count !== $righthand_count) {\n $are_equal = false;\n }\n\n return $are_equal;\n }", "public function checkMatchesXmlWithWhiteSpace($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, false, true);\n }", "private function evalequal($value, $data){\n\t\t\treturn (bool) $passed = ($data == $value) ? true : false;\n\t\t}", "function rest_are_values_equal($value1, $value2)\n {\n }", "abstract protected function checkValue( &$value );", "function my_acf_validate_value( $valid, $value, $field, $input ){\n\tif( !$valid ) {\n\t\treturn $valid;\n\t}\n $value_1 = $_POST['acf']['field_5a79e721d5c28'];\n $value_2 = $_POST['acf']['field_5a79e72cd5c29'];\n\tif ($value_1 != $value_2 ) {\n $valid = 'As senhas não são iguais';\n }\n\t// return\n\treturn $valid;\n\n}", "static function identicalTo($value)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::identicalTo', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function eql(Value $value): bool\n\t{\n\t\treturn is_a($value, get_class());\n\t}", "public function is($test_value) {\n\t\t$this_class = get_class($this);\n\t\tif ($test_value instanceof $this_class) {\n\t\t\treturn $test_value->getValue() === $this->value;\n\t\t}\n\t\t// Default to raw value comparison (this is not ideal, as the values\n\t\t// themselves are not type-hinted.\n\t\treturn $test_value === $this->value;\n\t}", "protected function isValid($value)\n {\n if ($value !== $this->options['expectedValue']) {\n $this->addError('The given value is expected to be %1$s.', 1361044943, [$this->options['expectedValue'] ? 'true' : 'false']);\n }\n }", "function is_equal_of(mixed $value, mixed ...$values): bool\n{\n $search_value = $value;\n foreach ($values as $value) {\n if ($search_value === $value) {\n return true;\n }\n }\n return false;\n}", "abstract public function getIsValidValue($value);", "abstract protected function isValidValue($value);", "abstract protected function compare($value): bool;", "protected function checksumMatches($value): bool\n {\n return $this->calculateChecksum($value) === $this->cutChecksum($value);\n }", "public function passes($attribute, $value)\n {\n return $value === 'tva' || $value === 'is';\n }", "private function randCompare($value)\n {\n return ($this->Compare($value, '1') <= 0 || $this->Compare($value, $this->n) >= 0);\n }", "function calculate_sameness($val1, $val2) {\n if ($val1 == 0 || $val2 == 0) return 0; //if either are unsure this is not a match\n else if ($val1 == $val2) return 1; //if both are sure and the same it is a match\n else return -10; //if both are sure and different it is not a match\n}", "public function passes($attribute, $value)\n {\n return $this->numericValidation() && $this->testUnique();\n }", "public function passes($attribute, $value) {\n\n //post arrays - check each item\n if (is_array($value)) {\n foreach ($value as $key => $val) {\n if ($val == strip_tags($val)) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n //run strip tags and then compare the strings\n if ($value == strip_tags($value)) {\n return true;\n }\n return false;\n }", "public function passes($attribute, $value)\n {\n $saldo = Cuenta::where('num_cuenta', $this->cuenta)->first()->saldo;\n $saldo_despues = $saldo - $value;\n return $saldo_despues > $this->monto_permitido;\n }", "public function isValid($value)\n {\n return $value === $this->getValue();\n }", "abstract protected function validateValue($value);", "public function is($value) {\n return ($this->code === $value || $this->value === $value);\n }", "public function passes($attribute, $value)\n {\n return Hash::check($value, $this->input);\n }", "abstract public function validate(\n $value\n ): bool;", "public function passes($attribute, $value)\n {\n $baseRaw = $this->model::where($attribute, 'like', withoutSpace($value) ?? '')->first();\n\n $rawsForCheck = [];\n foreach ($this->fields as $attributel => $value) {\n $raw = $this->model::where($attributel, 'like', withoutSpace($value) ?? '')->first();\n\n if (is_null($raw)) {\n $nullCheck = true;\n break;\n } else {\n $rawsForCheck[$raw->id] = $raw;\n }\n } \n\n if (isset($baseRaw) && isset($nullCheck)) {\n return false;\n }\n\n if (isset($baseRaw) && count($rawsForCheck) != 1) {\n return false;\n }\n\n if (isset($baseRaw) && count($rawsForCheck) == 1 && $baseRaw->id !== head($rawsForCheck)->id) {\n return false;\n }\n\n return true;\n }", "public function passes($attribute, $value)\n {\n return is_numeric($value) && $this->hasAllowedLength($value) && $this->checksumMatches($value);\n }", "abstract public function verify($value): void;", "public function shouldBeEqualTo($expected) {}", "public function equals($value);", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_NYSE,self::VALUE_NASDAQCM,self::VALUE_NASDAQGM,self::VALUE_NASDAQGS,self::VALUE_AMEX,self::VALUE_PINKSHEETS,self::VALUE_OTCBB,self::VALUE_INDUSTRYGROUPS,self::VALUE_INDICES,self::VALUE_AMSTERDAM,self::VALUE_ASX,self::VALUE_BERLIN,self::VALUE_BREMEN,self::VALUE_BRUSSELS,self::VALUE_COPENHAGEN,self::VALUE_DUSSELDORF,self::VALUE_FRANKFURT,self::VALUE_HAMBURG,self::VALUE_HANOVER,self::VALUE_HELSINKI,self::VALUE_HONGKONG,self::VALUE_ICELAND,self::VALUE_INDIA,self::VALUE_LISBON,self::VALUE_LSE,self::VALUE_MUMBAI,self::VALUE_MUNICH,self::VALUE_OSLO,self::VALUE_PARIS,self::VALUE_PRAGUE,self::VALUE_RIGA,self::VALUE_RTSRUB,self::VALUE_RTSUSD,self::VALUE_SINGAPORE,self::VALUE_STOCKHOLM,self::VALUE_STUTTGART,self::VALUE_TALLINN,self::VALUE_TOKYO,self::VALUE_TSX,self::VALUE_TSXV,self::VALUE_VILNIUS,self::VALUE_XETRA));\n\t}", "public function passes($attribute, $value)\n {\n // Validar longitud y sacar verificador\n if (strlen($value) === 10 ) {\n $verificador = substr($value,-1);\n $longitud = true;\n } elseif(strlen($value) === 13) {\n $verificador = substr($value,-4,1);\n $longitud = true;\n }else{\n $verificador = null;\n $longitud = false;\n }\n // Validar que solo sean numeros\n if (ctype_digit($value)) {\n $num = true;\n } else {\n $num = false;\n }\n\n // Validar que sea una cedula\n $coe = [2, 1, 2, 1, 2, 1, 2, 1, 2];\n $total = 0;\n for ($i = 0; $i < 9; $i++) {\n # code...\n $rest = $coe[$i] * $value[$i];\n if ($rest >= 10) {\n $rest = $rest - 9;\n }\n $total = $total + $rest;\n }\n //\n if (is_integer($total / 10)) {\n $superior = $total;\n } else {\n $float = $total / 10;\n $superior = ceil($float);\n $superior = $superior * 10;\n }\n $resultado = $superior - $total;\n\n if ($verificador == $resultado) {\n $ci = true;\n } else {\n $ci = false;\n }\n return $longitud && $num && $ci;\n }", "public static function isCorrect($value)\r\n {\r\n return (strcasecmp($value, BuildingQuality::AVERAGE) == 0 || strcasecmp($value, BuildingQuality::ECONOMY) == 0 ||\r\n strcasecmp($value, BuildingQuality::CUSTOM) == 0 || strcasecmp($value, BuildingQuality::LUXURY) == 0);\r\n }", "public function checkDiff()\n {\n if ($this->tokensOriginal !== $this->tokensMutated) {\n return true;\n }\n\n return false;\n }", "public function isSameScoreDifference() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return $this->intRealHomeScore - $this->intRealAwayScore === $this->intBetHomeScore - $this->intBetAwayScore;\n }", "abstract public function validate($value, Result $result);", "public function passes($attribute, $value): bool\n {\n try {\n $this->validateInput($value);\n } catch (\\Throwable $e) {\n // Apparently there are no simple ways to return different messages\n // based on user input in Laravel. Currently, the validator simply returns false\n // if data is not in valid format.\n return false;\n }\n $values = Arr::pluck($value, $this->key);\n\n return count($values) === count(array_unique($values));\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_ASKSELLERQUESTION,self::VALUE_RESPONSETOASQQUESTION,self::VALUE_CONTACTEBAYMEMBER,self::VALUE_CONTACTTRANSACTIONPARTNER,self::VALUE_RESPONSETOCONTACTEBAYMEMBER,self::VALUE_CONTACTEBAYMEMBERVIACOMMUNITYLINK,self::VALUE_CUSTOMCODE,self::VALUE_ALL,self::VALUE_CONTACTMYBIDDER,self::VALUE_CONTACTEBAYMEMBERVIAANONYMOUSEMAIL,self::VALUE_CLASSIFIEDSCONTACTSELLER,self::VALUE_CLASSIFIEDSBESTOFFER));\n\t}", "public function passes($attribute, $value)\n {\n $correct = [];\n foreach($this->answers as $answer) {\n if ($answer['correct']) {\n array_push($correct, true);\n }\n }\n return count($correct) === 1;\n }", "public function isValid($value);", "public function isValid($value);", "public function passes($attribute, $value)\n {\n // return strtoupper($value) === $value;\n return preg_match(\"/^[ ,<.>\\/?'\\\"\\;:=+-_)(*&%$@!AÁÀẢÃẠÂẤẦẨẪẬĂẮẰẲẴẶEÉÈẺẼẸÊẾỀỂỄỆIÍÌỈĨỊOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢUÚÙỦŨỤƯỨỪỬỮỰYÝỲỶỸỴĐaáàảãạâấầẩẫậăắằẳẵặeéèẻẽẹêếềểễệiíìỉĩịoóòỏõọôốồổỗộơớờởỡợuúùủũụưứừửữựyýỳỷỹỵđ0-9a-zA-Z\\s]+$/\", $value);\n }", "public function passes($attribute, $value)\n {\n $reg = '/^[0-9]{11}$/';\n if(preg_match($reg, $value)==false)\n return false;\n else\n {\n $digits = str_split($value);\n if ((intval(substr($value, 4, 2)) > 31)||(intval(substr($value, 2, 2)) > 12))\n return false;\n $checksum = (1*intval($digits[0]) + 3*intval($digits[1]) + 7*intval($digits[2]) + 9*intval($digits[3]) + 1*intval($digits[4]) + 3*intval($digits[5]) + 7*intval($digits[6]) + 9*intval($digits[7]) + 1*intval($digits[8]) + 3*intval($digits[9]))%10;\n if($checksum == 0)\n $checksum = 10;\n $checksum = 10 - $checksum;\n\n return (intval($digits[10]) == $checksum);\n }\n }", "protected function validateExact($value, $parameters){\n\t\t$size = $this->getStringSize($value);\n\t\treturn $size == $parameters;\n\t}", "public function it_comparison_match_test()\n {\n\n // describe method App\\Movie::getRatingLike() should return 5 or \"5\", if not it will be failed\n $this->getRatingLike()->shouldBeLike(5);\n }", "private function evallessthanorequal($value, $data){\n\t\t\treturn (bool) $passed = ($data <= $value) ? true : false;\n\t\t}", "public function passes($attribute, $value)\n {\n return !strncmp($this->town->short_postcode, $value, 2);\n }", "function matchField($value, $params = array()) {\n\t\tif ($this->data[$this->name][$params['field1']] != $this->data[$this->name][$params['field2']]) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function __invoke($value) {\n return $this->isValid($value);\n }", "public function equals($value) {\n return $value instanceof self && nameof($this) === nameof($value);\n }", "public function passes($attribute, $value): bool\n {\n $value = preg_replace('/\\s+/', '', trim($value));\n\n if (!is_string($value)) {\n return false;\n }\n // 19 14 89 62 43 4\n $result = preg_match('/^(\\d{2})(\\d{2})(\\d{2})\\d{5}$/i', $value, $output);\n\n if($result !== 1){\n return false;\n }\n\n $anno = date('Y') % 100;\n $subde = $output[1];\n $annoAlta = $output[2];\n $annoNac = $output[3];\n\n if ($subde != 97) {\n if ($annoAlta <= $anno) $annoAlta += 100;\n if ($annoNac <= $anno) $annoNac += 100;\n if ($annoNac > $annoAlta)\n return false;\n }\n\n return $this->luhn($value);\n }", "public function getIsValidValue($value)\r\n {\r\n return true;\r\n }", "public function passes($attribute, $value)\n {\n $chest = $this->user->chests()->where('place_id', $value)->latest()->first();\n $huntStatistic = (new HuntStatisticRepository)->first(['_id', 'freeze_till']);\n if ($chest) {\n $freezeTime = $chest->created_at->addSeconds($huntStatistic->freeze_till['chest']);\n if ($chest->place_id == $value && ($freezeTime->gte(now()))) {\n return false;\n }else{\n return true;\n }\n }else{\n return true;\n }\n }", "public function passes($attribute, $value)\n {\n $counter = 0;\n if ($this->attr1 == 0) $counter++;\n if ($this->attr2 == 0) $counter++;\n if ($this->attr3 == 0) $counter++;\n\n if ($counter == 2) {\n return true;\n } else {\n return false;\n }\n }", "public function check($value): bool;", "protected function validateEqualTo($value, $parameters){\n\t\treturn $value == $this->getValue($parameters[0]);\n\t}", "public function isSameTendency() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return \n ($this->intRealHomeScore < $this->intRealAwayScore && $this->intBetHomeScore < $this->intBetAwayScore) \n || ($this->intRealHomeScore > $this->intRealAwayScore && $this->intBetHomeScore > $this->intBetAwayScore) \n || ($this->intRealHomeScore === $this->intRealAwayScore && $this->intBetHomeScore === $this->intBetAwayScore);\n }", "public function passes($attribute, $value)\n {\n if (preg_match(\"/^.*[-].*$/\", $value) == true) {\n $this->error_message = \"Please do not use dash(-) sign\";\n return false;\n } else if (preg_match(\"/^[+,0].*$/\", $value) != true) {\n $this->error_message = \"Please start with either 0 or +\";\n return false;\n } else if (preg_match(\"/^[0,+]?[1-9][0-9]{9,14}$/\", $value) != true) {\n $this->error_message = \"Please insert only numbers ranging from 10 to 15 digits\";\n return false;\n }\n return true;\n }", "public function passes($attribute, $value): bool\n {\n if (!$value) {\n $this->errorMessage = 'ИНН пуст';\n return false;\n }\n\n if (preg_match('/[^0-9]/', $value)) {\n $this->errorMessage = 'ИНН может состоять только из цифр';\n return false;\n }\n\n if (strlen($value) !== 12) {\n $this->errorMessage = 'ИНН может состоять только из 12 цифр';\n return false;\n }\n\n $check_digit = function ($inn, $coefficients) {\n $n = 0;\n foreach ($coefficients as $i => $k) {\n $n += $k * (int)$inn[$i];\n }\n return $n % 11 % 10;\n };\n $n11 = $check_digit($value, [7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n $n12 = $check_digit($value, [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n if (($n11 === (int)$value[10]) && ($n12 === (int)$value[11])) {\n return true;\n }\n\n $this->errorMessage = 'Введите существующий ИНН';\n return false;\n }", "public function validate( $value )\n\t{\n\t\treturn (int)$value === $value;\n\t}", "public function shouldEqual($expected) {}", "public function eq($value)\n {\n \n return $this->is($this->value == unwrap($value));\n \n }", "function exact_value ( $str, $val )\n\t{\n\t\tif ( strcmp( strval( $str ), strval( $val ) ) !== 0 ) return FALSE;\n\t\treturn TRUE;\n\t}", "function validateCompare ($input, $input2, $option = 'same') {\n if($input === $input2) {\n return true;\n } else {\n return false;\n }\n}", "public function passes($attribute, $value)\n {\n //\n if(isset($value) && !empty($value)) : \n try {\n return $this->isValidBTCAddress($value);\n } catch(\\Exception $e) {\n return false;\n }\n else :\n return true;\n endif;\n }", "public function testSame()\n {\n $result = \"texto\";\n $this->assertSame($result, \"texto\"); //verifica con ===\n }", "public static function FailingTests(){\r\n\t\t$check = $val = 123;\r\n\t\tTestExecuter::AssertAreEqual($check, $val);\r\n\r\n\t\t//But this test will fail\r\n\t\t$val = \"not a number\";\r\n\t\tTestExecuter::AssertAreEqual($check, $val);\r\n\r\n\t\t//And this one is fine too\r\n\t\t$check = $val;\r\n\t\tTestExecuter::AssertAreEqual($check, $val);\r\n\t}", "public function notEqualTo($value);", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_NAME,self::VALUE_INTERIMENDINGDATE,self::VALUE_DATEPRELIMINARYDATALOADED,self::VALUE_EARNINGSPERIODINDICATOR,self::VALUE_QUARTERLYINDICATOR,self::VALUE_BASICEARNINGSINDICATOR,self::VALUE_TEMPLATEINDICATOR,self::VALUE_PRELIMINARYFULLCONTEXTINDICATOR,self::VALUE_PROJECTEDFISCALYEARENDDATE,self::VALUE_NUMBEROFMONTHSSINCELASTREPORTINGPERIOD,self::VALUE_OPERATINGREVENUE,self::VALUE_TOTALREVENUE,self::VALUE_ADJUSTMENTSTOREVENUE,self::VALUE_COSTOFSALES,self::VALUE_COSTOFSALESWITHDEPRECIATION,self::VALUE_GROSSMARGIN,self::VALUE_GROSSOPERATINGPROFIT,self::VALUE_RESEARCHANDDEVELOPMENTEXPENSES,self::VALUE_SELLINGGENERALANDADMINISTRATIVEEXPENSES,self::VALUE_ADVERTISINGEXPENSES,self::VALUE_OPERATINGINCOME,self::VALUE_OPERATINGINCOMEBEFOREDEPRECIATION,self::VALUE_DEPRECIATION,self::VALUE_DEPRECIATIONUNRECONCILED,self::VALUE_AMORTIZATION,self::VALUE_AMORTIZATIONOFINTANGIBLES,self::VALUE_OPERATINGINCOMEAFTERDEPRECIATION,self::VALUE_INTERESTINCOME,self::VALUE_EARNINGSFROMEQUITYINTEREST,self::VALUE_NETOTHERINCOME,self::VALUE_INCOMEACQUIREDINPROCESSRANDD,self::VALUE_INCOMERESTRUCTURINGANDMANDA,self::VALUE_OTHERSPECIALCHARGES,self::VALUE_SPECIALINCOMECHARGES,self::VALUE_TOTALINCOMEAVAILABLEFORINTERESTEXPENSE,self::VALUE_INTERESTEXPENSE,self::VALUE_PRETAXINCOME,self::VALUE_INCOMETAXES,self::VALUE_MINORITYINTEREST,self::VALUE_PREFERREDSECURITIESOFSUBSIDIARYTRUST,self::VALUE_INCOMEBEFOREINCOMETAXES,self::VALUE_NETINCOMEFROMCONTINUINGOPERATIONS,self::VALUE_NETINCOMEFROMDISCONTINUEDOPERATIONS,self::VALUE_NETINCOMEFROMTOTALOPERATIONS,self::VALUE_EXTRAORDINARYINCOMELOSSES,self::VALUE_INCOMEFROMCUMMULATEDEFFECTOFACCOUNTINGCHANGES,self::VALUE_INCOMEFROMTAXLOSSCARRYFORWARD,self::VALUE_OTHERGAINSANDLOSSES,self::VALUE_TOTALNETINCOME,self::VALUE_NORMALIZEDINCOME,self::VALUE_NETINCOMEAVAILABLEFORCOMMON,self::VALUE_PREFERREDDIVIDENDS,self::VALUE_EXCISETAXES,self::VALUE_BASICEPSFROMCONTINUINGOPERATIONS,self::VALUE_BASICEPSFROMDISCONTINUEDOPERATIONS,self::VALUE_BASICEPSFROMTOTALOPERATIONS,self::VALUE_BASICEPSFROMEXTRAORDINARYINCOME,self::VALUE_BASICEPSFROMCUMMULATEDEFFECTOFACCOUNTINGCHANGES,self::VALUE_BASICEPSFROMTAXLOSSCARRYFORWARDS,self::VALUE_BASICEPSFROMOTHERGAINSANDLOSSES,self::VALUE_BASICEPSTOTAL,self::VALUE_BASICNORMALIZEDNETINCOMESHARE,self::VALUE_DILUTEDEPSFROMCONTINUINGOPERATIONS,self::VALUE_DILUTEDEPSFROMDISCONTINUEDOPERATIONS,self::VALUE_DILUTEDEPSFROMTOTALOPERATIONS,self::VALUE_DILUTEDEPSFROMEXTRAORDINARYINCOME,self::VALUE_DILUTEDEPSFROMCUMMULATEDEFFECTOFACCOUNTINGCHANGES,self::VALUE_DILUTEDEPSFROMTAXLOSSCARRYFORWARD,self::VALUE_DILUTEDEPSFROMOTHERGAINSANDLOSSES,self::VALUE_DILUTEDEPSTOTAL,self::VALUE_DILUTEDNORMALIZEDNETINCOMESHARE,self::VALUE_DIVIDENDSPAIDPERSHARE,self::VALUE_REVENUESYEARTODATE,self::VALUE_INCOMEYEARTODATEFROMTOTALOPERATIONS,self::VALUE_DILUTEDEPSYEARTODATEFROMTOTALOPERATIONS,self::VALUE_DIVIDENDSPAIDPERSHAREYEARTODATE,self::VALUE_CASHANDEQUIVALENTS,self::VALUE_RESTRICTEDCASH,self::VALUE_MARKETABLESECURITIES,self::VALUE_ACCOUNTSRECEIVABLE,self::VALUE_LOANSRECEIVABLE,self::VALUE_OTHERRECEIVABLE,self::VALUE_RECEIVABLES,self::VALUE_RAWMATERIALS,self::VALUE_WORKINPROGRESS,self::VALUE_PURCHASEDCOMPONENTS,self::VALUE_FINISHEDGOODS,self::VALUE_OTHERINVENTORIES,self::VALUE_INVENTORIESADJUSTMENTSANDALLOWANCES,self::VALUE_INVENTORIES,self::VALUE_PREPAIDEXPENSES,self::VALUE_CURRENTDEFERREDINCOMETAXES,self::VALUE_OTHERCURRENTASSETS,self::VALUE_TOTALCURRENTASSETS,self::VALUE_LANDANDIMPROVEMENTS,self::VALUE_BUILDINGANDIMPROVEMENTS,self::VALUE_MACHINERYFURNITUREANDEQUIPMENT,self::VALUE_CONSTRUCTIONINPROGRESS,self::VALUE_OTHERFIXEDASSETS,self::VALUE_TOTALFIXEDASSETS,self::VALUE_GROSSFIXEDASSETS,self::VALUE_ACCUMULATEDDEPRECIATIONANDDEPLETION,self::VALUE_NETFIXEDASSETS,self::VALUE_INTANGIBLES,self::VALUE_COSTINEXCESS,self::VALUE_NONCURRENTDEFERREDINCOMETAXES,self::VALUE_OTHERNONCURRENTASSETS,self::VALUE_TOTALNONCURRENTASSETS,self::VALUE_TOTALASSETS,self::VALUE_INVENTORYVALUATIONMETHOD,self::VALUE_ACCOUNTSPAYABLE,self::VALUE_NOTESPAYABLE,self::VALUE_SHORTTERMDEBT,self::VALUE_ACCRUEDEXPENSES,self::VALUE_ACCRUEDLIABILITIES,self::VALUE_DEFERREDREVENUES,self::VALUE_CURRENTDEFERREDINCOMETAXLIABILITIES,self::VALUE_OTHERCURRENTLIABILITIES,self::VALUE_TOTALCURRENTLIABILITIES,self::VALUE_LONGTERMDEBT,self::VALUE_CAPITALLEASEOBLIGATIONS,self::VALUE_DEFERREDINCOMETAXLIABILITIES,self::VALUE_OTHERNONCURRENTLIABILITIES,self::VALUE_MINORITYINTERESTLIABILITIES,self::VALUE_PREFERREDSECURITIESOFSUBSIDIARYTRUSTLIABILITIES,self::VALUE_PREFERREDEQUITYOUTSIDESTOCKEQUITY,self::VALUE_TOTALNONCURRENTLIABILITIES,self::VALUE_TOTALLIABILITIES,self::VALUE_PREFERREDSTOCKEQUITY,self::VALUE_COMMONSTOCKEQUITY,self::VALUE_COMMONPAR,self::VALUE_ADDITIONALPAIDINCAPITAL,self::VALUE_CUMULATIVETRANSLATIONADJUSTMENT,self::VALUE_RETAINEDEARNINGS,self::VALUE_TREASURYSTOCK,self::VALUE_OTHEREQUITYADJUSTMENTS,self::VALUE_TOTALCAPITALIZATION,self::VALUE_TOTALEQUITY,self::VALUE_TOTALLIABILITIESANDSTOCKEQUITY,self::VALUE_CASHFLOW,self::VALUE_WORKINGCAPITAL,self::VALUE_FREECASHFLOW,self::VALUE_INVESTEDCAPITAL,self::VALUE_SHARESOUTSTANDINGCOMMONCLASSONLY,self::VALUE_PREFERREDSHARES,self::VALUE_TOTALORDINARYSHARES,self::VALUE_TOTALCOMMONSHARESOUTSTANDING,self::VALUE_TREASURYSHARES,self::VALUE_BASICWEIGHTEDSHARESOUTSTANDING,self::VALUE_DILUTEDWEIGHTEDSHARESOUTSTANDING,self::VALUE_NUMBEROFEMPLOYEES,self::VALUE_NUMBEROFPARTTIMEEMPLOYEES,self::VALUE_NETINCOMEORLOSS,self::VALUE_DEPRECIATIONEXPENSES,self::VALUE_AMORTIZATIONEXPENSES,self::VALUE_AMORTIZATIONOFINTANGIBLESEXPENSES,self::VALUE_DEFERREDINCOMETAXES,self::VALUE_OPERATINGGAINSORLOSSES,self::VALUE_EXTRAORDINARYGAINSORLOSSES,self::VALUE_INCREASEORDECREASEINRECEIVABLES,self::VALUE_INCREASEORDECREASEININVENTORIES,self::VALUE_INCREASEORDECREASEINPREPAIDEXPENSES,self::VALUE_INCREASEORDECREASEINOTHERCURRENTASSETS,self::VALUE_INCREASEORDECREASEINPAYABLES,self::VALUE_INCREASEORDECREASEINOTHERCURRENTLIABILITIES,self::VALUE_INCREASEORDECREASEINOTHERWORKINGCAPITAL,self::VALUE_OTHERNONCASHITEMS,self::VALUE_NETCASHFROMCONTINUINGOPERATIONS,self::VALUE_NETCASHFROMDISCONTINUEDOPERATIONS,self::VALUE_NETCASHFROMOPERATINGACTIVITIES,self::VALUE_SALEOFPROPERTYPLANTANDEQUIPMENT,self::VALUE_SALEOFLONGTERMINVESTMENTS,self::VALUE_SALEOFSHORTTERMINVESTMENTS,self::VALUE_PURCHASEOFPROPERTYPLANTANDEQUIPMENT,self::VALUE_ACQUISITIONS,self::VALUE_PURCHASEOFLONGTERMINVESTMENTS,self::VALUE_PURCHASEOFSHORTTERMINVESTMENTS,self::VALUE_OTHERINVESTINGCHANGESNET,self::VALUE_CASHFROMDISCONTINUEDINVESTINGACTIVITIES,self::VALUE_NETCASHFROMINVESTINGACTIVITIES,self::VALUE_ISSUANCEOFDEBT,self::VALUE_ISSUANCEOFCAPITALSTOCK,self::VALUE_REPAYMENTOFDEBT,self::VALUE_REPURCHASEOFCAPITALSTOCK,self::VALUE_PAYMENTOFCASHDIVIDENDS,self::VALUE_NETOTHERFINANCINGCHARGES,self::VALUE_CASHFROMDISCONTINUEDFINANCINGACTIVITIES,self::VALUE_NETCASHFROMFINANCINGACTIVITIES,self::VALUE_EFFECTOFEXCHANGERATECHANGES,self::VALUE_NETCHANGEINCASHANDCASHEQUIVALENTS,self::VALUE_CASHATBEGINNINGOFPERIOD,self::VALUE_CASHATENDOFPERIOD,self::VALUE_FOREIGNSALES,self::VALUE_DOMESTICSALES,self::VALUE_AUDITORSNAME,self::VALUE_AUDITORSREPORT,self::VALUE_CLOSEPERATIO,self::VALUE_HIGHPERATIO,self::VALUE_LOWPERATIO,self::VALUE_GROSSPROFITMARGIN,self::VALUE_PRETAXPROFITMARGIN,self::VALUE_POSTTAXPROFITMARGIN,self::VALUE_NETPROFITMARGIN,self::VALUE_INTERESTCOVERAGEFROMCONTINUINGOPERATIONS,self::VALUE_INTERESTASAPERCENTAGEOFINVESTEDCAPITAL,self::VALUE_EFFECTIVETAXRATE,self::VALUE_INCOMEPEREMPLOYEE,self::VALUE_NORMALIZEDCLOSEPERATIO,self::VALUE_NORMALIZEDHIGHPERATIO,self::VALUE_NORMALIZEDLOWPERATIO,self::VALUE_NORMALIZEDNETPROFITMARGIN,self::VALUE_NORMALIZEDRETURNONSTOCKEQUITY,self::VALUE_NORMALIZEDRETURNONASSETS,self::VALUE_NORMALIZEDRETURNONINVESTEDCAPITAL,self::VALUE_NORMALIZEDINCOMEPEREMPLOYEE,self::VALUE_QUICKRATIO,self::VALUE_CURRENTRATIO,self::VALUE_PAYOUTRATIO,self::VALUE_TOTALDEBTTOEQUITYRATIO,self::VALUE_LONGTERMDEBTTOTOTALCAPITAL,self::VALUE_LEVERAGERATIO,self::VALUE_ASSETTURNOVER,self::VALUE_CASHASAPERCENTAGEOFREVENUE,self::VALUE_RECEIVABLESASAPERCENTAGEOFREVENUE,self::VALUE_SGANDAEXPENSEASAPERCENTAGEOFREVENUE,self::VALUE_RANDDEXPENSEASAPERCENTAGEOFREVENUE,self::VALUE_REVENUEPERCASH,self::VALUE_REVENUEPERPLANT,self::VALUE_REVENUEPERCOMMONEQUITY,self::VALUE_REVENUEPERINVESTEDCAPITAL,self::VALUE_RECEIVABLETURNOVER,self::VALUE_INVENTORYTURNOVER,self::VALUE_RECEIVABLESPERDAYSALES,self::VALUE_SALESPERRECEIVABLES,self::VALUE_SALESPERINVENTORY,self::VALUE_REVENUETOASSETS,self::VALUE_NUMBEROFDAYSCOSTOFGOODSSOLDININVENTORY,self::VALUE_CURRENTASSETSPERSHARE,self::VALUE_TOTALASSETSPERSHARE,self::VALUE_INTANGIBLESASPERCENTAGEBOOKVALUE,self::VALUE_INVENTORYASPERCENTAGEREVENUE,self::VALUE_LONGTERMDEBTPERSHARE,self::VALUE_CURRENTLIABILITIESPERSHARE,self::VALUE_CASHPERSHARE,self::VALUE_LONGTERMDEBTTOEQUITYRATIO,self::VALUE_LONGTERMDEBTASAPERCENTAGEOFINVESTEDCAPITAL,self::VALUE_LONGTERMDEBTASAPERCENTAGEOFTOTALLIABILITIES,self::VALUE_TOTALLIABILITIESASAPERCENTAGEOFTOTALASSETS,self::VALUE_WORKINGCAPITALASAPERCENTAGEOFEQUITY,self::VALUE_REVENUEPERSHARE,self::VALUE_BOOKVALUEPERSHARE,self::VALUE_TANGIBLEBOOKVALUEPERSHARE,self::VALUE_PRICETOREVENUERATIO,self::VALUE_PRICETOEQUITYRATIO,self::VALUE_PRICETOTANGIBLEBOOKRATIO,self::VALUE_WORKINGCAPITALASPERCENTAGEOFPRICE,self::VALUE_WORKINGCAPITALPERSHARE,self::VALUE_CASHFLOWPERSHARE,self::VALUE_FREECASHFLOWPERSHARE,self::VALUE_RETURNONSTOCKEQUITY,self::VALUE_RETURNONINVESTEDCAPITAL,self::VALUE_RETURNONASSETS,self::VALUE_PRICECASHFLOWRATIO,self::VALUE_PRICEFREECASHFLOWRATIO,self::VALUE_SALESPEREMPLOYEE,self::VALUE_PERCENTAGESALESTOINDUSTRY,self::VALUE_PERCENTAGEEARNINGSTOINDUSTRY,self::VALUE_PERCENTAGEEPSTOINDUSTRY,self::VALUE_PERCENTAGEPRICETOINDUSTRY,self::VALUE_PERCENTAGEPETOINDUSTRY,self::VALUE_PERCENTAGEPRICEBOOKTOINDUSTRY,self::VALUE_PERCENTAGEPRICESALESTOINDUSTRY,self::VALUE_PERCENTAGEPRICECASHFLOWTOINDUSTRY,self::VALUE_PERCENTAGEPRICEFREECASHFLOWTOINDUSTRY,self::VALUE_PERCENTAGEDEBTEQUITYTOINDUSTRY,self::VALUE_PERCENTAGECURRENTRATIOTOINDUSTRY,self::VALUE_PERCENTAGEGROSSPROFITMARGINTOINDUSTRY,self::VALUE_PERCENTAGEPRETAXPROFITMARGINTOINDUSTRY,self::VALUE_PERCENTAGEPOSTTAXPROFITMARGINTOINDUSTRY,self::VALUE_PERCENTAGENETPROFITMARGINTOINDUSTRY,self::VALUE_PERCENTAGERETURNONEQUITYTOINDUSTRY,self::VALUE_PERCENTAGELEVERAGERATIOTOINDUSTRY,self::VALUE_PERCENTAGEASSETTURNOVERTOINDUSTRY,self::VALUE_LASTANNUALREPORTDATE,self::VALUE_LASTQUARTERLYREPORTDATE,self::VALUE_NONE,self::VALUE_TRUEFLOAT));\n\t}", "abstract public function isValid(mixed $value): bool;", "public function different( $value ) {\n return $this->diff( $value );\n }", "public function passes($attribute, $value):bool\n {\n //проверить что это массив уникальных значений\n if(!is_array($value)){\n $this->message = 'The field must be an array';\n return false;\n }\n //проверить массив на уникальность значений\n if(!($value === array_unique($value))){\n $this->message = 'The field must contain only unique values';\n return false;\n }\n //проверка на наличие неподдерживаемых элементов\n foreach($value as $m){\n if(array_search($m, config('senderman.supportedMessengers')) === false){\n $this->message = \"The field contains unsupported value: {$m}\";\n return false;\n }\n }\n\n return true;\n }", "public function passes($attribute, $value): bool\n {\n unset($attribute);\n $request = $this->request;\n $fund_password = $request->user()->fund_password;\n $checked = Hash::check($value, $fund_password);\n return $checked === true;\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_CURRENTSALESCONSENSUS,self::VALUE_CURRENTSALESCONSENSUSCHANGE,self::VALUE_SUMMARYCURRENTSTATISTICS,self::VALUE_SUMMARYCURRENTSTATISTICSCHANGE,self::VALUE_DEFAULT));\n\t}", "public function passes($attribute, $value)\n {\n return in_array('team_id', $value)\n && in_array('phone', $value)\n && in_array('sticky_phone_number_id', $value);\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_INCHECKOUT,self::VALUE_PRECHECKOUT));\n\t}", "public function sRiskDIFFER($user, $order, $value)\n {\n // Compare street and zipcode.\n // Return true if any of them doesn't match.\n return (\n strtolower(\n trim($user['shippingaddress']['street'])\n ) != strtolower(\n trim($user['billingaddress']['street'])\n )\n ) || (\n trim($user['shippingaddress']['zipcode'])\n != trim($user['billingaddress']['zipcode'])\n );\n }", "public function test_field_has_correct_value_attribute_when_changed()\n {\n $this->Field->attributes->value = $this->test_value;\n $dom = HtmlDomParser::str_get_html($this->Field->makeView()->render());\n $input = current($dom->find('input'));\n\n // A password field should never have a value even if one is set.\n $this->assertSame(true, $input->value);\n }", "public static function PassingTests(){\r\n\t\t\r\n\t\t$check = $val = \"abc is def\";\r\n\t\tTestExecuter::AssertAreEqual($check, $val);\r\n\r\n\t\t$check = $val = 157382;\r\n\t\tTestExecuter::AssertAreEqual($check, $val);\r\n\r\n\t\t$check = $val = (4763 - 324) . \" seconds\";\r\n\t\tTestExecuter::AssertAreEqual($check, $val);\r\n\t}", "public static function validate($value);", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_NOHITCOUNTER,self::VALUE_HONESTYSTYLE,self::VALUE_GREENLED,self::VALUE_HIDDEN,self::VALUE_CUSTOMCODE));\n\t}", "public function passes($attribute, $value)\n {\n // TODO: Implement passes() method.\n if (strtoupper($value) === $value) {\n return true;\n }\n\n return false;\n }", "public function passes($attribute, $value): bool\n {\n return preg_match(self::VALIDATION_REGEX, mb_strtolower($value));\n }", "public function passes($attribute, $value)\n {\n if(is_null($this->column))\n {\n $items = $value;\n } else {\n $items = array_column($value, $this->column);\n }\n $itemsUnique = array_unique($items);\n $itemsDiffAsoc = array_diff_assoc($items, $itemsUnique);\n if(count($itemsDiffAsoc) > 0)\n {\n return false;\n } else {\n return true;\n }\n }", "public function isExactResult() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return $this->intBetHomeScore === $this->intRealHomeScore && $this->intBetAwayScore === $this->intRealAwayScore;\n }", "public static function equal($value, $value1)\n {\n return ($value == $value1)?:false;\n }", "public function validate($value): bool\n {\n if (!array_key_exists($this->password, $this->data)) {\n return false;\n }\n if ($this->data[$this->password] !== $value) {\n return false;\n }\n return true;\n }", "public function passes($attribute, $value)\n {\n $validationFlag = false;\n if (!empty($value)) {\n $non_digits = [' ', '(', ')', '-', '.', '+'];\n $nums = str_replace($non_digits, '', $value);\n if (strlen($nums) == 10) {\n $validationFlag = true;\n }\n }\n return $validationFlag;\n }", "public function passes($attribute, $value)\n {\n if (request()->get('fecha_finalizado') != null) {\n\n $razon = Razon::find(request()->get('razon_id'), ['nombre']);\n\n if (!preg_match(\"/no acepta/i\", $razon->nombre)) {\n\n if (request()->get('valor_aprobado') != request()->get('valor_cotizado')) {\n return false;\n }\n }\n return true;\n }\n return true;\n }", "public function passes($attribute, $value)\n {\n return $this->hasher->check($value, $this->auth->guard()->user()->password);\n }", "public function validateValue($value)\n {\n }", "public function match($value, string $field, bool $strict = false): bool\n {\n if ($strict) {\n return $value === $this->getValidator()->getValue($field, null);\n }\n\n return $value == $this->getValidator()->getValue($field, null);\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_REPLACEMENTWARRANTY,self::VALUE_DEALERWARRANTY,self::VALUE_MANUFACTURERWARRANTY,self::VALUE_CUSTOMCODE));\n\t}", "public function isValidToken($value) {\n\t\tif ($value != $this->_previousToken)\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}" ]
[ "0.7482644", "0.61228627", "0.5901476", "0.5850103", "0.57399327", "0.56548667", "0.56168056", "0.56156915", "0.5549458", "0.551984", "0.54366934", "0.5425039", "0.5361208", "0.5327091", "0.5322754", "0.5315726", "0.53138745", "0.5306233", "0.5298211", "0.52211785", "0.520289", "0.51945406", "0.5181732", "0.51524615", "0.5141519", "0.51301265", "0.5106287", "0.5104401", "0.5097444", "0.5078622", "0.5077986", "0.50769264", "0.50525516", "0.5044842", "0.504317", "0.5032915", "0.50299037", "0.5029566", "0.5027311", "0.5025712", "0.5016374", "0.50031865", "0.5001234", "0.4989464", "0.49881214", "0.49826393", "0.49826393", "0.49764073", "0.49723053", "0.49620637", "0.49530095", "0.4950984", "0.49501878", "0.49449095", "0.4938785", "0.49357203", "0.49303016", "0.49192676", "0.4917827", "0.4916076", "0.49087232", "0.49081743", "0.49030474", "0.48973578", "0.48913383", "0.48900226", "0.4890015", "0.48845845", "0.48724252", "0.48673087", "0.48620307", "0.48564112", "0.48527417", "0.48452464", "0.4832574", "0.4816464", "0.48042506", "0.4795156", "0.47914273", "0.4791022", "0.47874403", "0.47872242", "0.4783787", "0.4782815", "0.4778022", "0.4775937", "0.4770958", "0.47657117", "0.4764739", "0.47572112", "0.4754619", "0.47535932", "0.47530004", "0.47520205", "0.47488558", "0.47487766", "0.47472316", "0.47471797", "0.4745397", "0.4740742" ]
0.5214767
20
Check that $value matches $against, enforcing whitespace similarity as well.
public function checkMatchesXmlWithWhiteSpace($value, $against) { return $this->checkMatchesXmlAdvanced($value, $against, false, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function passes($attribute, $value)\n {\n $bannedWords = preg_split('/\\n|\\r/', config('settings.short_bad_words'), -1, PREG_SPLIT_NO_EMPTY);\n\n foreach($bannedWords as $word) {\n // Search for the word in string\n if(strpos(mb_strtolower($value), mb_strtolower($word)) !== false) {\n return false;\n }\n }\n\n return true;\n }", "public function checkIdenticalTo($value, $against)\n {\n return new AssertionResult($value === $against, '{name} must be identical to {0}', [$against]);\n }", "public function passes($attribute, $value): bool\n {\n return preg_match('/\\s/', $value) === 0;\n }", "public function passes($attribute, $value)\n {\n // return strtoupper($value) === $value;\n return preg_match(\"/^[ ,<.>\\/?'\\\"\\;:=+-_)(*&%$@!AÁÀẢÃẠÂẤẦẨẪẬĂẮẰẲẴẶEÉÈẺẼẸÊẾỀỂỄỆIÍÌỈĨỊOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢUÚÙỦŨỤƯỨỪỬỮỰYÝỲỶỸỴĐaáàảãạâấầẩẫậăắằẳẵặeéèẻẽẹêếềểễệiíìỉĩịoóòỏõọôốồổỗộơớờởỡợuúùủũụưứừửữựyýỳỷỹỵđ0-9a-zA-Z\\s]+$/\", $value);\n }", "public function checkMatchesXmlWithCase($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, true, false);\n }", "public static function validateHasNoWhitespace( $value ) {\n\t\t\tif ( !is_string( $value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( preg_match( '/\\s/', $value ) ) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "public function passes($attribute, $value)\n {\n $contrasenyaSegura = false;\n if(strlen($value)>=8){\n $numeros = intval(preg_replace('/[^0-9]+/', '', $value), 10);\n if(strlen($numeros)>0){\n for($i = 0; $i<strlen($value) ; $i++){\n if(ctype_upper($value[$i])){\n $contrasenyaSegura = true;\n break;\n }\n }\n }\n\n }\n return $contrasenyaSegura;\n }", "public function passes($attribute, $value)\n {\n return !strncmp($this->town->short_postcode, $value, 2);\n }", "public function testExactMatch()\n {\n $word = $this->randomString(10);\n\n $percent1 = 0;\n $percent2 = 0;\n $percent3 = 0;\n\n //Verify that we produce the same result for an exact match\n //as the core levenshtein function\n $this->assertEquals(\n similar_text($word, $word, $percent1),\n mb_similar_text($word, $word, $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n\n //Verify that we produce an exact match result for strings\n //with multibyte characters.\n $this->assertEquals(5, mb_similar_text('nôtre', 'nôtre', $percent3));\n $this->assertEquals(100.0, $percent3);\n }", "public function passes($attribute, $value) {\n\n //post arrays - check each item\n if (is_array($value)) {\n foreach ($value as $key => $val) {\n if ($val == strip_tags($val)) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n //run strip tags and then compare the strings\n if ($value == strip_tags($value)) {\n return true;\n }\n return false;\n }", "function match_results($keyword, $value){\n\t\t// matching the keyword with the result\n\t\tif(strncmp($keyword,strtolower(trim($value)),strlen($keyword)) == 0){\n\t\t\tif(trim($value)){\n\t\t\t\treturn trim(\"$value\\n\");\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "public function passes($attribute, $value)\n {\n $noSpaces = ($value == trim($value) && strpos($value, ' ') !== false) ? false : true;\n\n $specialCharacters = '!\"#$%&\\'()*+,-./:;<=>?@[\\]^_`{|}~';\n\n $specialCharactersExclude = '!\"#$%&\\'()*+,-/:;<=>?@[\\]^`{|}~'; // Exclude underscore and period\n\n $startWithSpecialChars = in_array($value[0], str_split($specialCharacters));\n\n $endsWithSpecialChars = in_array($value[strlen($value) - 1], str_split($specialCharacters));\n\n $containsSpecialCharsExclude = Util::containsChar($specialCharactersExclude, $value);\n\n $moreThanOnePeriod = substr_count($value, '.') > 1 ? true : false;\n\n \n return (\n $noSpaces\n && !$startWithSpecialChars\n && !$endsWithSpecialChars\n && !$moreThanOnePeriod\n && !$containsSpecialCharsExclude\n ) ? true: false;\n }", "function validate_field_has_space_between($field_value, &$field)\n{\n $has_space = strpos($field_value, ' ');\n\n if ($has_space === false) {\n $field['error'] = 'Privalo buti tarpas';\n } elseif ($field_value != trim($field_value)) {\n $field['error'] = 'Neturi buti tarpo pradzioje ar pabaigoje';\n } else {\n return true;\n }\n}", "public function passes($attribute, $value): bool\n {\n $trimmed = trim(html_entity_decode(strip_tags($value)), \"\\t\\n\\r\\0\\x0B\\xC2\\xA0\");\n\n return ! empty($trimmed);\n }", "public function testMediumValuableWord() : void\n {\n $word = 'quirky';\n $this->assertEquals(22, score($word));\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^.*(?=^.{10}$)(?=.*\\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&+=]).*$/', $value);\n }", "public function passes($attribute, $value): bool\n {\n return preg_match(self::VALIDATION_REGEX, mb_strtolower($value));\n }", "function matchStrings($userValue, $label)\n{\n// debug(\"matchStrings $label\", $userValue);\n\n if(!strcasecmp($userValue, $label)) return true;\n \n $firstWord = substringBefore($label, \" \");\n return startsWith($userValue, $firstWord);\n}", "public function checkMatchesXmlStrict($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, false, false);\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\u4E00-\\u9FA5A-Za-z0-9_-]+$/', $value);\n }", "function spam_scrubber($value) {\n\t\t\n\t\t// list of very bad values\n\t\t$very_bad = array('to:', 'cc:', 'bcc:', 'content-type:', 'mime-version:', 'multipart-mixed:', 'content-transfer-encoding:');\n\t\t\n\t\t//if any of the very bad strings are in submitted value, return empty string\n\t\tforeach ($very_bad as $v) {\n\t\t\tif (stripos($value, $v) !== false) return '';\n\t\t}\n\t\t\n\t\t// replace any newline characters with spaces:\n\t\t$value = str_replace(array( \"\\r\", \"\\n\", \"%0a\", \"%0d\"), ' ', $value);\n\t\t\n\t\t//return the value\n\t\treturn trim($value);\n\t}", "public function match_results($keyword, $value){\n\t\t// matching the keyword with the result\n\t\tif(strncmp($keyword,strtolower(trim($value)),strlen($keyword)) == 0){\n\t\t\tif(trim($value)){\n\t\t\t\treturn trim(\"$value\\n\");\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "function exact_value ( $str, $val )\n\t{\n\t\tif ( strcmp( strval( $str ), strval( $val ) ) !== 0 ) return FALSE;\n\t\treturn TRUE;\n\t}", "public function passes($attribute, $value)\n {\n return preg_match('/(?=^.{4,253}$)(^(?!-)([a-zA-Z0-9\\-]{0,62}[a-zA-Z0-9]\\.)*[a-zA-Z]{1,63}$)/',\n $value) ||\n !preg_match('/(?=^.{3,63}$)(^(?!-)([a-zA-Z0-9\\-]{1,62}[a-zA-Z0-9]{1,62}$))/',\n $value);\n }", "public function testIsWhitespace() {\n\t\t$this->eq(s::isWhitespace(' '), true);\n\t\t$this->eq(s::isWhitespace(\"\\n\\n\\t \"), true);\n\t\t$this->eq(s::isWhitespace('abc'), false);\n\t\t$this->eq(s::isWhitespace(\"\\n\\tgfdgfd\"), false);\n\t\t$this->eq(s::isWhitespace(''), false);\n\t}", "public function passes($attribute, $value) {\n return preg_match(\"/^((?=.*?[A-Z])(?=.*?[a-z])(?=.*?\\d)|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[^a-zA-Z0-9])|(?=.*?[A-Z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])|(?=.*?[a-z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])).{8,}$/\", $value);\n }", "public function passes($attribute, $value)\n {\n $validationFlag = false;\n if (!empty($value)) {\n $non_digits = [' ', '(', ')', '-', '.', '+'];\n $nums = str_replace($non_digits, '', $value);\n if (strlen($nums) == 10) {\n $validationFlag = true;\n }\n }\n return $validationFlag;\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\pL\\.\\-\\_\\d+]+$/u', $value);\n }", "protected function validateAlphaNumSpaces( $attribute, $value ) {\n\n return (bool) preg_match( \"/^[A-Za-z0-9\\s]+$/\", $value );\n }", "function hobbyFormat ($value, $regex){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match($regex,$value)){\n return false;\n }\n \n return true;\n}", "public function match($value);", "public function passes($attribute, $value)\n {\n $permitidos = \"áéíóúabcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOP QRSTUVWXYZ \";\n //$permitidos = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \";\n\n for ($i = 0; $i < strlen($value); $i++) {\n if (strpos($permitidos, substr($value, $i, 1)) === false) {\n //no es válido;\n return false;\n }\n }\n\n //si estoy aqui es que todos los caracteres son validos\n return true;\n }", "public function passes($attribute, $value)\n {\n // TODO: Implement passes() method.\n if (strtoupper($value) === $value) {\n return true;\n }\n\n return false;\n }", "public function testWhitespace() {\n $this->assertEquals(\"Testing White Space\", Sanitize::whitespace(\"Testing White Space\"));\n $this->assertEquals(\"Testing White Space\", Sanitize::whitespace(\"Testing White Space\", array('limit' => 3)));\n $this->assertEquals(\"TestingWhiteSpace\", Sanitize::whitespace(\"Testing White Space\", array('limit' => 0)));\n\n $this->assertEquals(\"Testing\\tTabs\", Sanitize::whitespace(\"Testing\\t\\t\\tTabs\", array('tab' => true)));\n $this->assertEquals(\"Testing\\t\\tTabs\", Sanitize::whitespace(\"Testing\\t\\tTabs\", array('tab' => true, 'limit' => 3)));\n $this->assertEquals(\"TestingTabs\", Sanitize::whitespace(\"Testing\\tTabs\", array('tab' => true, 'limit' => 0)));\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^#(?:(?:[a-f\\d]{3}){1,2})$/i', $value);\n }", "public function passes($attribute, $value): bool\n {\n $pattern = preg_quote($this->pattern, '#');\n\n return ! preg_match(\"#[{$pattern}]#\", $value);\n }", "function isSpecialValue($value)\n {\n return strlen($value)>3 && $value[0]=='!' && $value[1]=='!' && $value[2]=='!';\n }", "public function check(string $value): string\n {\n $this->validateStructure($value);\n return $value;\n }", "public function passes($attribute, $value)\n {\n $flag = 0;\n if (isEmpty($value)) {\n $flag = 1;\n } else {\n $flag = preg_match(\"(^98|97\\d{8}$)\", $value);\n }\n return $flag;\n }", "public function __invoke($value)\n {\n assert(!isset($trimmedString), 'Cannot redeclare var $trimmedString');\n $trimmedString = static::sanitize($value);\n assert(!isset($result), 'Cannot redeclare var $result');\n $result = ($this->_isStructureValid($trimmedString) && $this->_isChecksumValid($trimmedString)) ? $trimmedString : null;\n return $result;\n }", "public static function isCorrect($value)\r\n {\r\n return (strcasecmp($value, BuildingQuality::AVERAGE) == 0 || strcasecmp($value, BuildingQuality::ECONOMY) == 0 ||\r\n strcasecmp($value, BuildingQuality::CUSTOM) == 0 || strcasecmp($value, BuildingQuality::LUXURY) == 0);\r\n }", "public function passes($attribute, $value)\n {\n if (preg_match(\"/^.*[-].*$/\", $value) == true) {\n $this->error_message = \"Please do not use dash(-) sign\";\n return false;\n } else if (preg_match(\"/^[+,0].*$/\", $value) != true) {\n $this->error_message = \"Please start with either 0 or +\";\n return false;\n } else if (preg_match(\"/^[0,+]?[1-9][0-9]{9,14}$/\", $value) != true) {\n $this->error_message = \"Please insert only numbers ranging from 10 to 15 digits\";\n return false;\n }\n return true;\n }", "public function validateValue($value)\n {\n return htmlspecialchars(trim($value));\n }", "public function testShortValuableWord() : void\n {\n $word = 'zoo';\n $this->assertEquals(12, score($word));\n }", "public function sanitize($value);", "public function passes($attribute, $value)\n {\n // 除了11、12 打头的手机号,其余都放行\n return preg_match('/^(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])\\d{8}$/', $value);\n }", "function inputCleaner($value){\n\t $toBeTested\t\t= strip_tags($value);\n\t // Instead of using HTMLStripSpecialChars, I am using some Regex\n\t\t// to have a greater degree of control over the input.\n\t\t//\tThis regex checks the entire string for anything that\n\t\t//\tcould ruin our consistency.\n\t $regExp = (\"/[\\!\\\"\\£\\$\\%\\^\\&\\*\\(\\)\\;\\'\\,\\\"\\?]/ \");\n\t if(preg_match_all($regExp, $toBeTested,$matches)){\n\t \treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn $toBeTested;\n\t\t}\n\t}", "public function passes($attribute, $value)\n {\n try {\n return !resolve(Spam::class)->detect($value);\n } catch (Exception $e) {\n return false;\n }\n }", "public function passes($attribute, $value)\n {\n// $len = strlen($value);\n $a = false;\n $value = strtolower($value);\n\n if(Str::endsWith($value, 'street')){\n $a = true;\n }\n if($a){\n return true;\n }\n return false;\n }", "public function testWhitespace(): void\n {\n $validator = new LengthValidator(allowNewLine: false);\n $result = $validator->validate('foo\n bar\n baz');\n\n $this->assertFalse($result->isValid());\n }", "public function like($value)\n {\n $term = '/.*' . $value . '.*/i';\n return $this->regex($term);\n }", "function placeFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_PLACE_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "public function check($value): bool\n {\n $value = str_split($value);\n\n return Helpers::collect($value)->duplicates()->isEmpty();\n }", "public static function like($valueA, $valueB) {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = false;\n\t\t\t\n\t\t\t// Check Values\n\t\t\tif(strcmp(strtolower($valueA), strtolower($valueB)) == 0) {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "public function passes($attribute, $value)\n {\n // si no viene un valor pasamos la validacion\n\n if(!$value){\n return true;\n }\n\n //que haya una mayuscula\n $upperCase=preg_match('@[A-Z]@',$value);\n //queremos una minuscula\n $lowerCase=preg_match('@[a-z]@',$value);\n //queremos que exista un numero\n $number=preg_match('@[0-9]@',$value);\n //minimo de 8 caracteres\n $length=strlen($value)>=8;\n $success=true;\n if(!$upperCase|| !$lowerCase || !$number || !$length){\n $success=false;\n }\n return $success;\n }", "public function isLegalValue($value) {\n\t\tswitch ( true ) {\n\t\t\tcase strpos($value, \"\\0\") !== false:\n\t\t\tcase strpos($value, \"\\n\") !== false:\n\t\t\tcase strpos($value, \"\\r\") !== false:\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function testInput($value){\n \n $MOOSE = $value;\n \n $MOOSE = trim($MOOSE);\n $MOOSE = stripslashes($MOOSE);\n $MOOSE = htmlspecialchars($MOOSE);\n return $MOOSE;\n \n }", "public function seotidy($passedvalue) {\n\t return strtolower(str_replace(\"'\",\"\",(str_replace('\\\\','-',str_replace('/','-',str_replace('&','and',str_replace(' ','-',($passedvalue))))))));\n\t}", "public function validateUsernameEqual($value, array $context)\n {\n Stopwatch::start('validateUsernameEqual');\n $users = $this->userlist();\n $lc = mb_strtolower($value);\n foreach ($users as $name) {\n if ($name === $value) {\n continue;\n }\n $name = mb_strtolower($name);\n $distance = levenshtein($lc, $name);\n if ($distance < 2) {\n return __('error.name.equalExists', $name);\n }\n }\n Stopwatch::stop('validateUsernameEqual');\n\n return true;\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^([a-z_\\d])+$/', $value) > 0;\n }", "function validate($val)\n{\n\t$val=htmlentities($val);\n\t$val=trim($val);\n\treturn $val;\n}", "private function compareHtmlStrings(string $db_value, string $parsed_value):bool\n {\n $db_value = htmlentities($db_value);\n $parsed_value = htmlentities($parsed_value);\n $len_db_value = strlen($db_value);\n $len_parsed_value = strlen($parsed_value);\n $diff_len = $len_db_value - $len_parsed_value;\n /* echo \"<br />compareHtmlStrings(): db_value (\".strlen($db_value).\"), parsed_value (\".strlen($parsed_value).\"), diff ($diff_len)\"; */\n /* $pos = 0; */\n /* while ($pos <= $len_db_value) { */\n /* $char_db = substr($db_value, $pos, 1); */\n /* $char_parsed = substr($parsed_value, $pos, 1); */\n /* if ($char_db === $char_parsed) { */\n /* echo \"<br /> $pos: $char_db --- $char_parsed \"; */\n /* echo \" ✔\"; */\n /* } else { */\n /* echo \"<br /> $pos: $char_db --- $char_parsed \"; */\n /* echo \" ✖\"; */\n /* } */\n /* $pos++; */\n /* } */\n return $diff_len === 0 || $diff_len === -42;\n }", "public function passes($attribute, $value)\n {\n if (strlen(preg_replace('/[^0-9]/', '', $value)) !== $this->digitsWithoutDash) {\n $this->message = \"The :attribute must include {$this->digitsWithoutDash} digits.\";\n return false;\n }\n if (!preg_match($this->regex, $value)) {\n return false;\n }\n return true;\n }", "function comparecsn($one, $two)\n{\n $one = preg_replace('/\\s*/m', '', strtolower($one));\n $two = preg_replace('/\\s*/m', '', strtolower($two));\n if ($one == $two) {\n return true;\n } else {\n return false;\n }\n}", "public function sanitize($value)\n {\n }", "private function pruneValue($value){\n $value = strtolower($value);\n $value = mysql_real_escape_string($value);\n return $value;\n }", "public function passes($attribute, $value)\n {\n return $value === 'tva' || $value === 'is';\n }", "public function my_custom_validation( string $value ): bool {\n\t\treturn strlen( $value ) <= 1;\n\t}", "public function hasSpaces(): bool\n\t{\n\t\treturn preg_match('/\\s/', $this->getValue());\n\t}", "function textFormat ($value){\n \n if(!preg_match(VALID_TEXT_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "protected function validateAlphaDashSpaces( $attribute, $value ) {\n return (bool) preg_match( \"/^[A-Za-z\\s-_]+$/\", $value );\n }", "public static function sanitize_textfield( $value ) {\n\t\tif ( is_object( $value ) || is_array( $value ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$value = (string) $value;\n\t\t$filtered = wp_check_invalid_utf8( $value );\n\n\t\tif ( strpos( $filtered, '<' ) !== false ) {\n\t\t\t$filtered = wp_pre_kses_less_than( $filtered );\n\t\t\t// This will strip extra whitespace for us.\n\t\t\t$filtered = wp_strip_all_tags( $filtered, false );\n\n\t\t\t// Use html entities in a special case to make sure no later\n\t\t\t// newline stripping stage could lead to a functional tag!\n\t\t\t$filtered = str_replace( \"<\\n\", \"&lt;\\n\", $filtered );\n\t\t}\n\t\t$filtered = preg_replace( '/[\\r\\n\\t ]+/', ' ', $filtered );\n\t\t$filtered = trim( $filtered );\n\n\t\t$found = false;\n\t\twhile ( preg_match( '/%[0-9]{2}/i', $filtered, $match ) ) {\n\t\t\t$filtered = str_replace( $match[0], '', $filtered );\n\t\t\t$found = true;\n\t\t}\n\n\t\tif ( $found ) {\n\t\t\t// Strip out the whitespace that may now exist after removing the octets.\n\t\t\t$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );\n\t\t}\n\n\t\treturn apply_filters( 'sanitize_text_field', $filtered, $value );\n\t}", "public function match(mixed $value);", "public function passes($attribute, $value)\n {\n if (! preg_match('/^[0-9]{8,20}$/', $value)) {\n $this->message = __('userandpermission::validation.digits', ['attribute' => $attribute]);\n } elseif (strlen($value) > $this->max) {\n $this->message = __('userandpermission::validation.phone_max', ['attribute' => $attribute, 'max' => $this->max]);\n } elseif (strlen($value) < $this->min) {\n $this->message = __('userandpermission::validation.phone_min', ['attribute' => $attribute, 'min' => $this->min]);\n }\n\n return ($this->message == 'passes');\n }", "function human_comparison(String $s1, String $s2, bool $mixedMode=true) :float {\n $s1 = strtoupper($s1);\n $s2 = strtoupper($s2);\n \n // replace alphanumeric charactors\n $s1clean = preg_replace(\"/[^A-Za-z0-9-]/\", '', trim($s1));\n $s2clean = preg_replace(\"/[^A-Za-z0-9-]/\", '', trim($s2));\n\n // remove double spaces\n while (strpos($s1clean, \" \") !== false) {\n $s1clean = str_replace(\" \", \" \", $s1clean);\n }\n \n while (strpos($s2clean, \" \") !== false) {\n $s2clean = str_replace(\" \", \" \", $s2clean);\n }\n \n // exact match\n if ($s1clean === $s2clean) {\n return 100;\n }\n\n // create arrays\n $ar1 = explode(\" \", $s1clean);\n $ar2 = explode(\" \", $s2clean);\n $s1_count = count($ar1);\n $s2_count = count($ar2);\n\n // flip the arrays if needed so ar1 is always largest.\n if ($s2_count > $s1_count) {\n $temp_ar = $ar2;\n $ar2 = $ar1;\n $ar1 = $temp_ar;\n }\n\n // flip array 2, to make the words the keys\n $ar2 = array_flip($ar2);\n\n $max_words = max($s1_count, $s2_count);\n $matches = 0;\n\n // find matching words\n foreach ($ar1 as $word) {\n if (array_key_exists($word, $ar2))\n $matches++;\n }\n \n // percentage of matching words\n $percent = ($matches / $max_words) * 50;\n \n // mix PHP's native similar text algorithm\n if ($mixedMode) {\n similar_text($s1clean, $s2clean, $similar);\n \n $similar = $matches>0 ? $similar * 0.5 : $similar;\n \n $percent = $percent + $similar;\n }\n \n return $percent;\n}", "public function passes($attribute, $value)\n {\n preg_match_all('/^\\:[^\\s\\:]+/', $this->key, $matches);\n\n if (empty($value) || empty($matches[0])) {\n return true;\n }\n\n return collect($matches)->pluck(0)->filter(function ($matched) use ($value) {\n return ! Str::contains($value, $matched);\n })->isEmpty();\n }", "public function checkMatchesXmlAdvanced($value, $against, $skipWhite, $ignoreCase)\n {\n if (defined('HHVM_VERSION')) {\n throw new BadMethodCallException('XML validation is not implemented in HHVM');\n }\n if (!class_exists(XmlInspector::class)) {\n throw new BadMethodCallException(\n 'XML validation needs the excemel library. Run `composer require moccalotto/exemel` to install'\n );\n }\n\n $message = '{name} must match the given XML document';\n $context = compact('against', 'skipWhite', 'ignoreCase');\n\n $valueXmlInspector = null;\n\n if (is_a($value, SimpleXMLElement::class)) {\n $valueXmlInspector = new XmlInspector($value);\n\n $success = $valueXmlInspector->sameAs($against, $skipWhite, $ignoreCase);\n\n return new Result($success, $message, $context);\n }\n\n if (!is_string($value)) {\n return new Result(false, $message, $context);\n }\n\n if (!$this->canParse($value)) {\n return new Result(false, $message, $context);\n }\n\n $valueXmlInspector = new XmlInspector(new SimpleXMLElement($value));\n\n $success = $valueXmlInspector->sameAs($against, $skipWhite, $ignoreCase);\n\n return new Result($success, $message, $context);\n }", "public function testEmptyStrings()\n {\n $percent1 = 0;\n $percent2 = 0;\n\n $this->assertEquals(\n similar_text('', '', $percent1),\n mb_similar_text('', '', $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n }", "function isSantizeString($var) {\n //Returns error message if it does\n\n //Sanitize the string, then see if there are any changes\n if (SanitizeString($var) == $var) {\n return \"\";\n } else {\n return \"Invalid Characters\";\n }\n}", "public function passes($attribute, $value)\n {\n if (! is_string($value) && ! is_numeric($value)) {\n return false;\n }\n\n return preg_match('/^[\\pL\\pN\\pM\\pZ\\'_-]+.?$/u', $value) > 0;\n }", "protected static function studly($value)\n {\n $value = ucwords(str_replace(['-', '_'], ' ', $value));\n\n return str_replace(' ', '', $value);\n }", "public function checkMatchesXml($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, true, true);\n }", "function checkValue($colName, $value, $words) {\r\r\n\t\t$ret = true;\r\r\n\t\treset($words);\r\r\n\t\t$regexp = \"/\\b(?:\". implode('|', $words) .\")\\b/ims\";\r\r\n\t\tif (preg_match($regexp, $value, $m)) {\r\r\n\t\t\t$ret = false;\r\r\n\t\t\tif ($this->action == 'block') {\r\r\n\t\t\t\treturn $ret;\r\r\n\t\t\t} else if ($this->action == 'replace') {\r\r\n\t\t\t\t$replacement = '$1' . $this->replaceWith . '$2';\r\r\n\t\t\t\t$value = preg_replace($regexp, $replacement, $value);\r\r\n\t\t\t// remove\t\r\r\n\t\t\t} else {\r\r\n\t\t\t\t$replacement = '$1$2';\r\r\n\t\t\t\t$value = preg_replace($regexp, $replacement, $value);\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t$this->replacements[$colName] = $value;\r\r\n\t\treturn $ret;\r\r\n\t}", "protected function doClean($value)\n {\n // based on http://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word\n $value = preg_replace('/((?![0-9]).)*/', '', $value);\n\n if (!self::isValidCreditCard($value, $this->options['card_type']))\n {\n throw new sfValidatorError($this, 'invalid', array('value' => $value));\n }\n\n return $value;\n }", "private function assert($value): bool {\n\n //Assertion::notEmpty($value); // Must not be empty\n Assertion::minLength($value, self::MIN_LENGTH); // Must be at least 5 characters\n Assertion::maxLength($value, self::MAX_LENGTH); // Must be less than 10 characters\n Assertion::regex(self::FORMAT); // Must follow a format of alphanumeric characters or underscores\n return true;\n }", "public function testEmptyString2()\n {\n $string1 = $this->randomString(rand(5, 10));\n\n $percent1 = 0;\n $percent2 = 0;\n\n $this->assertEquals(\n similar_text($string1, '', $percent1),\n mb_similar_text($string1, '', $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n }", "function filter_pattern($value)\n {\n global $pattern;\n return !strncmp($pattern, $value, strlen($pattern));\n }", "public function passes($attribute, $value): bool\n {\n if (!$value) {\n $this->errorMessage = 'ИНН пуст';\n return false;\n }\n\n if (preg_match('/[^0-9]/', $value)) {\n $this->errorMessage = 'ИНН может состоять только из цифр';\n return false;\n }\n\n if (strlen($value) !== 12) {\n $this->errorMessage = 'ИНН может состоять только из 12 цифр';\n return false;\n }\n\n $check_digit = function ($inn, $coefficients) {\n $n = 0;\n foreach ($coefficients as $i => $k) {\n $n += $k * (int)$inn[$i];\n }\n return $n % 11 % 10;\n };\n $n11 = $check_digit($value, [7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n $n12 = $check_digit($value, [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n if (($n11 === (int)$value[10]) && ($n12 === (int)$value[11])) {\n return true;\n }\n\n $this->errorMessage = 'Введите существующий ИНН';\n return false;\n }", "static function identicalTo($value)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::identicalTo', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public static function studly($value)\n {\n $value = ucwords(str_replace(['-', '_'], ' ', $value));\n\n return str_replace(' ', '', $value);\n }", "public static function studly($value)\n {\n $key = $value;\n if (isset(static::$studlyCache[$key])) {\n return static::$studlyCache[$key];\n }\n $value = ucwords(str_replace(['-', '_'], ' ', $value));\n return static::$studlyCache[$key] = str_replace(' ', '', $value);\n }", "function studly_case($value)\n {\n return Str::studly($value);\n }", "private function checkString($value)\n {\n if (!preg_match(\"/^[a-zA-Z ]*$/\", $value))\n {\n echo \"ERRORE nella Stringa : \" . $value;\n throw new InvalidArgumentException();\n }\n return true;\n }", "public function assertSameNoSpace($needle, $haystack)\n {\n return $this->assertSame($this->trimSpaces($needle), $this->trimSpaces($haystack));\n }", "function test_spaces_around_quotes( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}", "public function passes($attribute, $value)\n {\n $baseRaw = $this->model::where($attribute, 'like', withoutSpace($value) ?? '')->first();\n\n $rawsForCheck = [];\n foreach ($this->fields as $attributel => $value) {\n $raw = $this->model::where($attributel, 'like', withoutSpace($value) ?? '')->first();\n\n if (is_null($raw)) {\n $nullCheck = true;\n break;\n } else {\n $rawsForCheck[$raw->id] = $raw;\n }\n } \n\n if (isset($baseRaw) && isset($nullCheck)) {\n return false;\n }\n\n if (isset($baseRaw) && count($rawsForCheck) != 1) {\n return false;\n }\n\n if (isset($baseRaw) && count($rawsForCheck) == 1 && $baseRaw->id !== head($rawsForCheck)->id) {\n return false;\n }\n\n return true;\n }", "public function testValuableSingleLetter() : void\n {\n $word = 'f';\n $this->assertEquals(4, score($word));\n }", "public function equalsIgnoreCase($value)\n {\n $input_value = strtolower($this->getValue());\n $value = strtolower($value);\n\n return $input_value == $value;\n }", "public function isValid($value)\n {\n if ($value !== filter_var($value, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES)) {\n $this->addError(\n $this->translateErrorMessage(\n 'validator.text.notvalid',\n 'extbase'\n ),\n 1221565786\n );\n }\n }", "public function passes($attribute, $value): bool\n {\n $value = preg_replace('/\\s+/', '', trim($value));\n\n if (!is_string($value)) {\n return false;\n }\n // 19 14 89 62 43 4\n $result = preg_match('/^(\\d{2})(\\d{2})(\\d{2})\\d{5}$/i', $value, $output);\n\n if($result !== 1){\n return false;\n }\n\n $anno = date('Y') % 100;\n $subde = $output[1];\n $annoAlta = $output[2];\n $annoNac = $output[3];\n\n if ($subde != 97) {\n if ($annoAlta <= $anno) $annoAlta += 100;\n if ($annoNac <= $anno) $annoNac += 100;\n if ($annoNac > $annoAlta)\n return false;\n }\n\n return $this->luhn($value);\n }" ]
[ "0.61605304", "0.5904668", "0.58703566", "0.58438236", "0.5651348", "0.55833834", "0.5523529", "0.5510585", "0.5483966", "0.5461041", "0.5431343", "0.5425866", "0.54082304", "0.5373705", "0.53437173", "0.531781", "0.52882075", "0.52812976", "0.5265784", "0.5238926", "0.5228139", "0.52246594", "0.52240855", "0.52232367", "0.5213112", "0.519997", "0.5190997", "0.5187926", "0.51854587", "0.518229", "0.51526845", "0.51517713", "0.5115541", "0.5106756", "0.50974923", "0.5092395", "0.50540984", "0.50420266", "0.50415057", "0.5039187", "0.5034353", "0.50301015", "0.5020359", "0.50185746", "0.5017929", "0.50177014", "0.5001656", "0.5000657", "0.4995159", "0.4962354", "0.4957446", "0.49493217", "0.49447724", "0.4929891", "0.4914551", "0.49025965", "0.48900414", "0.48869693", "0.48825228", "0.48818794", "0.4877421", "0.48759535", "0.48750716", "0.4867532", "0.48450413", "0.48419037", "0.48317742", "0.48278186", "0.48266345", "0.4825359", "0.48167843", "0.48139426", "0.48133245", "0.48111585", "0.48085707", "0.4784617", "0.47827464", "0.4778884", "0.47698188", "0.47695997", "0.47690445", "0.47639906", "0.47630465", "0.47588977", "0.47562388", "0.4753108", "0.47522038", "0.47507247", "0.47488776", "0.47390458", "0.47368738", "0.47351405", "0.4734758", "0.47345826", "0.47320125", "0.47282952", "0.4724676", "0.47230974", "0.4722671", "0.47190422" ]
0.65028024
0
Check that $value matches $against, enforcing case similarity as well.
public function checkMatchesXmlWithCase($value, $against) { return $this->checkMatchesXmlAdvanced($value, $against, true, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function match($value);", "public function checkIdenticalTo($value, $against)\n {\n return new AssertionResult($value === $against, '{name} must be identical to {0}', [$against]);\n }", "public abstract function matches($value);", "public function passes($attribute, $value)\n {\n $bannedWords = preg_split('/\\n|\\r/', config('settings.short_bad_words'), -1, PREG_SPLIT_NO_EMPTY);\n\n foreach($bannedWords as $word) {\n // Search for the word in string\n if(strpos(mb_strtolower($value), mb_strtolower($word)) !== false) {\n return false;\n }\n }\n\n return true;\n }", "public function passes($attribute, $value)\n {\n // return strtoupper($value) === $value;\n return preg_match(\"/^[ ,<.>\\/?'\\\"\\;:=+-_)(*&%$@!AÁÀẢÃẠÂẤẦẨẪẬĂẮẰẲẴẶEÉÈẺẼẸÊẾỀỂỄỆIÍÌỈĨỊOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢUÚÙỦŨỤƯỨỪỬỮỰYÝỲỶỸỴĐaáàảãạâấầẩẫậăắằẳẵặeéèẻẽẹêếềểễệiíìỉĩịoóòỏõọôốồổỗộơớờởỡợuúùủũụưứừửữựyýỳỷỹỵđ0-9a-zA-Z\\s]+$/\", $value);\n }", "public function passes($attribute, $value)\n {\n // TODO: Implement passes() method.\n if (strtoupper($value) === $value) {\n return true;\n }\n\n return false;\n }", "public function match(mixed $value);", "function matchesCriterium ($criterium, $value) {\r\n return false;\r\n }", "public static function isCorrect($value)\r\n {\r\n return (strcasecmp($value, BuildingQuality::AVERAGE) == 0 || strcasecmp($value, BuildingQuality::ECONOMY) == 0 ||\r\n strcasecmp($value, BuildingQuality::CUSTOM) == 0 || strcasecmp($value, BuildingQuality::LUXURY) == 0);\r\n }", "public static function like($valueA, $valueB) {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = false;\n\t\t\t\n\t\t\t// Check Values\n\t\t\tif(strcmp(strtolower($valueA), strtolower($valueB)) == 0) {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "function exact_value ( $str, $val )\n\t{\n\t\tif ( strcmp( strval( $str ), strval( $val ) ) !== 0 ) return FALSE;\n\t\treturn TRUE;\n\t}", "public function passes($attribute, $value)\n {\n return $value === 'tva' || $value === 'is';\n }", "public function passes($attribute, $value)\n {\n $contrasenyaSegura = false;\n if(strlen($value)>=8){\n $numeros = intval(preg_replace('/[^0-9]+/', '', $value), 10);\n if(strlen($numeros)>0){\n for($i = 0; $i<strlen($value) ; $i++){\n if(ctype_upper($value[$i])){\n $contrasenyaSegura = true;\n break;\n }\n }\n }\n\n }\n return $contrasenyaSegura;\n }", "abstract public function verify($value): void;", "function matchStrings($userValue, $label)\n{\n// debug(\"matchStrings $label\", $userValue);\n\n if(!strcasecmp($userValue, $label)) return true;\n \n $firstWord = substringBefore($label, \" \");\n return startsWith($userValue, $firstWord);\n}", "public function passes($attribute, $value)\n {\n // Validar longitud y sacar verificador\n if (strlen($value) === 10 ) {\n $verificador = substr($value,-1);\n $longitud = true;\n } elseif(strlen($value) === 13) {\n $verificador = substr($value,-4,1);\n $longitud = true;\n }else{\n $verificador = null;\n $longitud = false;\n }\n // Validar que solo sean numeros\n if (ctype_digit($value)) {\n $num = true;\n } else {\n $num = false;\n }\n\n // Validar que sea una cedula\n $coe = [2, 1, 2, 1, 2, 1, 2, 1, 2];\n $total = 0;\n for ($i = 0; $i < 9; $i++) {\n # code...\n $rest = $coe[$i] * $value[$i];\n if ($rest >= 10) {\n $rest = $rest - 9;\n }\n $total = $total + $rest;\n }\n //\n if (is_integer($total / 10)) {\n $superior = $total;\n } else {\n $float = $total / 10;\n $superior = ceil($float);\n $superior = $superior * 10;\n }\n $resultado = $superior - $total;\n\n if ($verificador == $resultado) {\n $ci = true;\n } else {\n $ci = false;\n }\n return $longitud && $num && $ci;\n }", "public function testExactMatch()\n {\n $word = $this->randomString(10);\n\n $percent1 = 0;\n $percent2 = 0;\n $percent3 = 0;\n\n //Verify that we produce the same result for an exact match\n //as the core levenshtein function\n $this->assertEquals(\n similar_text($word, $word, $percent1),\n mb_similar_text($word, $word, $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n\n //Verify that we produce an exact match result for strings\n //with multibyte characters.\n $this->assertEquals(5, mb_similar_text('nôtre', 'nôtre', $percent3));\n $this->assertEquals(100.0, $percent3);\n }", "public function passes($attribute, $value): bool\n {\n return preg_match(self::VALIDATION_REGEX, mb_strtolower($value));\n }", "public function validateUsernameEqual($value, array $context)\n {\n Stopwatch::start('validateUsernameEqual');\n $users = $this->userlist();\n $lc = mb_strtolower($value);\n foreach ($users as $name) {\n if ($name === $value) {\n continue;\n }\n $name = mb_strtolower($name);\n $distance = levenshtein($lc, $name);\n if ($distance < 2) {\n return __('error.name.equalExists', $name);\n }\n }\n Stopwatch::stop('validateUsernameEqual');\n\n return true;\n }", "public function like($value);", "public function like($value)\n {\n $term = '/.*' . $value . '.*/i';\n return $this->regex($term);\n }", "public function passes($attribute, $value) {\n return preg_match(\"/^((?=.*?[A-Z])(?=.*?[a-z])(?=.*?\\d)|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[^a-zA-Z0-9])|(?=.*?[A-Z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])|(?=.*?[a-z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])).{8,}$/\", $value);\n }", "public function equalsIgnoreCase($value)\n {\n $input_value = strtolower($this->getValue());\n $value = strtolower($value);\n\n return $input_value == $value;\n }", "function calculate_sameness($val1, $val2) {\n if ($val1 == 0 || $val2 == 0) return 0; //if either are unsure this is not a match\n else if ($val1 == $val2) return 1; //if both are sure and the same it is a match\n else return -10; //if both are sure and different it is not a match\n}", "public function testMediumValuableWord() : void\n {\n $word = 'quirky';\n $this->assertEquals(22, score($word));\n }", "abstract protected function checkValue( &$value );", "public function testScore()\n {\n $value = mt_rand(1, 100);\n $comparisonValue = mt_rand(1, 100);\n $expected = [\n ComparisonFactor::EQUAL => ($value == $comparisonValue),\n ComparisonFactor::IDENTICAL => ($value === $comparisonValue),\n ComparisonFactor::NOT_EQUAL => ($value != $comparisonValue),\n ComparisonFactor::NOT_EQUAL_ALT => ($value <> $comparisonValue),\n ComparisonFactor::NOT_IDENTICAL => ($value !== $comparisonValue),\n ComparisonFactor::GREATER_THAN => ($value > $comparisonValue),\n ComparisonFactor::GREATER_THAN_OR_EQUAL_TO => ($value >= $comparisonValue),\n ComparisonFactor::LESS_THAN => ($value < $comparisonValue),\n ComparisonFactor::LESS_THAN_OR_EQUAL_TO => ($value <= $comparisonValue),\n ];\n foreach ($expected as $operator => $result) {\n $factor = new ComparisonFactor($comparisonValue, $operator);\n $this->assertEquals($result, $factor->score($value));\n }\n }", "public function passes($attribute, $value)\n {\n // si no viene un valor pasamos la validacion\n\n if(!$value){\n return true;\n }\n\n //que haya una mayuscula\n $upperCase=preg_match('@[A-Z]@',$value);\n //queremos una minuscula\n $lowerCase=preg_match('@[a-z]@',$value);\n //queremos que exista un numero\n $number=preg_match('@[0-9]@',$value);\n //minimo de 8 caracteres\n $length=strlen($value)>=8;\n $success=true;\n if(!$upperCase|| !$lowerCase || !$number || !$length){\n $success=false;\n }\n return $success;\n }", "public function passes($attribute, $value) {\n\n //post arrays - check each item\n if (is_array($value)) {\n foreach ($value as $key => $val) {\n if ($val == strip_tags($val)) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n //run strip tags and then compare the strings\n if ($value == strip_tags($value)) {\n return true;\n }\n return false;\n }", "public function passes($attribute, $value)\n {\n $flag = 0;\n if (isEmpty($value)) {\n $flag = 1;\n } else {\n $flag = preg_match(\"(^98|97\\d{8}$)\", $value);\n }\n return $flag;\n }", "public function passes($attribute, $value)\n {\n return !strncmp($this->town->short_postcode, $value, 2);\n }", "abstract protected function compare($value): bool;", "public function passes($attribute, $value): bool\n {\n $pattern = preg_quote($this->pattern, '#');\n\n return ! preg_match(\"#[{$pattern}]#\", $value);\n }", "static function identicalTo($value)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::identicalTo', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function passes($attribute, $value)\n {\n $role = DictionaryTerm::findOrFail($value);\n\n if (Dictionary::isRole($role)) {\n return true;\n }\n return false;\n }", "abstract protected function getCaseValue($value);", "public function it_comparison_match_test()\n {\n\n // describe method App\\Movie::getRatingLike() should return 5 or \"5\", if not it will be failed\n $this->getRatingLike()->shouldBeLike(5);\n }", "public function passes($attribute, $value)\n {\n return Hash::check($value, $this->input);\n }", "private function randCompare($value)\n {\n return ($this->Compare($value, '1') <= 0 || $this->Compare($value, $this->n) >= 0);\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\pL\\.\\-\\_\\d+]+$/u', $value);\n }", "private function checkMatch($value, $message, $match)\n {\n if($value !== $match)\n {\n $this->errors [] = $message;\n return false;\n } else {\n return true;\n }\n }", "public function passes($attribute, $value)\n {\n $reCaptcha = $value;\n\n if (trim($reCaptcha)) {\n $secret = \"6LdLMzgUAAAAAEs_42BvtJiTWpGOYw0L1UmhsJDa\";\n $llamado_get = \"https://www.google.com/recaptcha/api/siteverify?secret=$secret&response=$reCaptcha\";\n $response = file_get_contents($llamado_get);\n $responseKeys = json_decode($response, true);\n if(intval($responseKeys[\"success\"]) !== 1) {\n return false;\n }\n return true;\n } \n return true;\n }", "public function passes($attribute, $value)\n {\n return preg_match('/(?=^.{4,253}$)(^(?!-)([a-zA-Z0-9\\-]{0,62}[a-zA-Z0-9]\\.)*[a-zA-Z]{1,63}$)/',\n $value) ||\n !preg_match('/(?=^.{3,63}$)(^(?!-)([a-zA-Z0-9\\-]{1,62}[a-zA-Z0-9]{1,62}$))/',\n $value);\n }", "public function passes($attribute, $value)\n {\n $permitidos = \"áéíóúabcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOP QRSTUVWXYZ \";\n //$permitidos = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \";\n\n for ($i = 0; $i < strlen($value); $i++) {\n if (strpos($permitidos, substr($value, $i, 1)) === false) {\n //no es válido;\n return false;\n }\n }\n\n //si estoy aqui es que todos los caracteres son validos\n return true;\n }", "public static function validate($value);", "function my_acf_validate_value( $valid, $value, $field, $input ){\n\tif( !$valid ) {\n\t\treturn $valid;\n\t}\n $value_1 = $_POST['acf']['field_5a79e721d5c28'];\n $value_2 = $_POST['acf']['field_5a79e72cd5c29'];\n\tif ($value_1 != $value_2 ) {\n $valid = 'As senhas não são iguais';\n }\n\t// return\n\treturn $valid;\n\n}", "public static function alphabetic($value) {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = false;\n\t\t\t$pattern = \"/^[a-zA-Z]+$/\";\n\t\t\t\n\t\t\tif(!preg_match($pattern, $value)) {\n\t\t\t\t$result = false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "public function match($value, string $field, bool $strict = false): bool\n {\n if ($strict) {\n return $value === $this->getValidator()->getValue($field, null);\n }\n\n return $value == $this->getValidator()->getValue($field, null);\n }", "public function __invoke($value) {\n return $this->isValid($value);\n }", "public function passes($attribute, $value)\n {\n return $this->service->verify(\n $this->uuid,\n $this->ipaddr,\n $value,\n config('roda.google.recaptcha.cache', 300),\n );\n }", "public function compare_to_rule($value, $rule)\n {\n }", "public function passes($attribute, $value)\n {\n if (preg_match(\"/^.*[-].*$/\", $value) == true) {\n $this->error_message = \"Please do not use dash(-) sign\";\n return false;\n } else if (preg_match(\"/^[+,0].*$/\", $value) != true) {\n $this->error_message = \"Please start with either 0 or +\";\n return false;\n } else if (preg_match(\"/^[0,+]?[1-9][0-9]{9,14}$/\", $value) != true) {\n $this->error_message = \"Please insert only numbers ranging from 10 to 15 digits\";\n return false;\n }\n return true;\n }", "public function passes($attribute, $value)\n {\n try {\n return Factory::makeFromNumber($this->card_number)->isValidCvc($value);\n } catch (\\Exception $ex) {\n return false;\n }\n }", "function match_results($keyword, $value){\n\t\t// matching the keyword with the result\n\t\tif(strncmp($keyword,strtolower(trim($value)),strlen($keyword)) == 0){\n\t\t\tif(trim($value)){\n\t\t\t\treturn trim(\"$value\\n\");\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "abstract protected function isValidValue($value);", "public function checkMatchesXmlStrict($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, false, false);\n }", "function is_equal_of(mixed $value, mixed ...$values): bool\n{\n $search_value = $value;\n foreach ($values as $value) {\n if ($search_value === $value) {\n return true;\n }\n }\n return false;\n}", "abstract protected function validateValue($value);", "abstract public function validate($value, Result $result);", "public function passes($attribute, $value)\n {\n try {\n return !resolve(Spam::class)->detect($value);\n } catch (Exception $e) {\n return false;\n }\n }", "public function isValidRuleCriteria($value){\n if(strcmp($value,\"Weight\")\n || strcmp($value,\"Price\")\n ) {\n return true;\n }\n return false;\n }", "public function match_results($keyword, $value){\n\t\t// matching the keyword with the result\n\t\tif(strncmp($keyword,strtolower(trim($value)),strlen($keyword)) == 0){\n\t\t\tif(trim($value)){\n\t\t\t\treturn trim(\"$value\\n\");\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "public function passes($attribute, $value)\n {\n// $len = strlen($value);\n $a = false;\n $value = strtolower($value);\n\n if(Str::endsWith($value, 'street')){\n $a = true;\n }\n if($a){\n return true;\n }\n return false;\n }", "protected function isValid($value) {\n if (!is_string($value)) {\n $this->addError('The given value was not a valid string.', 1450180930);\n return;\n }\n\n $recaptcha = new \\ReCaptcha\\ReCaptcha($this->options['secretKey']);\n $resp = $recaptcha->verify($value, $_SERVER['REMOTE_ADDR']);\n\n if ($resp->isSuccess() === false) {\n $this->addError('The captcha was not answered correctly. Please try again.', 1450180934);\n }\n }", "public function passes($attribute, $value): bool\n {\n try {\n $this->validateInput($value);\n } catch (\\Throwable $e) {\n // Apparently there are no simple ways to return different messages\n // based on user input in Laravel. Currently, the validator simply returns false\n // if data is not in valid format.\n return false;\n }\n $values = Arr::pluck($value, $this->key);\n\n return count($values) === count(array_unique($values));\n }", "public function test($value): bool\n {\n if (strpos($this->modifiers, 'g') !== false) {\n $this->modifiers = str_replace('g', '', $this->modifiers);\n $matches = array();//because it's not optional in <5.4\n return preg_match_all($this->getRegex(), $value, $matches);\n }\n\n return (bool)preg_match($this->getRegex(), $value);\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_NYSE,self::VALUE_NASDAQCM,self::VALUE_NASDAQGM,self::VALUE_NASDAQGS,self::VALUE_AMEX,self::VALUE_PINKSHEETS,self::VALUE_OTCBB,self::VALUE_INDUSTRYGROUPS,self::VALUE_INDICES,self::VALUE_AMSTERDAM,self::VALUE_ASX,self::VALUE_BERLIN,self::VALUE_BREMEN,self::VALUE_BRUSSELS,self::VALUE_COPENHAGEN,self::VALUE_DUSSELDORF,self::VALUE_FRANKFURT,self::VALUE_HAMBURG,self::VALUE_HANOVER,self::VALUE_HELSINKI,self::VALUE_HONGKONG,self::VALUE_ICELAND,self::VALUE_INDIA,self::VALUE_LISBON,self::VALUE_LSE,self::VALUE_MUMBAI,self::VALUE_MUNICH,self::VALUE_OSLO,self::VALUE_PARIS,self::VALUE_PRAGUE,self::VALUE_RIGA,self::VALUE_RTSRUB,self::VALUE_RTSUSD,self::VALUE_SINGAPORE,self::VALUE_STOCKHOLM,self::VALUE_STUTTGART,self::VALUE_TALLINN,self::VALUE_TOKYO,self::VALUE_TSX,self::VALUE_TSXV,self::VALUE_VILNIUS,self::VALUE_XETRA));\n\t}", "public function equals($value);", "public function passes($attribute, $value)\n {\n $baseRaw = $this->model::where($attribute, 'like', withoutSpace($value) ?? '')->first();\n\n $rawsForCheck = [];\n foreach ($this->fields as $attributel => $value) {\n $raw = $this->model::where($attributel, 'like', withoutSpace($value) ?? '')->first();\n\n if (is_null($raw)) {\n $nullCheck = true;\n break;\n } else {\n $rawsForCheck[$raw->id] = $raw;\n }\n } \n\n if (isset($baseRaw) && isset($nullCheck)) {\n return false;\n }\n\n if (isset($baseRaw) && count($rawsForCheck) != 1) {\n return false;\n }\n\n if (isset($baseRaw) && count($rawsForCheck) == 1 && $baseRaw->id !== head($rawsForCheck)->id) {\n return false;\n }\n\n return true;\n }", "public static function match($valueA, $valueB) {\n\t\ttry {\n\t\t\t// Check Values\n\t\t\t$result = $valueA === $valueB;\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "public function passes($attribute, $value)\n {\n return preg_match('/^([a-z_\\d])+$/', $value) > 0;\n }", "public function passes($attribute, $value): bool\n {\n if (!$value) {\n $this->errorMessage = 'ИНН пуст';\n return false;\n }\n\n if (preg_match('/[^0-9]/', $value)) {\n $this->errorMessage = 'ИНН может состоять только из цифр';\n return false;\n }\n\n if (strlen($value) !== 12) {\n $this->errorMessage = 'ИНН может состоять только из 12 цифр';\n return false;\n }\n\n $check_digit = function ($inn, $coefficients) {\n $n = 0;\n foreach ($coefficients as $i => $k) {\n $n += $k * (int)$inn[$i];\n }\n return $n % 11 % 10;\n };\n $n11 = $check_digit($value, [7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n $n12 = $check_digit($value, [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n if (($n11 === (int)$value[10]) && ($n12 === (int)$value[11])) {\n return true;\n }\n\n $this->errorMessage = 'Введите существующий ИНН';\n return false;\n }", "public function validate($value);", "public function validate($value);", "function match( $cad, $cad2 ) \n{\n\treturn strcasecmp( $cad, $cad2 ) == 0; // Son iguales\n}", "function match($field, $value);", "function matchField($value, $params = array()) {\n\t\tif ($this->data[$this->name][$params['field1']] != $this->data[$this->name][$params['field2']]) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected function checksumMatches($value): bool\n {\n return $this->calculateChecksum($value) === $this->cutChecksum($value);\n }", "public function passes($attribute, $value): bool\n {\n $value = preg_replace('/\\s+/', '', trim($value));\n\n if (!is_string($value)) {\n return false;\n }\n // 19 14 89 62 43 4\n $result = preg_match('/^(\\d{2})(\\d{2})(\\d{2})\\d{5}$/i', $value, $output);\n\n if($result !== 1){\n return false;\n }\n\n $anno = date('Y') % 100;\n $subde = $output[1];\n $annoAlta = $output[2];\n $annoNac = $output[3];\n\n if ($subde != 97) {\n if ($annoAlta <= $anno) $annoAlta += 100;\n if ($annoNac <= $anno) $annoNac += 100;\n if ($annoNac > $annoAlta)\n return false;\n }\n\n return $this->luhn($value);\n }", "protected function isValid($value)\n {\n if ($value !== $this->options['expectedValue']) {\n $this->addError('The given value is expected to be %1$s.', 1361044943, [$this->options['expectedValue'] ? 'true' : 'false']);\n }\n }", "public function passes($attribute, $value)\n {\n switch ($this->request->get('nationality')) {\n default :\n return $this->iranNationalValidation($value);\n }\n }", "public function passes($attribute, $value)\n {\n return $this->hasher->check($value, $this->auth->guard()->user()->password);\n }", "public function passes($attribute, $value)\n {\n // if ($this->id != NULL) {\n // @$phoneUser = User::where('phone', $this->phone)->first();\n // @$phoneCustomer = Customer::where('phone', $this->phone)->first();\n\n // if ($phoneUser or $phoneCustomer) {\n // @$dbuser = @$phoneUser->id;\n // @$dbcust = @$phoneCustomer->id;\n \n // if (($this->id != @$dbuser) or ($this->id != @$dbcust)) {\n\n // return $this->fail(\"Phone number already exist.\".@$dbuser.','.@$dbcust);\n // }\n \n // }\n \n \n // }\n\n\n if (strlen($this->phone) < 10) {\n\n return $this->fail(\"Phone number must be exactly 10 digits.\");\n\n }\n\n if( preg_match(\"#\\W+#\", $this->phone) ) {\n\n return $this->fail(\"Phone number must not include a symbol!\");\n\n }\n\n if( preg_match(\"#[a-z]+#\", $this->phone) ) {\n\n return $this->fail(\"Phone number must not include a letter!\");\n\n }\n\n if( preg_match(\"#[A-Z]+#\", $this->phone) ) {\n\n return $this->fail(\"Phone number must not include a letter!\");\n\n }\n\n return true;\n }", "static function equalTo($value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::equalTo', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function check($value)\n {\n $checkResult = ['passed' => true, 'message' => \"has value '$value'\"];\n if ($this->nullable && $value === null) {\n $checkResult['passed'] = true;\n $checkResult['message'] = \"has value '$value'\";\n } elseif (!$this->nullable && $value === null) {\n $checkResult['passed'] = false;\n $checkResult['message'] = 'value is null';\n } elseif (!is_string($value) ) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"value '$value' is not string\";\n } elseif ($this->min && strlen($value) < $this->min) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"string length of '$value' is less then minimum length $this->min\";\n } elseif ($this->max && strlen($value) > $this->max) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"string length of '$value' is greater then maximum length $this->max\";\n } elseif ($this->regex && preg_match($this->regex, $value) !== 1) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"string '$value' does not matches to pattern '$this->regex'\";\n } elseif (count($this->enum) > 0 && !in_array($value, $this->enum)) {\n $checkResult['passed'] = false;\n $enumAsString = implode(',', $this->enum);\n $checkResult['message'] = \"string '$value' is not in set of possible values '$enumAsString'\";\n }\n return $checkResult;\n }", "public function matchesCriterium($criterium, $value)\n {\n return false;\n }", "public function passes($attribute, $value)\n {\n $correct = [];\n foreach($this->answers as $answer) {\n if ($answer['correct']) {\n array_push($correct, true);\n }\n }\n return count($correct) === 1;\n }", "abstract public function validate(\n $value\n ): bool;", "public function passes($attribute, $value)\n {\n return is_numeric($value) && $this->hasAllowedLength($value) && $this->checksumMatches($value);\n }", "function test($value) {\n\t\t// php doesn't have g modifier so we remove it if it's there and call preg_match_all()\n\t\tif(strpos($this->modifiers, 'g') !== false){\n\t\t\t$this->modifiers = str_replace('g', '', $this->modifiers);\n\t\t\treturn preg_match_all($this->getRegex(), $value);\n\t\t}\n\t\treturn preg_match($this->getRegex(), $value);\n\t}", "public function passes($attribute, $value)\n {\n $saldo = Cuenta::where('num_cuenta', $this->cuenta)->first()->saldo;\n $saldo_despues = $saldo - $value;\n return $saldo_despues > $this->monto_permitido;\n }", "protected abstract function doValidate($value);", "protected abstract function doValidate($value);", "public abstract function isValid(string $value): bool;", "public function passes($attribute, $value)\n {\n $noSpaces = ($value == trim($value) && strpos($value, ' ') !== false) ? false : true;\n\n $specialCharacters = '!\"#$%&\\'()*+,-./:;<=>?@[\\]^_`{|}~';\n\n $specialCharactersExclude = '!\"#$%&\\'()*+,-/:;<=>?@[\\]^`{|}~'; // Exclude underscore and period\n\n $startWithSpecialChars = in_array($value[0], str_split($specialCharacters));\n\n $endsWithSpecialChars = in_array($value[strlen($value) - 1], str_split($specialCharacters));\n\n $containsSpecialCharsExclude = Util::containsChar($specialCharactersExclude, $value);\n\n $moreThanOnePeriod = substr_count($value, '.') > 1 ? true : false;\n\n \n return (\n $noSpaces\n && !$startWithSpecialChars\n && !$endsWithSpecialChars\n && !$moreThanOnePeriod\n && !$containsSpecialCharsExclude\n ) ? true: false;\n }", "public function testShortValuableWord() : void\n {\n $word = 'zoo';\n $this->assertEquals(12, score($word));\n }", "public function containsSame(mixed $value): bool\n {\n return $this->isOk() && $this->value === $value;\n }", "public function val_match($var, $match, $case = 'i') {\n if ($case === 'i') {\n return (strtolower($var) === strtolower($match));\n } else {\n return ($var === $match);\n }\n unset($var, $match, $case);\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\u4E00-\\u9FA5A-Za-z0-9_-]+$/', $value);\n }", "public function testValuableSingleLetter() : void\n {\n $word = 'f';\n $this->assertEquals(4, score($word));\n }" ]
[ "0.6374303", "0.62320256", "0.61660063", "0.60021144", "0.59271306", "0.580791", "0.58049315", "0.5775805", "0.57540625", "0.566132", "0.55873066", "0.554872", "0.55210227", "0.5518404", "0.54376715", "0.54322594", "0.5400514", "0.5393178", "0.53875685", "0.53799576", "0.5373008", "0.53479254", "0.5344897", "0.5326638", "0.5320733", "0.53088707", "0.528784", "0.52600294", "0.5258977", "0.52499187", "0.5249859", "0.5235737", "0.52281654", "0.5228138", "0.519813", "0.5196968", "0.51840174", "0.5180132", "0.5171707", "0.51592267", "0.51549363", "0.51350844", "0.5125004", "0.51241916", "0.5115966", "0.5111873", "0.51114666", "0.51071143", "0.5096041", "0.5090502", "0.5086754", "0.50852406", "0.50840193", "0.5081233", "0.50805473", "0.5077511", "0.50731295", "0.50718385", "0.5071067", "0.5069527", "0.5058644", "0.50574243", "0.5049882", "0.50484234", "0.504315", "0.5041975", "0.5036046", "0.5034886", "0.5033745", "0.5028975", "0.5020241", "0.5019233", "0.50037587", "0.50037587", "0.49967673", "0.49958554", "0.4993573", "0.4978779", "0.49763697", "0.49743688", "0.4972331", "0.4969108", "0.49685", "0.49594685", "0.49567673", "0.4951241", "0.4951154", "0.4949352", "0.49478918", "0.49450943", "0.49430263", "0.49376944", "0.49376944", "0.4935718", "0.49329695", "0.49310306", "0.4926655", "0.49156404", "0.49118787", "0.49044082" ]
0.65371287
0
Check that $value matches $against, enforcing whitespace and case similarities as well.
public function checkMatchesXmlStrict($value, $against) { return $this->checkMatchesXmlAdvanced($value, $against, false, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function passes($attribute, $value)\n {\n $bannedWords = preg_split('/\\n|\\r/', config('settings.short_bad_words'), -1, PREG_SPLIT_NO_EMPTY);\n\n foreach($bannedWords as $word) {\n // Search for the word in string\n if(strpos(mb_strtolower($value), mb_strtolower($word)) !== false) {\n return false;\n }\n }\n\n return true;\n }", "public function checkMatchesXmlWithCase($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, true, false);\n }", "public function passes($attribute, $value)\n {\n // return strtoupper($value) === $value;\n return preg_match(\"/^[ ,<.>\\/?'\\\"\\;:=+-_)(*&%$@!AÁÀẢÃẠÂẤẦẨẪẬĂẮẰẲẴẶEÉÈẺẼẸÊẾỀỂỄỆIÍÌỈĨỊOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢUÚÙỦŨỤƯỨỪỬỮỰYÝỲỶỸỴĐaáàảãạâấầẩẫậăắằẳẵặeéèẻẽẹêếềểễệiíìỉĩịoóòỏõọôốồổỗộơớờởỡợuúùủũụưứừửữựyýỳỷỹỵđ0-9a-zA-Z\\s]+$/\", $value);\n }", "function matchStrings($userValue, $label)\n{\n// debug(\"matchStrings $label\", $userValue);\n\n if(!strcasecmp($userValue, $label)) return true;\n \n $firstWord = substringBefore($label, \" \");\n return startsWith($userValue, $firstWord);\n}", "public function checkIdenticalTo($value, $against)\n {\n return new AssertionResult($value === $against, '{name} must be identical to {0}', [$against]);\n }", "function exact_value ( $str, $val )\n\t{\n\t\tif ( strcmp( strval( $str ), strval( $val ) ) !== 0 ) return FALSE;\n\t\treturn TRUE;\n\t}", "public function checkMatchesXmlWithWhiteSpace($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, false, true);\n }", "public function passes($attribute, $value)\n {\n $contrasenyaSegura = false;\n if(strlen($value)>=8){\n $numeros = intval(preg_replace('/[^0-9]+/', '', $value), 10);\n if(strlen($numeros)>0){\n for($i = 0; $i<strlen($value) ; $i++){\n if(ctype_upper($value[$i])){\n $contrasenyaSegura = true;\n break;\n }\n }\n }\n\n }\n return $contrasenyaSegura;\n }", "public function match($value);", "public function passes($attribute, $value): bool\n {\n return preg_match(self::VALIDATION_REGEX, mb_strtolower($value));\n }", "public function passes($attribute, $value)\n {\n // TODO: Implement passes() method.\n if (strtoupper($value) === $value) {\n return true;\n }\n\n return false;\n }", "public function passes($attribute, $value)\n {\n $permitidos = \"áéíóúabcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOP QRSTUVWXYZ \";\n //$permitidos = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \";\n\n for ($i = 0; $i < strlen($value); $i++) {\n if (strpos($permitidos, substr($value, $i, 1)) === false) {\n //no es válido;\n return false;\n }\n }\n\n //si estoy aqui es que todos los caracteres son validos\n return true;\n }", "public function passes($attribute, $value) {\n return preg_match(\"/^((?=.*?[A-Z])(?=.*?[a-z])(?=.*?\\d)|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[^a-zA-Z0-9])|(?=.*?[A-Z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])|(?=.*?[a-z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])).{8,}$/\", $value);\n }", "function hobbyFormat ($value, $regex){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match($regex,$value)){\n return false;\n }\n \n return true;\n}", "function match_results($keyword, $value){\n\t\t// matching the keyword with the result\n\t\tif(strncmp($keyword,strtolower(trim($value)),strlen($keyword)) == 0){\n\t\t\tif(trim($value)){\n\t\t\t\treturn trim(\"$value\\n\");\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\u4E00-\\u9FA5A-Za-z0-9_-]+$/', $value);\n }", "public function passes($attribute, $value)\n {\n $noSpaces = ($value == trim($value) && strpos($value, ' ') !== false) ? false : true;\n\n $specialCharacters = '!\"#$%&\\'()*+,-./:;<=>?@[\\]^_`{|}~';\n\n $specialCharactersExclude = '!\"#$%&\\'()*+,-/:;<=>?@[\\]^`{|}~'; // Exclude underscore and period\n\n $startWithSpecialChars = in_array($value[0], str_split($specialCharacters));\n\n $endsWithSpecialChars = in_array($value[strlen($value) - 1], str_split($specialCharacters));\n\n $containsSpecialCharsExclude = Util::containsChar($specialCharactersExclude, $value);\n\n $moreThanOnePeriod = substr_count($value, '.') > 1 ? true : false;\n\n \n return (\n $noSpaces\n && !$startWithSpecialChars\n && !$endsWithSpecialChars\n && !$moreThanOnePeriod\n && !$containsSpecialCharsExclude\n ) ? true: false;\n }", "public function passes($attribute, $value)\n {\n return !strncmp($this->town->short_postcode, $value, 2);\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\pL\\.\\-\\_\\d+]+$/u', $value);\n }", "public function testExactMatch()\n {\n $word = $this->randomString(10);\n\n $percent1 = 0;\n $percent2 = 0;\n $percent3 = 0;\n\n //Verify that we produce the same result for an exact match\n //as the core levenshtein function\n $this->assertEquals(\n similar_text($word, $word, $percent1),\n mb_similar_text($word, $word, $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n\n //Verify that we produce an exact match result for strings\n //with multibyte characters.\n $this->assertEquals(5, mb_similar_text('nôtre', 'nôtre', $percent3));\n $this->assertEquals(100.0, $percent3);\n }", "public function passes($attribute, $value) {\n\n //post arrays - check each item\n if (is_array($value)) {\n foreach ($value as $key => $val) {\n if ($val == strip_tags($val)) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n //run strip tags and then compare the strings\n if ($value == strip_tags($value)) {\n return true;\n }\n return false;\n }", "public function passes($attribute, $value): bool\n {\n return preg_match('/\\s/', $value) === 0;\n }", "public abstract function matches($value);", "public static function like($valueA, $valueB) {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = false;\n\t\t\t\n\t\t\t// Check Values\n\t\t\tif(strcmp(strtolower($valueA), strtolower($valueB)) == 0) {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "public function equalsIgnoreCase($value)\n {\n $input_value = strtolower($this->getValue());\n $value = strtolower($value);\n\n return $input_value == $value;\n }", "public function validateUsernameEqual($value, array $context)\n {\n Stopwatch::start('validateUsernameEqual');\n $users = $this->userlist();\n $lc = mb_strtolower($value);\n foreach ($users as $name) {\n if ($name === $value) {\n continue;\n }\n $name = mb_strtolower($name);\n $distance = levenshtein($lc, $name);\n if ($distance < 2) {\n return __('error.name.equalExists', $name);\n }\n }\n Stopwatch::stop('validateUsernameEqual');\n\n return true;\n }", "public function passes($attribute, $value)\n {\n $flag = 0;\n if (isEmpty($value)) {\n $flag = 1;\n } else {\n $flag = preg_match(\"(^98|97\\d{8}$)\", $value);\n }\n return $flag;\n }", "public function match(mixed $value);", "public function passes($attribute, $value)\n {\n return preg_match('/^.*(?=^.{10}$)(?=.*\\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&+=]).*$/', $value);\n }", "public function testMediumValuableWord() : void\n {\n $word = 'quirky';\n $this->assertEquals(22, score($word));\n }", "public function passes($attribute, $value)\n {\n // si no viene un valor pasamos la validacion\n\n if(!$value){\n return true;\n }\n\n //que haya una mayuscula\n $upperCase=preg_match('@[A-Z]@',$value);\n //queremos una minuscula\n $lowerCase=preg_match('@[a-z]@',$value);\n //queremos que exista un numero\n $number=preg_match('@[0-9]@',$value);\n //minimo de 8 caracteres\n $length=strlen($value)>=8;\n $success=true;\n if(!$upperCase|| !$lowerCase || !$number || !$length){\n $success=false;\n }\n return $success;\n }", "public function match_results($keyword, $value){\n\t\t// matching the keyword with the result\n\t\tif(strncmp($keyword,strtolower(trim($value)),strlen($keyword)) == 0){\n\t\t\tif(trim($value)){\n\t\t\t\treturn trim(\"$value\\n\");\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "public function passes($attribute, $value)\n {\n// $len = strlen($value);\n $a = false;\n $value = strtolower($value);\n\n if(Str::endsWith($value, 'street')){\n $a = true;\n }\n if($a){\n return true;\n }\n return false;\n }", "public function passes($attribute, $value)\n {\n return preg_match('/(?=^.{4,253}$)(^(?!-)([a-zA-Z0-9\\-]{0,62}[a-zA-Z0-9]\\.)*[a-zA-Z]{1,63}$)/',\n $value) ||\n !preg_match('/(?=^.{3,63}$)(^(?!-)([a-zA-Z0-9\\-]{1,62}[a-zA-Z0-9]{1,62}$))/',\n $value);\n }", "public function passes($attribute, $value)\n {\n if (preg_match(\"/^.*[-].*$/\", $value) == true) {\n $this->error_message = \"Please do not use dash(-) sign\";\n return false;\n } else if (preg_match(\"/^[+,0].*$/\", $value) != true) {\n $this->error_message = \"Please start with either 0 or +\";\n return false;\n } else if (preg_match(\"/^[0,+]?[1-9][0-9]{9,14}$/\", $value) != true) {\n $this->error_message = \"Please insert only numbers ranging from 10 to 15 digits\";\n return false;\n }\n return true;\n }", "public function passes($attribute, $value)\n {\n $validationFlag = false;\n if (!empty($value)) {\n $non_digits = [' ', '(', ')', '-', '.', '+'];\n $nums = str_replace($non_digits, '', $value);\n if (strlen($nums) == 10) {\n $validationFlag = true;\n }\n }\n return $validationFlag;\n }", "public static function handle(string &$value): bool\n {\n if (preg_match('/^([a-z0-9A-Z_\\/\\-\\.\\@]+)$/', $value)) {\n return true;\n }\n\n return false;\n }", "public function passes($attribute, $value): bool\n {\n $pattern = preg_quote($this->pattern, '#');\n\n return ! preg_match(\"#[{$pattern}]#\", $value);\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^([a-z_\\d])+$/', $value) > 0;\n }", "public static function alphabetic($value) {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = false;\n\t\t\t$pattern = \"/^[a-zA-Z]+$/\";\n\t\t\t\n\t\t\tif(!preg_match($pattern, $value)) {\n\t\t\t\t$result = false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "function placeFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_PLACE_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "function match( $cad, $cad2 ) \n{\n\treturn strcasecmp( $cad, $cad2 ) == 0; // Son iguales\n}", "public function passes($attribute, $value)\n {\n return $value === 'tva' || $value === 'is';\n }", "public static function isCorrect($value)\r\n {\r\n return (strcasecmp($value, BuildingQuality::AVERAGE) == 0 || strcasecmp($value, BuildingQuality::ECONOMY) == 0 ||\r\n strcasecmp($value, BuildingQuality::CUSTOM) == 0 || strcasecmp($value, BuildingQuality::LUXURY) == 0);\r\n }", "function studly_case($value)\n {\n return Str::studly($value);\n }", "function comparecsn($one, $two)\n{\n $one = preg_replace('/\\s*/m', '', strtolower($one));\n $two = preg_replace('/\\s*/m', '', strtolower($two));\n if ($one == $two) {\n return true;\n } else {\n return false;\n }\n}", "public function testShortValuableWord() : void\n {\n $word = 'zoo';\n $this->assertEquals(12, score($word));\n }", "public abstract function isValid(string $value): bool;", "function isSantizeString($var) {\n //Returns error message if it does\n\n //Sanitize the string, then see if there are any changes\n if (SanitizeString($var) == $var) {\n return \"\";\n } else {\n return \"Invalid Characters\";\n }\n}", "function filter_pattern($value)\n {\n global $pattern;\n return !strncmp($pattern, $value, strlen($pattern));\n }", "public function testValuableSingleLetter() : void\n {\n $word = 'f';\n $this->assertEquals(4, score($word));\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^#(?:(?:[a-f\\d]{3}){1,2})$/i', $value);\n }", "function studly_case($value)\n\t{\n\t\treturn Illuminate\\Support\\Str::studly($value);\n\t}", "public function passes($attribute, $value)\n {\n if (strlen(preg_replace('/[^0-9]/', '', $value)) !== $this->digitsWithoutDash) {\n $this->message = \"The :attribute must include {$this->digitsWithoutDash} digits.\";\n return false;\n }\n if (!preg_match($this->regex, $value)) {\n return false;\n }\n return true;\n }", "function textFormat ($value){\n \n if(!preg_match(VALID_TEXT_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "public function like($value)\n {\n $term = '/.*' . $value . '.*/i';\n return $this->regex($term);\n }", "public static function validate($value);", "public function test_example()\n {\n $this->assertTrue( (new PassPhrase('abcde fghij'))->validate());\n $this->assertTrue( (new PassPhrase('a ab abc abd abf abj'))->validate());\n $this->assertTrue( (new PassPhrase('iiii oiii ooii oooi oooo'))->validate());\n $this->assertFalse( (new PassPhrase('abcde xyz ecdab'))->validate());\n $this->assertFalse( (new PassPhrase('oiii ioii iioi iiio'))->validate());\n }", "public function check($value)\n {\n $checkResult = ['passed' => true, 'message' => \"has value '$value'\"];\n if ($this->nullable && $value === null) {\n $checkResult['passed'] = true;\n $checkResult['message'] = \"has value '$value'\";\n } elseif (!$this->nullable && $value === null) {\n $checkResult['passed'] = false;\n $checkResult['message'] = 'value is null';\n } elseif (!is_string($value) ) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"value '$value' is not string\";\n } elseif ($this->min && strlen($value) < $this->min) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"string length of '$value' is less then minimum length $this->min\";\n } elseif ($this->max && strlen($value) > $this->max) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"string length of '$value' is greater then maximum length $this->max\";\n } elseif ($this->regex && preg_match($this->regex, $value) !== 1) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"string '$value' does not matches to pattern '$this->regex'\";\n } elseif (count($this->enum) > 0 && !in_array($value, $this->enum)) {\n $checkResult['passed'] = false;\n $enumAsString = implode(',', $this->enum);\n $checkResult['message'] = \"string '$value' is not in set of possible values '$enumAsString'\";\n }\n return $checkResult;\n }", "public function check(string $value): string\n {\n $this->validateStructure($value);\n return $value;\n }", "public function my_custom_validation( string $value ): bool {\n\t\treturn strlen( $value ) <= 1;\n\t}", "public function passes($attribute, $value): bool\n {\n $value = preg_replace('/\\s+/', '', trim($value));\n\n if (!is_string($value)) {\n return false;\n }\n // 19 14 89 62 43 4\n $result = preg_match('/^(\\d{2})(\\d{2})(\\d{2})\\d{5}$/i', $value, $output);\n\n if($result !== 1){\n return false;\n }\n\n $anno = date('Y') % 100;\n $subde = $output[1];\n $annoAlta = $output[2];\n $annoNac = $output[3];\n\n if ($subde != 97) {\n if ($annoAlta <= $anno) $annoAlta += 100;\n if ($annoNac <= $anno) $annoNac += 100;\n if ($annoNac > $annoAlta)\n return false;\n }\n\n return $this->luhn($value);\n }", "final public static function is($value):bool\n {\n return Validate::regex('alphanumericSlug',$value);\n }", "public function seotidy($passedvalue) {\n\t return strtolower(str_replace(\"'\",\"\",(str_replace('\\\\','-',str_replace('/','-',str_replace('&','and',str_replace(' ','-',($passedvalue))))))));\n\t}", "public function isValid($value)\n {\n if ($value !== filter_var($value, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES)) {\n $this->addError(\n $this->translateErrorMessage(\n 'validator.text.notvalid',\n 'extbase'\n ),\n 1221565786\n );\n }\n }", "public function passes($attribute, $value)\n {\n if (! is_string($value) && ! is_numeric($value)) {\n return false;\n }\n\n return preg_match('/^[\\pL\\pN\\pM\\pZ\\'_-]+.?$/u', $value) > 0;\n }", "abstract protected function validateValue($value);", "public function validate($field, $value)\n {\n return preg_match('/^(?=.*[!@#$%^&*-])(?=.*[0-9])(?=.*[A-Z]).{8,20}$/', $value) == 1;\n }", "protected function _normalize($value)\n {\n return strtolower($value);\n }", "public function passes($attribute, $value): bool\n {\n if (!$value) {\n $this->errorMessage = 'ИНН пуст';\n return false;\n }\n\n if (preg_match('/[^0-9]/', $value)) {\n $this->errorMessage = 'ИНН может состоять только из цифр';\n return false;\n }\n\n if (strlen($value) !== 12) {\n $this->errorMessage = 'ИНН может состоять только из 12 цифр';\n return false;\n }\n\n $check_digit = function ($inn, $coefficients) {\n $n = 0;\n foreach ($coefficients as $i => $k) {\n $n += $k * (int)$inn[$i];\n }\n return $n % 11 % 10;\n };\n $n11 = $check_digit($value, [7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n $n12 = $check_digit($value, [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n if (($n11 === (int)$value[10]) && ($n12 === (int)$value[11])) {\n return true;\n }\n\n $this->errorMessage = 'Введите существующий ИНН';\n return false;\n }", "public function passes($attribute, $value)\n {\n // 除了11、12 打头的手机号,其余都放行\n return preg_match('/^(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])\\d{8}$/', $value);\n }", "public function passes($attribute, $value)\n {\n //check that the password contains at least 86characters, one uppercase and lowercase letter and a number\n if (preg_match(\"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{6,}$/m\", $value)) {\n return true;\n } else {\n return false;\n }\n }", "private function checkString($value)\n {\n if (!preg_match(\"/^[a-zA-Z ]*$/\", $value))\n {\n echo \"ERRORE nella Stringa : \" . $value;\n throw new InvalidArgumentException();\n }\n return true;\n }", "public function isValid($value) {\n return parent::isValid($value) || preg_match($this->_pattren, $value);\n }", "function validate($val)\n{\n\t$val=htmlentities($val);\n\t$val=trim($val);\n\treturn $val;\n}", "private static function _casenormalize(&$val)\n {\n $val = strtolower($val);\n }", "function isSpecialValue($value)\n {\n return strlen($value)>3 && $value[0]=='!' && $value[1]=='!' && $value[2]=='!';\n }", "function matchesCriterium ($criterium, $value) {\r\n return false;\r\n }", "public function passes($attribute, $value): bool\n {\n $trimmed = trim(html_entity_decode(strip_tags($value)), \"\\t\\n\\r\\0\\x0B\\xC2\\xA0\");\n\n return ! empty($trimmed);\n }", "protected function validateAlphaNumSpaces( $attribute, $value ) {\n\n return (bool) preg_match( \"/^[A-Za-z0-9\\s]+$/\", $value );\n }", "function test($value) {\n\t\t// php doesn't have g modifier so we remove it if it's there and call preg_match_all()\n\t\tif(strpos($this->modifiers, 'g') !== false){\n\t\t\t$this->modifiers = str_replace('g', '', $this->modifiers);\n\t\t\treturn preg_match_all($this->getRegex(), $value);\n\t\t}\n\t\treturn preg_match($this->getRegex(), $value);\n\t}", "abstract protected function checkValue( &$value );", "public function studly_case($value)\n {\n return Str::studly($value);\n }", "private function process_alpha($value)\n {\n return ! preg_match('/[^a-zA-Z]/', $value);\n }", "public function sanitize($value);", "public function passes($attribute, $value)\n {\n $value = $this->removeCountryCode($value);\n\n if (!preg_match('/^[0-9]+$/', $value)) {\n $this->errorType = self::ERROR_TYPE_NUMERIC;\n return false;\n }\n\n $phoneLength = strlen($value);\n if ($phoneLength < 10 || $phoneLength > 11) {\n $this->errorType = self::ERROR_TYPE_LENGTH;\n return false;\n }\n\n if ($phoneLength === 10 && !preg_match('/^'.$this->prefixTenNumers.'/', $value)) {\n $this->errorType = self::ERROR_TYPE_FORMAT;\n return false;\n }\n\n if ($phoneLength === 11 && !preg_match('/^'.$this->prefixElevenNumbers.'/', $value)) {\n $this->errorType = self::ERROR_TYPE_FORMAT;\n return false;\n }\n\n return true;\n }", "public function passes($attribute, $value)\n {\n if (! preg_match('/^[0-9]{8,20}$/', $value)) {\n $this->message = __('userandpermission::validation.digits', ['attribute' => $attribute]);\n } elseif (strlen($value) > $this->max) {\n $this->message = __('userandpermission::validation.phone_max', ['attribute' => $attribute, 'max' => $this->max]);\n } elseif (strlen($value) < $this->min) {\n $this->message = __('userandpermission::validation.phone_min', ['attribute' => $attribute, 'min' => $this->min]);\n }\n\n return ($this->message == 'passes');\n }", "public function test($value): bool\n {\n if (strpos($this->modifiers, 'g') !== false) {\n $this->modifiers = str_replace('g', '', $this->modifiers);\n $matches = array();//because it's not optional in <5.4\n return preg_match_all($this->getRegex(), $value, $matches);\n }\n\n return (bool)preg_match($this->getRegex(), $value);\n }", "function spam_scrubber($value) {\n\t\t\n\t\t// list of very bad values\n\t\t$very_bad = array('to:', 'cc:', 'bcc:', 'content-type:', 'mime-version:', 'multipart-mixed:', 'content-transfer-encoding:');\n\t\t\n\t\t//if any of the very bad strings are in submitted value, return empty string\n\t\tforeach ($very_bad as $v) {\n\t\t\tif (stripos($value, $v) !== false) return '';\n\t\t}\n\t\t\n\t\t// replace any newline characters with spaces:\n\t\t$value = str_replace(array( \"\\r\", \"\\n\", \"%0a\", \"%0d\"), ' ', $value);\n\t\t\n\t\t//return the value\n\t\treturn trim($value);\n\t}", "public function passes($attribute, $value)\n {\n try {\n return !resolve(Spam::class)->detect($value);\n } catch (Exception $e) {\n return false;\n }\n }", "protected function isValid($value) {\n\t\tif (!is_string($value)) {\n\t\t\tthrow new \\TYPO3\\Flow\\Validation\\Exception\\InvalidSubjectException('The given value was not a string.', 1325155784);\n\t\t}\n\t\t$brewer = $this->brewerRepository->findOneByName($value);\n\n\t\tif ($brewer !== NULL) {\n\t\t\t$this->addError('The brewername is already in use.', 1325156008);\n\t\t}\n\t}", "public function checkMatchesXmlAdvanced($value, $against, $skipWhite, $ignoreCase)\n {\n if (defined('HHVM_VERSION')) {\n throw new BadMethodCallException('XML validation is not implemented in HHVM');\n }\n if (!class_exists(XmlInspector::class)) {\n throw new BadMethodCallException(\n 'XML validation needs the excemel library. Run `composer require moccalotto/exemel` to install'\n );\n }\n\n $message = '{name} must match the given XML document';\n $context = compact('against', 'skipWhite', 'ignoreCase');\n\n $valueXmlInspector = null;\n\n if (is_a($value, SimpleXMLElement::class)) {\n $valueXmlInspector = new XmlInspector($value);\n\n $success = $valueXmlInspector->sameAs($against, $skipWhite, $ignoreCase);\n\n return new Result($success, $message, $context);\n }\n\n if (!is_string($value)) {\n return new Result(false, $message, $context);\n }\n\n if (!$this->canParse($value)) {\n return new Result(false, $message, $context);\n }\n\n $valueXmlInspector = new XmlInspector(new SimpleXMLElement($value));\n\n $success = $valueXmlInspector->sameAs($against, $skipWhite, $ignoreCase);\n\n return new Result($success, $message, $context);\n }", "function validate_field_has_space_between($field_value, &$field)\n{\n $has_space = strpos($field_value, ' ');\n\n if ($has_space === false) {\n $field['error'] = 'Privalo buti tarpas';\n } elseif ($field_value != trim($field_value)) {\n $field['error'] = 'Neturi buti tarpo pradzioje ar pabaigoje';\n } else {\n return true;\n }\n}", "protected function isValid($value) {\n if (!is_string($value)) {\n $this->addError('The given value was not a valid string.', 1450180930);\n return;\n }\n\n $recaptcha = new \\ReCaptcha\\ReCaptcha($this->options['secretKey']);\n $resp = $recaptcha->verify($value, $_SERVER['REMOTE_ADDR']);\n\n if ($resp->isSuccess() === false) {\n $this->addError('The captcha was not answered correctly. Please try again.', 1450180934);\n }\n }", "public static function isValid($value) : bool {\n\t\t\treturn (is_string($value) && preg_match('/^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/', $value));\n\t\t}", "function inputCleaner($value){\n\t $toBeTested\t\t= strip_tags($value);\n\t // Instead of using HTMLStripSpecialChars, I am using some Regex\n\t\t// to have a greater degree of control over the input.\n\t\t//\tThis regex checks the entire string for anything that\n\t\t//\tcould ruin our consistency.\n\t $regExp = (\"/[\\!\\\"\\£\\$\\%\\^\\&\\*\\(\\)\\;\\'\\,\\\"\\?]/ \");\n\t if(preg_match_all($regExp, $toBeTested,$matches)){\n\t \treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn $toBeTested;\n\t\t}\n\t}", "function checkValue($colName, $value, $words) {\r\r\n\t\t$ret = true;\r\r\n\t\treset($words);\r\r\n\t\t$regexp = \"/\\b(?:\". implode('|', $words) .\")\\b/ims\";\r\r\n\t\tif (preg_match($regexp, $value, $m)) {\r\r\n\t\t\t$ret = false;\r\r\n\t\t\tif ($this->action == 'block') {\r\r\n\t\t\t\treturn $ret;\r\r\n\t\t\t} else if ($this->action == 'replace') {\r\r\n\t\t\t\t$replacement = '$1' . $this->replaceWith . '$2';\r\r\n\t\t\t\t$value = preg_replace($regexp, $replacement, $value);\r\r\n\t\t\t// remove\t\r\r\n\t\t\t} else {\r\r\n\t\t\t\t$replacement = '$1$2';\r\r\n\t\t\t\t$value = preg_replace($regexp, $replacement, $value);\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t$this->replacements[$colName] = $value;\r\r\n\t\treturn $ret;\r\r\n\t}", "public function validate($value);", "public function validate($value);", "public function isLegalValue($value) {\n\t\tswitch ( true ) {\n\t\t\tcase strpos($value, \"\\0\") !== false:\n\t\t\tcase strpos($value, \"\\n\") !== false:\n\t\t\tcase strpos($value, \"\\r\") !== false:\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.64134717", "0.63384795", "0.61892116", "0.5858221", "0.5836838", "0.58352935", "0.58161503", "0.57923543", "0.5768375", "0.56854916", "0.568472", "0.56120956", "0.5595552", "0.5568623", "0.5545766", "0.5543073", "0.5533441", "0.5506805", "0.5496426", "0.5490699", "0.5466103", "0.5458957", "0.54197043", "0.54090834", "0.53827906", "0.53687185", "0.5368372", "0.53651357", "0.5355094", "0.53476053", "0.53434587", "0.53397924", "0.53353393", "0.53303045", "0.52374834", "0.5231686", "0.5217646", "0.5209845", "0.52090603", "0.5208544", "0.5207072", "0.5199237", "0.51880264", "0.51872844", "0.5177951", "0.51478666", "0.51334304", "0.51183575", "0.51161885", "0.5107618", "0.50941634", "0.50893146", "0.50853664", "0.5084281", "0.5079512", "0.5064282", "0.5053708", "0.5053205", "0.5047999", "0.50315326", "0.50267476", "0.5024248", "0.50206393", "0.5020263", "0.50190216", "0.5014135", "0.5007208", "0.50055176", "0.50049734", "0.4996227", "0.4993556", "0.49829182", "0.4980957", "0.49771762", "0.49760488", "0.49750802", "0.49750304", "0.49699438", "0.4963597", "0.4960996", "0.49482557", "0.49368775", "0.49356872", "0.49348655", "0.49244422", "0.49230736", "0.49195877", "0.49162465", "0.4911457", "0.4908077", "0.490795", "0.49021637", "0.49013105", "0.48943335", "0.4894267", "0.48940733", "0.48915744", "0.48859206", "0.48859206", "0.48810363" ]
0.52804774
34
Check that $value matches $against, ignoring differences in case and whitespace.
public function checkMatchesXml($value, $against) { return $this->checkMatchesXmlAdvanced($value, $against, true, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkMatchesXmlWithCase($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, true, false);\n }", "public function passes($attribute, $value)\n {\n $bannedWords = preg_split('/\\n|\\r/', config('settings.short_bad_words'), -1, PREG_SPLIT_NO_EMPTY);\n\n foreach($bannedWords as $word) {\n // Search for the word in string\n if(strpos(mb_strtolower($value), mb_strtolower($word)) !== false) {\n return false;\n }\n }\n\n return true;\n }", "public function passes($attribute, $value)\n {\n // return strtoupper($value) === $value;\n return preg_match(\"/^[ ,<.>\\/?'\\\"\\;:=+-_)(*&%$@!AÁÀẢÃẠÂẤẦẨẪẬĂẮẰẲẴẶEÉÈẺẼẸÊẾỀỂỄỆIÍÌỈĨỊOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢUÚÙỦŨỤƯỨỪỬỮỰYÝỲỶỸỴĐaáàảãạâấầẩẫậăắằẳẵặeéèẻẽẹêếềểễệiíìỉĩịoóòỏõọôốồổỗộơớờởỡợuúùủũụưứừửữựyýỳỷỹỵđ0-9a-zA-Z\\s]+$/\", $value);\n }", "public function checkIdenticalTo($value, $against)\n {\n return new AssertionResult($value === $against, '{name} must be identical to {0}', [$against]);\n }", "function exact_value ( $str, $val )\n\t{\n\t\tif ( strcmp( strval( $str ), strval( $val ) ) !== 0 ) return FALSE;\n\t\treturn TRUE;\n\t}", "public function passes($attribute, $value)\n {\n // TODO: Implement passes() method.\n if (strtoupper($value) === $value) {\n return true;\n }\n\n return false;\n }", "public function checkMatchesXmlWithWhiteSpace($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, false, true);\n }", "public function passes($attribute, $value) {\n\n //post arrays - check each item\n if (is_array($value)) {\n foreach ($value as $key => $val) {\n if ($val == strip_tags($val)) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n //run strip tags and then compare the strings\n if ($value == strip_tags($value)) {\n return true;\n }\n return false;\n }", "public function match($value);", "public function passes($attribute, $value): bool\n {\n return preg_match(self::VALIDATION_REGEX, mb_strtolower($value));\n }", "public function passes($attribute, $value)\n {\n $contrasenyaSegura = false;\n if(strlen($value)>=8){\n $numeros = intval(preg_replace('/[^0-9]+/', '', $value), 10);\n if(strlen($numeros)>0){\n for($i = 0; $i<strlen($value) ; $i++){\n if(ctype_upper($value[$i])){\n $contrasenyaSegura = true;\n break;\n }\n }\n }\n\n }\n return $contrasenyaSegura;\n }", "public function passes($attribute, $value)\n {\n return !strncmp($this->town->short_postcode, $value, 2);\n }", "public function passes($attribute, $value) {\n return preg_match(\"/^((?=.*?[A-Z])(?=.*?[a-z])(?=.*?\\d)|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[^a-zA-Z0-9])|(?=.*?[A-Z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])|(?=.*?[a-z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])).{8,}$/\", $value);\n }", "public function passes($attribute, $value)\n {\n $permitidos = \"áéíóúabcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOP QRSTUVWXYZ \";\n //$permitidos = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \";\n\n for ($i = 0; $i < strlen($value); $i++) {\n if (strpos($permitidos, substr($value, $i, 1)) === false) {\n //no es válido;\n return false;\n }\n }\n\n //si estoy aqui es que todos los caracteres son validos\n return true;\n }", "function matchStrings($userValue, $label)\n{\n// debug(\"matchStrings $label\", $userValue);\n\n if(!strcasecmp($userValue, $label)) return true;\n \n $firstWord = substringBefore($label, \" \");\n return startsWith($userValue, $firstWord);\n}", "public function equalsIgnoreCase($value)\n {\n $input_value = strtolower($this->getValue());\n $value = strtolower($value);\n\n return $input_value == $value;\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\u4E00-\\u9FA5A-Za-z0-9_-]+$/', $value);\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\pL\\.\\-\\_\\d+]+$/u', $value);\n }", "public function passes($attribute, $value)\n {\n $flag = 0;\n if (isEmpty($value)) {\n $flag = 1;\n } else {\n $flag = preg_match(\"(^98|97\\d{8}$)\", $value);\n }\n return $flag;\n }", "public function checkMatchesXmlStrict($value, $against)\n {\n return $this->checkMatchesXmlAdvanced($value, $against, false, false);\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^.*(?=^.{10}$)(?=.*\\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&+=]).*$/', $value);\n }", "public function passes($attribute, $value)\n {\n return preg_match('/(?=^.{4,253}$)(^(?!-)([a-zA-Z0-9\\-]{0,62}[a-zA-Z0-9]\\.)*[a-zA-Z]{1,63}$)/',\n $value) ||\n !preg_match('/(?=^.{3,63}$)(^(?!-)([a-zA-Z0-9\\-]{1,62}[a-zA-Z0-9]{1,62}$))/',\n $value);\n }", "public function passes($attribute, $value): bool\n {\n return preg_match('/\\s/', $value) === 0;\n }", "public function passes($attribute, $value)\n {\n $noSpaces = ($value == trim($value) && strpos($value, ' ') !== false) ? false : true;\n\n $specialCharacters = '!\"#$%&\\'()*+,-./:;<=>?@[\\]^_`{|}~';\n\n $specialCharactersExclude = '!\"#$%&\\'()*+,-/:;<=>?@[\\]^`{|}~'; // Exclude underscore and period\n\n $startWithSpecialChars = in_array($value[0], str_split($specialCharacters));\n\n $endsWithSpecialChars = in_array($value[strlen($value) - 1], str_split($specialCharacters));\n\n $containsSpecialCharsExclude = Util::containsChar($specialCharactersExclude, $value);\n\n $moreThanOnePeriod = substr_count($value, '.') > 1 ? true : false;\n\n \n return (\n $noSpaces\n && !$startWithSpecialChars\n && !$endsWithSpecialChars\n && !$moreThanOnePeriod\n && !$containsSpecialCharsExclude\n ) ? true: false;\n }", "public function passes($attribute, $value)\n {\n // si no viene un valor pasamos la validacion\n\n if(!$value){\n return true;\n }\n\n //que haya una mayuscula\n $upperCase=preg_match('@[A-Z]@',$value);\n //queremos una minuscula\n $lowerCase=preg_match('@[a-z]@',$value);\n //queremos que exista un numero\n $number=preg_match('@[0-9]@',$value);\n //minimo de 8 caracteres\n $length=strlen($value)>=8;\n $success=true;\n if(!$upperCase|| !$lowerCase || !$number || !$length){\n $success=false;\n }\n return $success;\n }", "public function passes($attribute, $value)\n {\n// $len = strlen($value);\n $a = false;\n $value = strtolower($value);\n\n if(Str::endsWith($value, 'street')){\n $a = true;\n }\n if($a){\n return true;\n }\n return false;\n }", "function match_results($keyword, $value){\n\t\t// matching the keyword with the result\n\t\tif(strncmp($keyword,strtolower(trim($value)),strlen($keyword)) == 0){\n\t\t\tif(trim($value)){\n\t\t\t\treturn trim(\"$value\\n\");\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "public function passes($attribute, $value): bool\n {\n $pattern = preg_quote($this->pattern, '#');\n\n return ! preg_match(\"#[{$pattern}]#\", $value);\n }", "public function validateUsernameEqual($value, array $context)\n {\n Stopwatch::start('validateUsernameEqual');\n $users = $this->userlist();\n $lc = mb_strtolower($value);\n foreach ($users as $name) {\n if ($name === $value) {\n continue;\n }\n $name = mb_strtolower($name);\n $distance = levenshtein($lc, $name);\n if ($distance < 2) {\n return __('error.name.equalExists', $name);\n }\n }\n Stopwatch::stop('validateUsernameEqual');\n\n return true;\n }", "public function passes($attribute, $value)\n {\n $validationFlag = false;\n if (!empty($value)) {\n $non_digits = [' ', '(', ')', '-', '.', '+'];\n $nums = str_replace($non_digits, '', $value);\n if (strlen($nums) == 10) {\n $validationFlag = true;\n }\n }\n return $validationFlag;\n }", "public function passes($attribute, $value)\n {\n return $value === 'tva' || $value === 'is';\n }", "function filter_pattern($value)\n {\n global $pattern;\n return !strncmp($pattern, $value, strlen($pattern));\n }", "public static function like($valueA, $valueB) {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = false;\n\t\t\t\n\t\t\t// Check Values\n\t\t\tif(strcmp(strtolower($valueA), strtolower($valueB)) == 0) {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "public function passes($attribute, $value)\n {\n return preg_match('/^([a-z_\\d])+$/', $value) > 0;\n }", "public abstract function matches($value);", "function hobbyFormat ($value, $regex){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match($regex,$value)){\n return false;\n }\n \n return true;\n}", "public function passes($attribute, $value)\n {\n return preg_match('/^#(?:(?:[a-f\\d]{3}){1,2})$/i', $value);\n }", "public function match(mixed $value);", "public function match_results($keyword, $value){\n\t\t// matching the keyword with the result\n\t\tif(strncmp($keyword,strtolower(trim($value)),strlen($keyword)) == 0){\n\t\t\tif(trim($value)){\n\t\t\t\treturn trim(\"$value\\n\");\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "public function passes($attribute, $value)\n {\n if (strlen(preg_replace('/[^0-9]/', '', $value)) !== $this->digitsWithoutDash) {\n $this->message = \"The :attribute must include {$this->digitsWithoutDash} digits.\";\n return false;\n }\n if (!preg_match($this->regex, $value)) {\n return false;\n }\n return true;\n }", "public static function alphabetic($value) {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = false;\n\t\t\t$pattern = \"/^[a-zA-Z]+$/\";\n\t\t\t\n\t\t\tif(!preg_match($pattern, $value)) {\n\t\t\t\t$result = false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "public function passes($attribute, $value)\n {\n //check that the password contains at least 86characters, one uppercase and lowercase letter and a number\n if (preg_match(\"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{6,}$/m\", $value)) {\n return true;\n } else {\n return false;\n }\n }", "function passwordMatch($wachtwoord, $wachtwoordbevestiging) {\n\tif ($wachtwoord !== $wachtwoordbevestiging) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "public function passes($attribute, $value): bool\n {\n $value = preg_replace('/\\s+/', '', trim($value));\n\n if (!is_string($value)) {\n return false;\n }\n // 19 14 89 62 43 4\n $result = preg_match('/^(\\d{2})(\\d{2})(\\d{2})\\d{5}$/i', $value, $output);\n\n if($result !== 1){\n return false;\n }\n\n $anno = date('Y') % 100;\n $subde = $output[1];\n $annoAlta = $output[2];\n $annoNac = $output[3];\n\n if ($subde != 97) {\n if ($annoAlta <= $anno) $annoAlta += 100;\n if ($annoNac <= $anno) $annoNac += 100;\n if ($annoNac > $annoAlta)\n return false;\n }\n\n return $this->luhn($value);\n }", "function test($value) {\n\t\t// php doesn't have g modifier so we remove it if it's there and call preg_match_all()\n\t\tif(strpos($this->modifiers, 'g') !== false){\n\t\t\t$this->modifiers = str_replace('g', '', $this->modifiers);\n\t\t\treturn preg_match_all($this->getRegex(), $value);\n\t\t}\n\t\treturn preg_match($this->getRegex(), $value);\n\t}", "public function passes($attribute, $value)\n {\n // 除了11、12 打头的手机号,其余都放行\n return preg_match('/^(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])\\d{8}$/', $value);\n }", "public function testExactMatch()\n {\n $word = $this->randomString(10);\n\n $percent1 = 0;\n $percent2 = 0;\n $percent3 = 0;\n\n //Verify that we produce the same result for an exact match\n //as the core levenshtein function\n $this->assertEquals(\n similar_text($word, $word, $percent1),\n mb_similar_text($word, $word, $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n\n //Verify that we produce an exact match result for strings\n //with multibyte characters.\n $this->assertEquals(5, mb_similar_text('nôtre', 'nôtre', $percent3));\n $this->assertEquals(100.0, $percent3);\n }", "public function test($value): bool\n {\n if (strpos($this->modifiers, 'g') !== false) {\n $this->modifiers = str_replace('g', '', $this->modifiers);\n $matches = array();//because it's not optional in <5.4\n return preg_match_all($this->getRegex(), $value, $matches);\n }\n\n return (bool)preg_match($this->getRegex(), $value);\n }", "public function passes($attribute, $value)\n {\n if (! is_string($value) && ! is_numeric($value)) {\n return false;\n }\n\n return preg_match('/^[\\pL\\pN\\pM\\pZ\\'_-]+.?$/u', $value) > 0;\n }", "public function passes($attribute, $value)\n {\n if (preg_match(\"/^.*[-].*$/\", $value) == true) {\n $this->error_message = \"Please do not use dash(-) sign\";\n return false;\n } else if (preg_match(\"/^[+,0].*$/\", $value) != true) {\n $this->error_message = \"Please start with either 0 or +\";\n return false;\n } else if (preg_match(\"/^[0,+]?[1-9][0-9]{9,14}$/\", $value) != true) {\n $this->error_message = \"Please insert only numbers ranging from 10 to 15 digits\";\n return false;\n }\n return true;\n }", "public function validate($field, $value)\n {\n return preg_match('/^(?=.*[!@#$%^&*-])(?=.*[0-9])(?=.*[A-Z]).{8,20}$/', $value) == 1;\n }", "function matchesCriterium ($criterium, $value) {\r\n return false;\r\n }", "public static function isCorrect($value)\r\n {\r\n return (strcasecmp($value, BuildingQuality::AVERAGE) == 0 || strcasecmp($value, BuildingQuality::ECONOMY) == 0 ||\r\n strcasecmp($value, BuildingQuality::CUSTOM) == 0 || strcasecmp($value, BuildingQuality::LUXURY) == 0);\r\n }", "public function passes($attribute, $value): bool\n {\n $trimmed = trim(html_entity_decode(strip_tags($value)), \"\\t\\n\\r\\0\\x0B\\xC2\\xA0\");\n\n return ! empty($trimmed);\n }", "function match( $cad, $cad2 ) \n{\n\treturn strcasecmp( $cad, $cad2 ) == 0; // Son iguales\n}", "public function passes($attribute, $value)\n {\n $reg = '/^[0-9]{11}$/';\n if(preg_match($reg, $value)==false)\n return false;\n else\n {\n $digits = str_split($value);\n if ((intval(substr($value, 4, 2)) > 31)||(intval(substr($value, 2, 2)) > 12))\n return false;\n $checksum = (1*intval($digits[0]) + 3*intval($digits[1]) + 7*intval($digits[2]) + 9*intval($digits[3]) + 1*intval($digits[4]) + 3*intval($digits[5]) + 7*intval($digits[6]) + 9*intval($digits[7]) + 1*intval($digits[8]) + 3*intval($digits[9]))%10;\n if($checksum == 0)\n $checksum = 10;\n $checksum = 10 - $checksum;\n\n return (intval($digits[10]) == $checksum);\n }\n }", "public function passes($attribute, $value): bool\n {\n if (!$value) {\n $this->errorMessage = 'ИНН пуст';\n return false;\n }\n\n if (preg_match('/[^0-9]/', $value)) {\n $this->errorMessage = 'ИНН может состоять только из цифр';\n return false;\n }\n\n if (strlen($value) !== 12) {\n $this->errorMessage = 'ИНН может состоять только из 12 цифр';\n return false;\n }\n\n $check_digit = function ($inn, $coefficients) {\n $n = 0;\n foreach ($coefficients as $i => $k) {\n $n += $k * (int)$inn[$i];\n }\n return $n % 11 % 10;\n };\n $n11 = $check_digit($value, [7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n $n12 = $check_digit($value, [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8]);\n if (($n11 === (int)$value[10]) && ($n12 === (int)$value[11])) {\n return true;\n }\n\n $this->errorMessage = 'Введите существующий ИНН';\n return false;\n }", "public function passes($attribute, $value)\n {\n return (bool)preg_match(self::INN_REGEXP, $value, $matches);\n }", "private function process_alpha($value)\n {\n return ! preg_match('/[^a-zA-Z]/', $value);\n }", "function isSantizeString($var) {\n //Returns error message if it does\n\n //Sanitize the string, then see if there are any changes\n if (SanitizeString($var) == $var) {\n return \"\";\n } else {\n return \"Invalid Characters\";\n }\n}", "public function testMediumValuableWord() : void\n {\n $word = 'quirky';\n $this->assertEquals(22, score($word));\n }", "public function passes($attribute, $value)\n {\n $role = DictionaryTerm::findOrFail($value);\n\n if (Dictionary::isRole($role)) {\n return true;\n }\n return false;\n }", "public function my_custom_validation( string $value ): bool {\n\t\treturn strlen( $value ) <= 1;\n\t}", "public abstract function isValid(string $value): bool;", "function comparecsn($one, $two)\n{\n $one = preg_replace('/\\s*/m', '', strtolower($one));\n $two = preg_replace('/\\s*/m', '', strtolower($two));\n if ($one == $two) {\n return true;\n } else {\n return false;\n }\n}", "public function check(string $value): string\n {\n $this->validateStructure($value);\n return $value;\n }", "public static function handle(string &$value): bool\n {\n if (preg_match('/^([a-z0-9A-Z_\\/\\-\\.\\@]+)$/', $value)) {\n return true;\n }\n\n return false;\n }", "public function checkMatchesXmlAdvanced($value, $against, $skipWhite, $ignoreCase)\n {\n if (defined('HHVM_VERSION')) {\n throw new BadMethodCallException('XML validation is not implemented in HHVM');\n }\n if (!class_exists(XmlInspector::class)) {\n throw new BadMethodCallException(\n 'XML validation needs the excemel library. Run `composer require moccalotto/exemel` to install'\n );\n }\n\n $message = '{name} must match the given XML document';\n $context = compact('against', 'skipWhite', 'ignoreCase');\n\n $valueXmlInspector = null;\n\n if (is_a($value, SimpleXMLElement::class)) {\n $valueXmlInspector = new XmlInspector($value);\n\n $success = $valueXmlInspector->sameAs($against, $skipWhite, $ignoreCase);\n\n return new Result($success, $message, $context);\n }\n\n if (!is_string($value)) {\n return new Result(false, $message, $context);\n }\n\n if (!$this->canParse($value)) {\n return new Result(false, $message, $context);\n }\n\n $valueXmlInspector = new XmlInspector(new SimpleXMLElement($value));\n\n $success = $valueXmlInspector->sameAs($against, $skipWhite, $ignoreCase);\n\n return new Result($success, $message, $context);\n }", "public function passes($attribute, $value)\n {\n if ($value) {\n return preg_match('/^(([0-9]{2,4}-[0-9]{2,4}-[0-9]{3,4})|([0-9]{8,11}))$/', $value);\n } else {\n return true;\n }\n }", "final public static function is($value):bool\n {\n return Validate::regex('alphanumericSlug',$value);\n }", "function inputCleaner($value){\n\t $toBeTested\t\t= strip_tags($value);\n\t // Instead of using HTMLStripSpecialChars, I am using some Regex\n\t\t// to have a greater degree of control over the input.\n\t\t//\tThis regex checks the entire string for anything that\n\t\t//\tcould ruin our consistency.\n\t $regExp = (\"/[\\!\\\"\\£\\$\\%\\^\\&\\*\\(\\)\\;\\'\\,\\\"\\?]/ \");\n\t if(preg_match_all($regExp, $toBeTested,$matches)){\n\t \treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn $toBeTested;\n\t\t}\n\t}", "public function passes($attribute, $value)\n {\n try {\n if (substr($value, 0, 1) != '+') return false;\n if (strlen($value) < 9 || strlen($value) > 14) return false;\n if (!is_numeric(substr($value, 1))) return false;\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "public function sRiskDIFFER($user, $order, $value)\n {\n // Compare street and zipcode.\n // Return true if any of them doesn't match.\n return (\n strtolower(\n trim($user['shippingaddress']['street'])\n ) != strtolower(\n trim($user['billingaddress']['street'])\n )\n ) || (\n trim($user['shippingaddress']['zipcode'])\n != trim($user['billingaddress']['zipcode'])\n );\n }", "public function check($value): bool\n {\n $value = str_split($value);\n\n return Helpers::collect($value)->duplicates()->isEmpty();\n }", "protected function validateValidPassword( $attribute, $value ) {\n\n return (bool) preg_match( \"/S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S/\", $value );\n }", "abstract protected function checkValue( &$value );", "public function check($value)\n {\n $checkResult = ['passed' => true, 'message' => \"has value '$value'\"];\n if ($this->nullable && $value === null) {\n $checkResult['passed'] = true;\n $checkResult['message'] = \"has value '$value'\";\n } elseif (!$this->nullable && $value === null) {\n $checkResult['passed'] = false;\n $checkResult['message'] = 'value is null';\n } elseif (!is_string($value) ) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"value '$value' is not string\";\n } elseif ($this->min && strlen($value) < $this->min) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"string length of '$value' is less then minimum length $this->min\";\n } elseif ($this->max && strlen($value) > $this->max) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"string length of '$value' is greater then maximum length $this->max\";\n } elseif ($this->regex && preg_match($this->regex, $value) !== 1) {\n $checkResult['passed'] = false;\n $checkResult['message'] = \"string '$value' does not matches to pattern '$this->regex'\";\n } elseif (count($this->enum) > 0 && !in_array($value, $this->enum)) {\n $checkResult['passed'] = false;\n $enumAsString = implode(',', $this->enum);\n $checkResult['message'] = \"string '$value' is not in set of possible values '$enumAsString'\";\n }\n return $checkResult;\n }", "public function passes($attribute, $value)\n {\n return Hash::check($value, $this->input);\n }", "public function isLegalValue($value) {\n\t\tswitch ( true ) {\n\t\t\tcase strpos($value, \"\\0\") !== false:\n\t\t\tcase strpos($value, \"\\n\") !== false:\n\t\t\tcase strpos($value, \"\\r\") !== false:\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isValid($value)\n {\n if ($value !== filter_var($value, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES)) {\n $this->addError(\n $this->translateErrorMessage(\n 'validator.text.notvalid',\n 'extbase'\n ),\n 1221565786\n );\n }\n }", "public function passes($attribute, $value)\n {\n $baseRaw = $this->model::where($attribute, 'like', withoutSpace($value) ?? '')->first();\n\n $rawsForCheck = [];\n foreach ($this->fields as $attributel => $value) {\n $raw = $this->model::where($attributel, 'like', withoutSpace($value) ?? '')->first();\n\n if (is_null($raw)) {\n $nullCheck = true;\n break;\n } else {\n $rawsForCheck[$raw->id] = $raw;\n }\n } \n\n if (isset($baseRaw) && isset($nullCheck)) {\n return false;\n }\n\n if (isset($baseRaw) && count($rawsForCheck) != 1) {\n return false;\n }\n\n if (isset($baseRaw) && count($rawsForCheck) == 1 && $baseRaw->id !== head($rawsForCheck)->id) {\n return false;\n }\n\n return true;\n }", "function containsUpperAndLower($password)\n{\n if (strtoupper($password) == $password) return false;\n if (strtolower($password) == $password) return false;\n return true;\n}", "function isSpecialValue($value)\n {\n return strlen($value)>3 && $value[0]=='!' && $value[1]=='!' && $value[2]=='!';\n }", "public function passes($attribute, $value)\n {\n if (! preg_match('/^[0-9]{8,20}$/', $value)) {\n $this->message = __('userandpermission::validation.digits', ['attribute' => $attribute]);\n } elseif (strlen($value) > $this->max) {\n $this->message = __('userandpermission::validation.phone_max', ['attribute' => $attribute, 'max' => $this->max]);\n } elseif (strlen($value) < $this->min) {\n $this->message = __('userandpermission::validation.phone_min', ['attribute' => $attribute, 'min' => $this->min]);\n }\n\n return ($this->message == 'passes');\n }", "public static function validate($value);", "public function passes($attribute, $value)\n {\n preg_match_all('/^\\:[^\\s\\:]+/', $this->key, $matches);\n\n if (empty($value) || empty($matches[0])) {\n return true;\n }\n\n return collect($matches)->pluck(0)->filter(function ($matched) use ($value) {\n return ! Str::contains($value, $matched);\n })->isEmpty();\n }", "public static function isValid($value)\n {\n return is_string($value) && preg_match('/^[a-z]+$/', $value) === 1;\n }", "public function passes($attribute, $value)\n {\n try {\n return !resolve(Spam::class)->detect($value);\n } catch (Exception $e) {\n return false;\n }\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_WARRANTYOFFERED,self::VALUE_CUSTOMCODE));\n\t}", "function checker($word){\r\n\tif (strrev($word) == $word){\r\n\t\treturn true; \r\n\t}\r\n\telse{\r\n\t\treturn false; //returns the condition\r\n\t}\r\n\t}", "public function passes($attribute, $value)\n {\n return is_numeric($value) && $this->hasAllowedLength($value) && $this->checksumMatches($value);\n }", "public static function isValid($value) : bool {\n\t\t\treturn (is_string($value) && preg_match('/^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/', $value));\n\t\t}", "public function isValid($value) {\n return parent::isValid($value) || preg_match($this->_pattren, $value);\n }", "public function seotidy($passedvalue) {\n\t return strtolower(str_replace(\"'\",\"\",(str_replace('\\\\','-',str_replace('/','-',str_replace('&','and',str_replace(' ','-',($passedvalue))))))));\n\t}", "public function like($value)\n {\n $term = '/.*' . $value . '.*/i';\n return $this->regex($term);\n }", "public function passes($attribute, $value)\n {\n try {\n return Factory::makeFromNumber($this->card_number)->isValidCvc($value);\n } catch (\\Exception $ex) {\n return false;\n }\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_NYSE,self::VALUE_NASDAQCM,self::VALUE_NASDAQGM,self::VALUE_NASDAQGS,self::VALUE_AMEX,self::VALUE_PINKSHEETS,self::VALUE_OTCBB,self::VALUE_INDUSTRYGROUPS,self::VALUE_INDICES,self::VALUE_AMSTERDAM,self::VALUE_ASX,self::VALUE_BERLIN,self::VALUE_BREMEN,self::VALUE_BRUSSELS,self::VALUE_COPENHAGEN,self::VALUE_DUSSELDORF,self::VALUE_FRANKFURT,self::VALUE_HAMBURG,self::VALUE_HANOVER,self::VALUE_HELSINKI,self::VALUE_HONGKONG,self::VALUE_ICELAND,self::VALUE_INDIA,self::VALUE_LISBON,self::VALUE_LSE,self::VALUE_MUMBAI,self::VALUE_MUNICH,self::VALUE_OSLO,self::VALUE_PARIS,self::VALUE_PRAGUE,self::VALUE_RIGA,self::VALUE_RTSRUB,self::VALUE_RTSUSD,self::VALUE_SINGAPORE,self::VALUE_STOCKHOLM,self::VALUE_STUTTGART,self::VALUE_TALLINN,self::VALUE_TOKYO,self::VALUE_TSX,self::VALUE_TSXV,self::VALUE_VILNIUS,self::VALUE_XETRA));\n\t}", "function str_is($pattern, $value)\n {\n return Str::is($pattern, $value);\n }", "private function checkMatch($value, $message, $match)\n {\n if($value !== $match)\n {\n $this->errors [] = $message;\n return false;\n } else {\n return true;\n }\n }", "public function testShortValuableWord() : void\n {\n $word = 'zoo';\n $this->assertEquals(12, score($word));\n }" ]
[ "0.66479075", "0.6537236", "0.6399893", "0.6283788", "0.6117586", "0.59445363", "0.5889161", "0.58744943", "0.58494455", "0.5829316", "0.5825437", "0.57691693", "0.57685673", "0.57685477", "0.57478553", "0.56966126", "0.56856436", "0.56769496", "0.5669779", "0.5618284", "0.5592345", "0.557267", "0.55468655", "0.5528164", "0.5502821", "0.5496238", "0.54944366", "0.5489722", "0.5465138", "0.546435", "0.5458142", "0.5455142", "0.54532564", "0.5439394", "0.54360926", "0.53685105", "0.53379685", "0.53371686", "0.5336755", "0.53185904", "0.5312007", "0.53061527", "0.52896696", "0.52870584", "0.5285622", "0.524998", "0.5233627", "0.52232444", "0.52124155", "0.52036875", "0.52027565", "0.51990193", "0.51901335", "0.5169457", "0.51553077", "0.51388466", "0.51333785", "0.5115593", "0.5103565", "0.50968504", "0.50826895", "0.5082189", "0.50775415", "0.5077236", "0.5076685", "0.5076385", "0.5072278", "0.5070908", "0.50665396", "0.5050898", "0.5048469", "0.50428486", "0.5037233", "0.5037153", "0.5012533", "0.5008465", "0.50052476", "0.5003585", "0.5001865", "0.4998685", "0.4996652", "0.49924532", "0.49877638", "0.4987028", "0.4974063", "0.49716866", "0.49687028", "0.49676946", "0.4962518", "0.49583948", "0.49503672", "0.49450225", "0.49414766", "0.4938532", "0.49348786", "0.4930663", "0.49289903", "0.49258175", "0.4922377", "0.49222335" ]
0.5213841
48
Display a listing of the resource.
public function __construct() { $this->middleware('auth'); }
{ "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() { $total=Cart::total(); $tax=Cart::tax(); $cart=Cart::content(); $count=Cart::count(); $user=Auth::user(); $address=$user->address()->get(); return view('frontend.addressbook',compact('address','total','tax','count','cart')); }
{ "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) { $add=$request->all(); $user=Auth::user(); $user->address()->create($add); return redirect()->back; }
{ "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.72855324", "0.71447515", "0.7132799", "0.6641042", "0.66208744", "0.6566955", "0.65249777", "0.6509032", "0.6447701", "0.63756555", "0.6373163", "0.63650846", "0.63650846", "0.63650846", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676", "0.6341676" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "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, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "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 deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\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 function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\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 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 $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 File::find($id)->remove();\n \n return redirect()->route('files.index');\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 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 delete($path, $data = null);", "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 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 removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\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 destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function remove($filePath){\n return Storage::delete($filePath);\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 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(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\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 }", "public function remove($id);", "public function remove($id);", "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 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 }", "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 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 {\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 }", "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 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.6671365", "0.6660839", "0.66361386", "0.6632988", "0.6624729", "0.6542195", "0.6541645", "0.6466739", "0.6288393", "0.61767083", "0.6129533", "0.608954", "0.6054169", "0.60443425", "0.60073143", "0.59338665", "0.59317696", "0.592145", "0.5920155", "0.59065086", "0.5897853", "0.58968836", "0.58958197", "0.58958197", "0.58958197", "0.58958197", "0.58800334", "0.5869308", "0.5861188", "0.5811069", "0.5774596", "0.5763277", "0.5755447", "0.5747713", "0.5742094", "0.573578", "0.5727048", "0.57164854", "0.5712422", "0.57092893", "0.57080173", "0.5707143", "0.5704078", "0.5696418", "0.5684556", "0.5684556", "0.56790006", "0.5678463", "0.5658492", "0.564975", "0.5648406", "0.56480885", "0.5641393", "0.5638992", "0.56302536", "0.56228197", "0.5616424", "0.5607389", "0.56033397", "0.5602035", "0.55991143", "0.55988586", "0.5590501", "0.5581284", "0.55681103", "0.5566215", "0.55644745", "0.5563726", "0.55593926", "0.55583876", "0.5548547", "0.5542015", "0.5541403", "0.5541403", "0.55397224", "0.55390894", "0.55376494", "0.5531044", "0.5529739", "0.55279493", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527671", "0.5527155", "0.5526666", "0.55245256", "0.552101", "0.55183184" ]
0.0
-1
Display a listing of the resource.
public function index($account_id) { $accounts = new SchoolAccount(); $structures = new FeeStructure(); if($accounts->where('id',$account_id)->exists()) { $structures = $structures->where('school_account_id',$account_id)->paginate(10); return response()->json(compact('structures')); } else{ $structures = [ 'message'=>'account not found', ]; return response()->json(compact('structures')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "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 return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\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 {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create(){\n return view('form.create');\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 $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\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 create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\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\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "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}", "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 {\n return view('student::students.student.create');\n }" ]
[ "0.7593198", "0.7593198", "0.75881755", "0.75787884", "0.7570936", "0.74992913", "0.7436037", "0.7431172", "0.7386512", "0.7351077", "0.7337819", "0.73100585", "0.7295612", "0.72803086", "0.7272473", "0.72422874", "0.7229479", "0.7224403", "0.7184453", "0.7177193", "0.7173551", "0.71482", "0.71424824", "0.7141885", "0.7135663", "0.7126202", "0.7121413", "0.7113729", "0.7113729", "0.7113729", "0.7110717", "0.7092118", "0.7083616", "0.7080794", "0.7078082", "0.70561296", "0.70561296", "0.7054459", "0.703925", "0.70373696", "0.70346737", "0.70324355", "0.70287114", "0.7025425", "0.7025232", "0.7018496", "0.7016745", "0.7002774", "0.70019513", "0.69991785", "0.69942427", "0.69936013", "0.69929653", "0.6988009", "0.69856364", "0.6965122", "0.6964889", "0.6955187", "0.69511235", "0.69497", "0.6947041", "0.69432163", "0.6940678", "0.6939846", "0.6936846", "0.6936846", "0.6936506", "0.6933589", "0.69309", "0.69273484", "0.6925485", "0.6921386", "0.6917649", "0.6913987", "0.6910826", "0.6909406", "0.69085246", "0.6907409", "0.69021183", "0.6900961", "0.68997645", "0.68991655", "0.6894049", "0.68920606", "0.6892033", "0.6891114", "0.6890811", "0.6890811", "0.6887868", "0.6887327", "0.68854356", "0.688366", "0.68805534", "0.68766564", "0.68753666", "0.6872474", "0.68717086", "0.6869974", "0.6869806", "0.6868809", "0.68685615" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request,$account_id) { $accounts = new SchoolAccount(); $structures = new FeeStructure(); if($accounts->where('id',$account_id)->exists()) { $inputs = $request->all(); $rules = [ 'structure_name'=>'required', 'amount'=>'required', ]; $validator = Validator::make($inputs,$rules); if($validator->fails()){ $structures = [ 'failed'=>true, 'message'=>$validator->errors() ]; return response()->json(compact('structures')); } $structures->create(array( 'structure_name'=>strtolower($request->structure_name), 'amount'=>$request->amount, 'school_account_id'=>$account_id, )); $structures = [ 'message'=>'saved successfully', ]; return response()->json(compact('structures')); } else{ $structures = [ 'message'=>'account not found', ]; return response()->json(compact('structures')); } }
{ "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($account_id,$id) { $accounts = new SchoolAccount(); $structures = new FeeStructure(); if($accounts->where('id',$account_id)->exists()) { if($structures->where('id',$id)->exists()) { $structures = $structures->with('schoolAccount')->find($id); } else{ $structures = [ 'message'=>'structure not found', ]; } return response()->json(compact('structures')); } else{ $structures = [ 'message'=>'account not found', ]; return response()->json(compact('structures')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function 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 edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n 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 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($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n \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) {\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 editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }" ]
[ "0.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6834711", "0.6810601", "0.680613", "0.6804975", "0.68015367", "0.6795471", "0.6791821", "0.6791821", "0.6787303", "0.6783644", "0.67790574", "0.67766285", "0.6767741", "0.67610145", "0.67455536", "0.67455536", "0.6744367", "0.6743159", "0.6739656", "0.67351145", "0.67246765", "0.67128825", "0.6692859", "0.66916454", "0.6687554", "0.66875297", "0.6687494", "0.6684443", "0.668203", "0.66689324", "0.66680384", "0.6664605", "0.6664605", "0.66621166", "0.66604865", "0.66589504", "0.6655767", "0.66542184", "0.665213", "0.66422516", "0.6631665", "0.663077", "0.6627607", "0.6627607", "0.66193914", "0.6618503", "0.66160196", "0.66146857", "0.6609641", "0.6608315", "0.6605284", "0.6595882", "0.65947276", "0.6594626", "0.65895563", "0.6589339", "0.6587281", "0.65805006", "0.6579201", "0.6579166", "0.657641", "0.6576111", "0.65740323", "0.65692765", "0.6568046", "0.6567221", "0.6565346", "0.6560687", "0.6560687", "0.6560384", "0.65577257", "0.65569293", "0.65558636", "0.6555392", "0.65553015", "0.65542984", "0.655418", "0.6554106", "0.6547678", "0.65473104", "0.6543329" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request,$account_id, $id) { $accounts = new SchoolAccount(); $structures = new FeeStructure(); if($accounts->where('id',$account_id)->exists()) { if($structures->where('id',$id)->exists()) { $structures = $structures->find($id); $structures->structure_name = isset($request->structure_name)?strtolower($request->structure_name):$structures->structure_name; $structures->amount = isset($request->amount)?$request->amount:$structures->amount; $structures->school_account_id = isset($request->school_account_id)?$request->school_account_id:$structures->school_account_id; $structures->save(); $structures = [ 'message'=>'saved successfully', ]; return response()->json(compact('structures')); } else{ $structures = [ 'message'=>'structure not found', ]; } return response()->json(compact('structures')); } else{ $structures = [ 'message'=>'account not found', ]; return response()->json(compact('structures')); } }
{ "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 updateStream($path, $resource, Config $config)\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 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 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 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(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(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(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($request, $id);", "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 }", "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 }", "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 }", "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 }", "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);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\n {\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 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 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 static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "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(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(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 $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($id, $input);", "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(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 {/* 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 $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 {\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);", "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 }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\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(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() {\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 $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.74238616", "0.7062842", "0.7057816", "0.6897868", "0.65820867", "0.64505464", "0.6347915", "0.62114644", "0.6145006", "0.61231726", "0.6115922", "0.6100021", "0.6089019", "0.60542375", "0.60187906", "0.6008231", "0.5974106", "0.5944986", "0.59397626", "0.59393746", "0.58937186", "0.58607864", "0.5853811", "0.5853811", "0.58521867", "0.5815276", "0.58061725", "0.57518756", "0.57518756", "0.5736318", "0.57246256", "0.5715636", "0.5696208", "0.5691033", "0.5687788", "0.56692934", "0.56556624", "0.5652178", "0.56494987", "0.5636202", "0.56355816", "0.5632871", "0.563206", "0.56291884", "0.5621382", "0.56087434", "0.5602465", "0.55928403", "0.55825645", "0.55821884", "0.5581833", "0.5576869", "0.55712104", "0.5568173", "0.55648434", "0.5562885", "0.5560537", "0.5560537", "0.5560537", "0.5560537", "0.5560537", "0.55592597", "0.5556131", "0.5555849", "0.5555397", "0.5553912", "0.55530137", "0.5543831", "0.55430055", "0.5540152", "0.5539437", "0.55359006", "0.5535772", "0.5534487", "0.552458", "0.5518245", "0.5515452", "0.55145514", "0.5509227", "0.55079365", "0.55065364", "0.55039924", "0.5501616", "0.5500345", "0.5499738", "0.54980725", "0.5496017", "0.5496017", "0.5494488", "0.5494334", "0.54936594", "0.54934716", "0.5491019", "0.54835314", "0.54795796", "0.5479442", "0.5478275", "0.54646415", "0.54637444", "0.5461914", "0.54562414" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($account_id,$id) { $accounts = new SchoolAccount(); $structures = new FeeStructure(); if($accounts->where('id',$account_id)->exists()) { if($structures->where('id',$id)->exists()) { $structures = $structures->find($id); $structures->delete(); $structures = [ 'message'=>'deleted successfully', ]; return response()->json(compact('structures')); } else{ $structures = [ 'message'=>'structure not found', ]; } return response()->json(compact('structures')); } else{ $structures = [ 'message'=>'account not found', ]; return response()->json(compact('structures')); } }
{ "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
Set the paths to be considered as active (navigationwise).
public function setActivePaths(array $paths): void { $this->activePaths = $paths; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setActivePaths(array $paths)\n {\n $this->activePaths = $paths;\n }", "private function _setActiveNodes($nodes)\n {\n $path = craft()->request->getPath();\n $segments = craft()->request->getSegments();\n $segmentCount = count($segments) > 0 ? count($segments) : 1;\n\n // Set empty array for specific navigation\n $this->_activeNodeIds[ $this->_navigation->handle ] = array();\n $this->_activeNodeIdsForLevel[ $this->_navigation->handle ] = array();\n\n foreach ($nodes as $node) {\n if ($node['elementType'] == 'Asset') { continue; }\n\n $url = ! empty($node['elementId']) ? $node['elementUrl'] : $node['url'];\n $url = str_replace('{siteUrl}', '', $url);\n $url = str_replace('__home__', '', $url);\n if (substr($url, 0, 1) == '/') {\n $url = substr($url, 1); // Fix for relative URLs\n }\n if ($url == $path) {\n $this->_activeNodeIds[ $this->_navigation->handle ][] = $node['id'];\n $this->_activeNodeIdsForLevel[ $this->_navigation->handle ][ $segmentCount ] = $node['id'];\n }\n if (count($segments)) {\n $found = false;\n $count = 1; // Start at second\n $segmentString = $segments[0]; // Add first\n while ($count < count($segments)) {\n if ($url == $segmentString) {\n $found = true;\n break;\n }\n $segmentString .= '/' . $segments[$count];\n $count ++;\n }\n if ($found) {\n $this->_activeNodeIds[ $this->_navigation->handle ][] = $node['id'];\n $this->_activeNodeIdsForLevel[ $this->_navigation->handle ][$count] = $node['id'];\n }\n }\n }\n }", "public function setPaths(array $paths = []);", "public function setSwitchPaths(array $paths)\n {\n $this->switchPaths = $paths;\n }", "public function menu_set_active_item($path)\n {\n return menu_set_active_item($path);\n }", "private function setCurrentPath(){\n\t\t$dirs = explode('/', $this->pages[0]);\n\t\t// if last character is a / then just use it\n\t\tif(empty($dirs[count($dirs)-1]) || is_null($dirs[count($dirs)-1])){\n\t\t\t$this->current_path = $this->pages[0];\n\t\t// if end of path was a filename, remove it and add a /\n\t\t} else {\n\t\t\tarray_pop($dirs);\n\t\t\t$this->current_path = implode('/', $dirs).'/';\n\t\t}\n\t}", "public function setGlobalPaths($paths);", "public function setPaths($paths)\n {\n $this->__paths = $paths;\n }", "public function setPaths($paths)\n {\n $this->_paths = (array) $paths;\n }", "public function getActivePaths()\n {\n return $this->activePaths;\n }", "public function setPaths($paths) {\n $this->paths = $paths;\n }", "public function setPaths($paths) {\n $this->paths = $paths;\n }", "public function setInitialPaths() {}", "public function enableNavigation() {\n\t\t$this->enableNav = true;\n\t}", "public function setPaths(array $paths)\n {\n $this->paths = $paths;\n }", "public function setPaths(array $paths)\n {\n $this->paths = $paths;\n }", "public function setPaths(array $paths) {\r\n foreach ($paths as $path) {\r\n $this->addPath($path);\r\n }\r\n }", "function setActive() ;", "function _navSetup()\n\t{\n\t\t// get the path to the current page\n\t\t$this->path = $this->getPath($this->area, $this->page);\n\t\t\n\t\t// reset the navigational elements\n\t\t$this->nav = array();\n\t\t\n\t\t// we use the view URL a lot\n\t\t$view_url = $this->parse->getRenderConf('xhtml', 'wikilink', 'view_url');\n\t\t\n\t\t// is there a path? (if not, the page is not on the map)\n\t\tif (count($this->path) > 0) {\n\t\t\t\n\t\t\t// get nav elements leading to this page...\n\t\t\tforeach ($this->path as $key => $val) {\n\t\t\t\t\t\n\t\t\t\tif ($key == 0) {\n\t\t\t\t\n\t\t\t\t\t// get the map tops\n\t\t\t\t\t$this->nav[$key] = $this->_tops($val, $view_url);\n\t\t\t\t\t\n\t\t\t\t} elseif (isset($this->path[$key-1])) {\n\t\t\t\t\n\t\t\t\t\t// get children\n\t\t\t\t\t$prev_page = $this->path[$key-1];\n\t\t\t\t\t$this->nav[$key] = $this->_kids($prev_page, $val, $view_url);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t// and get the first nav element below this page.\n\t\t\t$prev_page = $val;\n\t\t\t$this->nav[$key+1] = $this->_kids($prev_page, $this->page,\n\t\t\t\t$view_url, true);\n\t\t\t\n\t\t} else {\n\n\t\t\t// Set the nav element to the top level page list for the area, so\n\t\t\t// that the list of top level pages is shown even if we move outside\n\t\t\t// the area map.\n\t\t\t$this->nav[0] = $this->_tops(\"\", $view_url);\n\t\t}\n\t\t\t\n\t\t\n\t\t// nav to AreaMap, edit, history, and links\n\t\t$this->nav['map'] =\tsprintf($view_url, 'AreaMap');\n\t\t$this->nav['history'] = sprintf($view_url, $this->page) . '&view=history';\n\t\t$this->nav['links'] = sprintf($view_url, $this->page) . '&view=links';\n\t\t$this->nav['source'] = sprintf($view_url, $this->page) . '&view=source';\n\t\t$this->nav['rss'] = sprintf($this->conf['absolute_url'].\"rss.php?area=%s&page=%s\", $this->area, $this->page);\n\t\t$this->nav['edit'] = sprintf($this->conf['absolute_url'].\"edit.php?area=%s&page=%s\", $this->area, $this->page);\n\t}", "private function setPath()\n {\n $urlE = $this->explodedUrl;\n\n unset($urlE[0], $urlE[1], $urlE[2]);\n $url = implode('/', $urlE);\n $pathE = explode('?', $url);\n $e = explode('/', $pathE[0]);\n $this->path = count($e) == 1 && $e[0] === '' ? array() : $e;\n }", "function set_active($path, $active = 'active') {\n\n return call_user_func_array('Request::is', (array)$path) ? $active : '';\n\n}", "public function setActive() {}", "function set_active($path, $active = 'active')\n{\n return Request::is($path) ? $active : '';\n}", "public function setPartialPaths() {}", "public function getActivePaths(): array\n {\n return $this->activePaths;\n }", "public function set_path($path)\n\t{\n\t\t$this->route_stack[self::SEG_PATH] = $path;\n\t}", "public static function setPath($path)\n {\n static::$pathTop = $path;\n }", "function setActiveNavTab($path)\n{\n return Request::is($path) ? 'nav-link active' : 'nav-link';\n}", "private function setPaths(array $pathsOverride)\n {\n if (count($pathsOverride)) {\n $this->paths = $pathsOverride;\n } else {\n $this->paths = explode(';', getenv('PATH'));\n }\n }", "public function setPath()\n {\n $this->path = $this->getNamespace() . $this->getControllerName();\n }", "public function setActive()\n\t\t{\n\t\t\t$this->_state = 1;\n\t\t}", "public function setActive()\r\n {\r\n $this->active = true;\r\n }", "public function setControllerPaths($paths)\n\t{\n\t\t$this->_controllerPaths = $paths;\n\t}", "public function setNavigation(array $menu){\n $this->_navigation = $menu;\n }", "function isActive($path, $active = 'active nav-active nav-expanded'){\n return call_user_func_array('Request::is', (array)$path) ? $active : '';\n}", "protected function __construct(){\n $this->_navigation = $this->_markActive($this->_filter($this->_getPages()));\n }", "protected function auto_register_paths()\r\n\t\t{\r\n\t\t\t// prepend all the ignore paths\r\n\t\t\t$n = count( $this->path_ignore );\r\n\t\t\tfor ( $i = 0; $i < $n; $i++ )\r\n\t\t\t\t$this->path_ignore[ $i ] = $this->local . $this->path_ignore[ $i ];\r\n\t\t\t\r\n\t\t\t$dirs = glob( $this->local . \"*\", GLOB_ONLYDIR );\r\n\t\t\t\r\n\t\t\t// setup all valid web directories\r\n\t\t\t$this->paths[ self::ROOT_PATH ] = $this->local;\r\n\t\t\tforeach( $dirs as $d )\r\n\t\t\t\tif ( !in_array( $d, $this->path_ignore ) )\r\n\t\t\t\t\t$this->paths[ basename( $d ) ] = $d . DIRECTORY_SEPARATOR;\r\n\t\t}", "protected function setInitialBackPath() {}", "public function moveTo($selected) {\n\t\tfor($position = 0; $position < $this->mainGraph->getAllVertex ()->size (); $position += 1) {\n\t\t\tif ($this->mainGraph->getAllVertex ()->get ( $position )->getVertexName () == $selected) {\n\t\t\t\t$this->visited [$this->inHere->getVertexName ()] = true;\n\t\t\t\t$this->inHere = $this->mainGraph->getAllVertex ()->get ( $position );\n\t\t\t\t$this->history = $this->history . \".\" . $position;\n\t\t\t}\n\t\t}\n\t}", "public function setIncludePaths($paths)\n\t{\n\t\t$this->_includePaths = $paths;\n\t}", "function activate() {\r\n global $wp_rewrite;\r\n\r\n if ( get_option('permalink_structure') != '' && !strpos($wp_rewrite->get_page_permastruct(), '.' . $this->options->extension) ) {\r\n $wp_rewrite->page_structure = $wp_rewrite->page_structure . '.' . $this->options->extension;\r\n }\r\n\r\n $wp_rewrite->flush_rules();\r\n }", "static function set_url_segment($path) {\r\n\t\tself::$url_path = $path;\r\n\t}", "public function setEntryPaths($paths);", "public static final function setPaths($paths)\n {\n\tif (!is_array($paths)) {\n\t throw new Exception('Include paths should be of Array type');\n\t}\n\tforeach ($paths as $path) {\n\t if (!is_dir($path)) {\n\t\tthrow new Exception(sprintf('Include path \"%s\" does not exists', $path));\n\t }\n\t}\n\tself::$_paths = $paths;\n }", "public function setTaxonomyPaths($paths);", "public function activate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 1]);\n }\n\n $this->resetSelected();\n }", "public function addPaths(array $paths)\n {\n $this->_paths = array_unique(array_merge($this->_paths, $paths));\n }", "public function SetActive ($active = TRUE);", "public function set_path() {\n\t\t\t\n\t\t\t// pick up the path types\n\t\t\t$path_types = include_once(CONFIGPATH . 'path-types.php' );\n\n\t\t\t// get the base path for the deploy type\n\t\t\t$base_path = $path_types[ $this->repo[ 'type' ] ];\n\n\t\t\t// check if it is a valid path\n\t\t\t$this->is_path_valid( $base_path );\n\n\t\t\t// append the repositories name to get the final deploy path\n\t\t\t$this->repo[ 'path' ] = $base_path . '/' . $this->repo[ 'name' ];\n\t\t}", "static function navigation($pages, $depth=1) {\n\t\t$active = false;\n\t\t$elements = $classes = array();\n\t\tforeach ($pages as $page) {\n\t\t\t$class = '';\n\t\t\t\n\t\t\t//get selected\n\t\t\tif (http::request('path_query') == $page['url']) {\n\t\t\t\t$class = 'active';\n\t\t\t\t$active = true;\n\t\t\t}\n\t\t\t\n\t\t\t$return = self::a($page['url'], $page['title']);\n\t\t\t\n\t\t\tif (isset($page['children']) && count($page['children'])) {\n\t\t\t\tlist($content, $descendant_active) = self::navigation($page['children'], $depth + 1);\n\t\t\t\t$return .= $content;\n\t\t\t\tif ($descendant_active) {\n\t\t\t\t\t$class = 'descendant-active';\n\t\t\t\t\t$active = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$classes[] = $class;\n\t\t\t$elements[] = $return;\n\t\t}\n\t\t\t\n\t\t$return = self::ul($elements, false, $classes);\n\t\tif ($depth == 1) return $return;\n\t\treturn array($return, $active); //have to pass the fact that there was a selected item up the chain\n\t}", "private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }", "protected function controlActiveElements() {}", "protected function _markActive($menu){\n $controllerName = Zend_Registry::get('controllerName');\n $actionName = Zend_Registry::get('actionName');\n\n foreach($menu as $tabKey => $tab){\n if ($controllerName === $tab['main']['controller'] && $actionName === $tab['main']['action']){\n $menu[$tabKey]['main']['active'] = TRUE;\n }\n\n if(isset($tab['pages'])){\n foreach($tab['pages'] as $pagekey => $page) {\n if($controllerName === $page['controller'] && ($actionName === $page['action'] || (array_key_exists('scope', $page) && $page['scope'] == '*'))){\n $menu[$tabKey]['pages'][$pagekey]['active'] = TRUE;\n $menu[$tabKey]['main']['active'] = TRUE;\n break;\n }\n }\n }\n }\n\n return $menu;\n }", "function setActive($a_active)\n\t{\n\t\t$this->active = $a_active;\n\t}", "public function setActive()\n {\n $this->update(['status' => static::STATUS_ACTIVE]);\n }", "function _setNavigation()\r\n {\r\n global $_ARRAYLANG;\r\n\r\n $ckEditorFuncNum = isset($_GET['CKEditorFuncNum']) ? '&amp;CKEditorFuncNum='.contrexx_raw2xhtml($_GET['CKEditorFuncNum']) : '';\r\n $ckEditor = isset($_GET['CKEditor']) ? '&amp;CKEditor='.contrexx_raw2xhtml($_GET['CKEditor']) : '';\r\n\r\n $this->_objTpl->addBlockfile('FILEBROWSER_NAVIGATION', 'fileBrowser_navigation', 'module_fileBrowser_navigation.html');\r\n $this->_objTpl->setVariable(array(\r\n 'FILEBROWSER_MEDIA_TYPE_MENU' => $this->_getMediaTypeMenu('fileBrowserType', $this->_mediaType, 'onchange=\"window.location.replace(\\''. \\Cx\\Core\\Csrf\\Controller\\Csrf::enhanceURI('index.php?cmd=FileBrowser').'&amp;standalone=true&amp;langId='.$this->_frontendLanguageId.'&amp;type=\\'+this.value+\\''.$ckEditorFuncNum.'\\')\"'),\r\n 'TXT_FILEBROWSER_PREVIEW' => $_ARRAYLANG['TXT_FILEBROWSER_PREVIEW']\r\n ));\r\n\r\n if ($this->_mediaType != 'webpages') {\r\n // only show directories if the files should be displayed\r\n if (count($this->_arrDirectories) > 0) {\r\n foreach ($this->_arrDirectories as $arrDirectory) {\r\n $this->_objTpl->setVariable(array(\r\n 'FILEBROWSER_FILE_PATH' => \"index.php?cmd=FileBrowser&amp;standalone=true&amp;langId={$this->_frontendLanguageId}&amp;type={$this->_mediaType}&amp;path={$arrDirectory['path']}\" . $ckEditor . $ckEditorFuncNum,\r\n 'FILEBROWSER_FILE_NAME' => $arrDirectory['name'],\r\n 'FILEBROWSER_FILE_ICON' => $arrDirectory['icon']\r\n ));\r\n $this->_objTpl->parse('navigation_directories');\r\n }\r\n }\r\n }\r\n $this->_objTpl->parse('fileBrowser_navigation');\r\n }", "public function Proccess()\r\n {\r\n if(empty($this->config['active']))\r\n {\r\n $this->config['active'] = \"Dushboard/index\";\r\n }\r\n\r\n $this->config['nav_finished_list'] = $this->build_menu($this->config[\"nav_list\"], 0, $this->config['active']);\r\n $this->find_parent($this->config[\"nav_list\"],$this->config[\"current\"]);\r\n $this->config['path'] = array_reverse($this->config['path']);\r\n // echo \"<pre>\";\r\n // var_dump($this->config['nav_finished_list']);\r\n // echo \"</pre>\";\r\n }", "function setPath($path) {\n if (substr($path,-1)!=\"/\") $path.=\"/\";\n //if (!file_exists($path)) echo \"<div>Path $path not found</div>\";\n $this->mat = $path;\n return true;\n }", "private function setPath($path) {\n return;\n }", "public function setPaths()\n\t{\n\t\t$this->componentURL = Request::base() . 'publications/';\n\t\t$this->resourceURL = $this->componentURL . $this->id;\n\n\t\t$database = \\App::get('db');\n\t\t$pub = new \\Components\\Publications\\Tables\\Publication($database);\n\t\t$publication = $pub->getPublication($this->id);\n\t\t$this->resourceSite = \\Components\\Publications\\Helpers\\Html::buildPubPath($this->id, $publication->version_id, '', $publication->secret, 1);\n\t}", "public function setPaths(array $paths): Indexer {\n $this->paths = $paths;\n return $this;\n }", "function set_path($path) \n {\n $this->path = \"/\" . trim($path, \"/\");\n }", "function activate() {\n \n // actualizar las reglas de escritura para que observen la nueva taxonomia\n flush_rewrite_rules();\n }", "public function set_path($path) {\n $this->path = $path;\n }", "public function init() {\n $this->aBasePaths = array('active' => array(), 'all' => array());\n return $this;\n }", "abstract protected function paths();", "public function addClassPath( &$path ) {\n\t\n\t\tif ( in_array( $path, self::$paths ))\n\t\t\treturn $this;\n\t\t\t\n\t\tself::$paths[] = $path;\n\t\t\n\t\treturn $this;\n\t}", "public function activeNavigation($path)\n {\n $uri = $this->request->getMasterRequest()->getPathInfo();\n $reqNav = explode('/', $uri);\n $nav = explode('/', $path);\n\n if (count($reqNav) > 2 && count($nav) > 2 && $reqNav[2] === $nav[2]) {\n if ($reqNav[2] === 'people') {\n if ($this->tokenStorage->getToken()) {\n $token = $this->tokenStorage->getToken();\n if ($token) {\n $user = $token->getUser();\n if ($user instanceOf User) {\n $linkSlug = $reqNav[count($reqNav) - 1];\n $userSlug = $user->getProfile()->getSlug();\n //His profile\n return $userSlug === $linkSlug ? 2 : 1;\n }\n }\n }\n //Profile navigation match\n return 1;\n }\n //Basic navigation match\n return 1;\n }\n\n //Support accountSettings route\n if (count($reqNav) > 3 && $reqNav[2] == 'account' && $reqNav[3] == 'settings') {\n return 2;\n }\n return false;\n }", "function setPath() {\n\n // Wp installation path\n $wp_install_path = str_replace( 'http://' . $_SERVER['HTTP_HOST'], '', site_url());\n\n // Set the instance starting path\n $this->path = $wp_install_path . App::getOption('path');\n\n // Grab the server-passed \"REQUEST_URI\"\n $this->current_uri = $this->request->server()->get('REQUEST_URI');\n\n // Remove the starting URI from the equation\n // ex. /wp/cocoon/mypage -> /mypage\n $this->request->server()->set(\n 'REQUEST_URI', substr($this->current_uri, strlen($this->path))\n );\n\n }", "public function initialize()\n {\n parent::initialize();\n $nav_selected = [\"system_settings\"];\n $this->set('nav_selected', $nav_selected);\n }", "public static function setPath($path)\n {\n }", "function activatePages()\n\t{\n\t\tglobal $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilLMPage.php\");\n\t\tif (is_array($_POST[\"id\"]))\n\t\t{\n\t\t\t$act_items = array();\n\t\t\t// get all \"top\" ids, i.e. remove ids, that have a selected parent\n\t\t\tforeach($_POST[\"id\"] as $id)\n\t\t\t{\n\t\t\t\t$path = $this->tree->getPathId($id);\n\t\t\t\t$take = true;\n\t\t\t\tforeach($path as $path_id)\n\t\t\t\t{\n\t\t\t\t\tif ($path_id != $id && in_array($path_id, $_POST[\"id\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$take = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($take)\n\t\t\t\t{\n\t\t\t\t\t$act_items[] = $id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t\tforeach($act_items as $id)\n\t\t\t{\n\t\t\t\t$childs = $this->tree->getChilds($id);\n\t\t\t\tforeach($childs as $child)\n\t\t\t\t{\n\t\t\t\t\tif (ilLMObject::_lookupType($child[\"child\"]) == \"pg\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$act = ilLMPage::_lookupActive($child[\"child\"],\n\t\t\t\t\t\t\t$this->content_object->getType());\n\t\t\t\t\t\tilLMPage::_writeActive($child[\"child\"],\n\t\t\t\t\t\t\t$this->content_object->getType(), !$act);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ilLMObject::_lookupType($id) == \"pg\")\n\t\t\t\t{\n\t\t\t\t\t$act = ilLMPage::_lookupActive($id,\n\t\t\t\t\t\t$this->content_object->getType());\n\t\t\t\t\tilLMPage::_writeActive($id,\n\t\t\t\t\t\t$this->content_object->getType(), !$act);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tilUtil::sendFailure($lng->txt(\"no_checkbox\"), true);\n\t\t}\n\t\t\n\t\t$this->ctrl->redirect($this, \"view\");\n\t}", "public function setActive($value) {\n\t\t$this->_active = $value;\n\t}", "function set($path, $value)\n\t\t{\n\t\t\t$this->Init();\n\t\t\t$path = explode(\"/\", $path);\n\t\t\t$pointer = end($path);\n\t\t\t$tmp = $value;\n\t\t\twhile($pointer){\n\t\t\t\tif (!empty($pointer)){\n\t\t\t\t\t$tmp = array($pointer=>$tmp);\n\t\t\t\t\t$pointer = prev($path);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->settings = array_merge_recursive_overwrite($this->settings, $tmp);\n\t\t\t$this->saveSettings();\n\t\t}", "function set_active_nav_class ($classes, $item) {\n if (in_array('current-menu-item', $classes) ){\n $classes[] = 'activemenu ';\n }\n return $classes;\n}", "public function __construct($paths) \n { \n $this->addPaths((array) $paths);\n }", "function set_path($dot_path)\n\t{\n\t\t$this->path = explode('.', $dot_path);\n\t\treturn $this;\n\t}", "public function setPath( $path );", "public function setPath( $val ) { $this->__set('path', $val); }", "private static function setLookupPath(Array $paths = null) {\n self::definePathConstants();\n\n // set default lookup paths\n self::$lookup_path = array(\n EFC_WEBAPP_PATH . \"config/\",\n EFC_WEBAPP_PATH . \"_lib/\",\n EFC_WEBAPP_PATH . \"_lib/model/\",\n EFC_WEBAPP_PATH . \"_lib/dao/\",\n EFC_WEBAPP_PATH . \"_lib/extlib/facebook/src/Facebook\",\n EFC_WEBAPP_PATH . \"_lib/extlib/EFC/\",\n EFC_WEBAPP_PATH . \"_lib/extlib/Upload1/\",\n EFC_WEBAPP_PATH . \"_lib/controller/\",\n EFC_WEBAPP_PATH . \"_lib/exceptions/\"\n );\n\n // set default lookup path for special classes\n //self::$special_classes [\"Smarty\"] = EFC_WEBAPP_PATH . \"_lib/extlib/smarty-3.1.27/libs/Smarty.class.php\";\n self::$special_classes [\"Smarty\"] = EFC_WEBAPP_PATH . \"_lib/extlib/Smarty-2.6.28_bk/libs/Smarty.class.php\";\n\n if (isset($paths)) {\n foreach($paths as $path) {\n self::$lookup_path[] = $path;\n }\n }\n }", "protected function active(array $nav)\n {\n // check if each item is active\n foreach ($nav as $key => $value) {\n // check if it is local\n if (isset($value['slug'])) {\n // if the request starts with the slug\n if ($this->request->is($value['slug']) || $this->request->is($value['slug'].'/*')) {\n // then the navigation item is active, or selected\n $nav[$key]['active'] = true;\n } else {\n // then the navigation item is not active or selected\n $nav[$key]['active'] = false;\n }\n } else {\n // then the navigation item is not active or selected\n $nav[$key]['active'] = false;\n }\n }\n\n // spit out the nav bar array at the end\n return $nav;\n }", "function activeLink($name=null,$tree=false)\n {\n\n\n\n if ( $tree and $name == 'setup' )\n {\n\n $setupArray = ['client-types','resources','teams','costs'];\n\n if ( in_array(request()->segment(1) ,$setupArray) )\n {\n return 'active selected';\n }\n return '';\n\n\n }\n\n if ( $tree and $name == 'reports' )\n {\n $reportArray = ['opportunity-report','activity-report','proposal-report','invoice-report'];\n\n if ( in_array(request()->segment(1) ,$reportArray) )\n {\n return 'active selected';\n }\n return '';\n\n\n }\n\n if ( !is_null($name) and request()->segment(1) == $name )\n {\n if ( $tree )\n {\n return 'current-page';\n }\n\n return 'active selected';\n }\n\n\n }", "public function setPath($path){ }", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath( $path )\n\t{\n\t\t$this->path = $path;\n\t\t$this->modified = true;\n\t}", "protected function pathInit(): void\n {\n [$path, $regExp] = $this->pathExtract();\n $this->path = null;\n\n if ($path) {\n $this->path = new Path($this->getDefaultRegex(), $path, $regExp);\n }\n }", "public function SetPath($path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function menu_set_active_menu_names($menu_names = NULL)\n {\n return menu_set_active_menu_names($menu_names);\n }", "function make_nav(Collection $tree, $activeItemKey = null, &$active = null)\n{\n if (!$tree->count()) return null;\n\n return array_map(function ($item) use ($activeItemKey, &$active) {\n $data = array();\n\n $childActive = false;\n $data['items'] = make_nav($item->children, $activeItemKey, $childActive);\n\n if ($activeItemKey !== null)\n {\n $childActive |= $activeItemKey == $item->getKey();\n }\n\n $active |= $childActive;\n\n $data['active'] = $childActive;\n\n foreach (array('url', 'label') as $key) {\n $getter = 'getNav'.ucfirst($key);\n\n $data[$key] = $item->$getter();\n }\n\n return $data;\n\n }, $tree->all());\n}", "public function setContextPath($path) {\n\t\t\n\t}", "public function setPath($path = '');", "public function setPath($path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function reset() {\n $this->_path = array();\n }", "public function setup_selected() {\n\t}", "function setControllersPath($path) {\r\n $path .= DIRSEP;\r\n if (is_dir($path) == false) {\r\n throw new Exception ('Invalid controller path: `' . $path . '`');\r\n }\r\n $this->controllers_path = $path;\r\n }", "public function setPathPaginator($path = null)\n {\n if (!empty($path)) {\n $this->pathPaginator = $path;\n } else {\n $this->pathPaginator = APP_PATH . '/views/paginator/';\n }\n }", "public function setPath($path)\r\n\t{\r\n\t\t$this->path=$path;\r\n\t}" ]
[ "0.7670741", "0.6055043", "0.6027986", "0.60199827", "0.59185576", "0.58939", "0.58446544", "0.5830831", "0.58211106", "0.57983005", "0.5781538", "0.5781538", "0.5747529", "0.571498", "0.56703293", "0.56703293", "0.5627849", "0.5583414", "0.55787563", "0.55007374", "0.5483727", "0.54793334", "0.54343563", "0.537792", "0.53762573", "0.53375185", "0.53122944", "0.531087", "0.5299815", "0.5272137", "0.52458", "0.5233122", "0.519505", "0.51917654", "0.51830107", "0.51709855", "0.5145704", "0.5122231", "0.5040291", "0.5036594", "0.50168836", "0.5015121", "0.4996814", "0.4957215", "0.4944074", "0.49381393", "0.4929604", "0.49261436", "0.49157253", "0.49140212", "0.48977044", "0.48795885", "0.48767367", "0.48758712", "0.4855676", "0.48508862", "0.48439482", "0.4838857", "0.48372015", "0.48173144", "0.4806071", "0.4767727", "0.476308", "0.47609824", "0.47602755", "0.47581497", "0.47576314", "0.4753939", "0.47321433", "0.47264504", "0.47237405", "0.47231436", "0.4714035", "0.47083673", "0.47067356", "0.4705701", "0.47027853", "0.47009906", "0.4700953", "0.4699467", "0.469651", "0.46927333", "0.46915033", "0.46864527", "0.46864527", "0.46864527", "0.46864527", "0.46838412", "0.46823055", "0.4680617", "0.46773404", "0.4676564", "0.46703807", "0.46675786", "0.46631512", "0.46518058", "0.46514037", "0.46473125", "0.4641822", "0.46392706" ]
0.77386045
0
Get the active paths previously set.
public function getActivePaths(): array { return $this->activePaths; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getActivePaths()\n {\n return $this->activePaths;\n }", "public function getPaths()\n {\n return $this->_paths;\n }", "public function getPaths()\n {\n return $this->paths;\n }", "public static final function paths()\n {\n\treturn self::$_paths;\n }", "public function get_paths()\n\t{\n\t\tif ( ! ee()->session->cache(__CLASS__, 'paths'))\n\t\t{\n\t\t\t$paths = array();\n\t\t\t$upload_prefs = $this->get_file_upload_preferences(NULL, NULL, TRUE);\n\n\t\t\tif (count($upload_prefs) == 0)\n\t\t\t{\n\t\t\t\treturn $paths;\n\t\t\t}\n\n\t\t\tforeach ($upload_prefs as $row)\n\t\t\t{\n\t\t\t\t$paths[$row['id']] = $row['url'];\n\t\t\t}\n\n\t\t\tee()->session->set_cache(__CLASS__, 'paths', $paths);\n\t\t}\n\n\t\treturn ee()->session->cache(__CLASS__, 'paths');\n\t}", "static function getPaths()\n {\n return self::$paths;\n }", "public function getPaths(): array\n {\n return $this->paths;\n }", "public function getPaths(): array\n {\n return $this->paths;\n }", "public function getSwitchPaths()\n {\n return $this->switchPaths;\n }", "public function getPaths();", "final public function get_paths() {\n return array();\n }", "public static function paths() {\n\t\tif (is_null(static::$paths)) {\n\t\t\tstatic::$paths = new ApplicationPathProvider();\n\t\t}\n\n\t\treturn static::$paths;\n\t}", "public function paths(){\n\t\treturn array_map(function($item){ return $item[0];}, $this->added);\n\t}", "public function getPath(): array\r\n {\r\n return $this->path;\r\n }", "public function get_arrPathItems()\n {\n return $this->arrPathItems;\n }", "public function getPathSegments () {\n return $this->pathSegments;\n }", "public function getArray() {\n return $this->_path;\n }", "public function getPath() {\n\t\tforeach ($this->aPoints as $intPoint) {\n\t\t\t$this->fillFullPath($intPoint, $intPoint);\n\t\t}\n\t\treturn $this->aFullPathes;\n\t}", "protected static function getPathsInternal() {}", "public function getPreferencePaths()\n {\n return $this->getHelper()->getPreferences($this);\n }", "public function getPaths()\n {\n return array_map(function (ScriptBranch $branch) {\n return $branch->getPath();\n }, $this->descriptorMap);\n }", "public function incomingPaths()\n {\n return $this->hasMany(Path::class, 'last_node_id','id');\n }", "public function getCurrentPath()\n {\n return $this->path;\n }", "public function getAllPaths(): array\n {\n return [\n 'all_users_profile' => $this->getAllUsersProfilePath(),\n 'app_data' => $this->getAppDataPath(),\n 'com_spec' => $this->getComSpecPath(),\n 'common_program_files' => $this->getCommonProgramFilesPath(),\n 'common_program_files_x86' => $this->getCommonProgramFilesX86Path(),\n 'driver_data' => $this->getDriverDataPath(),\n 'home_drive' => $this->getHomeDrivePath(),\n 'home' => $this->getHomePath(),\n 'local_app_data' => $this->getLocalAppDataPath(),\n 'logon_server' => $this->getLogonServerPath(),\n 'one_drive' => $this->getOneDrivePath(),\n 'path' => $this->getPath(),\n 'program_data' => $this->getProgramDataPath(),\n 'program_files' => $this->getProgramFilesPath(),\n 'program_files_x86' => $this->getProgramFilesX86Path(),\n 'public' => $this->getPublicPath(),\n 'system_drive' => $this->getSystemDrivePath(),\n 'system_root' => $this->getSystemRootPath(),\n 'temp' => $this->getTempPath(),\n 'user_profile' => $this->getUserProfilePath(),\n 'win_dir' => $this->getWindirPath(),\n ];\n }", "public function getPath(): array;", "public function getAvailablePaths()\n {\n $paths = [];\n $datasources = array_reverse($this->datasources);\n foreach ($datasources as $datasource) {\n $paths = array_merge($paths, $datasource->getAvailablePaths());\n }\n return $paths;\n }", "public function get_active_routes(){\n\t\n\t\t$route = reset($this->routes);\n\t\tdo {\n\t\t\t$result = str_starts(strtolower(trim($route['path'])).'/', '/'.ROUTE.'/') ? true : false;\n\t\t\t$current_route = $route;\n\t\t\t$route = next($this->routes);\n\t\t} while ($result === false && $route !== false );\n\t\tif ($result) { $this->route_to_controller = $current_route;}\n\t\n\t\treturn $this->route_to_controller;\n\t\n\t}", "public function get_all_active_plugins_paths() {\n\t\tglobal $jetpack_autoloader_activating_plugins_paths;\n\n\t\t$active_plugins_paths = $this->get_active_plugins_paths();\n\t\t$multisite_plugins_paths = $this->get_multisite_plugins_paths();\n\t\t$activating_plugins_paths = $this->get_plugins_activating_via_request();\n\n\t\treturn array_unique(\n\t\t\tarray_merge(\n\t\t\t\t$active_plugins_paths,\n\t\t\t\t$activating_plugins_paths,\n\t\t\t\t$multisite_plugins_paths,\n\t\t\t\t(array) $jetpack_autoloader_activating_plugins_paths\n\t\t\t)\n\t\t);\n\t}", "protected function get_active_plugins_paths() {\n\t\t$plugin_slugs = (array) get_option( 'active_plugins', array() );\n\t\t$plugin_slugs = array_filter( $plugin_slugs, array( $this, 'is_directory_plugin' ) );\n\t\treturn array_map( array( $this, 'create_plugin_path' ), $plugin_slugs );\n\t}", "public function getLoadPaths()\n {\n return $this->loadPaths;\n }", "public function getPath() {\n\t\treturn $this->current_path;\n\t}", "public function getPaths($key = false)\n {\n if ($key) {\n return $this->__paths[$key];\n }\n\n return $this->__paths;\n }", "public function getHandledPaths();", "public function get_current_path() {\n $current_path = \\Drupal::service('path.current')->getPath();\n $result = \\Drupal::service('path_alias.manager')->getAliasByPath($current_path);\n\n return $result;\n }", "public function fetchPath()\n {\n $path = array();\n foreach ($this->forumNode()->fetchPath() as $item)\n {\n $path[] = array(\n 'url' => $item->urlAlias(),\n 'text' => $item->Name\n );\n }\n \n $path[] = array(\n 'url' => $this->forumNode()->urlAlias(),\n 'text' => $this->forumNode()->Name\n );\n \n $path[] = array(\n 'url' => $this->urlAlias(),\n 'text' => $this->attribute('name')\n );\n \n return $path;\n }", "public function get_path()\n\t{\n\n\t\t$lft_col = $this->left_column;\n\t\t$rgt_col = $this->right_column;\n\t\t\n\t\t//$this->model->where($this->scope_column,$this->get_scope());\n\t\t$this->model->where($lft_col . ' <= '.$this->model->$lft_col . ' AND ' . $rgt_col . ' >=' .$this->model->$rgt_col . ' ORDER BY '.$lft_col);\n\n\t\treturn $this->model->find_all(); \n\n\t}", "protected function getSetupPaths()\n\t{\n\t\treturn $this->paths;\n\t}", "public function getPath(): ?array\n {\n return $this->path;\n }", "public function getSearchPaths()\n {\n return $this->searchPaths;\n }", "public function\n\tGetPathArray():\n\t?Array {\n\n\t\tif(!$this->Path)\n\t\treturn NULL;\n\n\t\treturn explode('/',trim($this->Path,'/'));\n\t}", "public function getLocalPaths()\n {\n return array_map(\n function (LocalResource $r) { return $r->getLocalPath(); },\n $this->toArray()\n );\n }", "function getPaths()\n {\n return require 'paths.php';\n }", "public function paths(Source $source = null) {\n\t\tif ($source) {\n\t\t\t$this->applyStrategy($source);\n\t\t}\n\t\treturn $this->_paths;\n\t}", "public function getPath()\n\t{\n\t\t\n\t\t$this->setPath();\n\t\treturn $this->path;\n\t\t\n\t}", "public function includedPaths()\n {\n if ($this->includedPaths === null) {\n return $this->defaultIncludedPaths();\n }\n\n return $this->includedPaths;\n }", "public function get_active_relations() {\n\t\t\treturn $this->_active_relations;\n\t\t}", "public function getPaths(bool $useNullOnEmptyPaths = FALSE): ?array {\n\t\treturn count($this->paths) ? $this->paths : ($useNullOnEmptyPaths ? NULL : []);\n\t}", "public function getBasePaths($sType = null, $blActive = true) {\n if (empty($this->aBasePaths[$blActive ? 'active' : 'all'])) {\n $sDs = DIRECTORY_SEPARATOR;\n $sLibPath = self::getLibPath();\n $aBasePaths = array(); \n foreach ($this->glob($sLibPath . 'Codepool' . $sDs . '*', GLOB_ONLYDIR) as $sBasePath) {\n $sExtension = basename($sBasePath);\n $aSubPaths = $this->glob($sBasePath . $sDs . '*', GLOB_ONLYDIR);\n $aSubPaths = is_array($aSubPaths) ? $aSubPaths :array();\n foreach ($aSubPaths as $sSubPath) {\n $aBasePaths[$sExtension . '_' . basename($sSubPath)] = $sSubPath;\n }\n }\n ksort($aBasePaths);\n $aBasePaths = $this->getClasses($aBasePaths, $blActive);\n// if(class_exists('dBug',false)){new dBug($aBasePaths,'',true);}else{/*echo'<textarea>'.print_r($aBasePaths,true).'</textarea>';*/}\n $this->aBasePaths[$blActive ? 'active' : 'all'] = $aBasePaths;\n }\n if ($sType === null) {\n return $this->aBasePaths[$blActive ? 'active' : 'all'];\n } else {\n return isset($this->aBasePaths[$blActive ? 'active' : 'all'][$sType]) ? $this->aBasePaths[$blActive ? 'active' : 'all'][$sType] : array();\n }\n }", "public function getInputPaths ()\n {\n return $this->paths;\n }", "protected function getCurrentAll()\n {\n return $this->current;\n }", "public function getPathList() {\n \n $path_list = '';\n foreach($this->_path as $path) {\n $path_list .= '<li>' . $path . '</li>'; \n }\n\n return $path_list;\n }", "public static function getPathParams() {\n return isset(self::$pathParams)\n ? self::$pathParams\n : (self::$pathParams = self::parsePath(\n self::getPath(),\n self::getScopeList()));\n\t}", "function getPath() {\n\t\treturn $this->path;\n\t}", "abstract public function getCurrentPath();", "public function getArrPath() : array {\n $v = [];\n return $this->_getArrPath($v);\n }", "public function all()\n {\n // 返回各addon的绝对路径\n return array_unique(\n array_merge(\n $this->core(),\n $this->configured()\n )\n );\n }", "public function fetch_path()\n\t{\n\t\treturn $this->route_stack[self::SEG_PATH];\n\t}", "public function getPaths()\n\t{\n\t\treturn [\n '/containers/winnative/api/context',\n\t\t];\n\t}", "public function setActivePaths(array $paths)\n {\n $this->activePaths = $paths;\n }", "public function current() {\n return current($this->_path);\n }", "public function getModelsUsingPaths()\n {\n return $this->_modelsUsingPath;\n }", "function getPaths()\n {\n $paths = array();\n foreach ($this->names as $name) {\n $paths[] = $this->dir.$name.$this->ext;\n }\n return $paths;\n }", "private function _getRequestPaths()\n {\n $paths = array();\n \n // Find maxPages with the ceil of the total properties / the maximum\n // pageSize\n $maxPages = ceil($this->getTotal() / $this->getMaxPageSize());\n \n // Use plus one as the first page will have already be requested\n for ($i = $this->getPage() + 1; $i <= $maxPages; $i++) {\n $paths[] = $this->getRequestPath($i, $this->getMaxPageSize());\n }\n \n return $paths;\n }", "private function _getResult(){\r\n\r\n $position = $this->_startPoint;\r\n $tile = $this->_getTile($position);\r\n $path[] = $position;\r\n\r\n while(!$this->_checkEnd($position)){\r\n $direction= $tile->getLastMove();\r\n $position = $this->_getNewPosition($position,$direction);\r\n $tile = $this->_getTile($position);\r\n $path[] = $position;\r\n }\r\n\r\n return $path;\r\n }", "protected function uniquePaths()\n {\n return [\n $this->newPath(),\n $this->newPath(\"../{$this->handle}.yaml\"),\n ];\n }", "public function getPath() {\n\t\treturn $this->path;\n\t}", "public function getPath() {\n\t\treturn $this->path;\n\t}", "public function getPath()\n {\n return $this->__get(\"path\");\n }", "public function getPath()\n\t{\n\t\treturn $this->_path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->_path;\n\t}", "public function getPath() { return $this->_path; }", "public function path() {\n\t\treturn $this->_path;\n\t}", "public function getPath(){\n\t\treturn $this->path;\n\t}", "public function getPath()\n {\n return $this->_path;\n }", "public function getPath()\n {\n return $this->_path;\n }", "public function getPath()\n {\n return $this->_path;\n }", "public function getUnwantedPath() : array\n {\n return $this->unwantedPath;\n }", "function getCurTrackPath(){\n\n\t}", "function _paths($plugin = null, $cached = true) {\n\t\t$paths = parent::_paths($plugin, $cached);\n\n\t\tif (!empty($this->theme)) {\n\t\t\t$count = count($paths);\n\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t $themes = (array)$this->theme;\n\t\t\t $countThemes = count($themes);\n\t\t\t for ($j = 0; $j < $countThemes; $j++) {\n\t\t\t $themePaths[] = $paths[$i] . 'themed'. DS . $themes[$j] . DS;\n\t\t\t }\n\t\t\t}\n\t\t\t$paths = array_merge($themePaths, $paths);\n\t\t}\n\n\t\tif (empty($this->__paths)) {\n\t\t\t$this->__paths = $paths;\n\t\t}\n\t\t\n\t\treturn $paths;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "protected function getPaths()\n {\n $directory = new RecursiveDirectoryIterator($this->getMigrationPath());\n $iterator = new RecursiveIteratorIterator($directory);\n $paths = [];\n foreach ($iterator as $info) {\n if ($info->isDir()) {\n $paths[] = $info->getPath();\n }\n }\n\n return array_unique($paths);\n }", "public function getCurrentPathNumber() {\r\n return $this->num_path_current;\r\n }", "private function getPath()\n {\n return $this->path;\n }", "function getPath( )\r\n\t{\r\n\t\treturn $this->path;\r\n\t}", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function getPath()\r\n\t{\r\n\t\treturn $this->path;\r\n\t}", "public function getPath()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('path');\n }", "public static function getActive() {\n return new FileStorage(config_get_config_directory(CONFIG_ACTIVE_DIRECTORY));\n }", "protected static function getCacheStateFiles()\n {\n return array_map(array('static', 'getCacheStateIndicatorFileName'), static::$steps);\n }", "public function getActive()\n {\n return $this->get(self::_ACTIVE);\n }", "public function getSeriesPath() : array {\n return $this->seriesPath;\n }", "public function getPath() {\n return $this->path;\n }", "public function getPath() {\n return $this->path;\n }", "public function getPath() {\n return $this->path;\n }", "public function getPath() {\n return $this->path;\n }", "public function getPath() {\n return $this->path;\n }" ]
[ "0.88488114", "0.70157623", "0.69396144", "0.68425727", "0.68381935", "0.672798", "0.6540551", "0.6540551", "0.6521714", "0.6469746", "0.64147973", "0.6358056", "0.6334045", "0.6322508", "0.63079894", "0.6160001", "0.61055475", "0.60270005", "0.59959954", "0.59805113", "0.59692514", "0.59678906", "0.5965316", "0.5919787", "0.59039074", "0.5895364", "0.588317", "0.5858495", "0.58550066", "0.5834696", "0.58303934", "0.5789404", "0.5746171", "0.57132554", "0.5713041", "0.57106847", "0.5699447", "0.5697354", "0.56926936", "0.56871015", "0.56783915", "0.56569433", "0.5651564", "0.5647175", "0.56447566", "0.5631118", "0.5628189", "0.5628061", "0.56030095", "0.5602818", "0.5574002", "0.55734736", "0.55659723", "0.55590004", "0.55537426", "0.55329055", "0.55282915", "0.5527357", "0.5508178", "0.5497383", "0.5496008", "0.5489435", "0.5459652", "0.5458459", "0.54547197", "0.5454004", "0.5454004", "0.54494196", "0.54486805", "0.54486805", "0.5438384", "0.54363483", "0.543088", "0.5415031", "0.5415031", "0.5415031", "0.5406271", "0.54058826", "0.5400212", "0.5399456", "0.5399456", "0.5399456", "0.5399456", "0.5397686", "0.53975517", "0.5391956", "0.5386894", "0.5383465", "0.5383465", "0.53798926", "0.53661275", "0.5357366", "0.5345587", "0.534438", "0.533921", "0.5336566", "0.5336566", "0.5336566", "0.5336566", "0.5336566" ]
0.8424045
1
Checks if the provided path is to be considered as active.
public function isActivePath(string $path): bool { return \in_array($path, $this->activePaths, true) || $this->requestStack->getCurrentRequest()->getRequestUri() === $path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isActivePath($path)\n {\n return in_array($path, $this->activePaths) || $path === $this->container->get('request')->getRequestUri();\n }", "public function isPagePathActive($pathToPage) {\n if ($pathToPage == '') {\n return false;\n }\n\n $pathToPage = str_replace('//', '/', $pathToPage . '/');\n return substr($this->currentPagePath . '/', 0, strlen($pathToPage)) == $pathToPage;\n }", "public function is_active();", "public function valid() {\n return ( current($this->_path) !== false );\n }", "public function activeNavigation($path)\n {\n $uri = $this->request->getMasterRequest()->getPathInfo();\n $reqNav = explode('/', $uri);\n $nav = explode('/', $path);\n\n if (count($reqNav) > 2 && count($nav) > 2 && $reqNav[2] === $nav[2]) {\n if ($reqNav[2] === 'people') {\n if ($this->tokenStorage->getToken()) {\n $token = $this->tokenStorage->getToken();\n if ($token) {\n $user = $token->getUser();\n if ($user instanceOf User) {\n $linkSlug = $reqNav[count($reqNav) - 1];\n $userSlug = $user->getProfile()->getSlug();\n //His profile\n return $userSlug === $linkSlug ? 2 : 1;\n }\n }\n }\n //Profile navigation match\n return 1;\n }\n //Basic navigation match\n return 1;\n }\n\n //Support accountSettings route\n if (count($reqNav) > 3 && $reqNav[2] == 'account' && $reqNav[3] == 'settings') {\n return 2;\n }\n return false;\n }", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "function set_active($path, $active = 'active')\n{\n return Request::is($path) ? $active : '';\n}", "protected function isUrlActive()\n {\n $route = Url::route($this->url);\n if($route) return App::router()->getCurrent()->matches($route);\n return false;\n }", "function isActive($path, $active = 'active nav-active nav-expanded'){\n return call_user_func_array('Request::is', (array)$path) ? $active : '';\n}", "function set_active($path, $active = 'active') {\n\n return call_user_func_array('Request::is', (array)$path) ? $active : '';\n\n}", "public function has($path)\n {\n return $this->findByLocation($path) !== null;\n }", "protected function is_service_allowed($path) {\n\t\treturn true;\n\t}", "public function has($path);", "public static function isActiveRoute()\n {\n return \\Route::currentRouteName() === static::routeName();\n }", "public function hasPath(string $path) : bool {\n\t\t\treturn ($this->getValue($path) !== null);\n\t\t}", "public function isValidPathReturnsTrueIfPathExists() {}", "public function isActive(): bool {\n if (App::getClassStatus() == App::STATUS_INITIALIZING) {\n return true;\n }\n\n $routeUri = Router::getUriObjByURL(Request::getRequestedURI());\n\n if ($routeUri !== null) {\n $routeType = $routeUri->getType();\n } else {\n $routeType = Router::VIEW_ROUTE;\n }\n\n return $routeType == Router::API_ROUTE || (defined('API_CALL') && API_CALL === true);\n }", "public function check( $path = null ) {\n\t\t//we can reuse wordpress function here.\n\t\tif ( is_null( $path ) ) {\n\t\t\t$path = WD_Utils::retrieve_wp_config_path();\n\t\t}\n\t\t$is_debug_on = $this->is_debug_on( $path );\n\t\tif ( $is_debug_on === false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$is_display_on = $this->is_display_on( $path );\n\t\tif ( $is_display_on === 0 ) {\n\t\t\t//debug is one, but the display defined & turn off\n\t\t\treturn true;\n\t\t}\n\n\t\t//if till here, mean the display defined and on, or doesn't\n\t\treturn false;\n\t}", "public static function isActivated ()\r\n {\r\n return Session::exists('acl');\r\n }", "public function isAvailable() {\n $path = $this->path();\n return file_exists($path);\n }", "public function is_plugins_active( $pl_file_path = NULL ){\r\n $installed_plugins_list = get_plugins();\r\n return isset( $installed_plugins_list[$pl_file_path] );\r\n }", "public function IsActive ();", "protected function validController($path) {\r\n return file_exists($path) && is_readable($path);\r\n }", "public function validatePath()\n {\n $path = $this->getFullPath();\n\n return\n strpos($path, $this->chrootDir) === 0\n && (strpos($path, '..') === false || !empty($this->path));\n }", "public static function isValidThreadPath( $path )\n\t{\n\t\treturn str::isString( $path ) && preg_match( '/^([^.]+\\.)*[^.]+$/', strval( $path ) );\n\t}", "public function isValidPath( string $path ) : bool {\n\t\treturn ( preg_match( ((object) self::$REGEX)->path, $path ) ) ? true : false ;\n\t}", "public function isAvailable(){\n\t\treturn is_dir($this->path);\n\t}", "protected static function isPermittedPath($path)\n {\n }", "public function exists($path)\n {\n }", "public function exists($path)\n {\n }", "public function exists($path)\n {\n }", "public function exists($path)\n {\n }", "public function exists($path)\n {\n }", "public function is_active(): bool;", "public function isValidPath($path)\n\t{\n\t\treturn $this->getPath() == rtrim($path,'/').'/';\n\t}", "public function has($path)\n {\n }", "public function isPath( string $path ): bool {\n\t\t\treturn (bool) @preg_match(\n\t\t\t\t'/^(.+)/([^/]+)$/',\n\t\t\t\t$path\n\t\t\t);\n\t\t}", "public static function exists($path)\n {\n }", "public function checkPathExists($path);", "public function checkIsPathExists($path);", "public function is_local( $path ){\r\n\r\n\t\tif ( count( explode( root, $path ) ) > 1 )\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\r\n\t}", "private static function checkPathState($path)\n {\n if (!file_exists($path)) {\n // try create\n if (!mkdir($path, 0755)) {\n return __('Directory does not exists (and cannot create)', 'tfuse');\n }\n }\n\n if (!is_writable($path)) {\n // try make writable\n if (!(@chmod($path, 0755))) {\n return __('Directory is not writable (and cannot make writable)', 'tfuse');\n }\n }\n\n return true;\n }", "function is_active()\n {\n }", "private function isAuthRequiredForPath($path)\n {\n\t\t$path_arr = explode('/', $path);\n\t\t$path_new = implode('/', array_slice($path_arr, 0, 3));\n\t\t\n return in_array($path_new, [\n\t\t]);\n }", "public function is_active( $curr ){\n\t\t$bypass_list = self::get_option( 'bypass_list', array() );\n\t\treturn ! in_array( $curr, $bypass_list );\n\t}", "public function isPathDefined()\n {\n if (isset($this->path)) {\n // Make sure there's no forward slashes in the front (beginning) of the path string\n return ltrim($this->path, \"/\");\n }\n return false;\n }", "public function isActive()\n {\n\n return is_readable($this->_getFontPath());\n\n }", "public function exists($path);", "public function isActive (Request $request)\n {\n //debug ($this->method);\n //debug($request->getMethod());\n //debug ($this->getPattern(), $this->path);\n if ($this->method!==null && $this->method!=$request->getMethod())\n {\n return false;\n }\n\n if (\n ($request->getPath()==='/' && $this->path==='/') ||\n preg_match($this->getPattern(), $request->getPath())===1\n )\n {\n //Maybe filter compiration must be before regex match?\n //If it will be cost effective\n if (is_array($this->filters) && count($this->filters))\n {\n foreach ($this->filters as $name => $options)\n {\n $filter = Route::getFilter($name);\n if (!$filter($this, $request, $options))\n {\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }", "static function inPath () {\n return strrpos(\n self::instance()->current_uri, \n self::instance()->path, \n -strlen(self::instance()->current_uri)\n ) !== false;\n }", "public function __isset(string $path) : bool\n {\n return $this->exists($path);\n }", "public function exists($path)\n {\n return $this->driver->exists($path);\n }", "public static function check(&$path) {\n\n Log::in(\"Passthru check\");\n\n /* If we are in checkout mode, we always pass through */\n if ( PassThru::checkoutMode() === true ) {\n \tLog::out(\"passthru - check - we are in checkout mode\");\n \t/* Ok, we have passthru, mangle the path from\n * mount point relative as supplied by FUSE into\n * a real path.\n */\n \t$path = PassThru::$_realPath.$path;\n return true; \t\n }\n \n /* Check for directories, If non set return */\n If ( !PassThru::$_passThruSet) return false;\n\n /* Otherwise check for them */\n foreach ( PassThru::$_passThru as $passpath) {\n\n if ( strstr($path, $passpath) ) {\n\n /* Ok, we have passthru, mangle the path from\n * mount point relative as supplied by FUSE into\n * a real path.\n */\n $path = PassThru::$_realPath.$path;\n return true;\n }\n\n }\n\n Log::out(\"Passthru check\");\n return false;\n\n }", "public static function is_plugin_active( $plugin_file_path ) {\n\t\tif ( ! function_exists( 'is_plugin_active' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\t\t}\n\n\t\treturn is_plugin_active( $plugin_file_path );\n\t}", "public function pathExists($path)\n {\n $url = $_ENV['app_frontend_url'] . self::URL . '?path=' . urlencode($path);\n $curl = $this->transport;\n $curl->write($url, [], CurlInterface::GET);\n $result = $curl->read();\n $curl->close();\n\n return strpos($result, 'path exists: true') !== false;\n }", "public static function isExpired($path)\n {\n }", "public static function check($path)\n\t\t{\n\t\t\treturn file_exists($path);\n\t\t}", "public static function checkActive () {\n\t\tif ( trim( session_id() ) == FALSE ) {\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function has(string $path): bool;", "public function has(string $path): bool;", "function isActive()\n {\n if ( $this->getVar( 'level' ) == 0 ) {\n return false;\n }\n return true;\n }", "public function isActivated() {}", "public function has($path) {\n\t\treturn isset($_COOKIE[$path]);\n\t}", "protected function isActiveByRoutes()\r\n {\r\n if (!$this->routes_activate) return false;\r\n\r\n $route_name = request()->route()->getName();\r\n\r\n return in_array($route_name, $this->routes_activate);\r\n }", "public function isActive() {\n return (($page = Mage::registry('splash_page')) !== null) && $page->getId() === $this->getId();\n }", "public function pathExists($path);", "public function isActive(): bool\n {\n switch ($this->type) {\n\n case MenuPresenceType::GROUP:\n return false;\n\n case MenuPresenceType::ACTION:\n // Activity is based on named route match, unless specific match is defined\n return false;\n\n case MenuPresenceType::LINK:\n // Activity is based on URL match, unless specific match is defined\n return false;\n\n // Default omitted on purpose\n }\n\n return false;\n }", "public function has($path)\n {\n return !is_null($this->get($path));\n }", "protected function isActiveByUrls()\r\n {\r\n if (!$this->urls_activate) {\r\n return false;\r\n }\r\n\r\n //Check by string if string given\r\n if (!is_array($this->urls_activate)) {\r\n return request()->path() == $this->urls_activate || request()->url() == $this->urls_activate;\r\n }\r\n\r\n //Check by array if array given\r\n return in_array(request()->path(), $this->urls_activate) || request()->url() == $this->urls_activate;\r\n }", "public function isScanActive()\n {\n return $this->lastScan == 'active';\n }", "public function isActive() {}", "public function isActive() {}", "public function isActive() {}", "public function isActive() {}", "public function isActive() {}", "public function isActive() {}", "static public function supports($path);", "public function exists()\n {\n if (is_string($this->current_filepath)) {\n return is_file($this->current_filepath);\n }\n return false;\n }", "protected static function fileIsAccessible($path)\n {\n }", "public static function isExists($_path)\r\n {\r\n return file_exists($_path);\r\n }", "public function isActive();", "public function isActive();", "public function isActive();", "public function isActive();", "public function isActive()\n\t\t{\n\t\t\treturn $this->_state === 1;\n\t\t}", "private function shouldProcess($path) {\n\n //Handle something special\n return true;\n\n }", "public static function StagCatalog_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'stag-catalog/stag-catalog.php', self::$active_plugins ) || array_key_exists( 'stag-catalog/stag-catalog.php', self::$active_plugins );\n }", "public function hasStarted() {\n if($this->state != \"unavailable\" &&\n $this->state != \"available\") {\n \n return true;\n } else {\n return false;\n }\n }", "function is_active() {\n\t\treturn isset( $this->username ) && !empty( $this->username );\n\t}", "public function is_path_valid( $path ) {\n\n\t\t\t// no path configured for the deploy type\n\t\t\tif ( ! isset( $path ) ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Path not configured for the requested deploy type'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// path is empty\n\t\t\tif ( empty( $path ) ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Path empty for the requested deploy type'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// path doesn't exist\n\t\t\tif ( ! is_dir( $path ) ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Path does not exist for the requested deploy'\n\t\t\t\t);\n\t\t\t}\n\t\t}", "protected function isPageActive()\n {\n if($this->url->getTarget()->id == Page::id()) return true;\n return false;\n }", "public function isActive()\n\t{\n\t\treturn $this->Status === 'active';\n\t}", "function pathExists($path);", "function taxonomies_is_active_route(string $route = '', array $params = []): bool\n {\n if (is_array($params) && count($params) > 0) {\n $route = route($route, $params, false);\n $path = '/'. request()->decodedPath();\n\n return $route === $path;\n }\n\n if (request()->routeIs($route))\n return true;\n\n if (! $currentRoute = app()->router->currentRouteName())\n return false;\n\n if (! is_array($route))\n $route = [$route];\n\n if (in_array($currentRoute, $route))\n return true;\n\n return false;\n }", "public function isActive()\n {\n return (bool) ($this->_state == 'active');\n }", "public function exists($path) {\n return file_exists($path);\n }", "public static function Elementor_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'elementor/elementor.php', self::$active_plugins ) || array_key_exists( 'elementor/elementor.php', self::$active_plugins );\n }", "private function active(): bool\n {\n return session_status() === \\PHP_SESSION_ACTIVE;\n }", "public function check_added_path($path){\n\t\t$path = Url::resolve_relative($path);\n\t\tif(isset($this->added_paths[$path])){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.7911937", "0.6806912", "0.6340883", "0.62418836", "0.62279665", "0.6159145", "0.6159145", "0.6151744", "0.6147101", "0.60961384", "0.6091341", "0.60795814", "0.6031118", "0.60176647", "0.600204", "0.5997343", "0.5996634", "0.5991496", "0.5975198", "0.59614915", "0.59583294", "0.5942063", "0.5929992", "0.59226894", "0.5920786", "0.59178334", "0.59066164", "0.590316", "0.59005785", "0.59002", "0.59002", "0.59002", "0.58991426", "0.5898636", "0.5889947", "0.5879753", "0.58705187", "0.5858422", "0.58373344", "0.58266467", "0.58249927", "0.58019245", "0.57845145", "0.57836044", "0.577087", "0.57672423", "0.57669944", "0.5757053", "0.575629", "0.5755838", "0.5754652", "0.57517844", "0.5745459", "0.5741887", "0.57412034", "0.5739001", "0.5737985", "0.57326406", "0.5731949", "0.5721272", "0.5721272", "0.57199347", "0.57013315", "0.56888074", "0.5679368", "0.567357", "0.5673084", "0.5671645", "0.5669646", "0.56671864", "0.5665992", "0.566325", "0.566325", "0.5662765", "0.5662765", "0.5662765", "0.5662765", "0.5661797", "0.5660949", "0.56501615", "0.56478876", "0.56470656", "0.56470656", "0.56470656", "0.56470656", "0.5646809", "0.5633368", "0.5631899", "0.5631126", "0.56194127", "0.561782", "0.56079924", "0.55868214", "0.5581103", "0.5578487", "0.5571001", "0.55700797", "0.55700403", "0.55667776", "0.55631524" ]
0.7924501
0
/ pass thru based on extension ...parser>html>parse(...)
public function __get(string $extension) { $extension = $this->normalizeExtension($extension); if (!\array_key_exists($extension, $this->parsers)) { throw new ParserForExtentionNotFoundException($extension); } return $this->parsers[$extension]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseHTML(){\n\t\t$code = preg_replace_callback('~(href|src|codebase|url|action)\\s*=\\s*([\\'\\\"])?(?(2) (.*?)\\\\2 | ([^\\s\\>]+))~isx',array('self','parseExtURL'),$this->source);\n\t\t$code = preg_replace_callback('~(<\\s*style.*>)(.*)<\\s*/\\s*style\\s*>~iUs',Array('self','parseCSS'),$code);\n\t\t$code = preg_replace_callback('~(style\\s*=\\s*)([\\'\\\"])(.*)\\2~iUs',Array('self','parseStyle'),$code);\n\t\t$code = preg_replace_callback('~<script(\\s*.*)>(.*)<\\s*/\\s*script>~iUs',Array('self','parseScriptTag'),$code);\n\t\t$this->output = $code;\n\t}", "public function parse($html);", "public function parse($html);", "function _parseHtml($html)\n\t\t{\n\t\t\t$html=preg_replace(\"/<!DOCTYPE((.|\\n)*?)>/ims\",\"\",$html);\n\t\t\t$html=preg_replace(\"/<script((.|\\n)*?)>((.|\\n)*?)<\\/script>/ims\",\"\",$html);\n\t\t\tpreg_match(\"/<head>((.|\\n)*?)<\\/head>/ims\",$html,$matches);\n\t\t\t$head=$matches[1];\n\t\t\tpreg_match(\"/<title>((.|\\n)*?)<\\/title>/ims\",$head,$matches);\n\t\t\t$this->title = $matches[1];\n\t\t\t$html=preg_replace(\"/<head>((.|\\n)*?)<\\/head>/ims\",\"\",$html);\n\t\t\t$head=preg_replace(\"/<title>((.|\\n)*?)<\\/title>/ims\",\"\",$head);\n\t\t\t$head=preg_replace(\"/<\\/?head>/ims\",\"\",$head);\n\t\t\t$html=preg_replace(\"/<\\/?body((.|\\n)*?)>/ims\",\"\",$html);\n\t\t\t$this->htmlHead=$head;\n\t\t\t$this->htmlBody=$html;\n\t\t\treturn;\n\t\t}", "protected function parse() {}", "public function process($html);", "abstract public function parse ();", "public function parse();", "public function parse();", "public function parse();", "function parse ($html) {\n // TODO fix by shijp : 临时方案\n if (is_array($html)) {\n return $html;\n }\n\n // If there are no HTML tags, ignore it\n if (false === strpos($html, '<'))\n return $html;\n if (! preg_match(\"/<(?=[a-zA-Z\\/])/\", $html))\n return $html;\n\n $this->clear();\n return parent::parse($html);\n }", "public function parse( $contents );", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "private function parse ( ) {\n\t\t\t$this->parse_csv();\n\t\t\t\n\t\t\t// parse out the daily html\n\t\t\t$this->parse_html();\n\t\t\t\n\t\t}", "public function parse($content);", "function parseHtml($s_str)\r\n{\r\n$i_indicatorL = 0;\r\n$i_indicatorR = 0;\r\n$s_tagOption = \"\";\r\n$i_arrayCounter = 0;\r\n$a_html = array();\r\n// Search for a tag in string\r\nwhile( is_int(($i_indicatorL=strpos($s_str,\"<\",$i_indicatorR))) ) {\r\n// Get everything into tag...\r\n$i_indicatorL++;\r\n$i_indicatorR = strpos($s_str,\">\", $i_indicatorL);\r\n$s_temp = substr($s_str, $i_indicatorL, ($i_indicatorR-$i_indicatorL) );\r\n$a_tag = explode( ' ', $s_temp );\r\n// Here we get the tag's name\r\nlist( ,$s_tagName,, ) = each($a_tag);\r\n$s_tagName = strtoupper($s_tagName);\r\n// Well, I am not interesting in <br>, </font> or anything else like that...\r\n// So, this is false for tags without options.\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) && $s_tagOption[1];\r\nif( $b_boolOptions ) {\r\n// Without this, we will mess up the array\r\n$i_arrayCounter = (int)count($a_html[$s_tagName]);\r\n// get the tag options, like src=\"htt://\". Here, s_tagTokOption is 'src'and s_tagTokValue is '\"http://\"'\r\n\r\ndo {\r\n$s_tagTokOption = strtoupper(strtok($s_tagOption[1], \"=\"));\r\n$s_tagTokValue = trim(strtok(\"=\"));\r\n$a_html[$s_tagName][$i_arrayCounter][$s_tagTokOption] =\r\n$s_tagTokValue;\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) &&\r\n$s_tagOption[1];\r\n} while( $b_boolOptions );\r\n}\r\n}\r\nreturn $a_html;\r\n}", "public function parsePage($html){\n\t\t\tforeach($html->find(Configuration::getParameter(\"TAG_CLASS\")) as $become) {\n\t\t\t\tif($become->getAttribute(\"scope\") == \"\"){\n\t\t\t\t\tif($become->getAttribute(\"method\") != \"\"){\n\t\t\t\t\t\t$template = $become->innertext;\n\t\t\t\t\t\tif($template != \"\")\n\t\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($this, $become->getAttribute(\"method\")), $template);\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($this, $become->getAttribute(\"method\")));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$template = $become->innertext;\n\t\t\t\t\tif($template != \"\")\n\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($become->getAttribute(\"scope\"), $become->getAttribute(\"method\")), $template);\n\t\t\t\t\telse \n\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($become->getAttribute(\"scope\"), $become->getAttribute(\"method\")));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $html;\n\t\t}", "abstract public function parse(\\SHH\\Parser &$parser);", "protected function parse()\n {\n\n $crawler = new Crawler($this->originalHTML);\n\n $this->tableOfContents = $crawler->filter('body > nav')->html();\n $this->body = $crawler->filter('body > main')->html();\n\n $this->reformatTableOfContents();\n $this->reformatBody();\n }", "public function parse($body) {\n\t\tif($this->is_post) return $this->html_post;\n\t\t//call this line when header redirect\n\t\tif($this->is_redirect) return \"\";\n\t\t//call this line when error 404\n\t\tif($this->is_error_404) return \"\";\n\t\t\n\t\t//otherwise, run parser for the body\n\t\tforeach($this->parsers as $parser)\n\t\t\t$parser($body);\t//pass reference into parser\n\t\treturn $body;\n\t}", "protected function parseHtml() {\r\n\t\tif (is_array($this->cfg->html))\r\n\t\t\t$this->cfg->html = utils::render($this->cfg->html);\r\n\t}", "abstract function get_html();", "public static function parse() {\n if (\\CMS::$_vars[3] == 'submit') {\n switch (\\CMS::$_vars[2]) {\n case 'add':\n self::add_submit();\n break;\n \n case 'edit':\n self::edit_submit();\n break;\n }\n }\n\n\n /* Page Content Handlers */\n switch (\\CMS::$_vars[2]) {\n case 'add':\n self::$_pagemode = 'add';\n self::add();\n break;\n \n case 'edit':\n self::$_pagemode = 'edit';\n self::edit();\n break;\n \n case 'confirmdelete':\n self::$_pagemode = 'confirmdelete';\n self::confirmdelete();\n break;\n \n case 'delete':\n self::$_pagemode = 'delete';\n self::delete();\n break;\n \n \n case 'list':\n self::$_pagemode = 'listall';\n self::listall();\n break;\n \n default:\n self::$_pagemode = 'listall';\n self::listall(); \n }\n\n if (self::$_status) {\n \\Html::set('{status}', self::$_status);\n }else{\n \\Html::set('{status}', '');\n }\n }", "public abstract function get_html();", "public abstract function parse($text);", "function show_parsed(){ // parsing template (if needed) and showing the result of parsing\n\tif (isset($this->result)) echo $this->result;\n\telse {\n\t\t$this->parse();\n\t\techo $this->result;\n\t}\n}", "protected function _getParser() {}", "abstract protected function parse($data);", "protected function _parseTemplate() {}", "public function parse($url);", "private function parse()\n {\n $this->parseChildrenNodes($this->_dom, $this->_rootNode);\n }", "public function parse(): OptionPage;", "public function parse(string $content);", "public function parse(string $content);", "function parse()\n {\n $params=$this->layoutManager->getPluginParams(\"L\");\n $tLang=$params[\"lang\"];\n $el=$this->getSubElements();\n $id=$el[\"ID\"][\"text\"];\n $textNode=$el[\"C\"][\"node\"];\n $layoutContents=$textNode->contents;\n $nContents=count($layoutContents);\n if($nContents==0)\n return;\n\n $curVar=1;\n $phpCode=array();\n $newContents=array();\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n /* Supongamos una lista de layoutContents del tipo HTML - PHP - HTML : ej: a <?php echo \"p\";?> b\n * Para buscar la traduccion, hay que actuar como si fuera 1 solo layoutContent de tipo a %1 b\n * Por eso, el resultado debe ser 1 solo layoutcontent de tipo HTML, aunque dentro, contenga codigo php.\n * \n */\n $html=\"\";\n for($k=0;$k<$nContents;$k++)\n { \n if($layoutContents[$k][\"TYPE\"]==\"HTML\")\n {\n $html.=$layoutContents[$k][\"TEXT\"];\n }\n else\n {\n if($layoutContents[$k][\"TYPE\"]==\"PHP\")\n {\n $html.=\"{%\".$curVar.\"}\";\n $phpCode[$curVar]=$layoutContents[$k][\"TEXT\"];\n $curVar++;\n }\n else\n {\n // Se traduce el nodo HTML actual\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n // Se copia el nodo que hemos encontrado, tal cual (no es ni PHP ni HTML)\n $newContents[]=$layoutContents[$k];\n // Se crea el siguiente nodo HTML.\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n $html=\"\";\n $phpCode=array();\n $curVar=1;\n }\n \n }\n } \n // Al llegar aqui, nos queda el ultimo nodo HTML creado.Hay que parsearlo.\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n return $newContents;\n }", "public function parse($text);", "function parseHTML($url) {\n $html = getHTML($url);\n // php says this is some broken-ass html\n // attemtping to repair enough to make usable\n $dom = handleBrokenHTML($html);\n return simplexml_import_dom($dom);\n}", "public static function parse(){\n self::$time_start = self::time();\n if(self::$state != self::STATE_READY){\n self::$error = 'Parser is not in a ready stage, current state: '.self::$state;\n self::$state = self::STATE_ERROR;\n return false;\n }\n if(self::$body == ''){\n self::$state = self::STATE_ERROR;\n self::$error = 'Body is empty';\n return false;\n }\n self::$state = self::STATE_ACTIVE;\n \n $run = true;\n while($run){\n $found = false;\n $find_open = strpos(self::$body, PARSER_OPEN_TOKEN);\n if($find_open !== false){\n $find_close = strpos(self::$body, PARSER_CLOSE_TOKEN, $find_open);\n if($find_close !== false){\n $found = true;\n $tag = substr(self::$body, $find_open, (($find_close-$find_open)+strlen(PARSER_CLOSE_TOKEN)) );\n $content = self::parse_tag($tag);\n self::$body = str_replace($tag, $content, self::$body);\n }\n }\n if(!$found){\n $run = false;\n }\n }\n self::$state = self::STATE_PARSED;\n self::time_exec();\n }", "public function parse()\n\t{\n\t\t$this->parseGroups();\n\t\t$this->parseBadges();\n\t}", "public function parse()\n {\n $config = \\CB::getInstance()['pom'];\n $template = $this->tpl->getTemplate();\n $this->UID = 'v' . sha1(get_class(MVC\\Page::$current) . $template . serialize($this->vars) . \\CB::getSiteUniqueID());\n if (!empty($config['cacheEnabled']) && !$this->isExpired(true)) $this->pull(true);\n else\n {\n $ctx = $this->parseTemplate($this->prepareTemplate($template, $this->vars));\n $body = array_pop($ctx['controls']);\n if ($body)\n {\n if (!($body instanceof Body) || count($ctx['controls'])) throw new Core\\Exception($this, 'ERR_VIEW_5');\n $this->controls[$body->attr('id')] = $body;\n $this->commit();\n static::decodePHPTags($body, $ctx['marks']);\n $src = \\CB::url('framework-web') . '/js/jquery/jquery.min.js';\n if (empty($this->js['top'][$src])) $this->addJS(['src' => $src], null, true, -1000);\n $src = \\CB::url('framework-web') . '/js/cb.full.min.js?v=2';\n if (empty($this->js['top'][$src])) $this->addJS(['src' => $src], null, true, -999);\n }\n $this->tpl->setTemplate($ctx['html']);\n if (!empty($config['cacheEnabled'])) \n {\n $this->commit();\n $this->push(true);\n }\n }\n return $this;\n }", "public function parse()\n {\n }", "private function parse( $html ) {\n\t\t$replaced_html = preg_replace_callback( '/<\\s*script\\s*(?<attr>[^>]*?)?>(?<content>.*?)?<\\s*\\/\\s*script\\s*>/ims', [ $this, 'replace_scripts' ], $html );\n\n\t\tif ( empty( $replaced_html ) ) {\n\t\t\treturn $html;\n\t\t}\n\n\t\treturn $replaced_html;\n\t}", "abstract protected function loadHtml($text= null);", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "abstract protected function newParser();", "public function getParser() {}", "public function getParser() {}", "public function getParser() {}", "protected function parse_content(){\n $m = array(); // we will keep here\n list( $t, $text ) = explode( \"<div class='post entry-content '>\", $this->page );\n list( $text, $t ) = explode( '</div>', $text );\n return $text;\n }", "function pparse($handle)\n\t{\n\t\tglobal $config;\n\n\t\t// Mighty Gorgon - Extra Debug - BEGIN\n\t\tif (defined('DEBUG_EXTRA') && DEBUG_EXTRA && !empty($_REQUEST['explain']))\n\t\t{\n\t\t\tglobal $user, $db;\n\t\t\tif (($user->data['user_level'] == ADMIN) && method_exists($db, 'sql_report'))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Mighty Gorgon - Extra Debug - END\n\n\t\tif (!defined('CSS_JS_PARSED'))\n\t\t{\n\t\t\t$this->add_css_js();\n\t\t}\n\n\t\t// parsing header if there is one\n\t\tif($this->preparse || $this->postparse)\n\t\t{\n\t\t\t$preparse = $this->preparse;\n\t\t\t$postparse = $this->postparse;\n\t\t\t$this->preparse = '';\n\t\t\t$this->postparse = '';\n\t\t\tif($preparse)\n\t\t\t{\n\t\t\t\t$this->pparse($preparse);\n\t\t\t}\n\t\t\tif($postparse)\n\t\t\t{\n\t\t\t\t$str = $handle;\n\t\t\t\t$handle = $postparse;\n\t\t\t\t$this->pparse($str);\n\t\t\t}\n\t\t}\n\n\t\t// checking if handle exists\n\t\tif (empty($this->files[$handle]) && empty($this->files_cache[$handle]))\n\t\t{\n\t\t\tif(isset($this->files[$handle]) && ($this->files[$handle] === false))\n\t\t\t{\n\t\t\t\t// skip file\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tdie(\"Template->loadfile(): No files found for handle $handle\");\n\t\t}\n\t\t$this->xs_startup();\n\t\t$force_recompile = empty($this->uncompiled_code[$handle]) ? false : true;\n\n\t\t// checking if php file exists.\n\t\tif (!empty($this->files_cache[$handle]) && !$force_recompile)\n\t\t{\n\t\t\t// php file exists - running it instead of tpl\n\t\t\t$this->execute($this->files_cache[$handle], '', $handle);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!$this->loadfile($handle))\n\t\t{\n\t\t\tdie(\"Template->pparse(): Couldn't load template file for handle $handle\");\n\t\t}\n\n\t\t// actually compile the template now.\n\t\tif (empty($this->compiled_code[$handle]))\n\t\t{\n\t\t\t// Actually compile the code now.\n\t\t\tif(!empty($this->files_cache2[$handle]) && empty($this->files_cache[$handle]) && !$force_recompile)\n\t\t\t{\n\t\t\t\t$this->compiled_code[$handle] = $this->compile2($this->uncompiled_code[$handle], $handle, $this->files_cache2[$handle]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->compiled_code[$handle] = $this->compile2($this->uncompiled_code[$handle], '', '');\n\t\t\t}\n\t\t}\n\n\t\t// Run the compiled code.\n\t\tif (empty($this->files_cache[$handle]) || $force_recompile)\n\t\t{\n\t\t\t$this->execute('', $this->compiled_code[$handle], $handle);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->execute($this->files_cache[$handle], '', $handle);\n\t\t}\n\t\treturn true;\n\t}", "public function loadHTML();", "public static function handle() {\n\t\t\n\t\tif(!static::$multiline) {\n\t\t\t$node = nodes\\Tag::new_from_parser(static::$parser);\n\t\t\tstatic::parse_start($node);\n\t\t\t\n\t\t\tif(static::$multiline) {\n\t\t\t\tstatic::$parser->force_handler(get_called_class());\n\t\t\t\tstatic::$parser->expect_indent(Parser::EXPECT_MORE);\n\t\t\t}\n\t\t} else {\n\t\t\t$node = static::$parser->context();\n\t\t\t$node->content .= ' ' . static::$parser->content();\n\t\t\t\n\t\t\tswitch(static::$multiline) {\n\t\t\t\tcase self::MULTILINE_HTML_ATTRIBUTES:\n\t\t\t\t\tstatic::$multiline = false;\n\t\t\t\t\tstatic::parse_html_attributes($node);\n\t\t\t\tbreak;\n\t\t\t\tcase self::MULTILINE_RUBY_ATTRIBUTES:\n\t\t\t\t\tstatic::$multiline = false;\n\t\t\t\t\tstatic::parse_ruby_attributes($node);\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$node->exception('Sanity error: unknown multiline modifier');\n\t\t\t}\n\t\t\t\n\t\t\tif(static::$multiline)\n\t\t\t static::$parser->force_handler(get_called_class());\n\t\t}\n\t\t\n\t}", "public function parse($file);", "public function parse($file);", "function parse($str, $structure = false, $php = true, $info = null)\n\t{\n\t\tif(!is_string($str)) return false;\n\n\t\t// render or delete php\n\t\tif($php && strpos($str, '<?php') !== false) {\n\t\t\ttry { $str = $this->php_render($str, $info); }\n\t\t\tcatch(Exception $phperror) {}\n\t\t}\n\t\tif(!$php || isset($phperror)) $str = preg_replace('`<\\?php.*\\?>`mUi', '', $str);\n\n\t\t// find and extract items to preserve\n\t\tglobal $p_items;\n\t\tif(!isset($p_items)) $p_items = array();\n\t\t$p_patterns = array(\n\t\t\t'`<\\s*noparse[^>]*>(.*)</\\s*noparse[^>]*>`smUi',\n\t\t\t'`<\\s*script[^>]*>.*</\\s*script[^>]*>`smUi');\n\t\t$p_func = create_function('$out', '\n\t\t\tglobal $p_items;\n\t\t\t$p_items[] = isset($out[1]) ? $out[1] : $out[0];\n\t\t\treturn \"<THIISpreserve\".(count($p_items)-1).\"/>\";');\n\t\tforeach($p_patterns as $p) $str = preg_replace_callback($p, $p_func, $str);\n\t\t// parse code\n\t\t$str = preg_replace_callback('`(\\n?)<code([^>]*)>(.*)(</\\s*code[^>]*>)`smUi', array(&$this, 'parse_code'), $str);\n\n\t\t// hr\n\t\t$str = preg_replace('`___+`', '<hr />', $str);\n\t\t// lists\n\t\t$str = preg_replace_callback('`(?:\\n(?: |\\t)+[-*][^\\n]*)+`', array(&$this, 'parse_list'), $str);\n\n\t\t// find and render markups\n\t\t$markup_list = array('**'=>'**', '//'=>'//', '__'=>'__', '\\'\\''=>'\\'\\'', '{{'=>'}}', 'href=\"[['=>']]\"', '[['=>']]', '(('=>'))');\n\t\t$markup_pattern = '`(\\*\\*|(?<!:)//|__|\\'\\'|\\{\\{|\\}\\}|\\[\\[|\\]\\]|\\(\\(|\\)\\))`';\n\t\t$markup_matches = preg_split($markup_pattern, $str, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\t$tree = $this->markup_tree_create($markup_list, $markup_matches);\n\t\t$str = $this->markup_tree_render($tree);\n\n\t\t// headers and paragraphs\n\t\tif($structure) {\n\t\t\t$str = $this->parse_headers($str);\n\t\t\t$str = $this->parse_breaks($str);\n\t\t}\n\n\t\t// dashes\n\t\t$str = preg_replace(\n\t\t\tarray('`[^-](?<!<!)---(?!>)[^-]`', '`[^-](?<!<!)--(?!>)[^-]`'),\n\t\t\tarray('&mdash;', '&ndash;'),\n\t\t\t$str);\n\n\t\t// retrieve preserved items\n\t\tforeach($p_items as $id => $item)\n\t\t\t$str = preg_replace('`<THIISpreserve'.$id.'/>`', $item, $str, 1);\n\n\t\treturn $str;\n\t}", "protected function initializeExternalParsers() {}", "private function parseContents($html)\n {\n if (ltrim($html) == '') {\n return '';\n }\n \n /* do we really have tags to omit parsing for?!?\n // Don't parse contents of \"iframe\" element.\n if ($this->name == 'iframe') {\n return $this->parseNoContents('iframe', $html);\n }\n\n // Only TEXT inside a \"script\" element.\n if ($this->name == 'script') {\n return $this->parseForeignContents('script', $html);\n }\n\n // Only TEXT inside a \"style\" element.\n if ($this->name == 'style') {\n return $this->parseForeignContents('style', $html);\n }\n */\n \n // Parse contents one token at a time.\n $remainingHtml = $html;\n while (preg_match(\"/^\\s*<\\/\\s*\".$this->name.\"\\s*>/is\", $remainingHtml) === 0) {\n $token = TokenFactory::buildFromHtml(\n $remainingHtml,\n $this,\n //false \n $this->getThrowOnError()\n );\n\n if ($token === false || $token->isClosingElementImplied($remainingHtml)) {\n return $remainingHtml;\n }\n \n if (!is_array($this->children)) {\n $this->children = array();\n }\n $remainingHtml = $token->parse($remainingHtml);\n $this->children[] = $token;\n }\n\n // Remove last token if contains only whitespace.\n if (!empty($this->children)) {\n $lastChildArray = array_slice($this->children, -1);\n $lastChild = array_pop($lastChildArray);\n if ($lastChild->isText() && trim($lastChild->getValue()) == '') {\n array_pop($this->children);\n }\n }\n\n // Remove remaining closing tag.\n $posOfClosingBracket = mb_strpos($remainingHtml, '>');\n\n return mb_substr($remainingHtml, $posOfClosingBracket + 1);\n }", "function process() {\n return $this->_parse();\n }", "public function parse($data);", "public function parse($data);", "public function parse($data);", "public function parse()\n {\n // turn the url into an array by nodes\n $this->nodes = explode('/', $this->url);\n \n // slide the controller off the first element\n $this->controller = array_shift($this->nodes);\n\t // break the path apart into its segments\n\t // controller - params ( node will always be empty for restful urls )\n\t //@list( , $this->nodes ) = explode( '/', $this->url, 2 );\n\t\n\t // add params to the to the params array\n/*\n\t if ( !empty( $params ) ) {\n\t \n\t // break apart the params\n\t $params = explode( '/', $params );\n\t\n\t for ( $i = 0; $i < count( $params ); $i++ ) {\n\t $this->params[] = str_replace( KEYWORD_SEPARATOR, ' ', $params[$i]);\n\t }\n\t }\n*/\n \n \n }", "public function testContentParsing() {\n\n require_once __DIR__ . '/../../../../wp-load.php';\n\n $content = file_get_contents(__DIR__ . '/testResources/content.html');\n $filterKeywords = array(\n 'whiteList' => array('pagemaker'),\n 'blackList' => array('desktop')\n );\n $filterMode = 'white_list';\n $contentParser = new Content();\n echo $parsedContent = $contentParser->convertContent($content, $filterKeywords, $filterMode);\n }", "function parse($data = \"\") {\n // bold, italic, h2 (Название)\n $data = preg_replace(\"/<span class=rvts78>(.+?)\\s?<\\/span>/i\",\"##**_$1_**\",$data);\n // bold. h3 (коротко)\n $data = preg_replace(\"/<span class=rvts23>(.+?)\\s?<\\/span>/i\",\"###**$1**\",$data);\n // bold (Статья)\n $data = preg_replace(\"/<span class=rvts(?:9|44)>(.+?)\\s?<\\/span>/i\",\"**$1**\",$data);\n // bold h4 (Раздел)\n $data = preg_replace(\"/<span class=rvts15>(.+?)\\s?<\\/span>/i\",\"####**$1**\",$data);\n\n $container = $data;\n\n $container = strip_tags($container);\n $container = preg_replace(\"/&nbsp;/s\",\" \",$container);\n $container = preg_replace(\"/(\\r\\n|\\n|\\r)+/s\",\"\\n\\n\",$container);\n return trim($container);\n}", "private function parse()\n\t{\n\t\t// parse datagrids\n\t\tif(!empty($this->datagrids)) $this->tpl->assign('datagrids', $this->datagrids);\n\t}", "public function ParseHTML()\r\n {\r\n\r\n\t\t\t$this->Display[\"title\"] = $this->Label;\t\t\t\r\n\t\t\t$this->Display[\"links\"] = $this->ShowNextPrev;\r\n\t\t\t$this->Display[\"total\"] = $this->Total;\r\n\t\t\t\r\n $totalpages = ($this->ItemsOnPage > 0) ? ceil($this->Total / $this->ItemsOnPage) : 0;\r\n\t\t\t\r\n\t\t\tif ($this->PageNo > $totalpages) \r\n\t\t\t\t$this->PageNo = $totalpages;\r\n\r\n $firstpage = $this->PageNo >= 10 ? $this->PageNo - 5 : 1;\r\n $lastpage = $firstpage + 9;\r\n\r\n $lastpage = $lastpage > $totalpages ? $totalpages : $lastpage;\r\n\t\t\t\r\n\t\t\t// Generate URL\r\n\t\t\t$url = $this->URLFormat . $this->GetQueryString();\r\n\t\t\t\r\n\t\t\tif ($this->ShowNextPrev)\r\n\t\t\t{\r\n\t\t\t\tif ($this->PageNo > 1)\r\n\t\t\t\t\t$this->Display[\"prevlink\"] = $this->URL.sprintf($url, $this->PageNo - 1, $this->Total);\r\n\t\t\t\tif ($this->PageNo < $lastpage)\r\n\t\t\t\t\t$this->Display[\"nextlink\"] = $this->URL.sprintf($url, $this->PageNo + 1, $this->Total);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($firstpage > 1)\r\n\t\t\t\t$this->Display[\"firstpage\"] = array(\"link\" => $this->URL.sprintf($url, 1, $this->Total), \"num\" => \"1\");\r\n\t\t\t\r\n for ($n = $firstpage; $n <= $lastpage; $n++)\r\n {\r\n\t\t\t\t$selected = ($this->PageNo == $n);\r\n $this->Display[\"pages\"][] = array(\"num\" => $n, \"selected\"=>$selected, \"link\" => $this->URL.sprintf(urldecode($url), $n, $this->Total));\r\n }\r\n\r\n if ($lastpage < $totalpages)\r\n\t\t\t\t$this->Display[\"lastpage\"] = array(\"link\" => $this->URL.sprintf($url, $totalpages, $this->Total), \"num\" => $totalpages);\r\n\r\n }", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }", "public function run()\n {\n// $this->parse();\n }", "static public function getFromString(){\n set_error_handler(array('\\Draeli\\RssBridge\\Utils', 'set_error_handler'));\n $result = call_user_func_array( array('\\Sunra\\PhpSimple\\HtmlDomParser', 'str_get_html'), func_get_args() );\n restore_error_handler ();\n\n return $result;\n }", "public function load($html);", "function parseText($text) {\r\n\t\r\n\t\r\n\t\t$parsed_text = $this->urlsTolinks($text);\r\n\t\t\r\n\t\t//if no paragraph or break tags replace \\n with <br />\r\n\t\t\r\n\t\tif (!eregi('(<p|<br)', $parsed_text)) {\r\n\t\t\t\r\n\t\t\t$parsed_text = nl2br($parsed_text);\r\n\t\t\r\n \t\t} \r\n\t\t\r\n\t\t$parsed_text = $this->replaceMediaPlaceholders($parsed_text);\r\n\t\t$parsed_text = $this->replaceUserVariables($parsed_text);\r\n\t\t$parsed_text = $this->textoGif($parsed_text);\r\n\t\t//$parsed_text = $this->popuplinks($parsed_text);\r\n\t\t \t\t\r\n\t\treturn $parsed_text;\r\n\t\r\n\t}", "function parse() {\n \n\t if ($this -> XMLForm -> isPosted()) { \n $this -> doPost();\n }\n $this -> doGet();\n \n return $this -> drawPage();\n \n }", "public static function PARSE_HTML($htmlData , $selectList,$parentIdx = -1 ,$isLower = true) {\n\t$retval = array();\n\t$openTagList = array();//key:tag,\n\t$level = 0;\n\t$mIdx = -1;//match\n\t$ePos = 0;\n\t$isScripting = false;\n\t$setUpCurHtml = '';\n\t$setUpTagAttrList = array();\n\t$matchingIdxList = array();\n\t$maxSelectCount = count($selectList);\n\n\t//start html parse\n\t//get one tag string\n\twhile(!empty($htmlData)){\n\t $openTagPos = strpos($htmlData , '<' ) ;\n\t if( $openTagPos === false){\n\t\t$htmlData = \"\";\n\t\tbreak;\n\t }\n\t else if( $openTagPos > 0){\n\t\t$htmlData = substr($htmlData , $openTagPos);\n\t }\n\t else{}//first char is \"<\"\n\n\t $closeTagPos = strpos($htmlData , '>' ) ;\n\t if( $closeTagPos === false){\n\t\tif(!empty($htmlData)) $htmlData .= \">\";//\"<\" exists.\n\t\t$closeTagPos = strlen($htmlData) - 1;\n\t }\n\n\t $tag = substr($htmlData , 1 , $closeTagPos - 1 );\n\t $htmlData = substr($htmlData , $closeTagPos + 1 );\n\n\t //tag type check\n\t if( self::CHECK_TAG_TYPE($tag) == self::$TAG_TYPE_LIST['open'] ){\n\t\t//condition check\n\t\tif( $isScripting ){\n\t\t continue;\n\t\t}\n\n\t\t$tmpData = explode( self::SPLIT_CHAR , $tag );\n\n\t\tif($isLower) $tmpData[0] = strtolower($tmpData[0]);\n\t\t$openTagList[] = $tmpData[0];\n\t\tif( $tmpData[0] == 'script') $isScripting = true;\n\n\t\t$isContinue = false;\n\n\t\tfor( $i = $level; $i < $maxSelectCount;$i++ ){\n\t\t if( self::IS_MATCH( $tag , $selectList[$i] ) ){\n\t\t\t$matchingIdxList[] = count($openTagList) - 1;\n\t\t\t//check extra\n\t\t\tforeach( $selectList[$i]['extra'] as $val ){\n\t\t\t if( $val == 'cha' ){//choice child\n\t\t\t\t$isContinue = true;\n\t\t\t }\n\t\t\t else if($val == 'all' ){\n\t\t\t\t//no exec\n\t\t\t }\n\t\t\t else{}\n\t\t\t}\n\t\t\tif($isContinue){\n\t\t\t //count up $level\n\t\t\t $i++;\n\t\t\t break;\n\t\t\t}\n\t\t }\n\t\t else break;\n\t\t}\n\n\t\t$level = $i;\n\t\tif($isContinue)continue;\n\t\tif( $maxSelectCount <= $level ){\n\t\t //save tag attribute\n\t\t $tmpList = self::GET_TAG_DATA($tag);\n\t\t $setUpTagAttrList = $tmpList['attr'];\n\n\t\t //get matching close tag position and get current html data\n\t\t $openTagLastIdx = count($openTagList) - 1;\n\t\t $matchTag = $openTagList[$openTagLastIdx];\n\t\t if( in_array($matchTag,self::$SELF_CLOSE_TAG_TYPE_LIST) ){\n\t\t\tarray_pop($openTagList);\n\t\t\t$openTagLastIdx--;\n\t\t\t$setUpCurHtml = '';\n\t\t }\n\t\t else{\n\t\t\t$endPos = 0;\n\t\t\t$nextPos = 0;\n\t\t\t$maxLen = strlen($htmlData);\n\t\t\t$isFirst = true;\n\t\t\tfor($i = $openTagLastIdx; $i > -1;$i-- ){\n\t\t\t $checkTag = $openTagList[$i];\n\t\t\t while($endPos < $maxLen){\n\t\t\t\t$searchNextPos = strpos( $htmlData , '<' . $checkTag .'>',$nextPos);\n\t\t\t\tif($searchNextPos === false) $nextPos = strpos( $htmlData , '<' . $checkTag .' ',$nextPos);\n\t\t\t\telse $nextPos = $searchNextPos;\n\n\t\t\t\t$endPos = strpos( $htmlData , '</' . $checkTag . '>',$endPos );\n\t\t\t\tif($endPos === false){\n\t\t\t\t //no close tag\n\t\t\t\t break;\n\t\t\t\t}\n\t\t\t\telse if($nextPos === false || $endPos < $nextPos){\n\t\t\t\t break;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t //next loop\n\t\t\t\t $endPos += strlen('</' . $checkTag . '>');\n\t\t\t\t $nextPos = strpos($htmlData,'>' , $nextPos) + 1;\n\t\t\t\t}\n\t\t\t }\n\t\t\t if( $endPos !== false && $endPos < $maxLen ){\n\t\t\t\tif($isFirst){\n\t\t\t\t array_pop( $openTagList );\n\t\t\t\t $openTagLastIdx--;\n\t\t\t\t}\n\t\t\t\telse $isFirst = false;\n\t\t\t\tbreak;\n\t\t\t }\n\t\t\t array_pop($openTagList);\n\t\t\t $openTagLastIdx--;\n\t\t\t}\n\n\t\t\t$setUpCurHtml = substr($htmlData,0,$endPos );\n\t\t\tif($isFirst) $htmlData = substr($htmlData,$endPos + strlen('</' . $matchTag . '>') );\n\t\t\telse $htmlData = substr($htmlData,$endPos );\n\n\t\t }\n\n\t\t //save retval select list\n\t\t $selectObj = new DBRHtmlParse();\n\t\t $selectObj->setAttrList( $setUpTagAttrList );\n\t\t $selectObj->setCurrentHtml( $setUpCurHtml );\n\t\t $selectObj->setTagName( $matchTag );\n\t\t $selectObj->setSelectParentIdx( $parentIdx );\n\t\t $retval[] = $selectObj;\n\t\t $setUpCurHtml = '';//clear\n\n\t\t //matching level fix\n\t\t $matchingLastIdx = count($matchingIdxList)-1;\n\t\t for($j = $matchingLastIdx; $j > -1; $j-- ){\n\t\t\tif( $openTagLastIdx < $matchingIdxList[$j] ){\n\t\t\t $level--;\n\t\t\t array_pop($matchingIdxList);\n\t\t\t}\n\t\t\telse break;\n\t\t }\n\t\t}\n\t }\n\t else if( self::CHECK_TAG_TYPE($tag) == self::$TAG_TYPE_LIST['close'] ){\n\n\t\t//get tag name\n\t\t$tag = substr($tag , 1 );\n\t\t//$tmpList = explode(' ' , $tag );\n\t\t//if($isLower) $tmpList[0] = strtolower($tmpList[0]);\n\t\t//$tag = $tmpList[0];\n\t\tif($isLower) $tag = strtolower($tag);\n\n\t\t//condition check\n\t\tif( $isScripting && $tag !== 'script' ){\n\t\t continue;\n\t\t}\n\t\tif( $tag == 'script') $isScripting = false;\n\n\t\t$openTagLastIdx = count($openTagList) - 1;\n\n\t\tfor($i = $openTagLastIdx; $i > -1;$i-- ){\n\t\t if( $openTagList[$i] == $tag ){\n\t\t\tbreak;\n\t\t }\n\t\t}\n\n\t\t//close tag\n\t\tif($i == -1){\n\t\t //get true close tag\n\t\t for($i = $openTagLastIdx; $i > -1;$i-- ){\n\t\t\t$endPos = strpos( $htmlData ,'</' . $openTagList[$i] . '>' );\n\t\t\tif($endPos !== false){\n\t\t\t $i++;\n\t\t\t break;\n\t\t\t}\n\t\t }\n\t\t if($i == -1) $i = 0;\n\t\t}\n\t\tfor($j = $openTagLastIdx; $j >= $i;$j-- ){\n\t\t array_pop( $openTagList );\n\t\t}\n\n\t\t$openTagLastIdx = $j;\n\n\t\t$mIdx = -1;\n\t\t$matchingLastIdx = count($matchingIdxList)-1;\n\t\tfor($j = $matchingLastIdx; $j > -1; $j-- ){\n\t\t if( $openTagLastIdx < $matchingIdxList[$j] ){\n\t\t\t$level--;\n\t\t\tarray_pop($matchingIdxList);\n\t\t }\n\t\t else break;\n\t\t}\n\n\n\t }\n\t else if( self::CHECK_TAG_TYPE($tag) == self::$TAG_TYPE_LIST['comment'] ){\n\t }\n\t else{}\n\n\t}\n\n\tif(count($retval) == 0) return $retval;\n\n\t//if tag is open , push open tag list and check selector\n\t//check child data\n\t$addList = array();\n\t$retvalOrder = array();\n\n\t//if extra last condition = '>',no loop\n\t$isSkip = false;\n\t$selectLastIdx = count($selectList) - 1;\n\tfor($i = $selectLastIdx;$i > -1; $i--){\n\t $extras = $selectList[$i]['extra'];\n\t if( in_array('cha',$extras) ){\n\t\t$isSkip = true;\n\t\tbreak;\n\t }\n\t if( in_array('all',$extras) ){\n\t\tcontinue;\n\t }\n\t break;\n\t}\n\tif($isSkip) return $retval;\n\n\tfor($i = 0;$i < $selectLastIdx; $i++){//last is not\n\t if( in_array( 'chf' , $selectList[$i]['extra'])\n\t\t|| in_array( 'ef' , $selectList[$i]['extra'])){\n\t\t$retval = array( $retval[0] );\n\t\tbreak;\n\t }\n\t if( in_array( 'chl' , $selectList[$i]['extra'])\n\t\t|| in_array( 'el' , $selectList[$i]['extra'])){\n\t\t$retval = array( $retval[count($retval) - 1] );\n\t\tbreak;\n\t }\n\t}\n\n\t//choice extra option data\n\t$extraData = $selectList[$selectLastIdx]['extra'];\n\tif( in_array('ef' , $extraData ) ) return array($retval[0]);\n\telse{}\n\n\t$setUpIdx = $parentIdx;\n\tforeach( $retval as $parseObj ){\n\t $retvalOrder[] = $parseObj;\n\t $setUpIdx++;\n\n\t $tmpList = self::PARSE_HTML($parseObj->getCurrentHtml() , array($selectList[$selectLastIdx]),$setUpIdx );\n\t foreach( $tmpList as $addElem){\n\t\t$retvalOrder[] = $addElem;\n\t\t$setUpIdx++;\n\t }\n\t}\n\n\t//choice child option\n\tif( $parentIdx == -1 ){\n\t if( in_array('chf' , $extraData ) ){\n\t\t$retval = array();\n\t\t$pushKeyList = array();\n\t\tforeach( $retvalOrder as $keyIdx=>$obj){\n\t\t $idx = $obj->getSelectParentIdx();\n\t\t if( !isset($retval[$idx]) ){\n\t\t\tif( !in_array( $idx , $pushKeyList ) ) $obj->setSelectParentIdx(-1);\n\t\t\t$pushKeyList[] = $keyIdx;\n\t\t\t$retval[$idx] = $obj;\n\t\t }\n\t\t}\n\t\treturn array_values($retval);\n\t }\n\t else if( in_array('chl' , $extraData ) ){\n\t\t$retval = array();\n\t\tforeach( $retvalOrder as $keyIdx=>$obj){\n\t\t $idx = $obj->getSelectParentIdx();\n\t\t $pushKeyList[$idx] = $keyIdx;\n\t\t $retval[$idx] = $obj;\n\t\t}\n\n\t\t//check no parent data is set or not\n\t\tforeach( $retval as $obj){\n\t\t if( !in_array( $obj->getSelectParentIdx(),$pushKeyList) ){\n\t\t\t$obj->setSelectParentIdx(-1);\n\t\t }\n\t\t}\n\n\t\treturn array_values($retval);\n\t }\n\t else if( in_array('el' , $extraData ) ){\n\t\treturn array($retvalOrder[count($retvalOrder) - 1]);\n\t }\n\t else{}\n\t}\n\n\treturn $retvalOrder;\n }", "public function parse()\n {\n // TODO: Implement parse() method.\n }", "public function isParsed();", "abstract public function parse($string);", "abstract public function parse($value);", "public function parse(): void\n {\n // TODO: Implement parse() method.\n }", "function parseText($txt,$wrap){\n\t\t\t$txt = $this->TS_links_rte($txt, $wrap);\n\t\t\t//prepend relative paths with url\n\t\t\t$txt = $this->makeAbsolutePaths($txt);\n\t\t\t$txt = $this->cleanHTML($txt);\n\t\t\treturn $txt;\n\t\t\n\t}", "protected function parse(): void\n {\n parent::parse();\n $this->template->assign('dataGrid', (string) $this->dataGrid->getContent());\n }", "protected function parseHtml()\n\t{\n\t\t// parse the html to look for the h4 'have X in circles' element\n\t\tpreg_match('/<h4 class=\"nPQ0Mb pD8zNd\">(.*?)<\\/h4>/s', $this->html, $matches);\n\n\t\tif (isset($matches) && !empty($matches))\n\t\t{\n\t\t\t$count = $matches[1];\n\t\t\t$circles = preg_replace('/[^0-9_]/', '', $count);\n\t\t}\n\t\tif (empty($circles))\n\t\t{\n\t\t\t$circles = 0;\n\t\t}\n\n\t\t// parse the html for the user's name\n\t\tpreg_match('/<span class=\"fn\">(.*?)<\\/span>/s', $this->html, $matches);\n\t\t$name = $matches[1];\n\n\t\t// parse the html for the img div\n\t\tpreg_match('/<div class=\"k-Va-pc-N-A\">(.*?)<\\/div>/s', $this->html, $matches);\n\t\t$img_div = $matches[1];\n\t\t\n\t\t// parse the img div for the image src\n\t\tpreg_match('/< *img[^>]*src *= *[\"\\']?([^\"\\']*)/i', $img_div, $matches);\n\t\t$img = 'http:' . $matches[1];\n\n\t\t// put the data in an array\n\t\t$return = array('id' => $this->user_id, 'count' => $circles, 'name' => $name, 'img' => $img, 'url' => $this->url);\n\n\t\treturn $return;\n\t}", "abstract public function convert_to_html();", "function parse(&$reader, &$ctxt)\r\n\t{\r\n\t\t$parser =& new PhaseParser($reader, $ctxt);\r\n\t\t$output = '';\r\n\t\t\r\n\t\t// NOTE: this method provides an easy way to setup the tag libraries\r\n\t\t$parser->loadTagLibraries();\r\n\r\n\t\twhile ($reader->hasMoreInput())\r\n\t\t{\r\n\t\t\t$output .= $parser->parseElements();\r\n\t\t}\r\n\r\n\t\t// tack on the tag functions, wrapping them in the namespace\r\n\t\t// for this phase context\r\n\t\tif (count($parser->tagFunctions))\r\n\t\t{\r\n\t\t\t$output .= \r\n\t\t\t'<?php' . \"\\n\" .\r\n\t\t\t'class ' . $parser->namespace . ' {' . \"\\n\" .\r\n\t\t\timplode(\"\\n\", array_reverse($parser->tagFunctions)) . \"\\n\" .\r\n\t\t\t'}' . \"\\n\" .\r\n\t\t\t'?>' . \"\\n\";\t\r\n\t\t}\r\n\r\n\t\t// merge sections where php tags have become adjacent (no need for them)\r\n\t\t$output = preg_replace('; *\\?><\\?php *;', ' ', $output);\r\n\r\n\t\treturn $output;\r\n\t}", "public function parseHtml($html)\n\t{\n\t\t$delimiters = SLS_String::getBoundContent($html,\"|||sls:\",\"|||\");\n\t\t$arraySearch = array();\n\t\t$arrayReplace = array();\n\t\t\n\t\t$dtd = new SLS_Dtd(null);\n\t\t\n\t\t// Foreach delimiters found, search if we can map a function of SLS_Dtd's class with this delimiter\n\t\tforeach($delimiters as $delimiter)\n\t\t{\n\t\t\t$dtd_mask = $delimiter;\n\t\t\t$delimiter = explode(\":\",$delimiter);\n\t\t\t$method = array_shift($delimiter);\n\t\t\t$args = $delimiter;\t\t\t\n\t\t\t\n\t\t\t$ref = new ReflectionMethod($dtd,$method);\t\t\t\n\t\t\t$nbRequiredParams = $ref->getNumberOfRequiredParameters();\n\t\t\t$nbMaxParams = $ref->getNumberOfParameters();\n\t\t\t\n\t\t\tif ($nbRequiredParams > count($args))\t\t\t\n\t\t\t\tSLS_Tracing::addTrace(new Exception(\"Error: Specific SLS_Dtd function `\".$method.\"` needs at least \".$nbRequiredParams.\" required parameters\"),true);\n\t\t\tif ($nbMaxParams < count($args))\n\t\t\t\tSLS_Tracing::addTrace(new Exception(\"Warning: Specific SLS_Dtd function `\".$method.\"` has only \".$nbMaxParams.\" parameters, you call it with \".count($args).\" parameters\"),true);\n\t\t\t\n\t\t\tif (method_exists($dtd,$method) && $nbRequiredParams <= count($args))\n\t\t\t{\n\t\t\t\tarray_push($arraySearch,\"|||sls:\".$dtd_mask.\"|||\");\n\t\t\t\tarray_push($arrayReplace,$ref->invokeArgs($dtd,$args));\n\t\t\t}\n\t\t\telse\n\t\t\t\tSLS_Tracing::addTrace(new Exception(\"Warning: the delimiter |||sls:\".$method.\"||| doesn't match with any function of class SLS_Dtd\"));\n\t\t}\n\t\treturn str_replace($arraySearch,$arrayReplace,$html);\n\t}", "protected function parse_other_tags(&$rendered)\n \t{\n \t\t// extract layout tags from rendered source\n \t\t$layouts=array();\n \t\t$layout_tags = \"#<layout:(\\w+)\\s+([^/>]*)([/]*)>#\";\t\t\t\t\t\t// extracts layout tags\n\t\t\n \t\twhile(preg_match($layout_tags,$rendered,$layouts,PREG_OFFSET_CAPTURE)==1)\n \t\t{\n \t\t\t$tag=$layouts[1][0];\n \t\t\t$full_tag=$layouts[0][0];\n \t\t\t$attributes=$layouts[2][0];\n \t\t\t\n \t\t\tswitch($tag)\n \t\t\t{\n \t\t\t\tcase 'styles':\n \t\t\t\t\t$rendered=str_replace($full_tag,$this->write_styles(),$rendered);\n\t \t\t\t\tbreak;\n \t\t\t\t\t\n \t\t\t\tcase 'includes':\n\t \t\t\t\t$rendered=str_replace($full_tag,$this->write_includes(),$rendered);\n\t \t\t\t\tbreak;\n \t\t\t\t\n \t\t\t\tcase 'blocks':\n \t\t\t\t\t$rendered=str_replace($full_tag,$this->write_blocks(),$rendered);\n \t\t\t\t\tbreak;\n \t\t\t\t\n \t\t\t\tcase 'content':\n \t\t\t\t\t$attrs=array();\n\t\t\t\t\tpreg_match_all(View::REGEX_ATTRIBUTE,trim($attributes),$attrs,PREG_SET_ORDER);\n\t\t\t\t\t\n\t\t\t\t\t$id=null;\n\t\t\t\t\t$wrap=false;\n\t\t\t\t\t$use_id=false;\n\t\t\t\t\t\n\t\t\t\t\tforeach($attrs as $attr)\n\t\t\t\t\t\tswitch(strtolower($attr[1]))\n\t \t\t\t\t\t{\n\t \t\t\t\t\t\tcase 'id':\n\t \t\t\t\t\t\t\t$id=$attr[2];\n\t \t\t\t\t\t\t\tbreak;\n\t \t\t\t\t\t\tcase 'wrap':\n\t \t\t\t\t\t\t\t$wrap=$attr[2];\n\t \t\t\t\t\t\t\tbreak;\n\t \t\t\t\t\t\tcase 'use_id':\n\t \t\t\t\t\t\t\t$use_id=($attr[2]!='false');\n\t \t\t\t\t\t\t\tbreak;\n\t \t\t\t\t\t\tcase 'class':\n\t \t\t\t\t\t\t\t$class_name=$attr[2];\n\t \t\t\t\t\t\t\tbreak;\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t\t\t\t\tif ($id==null)\n\t\t\t\t\t\ttrace('Layout',\"No 'id' attribute supplied for layout content tag.\");\n\t\t\t\t\t\t\n\t\t\t\t\t$text=$this->write_content($id,$rendered);\n\t\t\t\t\t\n\t\t\t\t\tif (($wrap) && ($text!=''))\n\t\t\t\t\t{\n\t\t\t\t\t\t$text=\"<$wrap\".(($use_id==true) ? \" id='$id' \":\"\").((isset($class_name)) ? \" class='$class_name' \":\"\").\">\\n\".$text;\n\t\t\t\t\t\t$text.=\"\\n</$wrap>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t$rendered=str_replace($full_tag,$text,$rendered);\n\t\t\t\t\t\t\n \t\t\t\t\tbreak;\n \t\t\t\t\n \t\t\t\tdefault:\n \t\t\t\t\t$rendered=str_replace($full_tag,'',$rendered);\n \t\t\t}\n \t\t}\n \t}", "public function loadparser($data){\n\t\t$this->hakakses = $this->gethakakses();\n\t\tif ($this->hakakses=='admin') {\n\t\t\t$this->parser->parse('admin/v-index-admin', $data);\n\t\t}else{\n\t\t\techo \"forbidden access\"; \t\t\n\t\t}\n\t}", "function tidy_get_html(tidy $object) {}", "protected function parse($html)\n {\n $doc = new \\DOMDocument();\n $doc->loadHTML('<?xml encoding=\"UTF-8\">' . $html);\n\n $xpath = new \\DOMXPath($doc);\n\n $title = $xpath->query(\"//div[@id='title']/div[@class='left']/h1\");\n $developer = $xpath->query(\"//div[@id='title']/div[@class='left']/h2\");\n $description = $xpath->query(\"//div[@class='product-review']/p\");\n\n if (empty($title) || empty($developer) || empty($description)) {\n throw new InvalidPageException('Invalid page format');\n }\n\n $this->title = $title->item(0)->textContent;\n $this->developer = ltrim($developer->item(0)->textContent, 'By ');\n $this->description = $description->item(0)->textContent;\n $this->source = 'apple';\n }", "public function parse(): void\n {\n $this->template->assign('page_title', BL::getLabel($this->url->getModule()));\n $this->cssFiles->parse($this->template, 'cssFiles');\n $this->jsFiles->parse($this->template, 'jsFiles');\n\n $this->jsData->add('site', 'domain', SITE_DOMAIN);\n $this->jsData->add('editor', 'language', $this->getCKEditorLanguage());\n $this->jsData->add('Core', 'session_timeout', $this->getFirstPossibleSessionTimeout());\n\n if (!empty($this->get('fork.settings')->get('Core', 'theme'))) {\n $this->jsData->add('theme', 'theme', $this->get('fork.settings')->get('Core', 'theme'));\n $themePath = FRONTEND_PATH . '/Themes/' . $this->get('fork.settings')->get('Core', 'theme');\n $this->jsData->add('theme', 'path', $themePath);\n $this->jsData->add('theme', 'has_css', is_file($themePath . '/Core/Layout/Css/screen.css'));\n $this->jsData->add('theme', 'has_editor_css', is_file($themePath . '/Core/Layout/Css/editor_content.css'));\n }\n $this->template->assign('jsData', $this->jsData);\n }", "public function createParser();", "public function testOrgApacheSlingCommonsHtmlInternalTagsoupHtmlParser()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.commons.html.internal.TagsoupHtmlParser';\n\n $crawler = $client->request('POST', $path);\n }", "function parse(){ // parsing template\n\t$loop_count = -1;\n\tif (func_num_args()>= 1){\n\t\t$proc_type = func_get_arg(0);\n\t\t//if (!in_array($proc_type, array(PT_ROOT, PT_IF, PT_FOR, PT_SILENT_IF, PT_SILENT_FOR, PT_FALSE_IF))) system_die('Invalid process type', 'Template->parse');\n\t} else {\n\t\tif ( (PT_COMPILE) && (isset($this->filename)) ) // file parsing\n\t\t{\n\t\t\tif (file_exists($this->filename . '.php'))\n\t\t\t\tif (filemtime($this->filename . '.php') > filemtime($this->filename))\n\t\t\t\t{\n\t\t\t\t\tinclude($this->filename . '.php');\n\t\t\t\t\t$this->result = $r;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t$nesting = 0;\n\t\t\t$tplc = '<?$r=\\'\\';';\n\t\t\tfor ($i=0; $i<count($this->template); $i++)\n\t\t\t{\n\t\t\t\t// process\n\t\t\t\t$line = trim($this->template[$i]);\n\t\t\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\t\t\t$result = array();\n\t\t\t\tif (preg_match(PT_START_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'for ($i' . $nesting . '=0;$i' . $nesting . '<intval(' . $this->get_var_ref($result[3], $nesting) . ');$i' . $nesting . '++){' . \"\\n\";\n\t\t\t\t\t\t$nesting++;\n\t\t\t\t\t}\n\t\t\t\t\telse // this line is IF opening tag\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'if ('.$result[2].'(bool)('.$this->get_var_ref($result[3], $nesting).')){' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t} elseif (preg_match(PT_END_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}' . \"\\n\";\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t\t$nesting--;\n\t\t\t\t} elseif (preg_match(PT_MIDDLE_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}else{' . \"\\n\";\n\t\t\t\t} elseif (preg_match('/<%/', $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$j = 0;\n\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\twhile ($j<strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( ($line[$j] == '<') && ($line[$j+1] == '%') )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_f_value(substr($line, $j), $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t$j += $dw;\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$tmp_str .= $line[$j];\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t\t$tplc .= '$r.=\"\\\\n\";';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($line, $nesting, $dw) . \".\\\"\\\\n\\\";\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tplc .= '?>';\n\t\t\t\n\t\t\t$fh = fopen($this->filename . '.php', 'wt');\n\t\t\tif ($fh)\n\t\t\t{\n\t\t\t\tfwrite($fh, $tplc);\n\t\t\t\tfclose($fh);\n\t\t\t}\n\t\t\telse\n\t\t\t\tsystem_die('Cannot save compiled template');\n\t\t\tinclude($this->filename . '.php');\n\t\t\t$this->result = $r;\n\t\t\treturn 0;\n\t\t} // if compile and filename\n\t\t$proc_type = PT_ROOT;\n\t\tunset($this->result);\n\t}\n\tif (func_num_args()> 1){\n\t\t$curr_pos = intval(func_get_arg(1));\n\t\tif (($proc_type == PT_FOR) && (func_num_args() < 3)) system_die('Undefined loop count (FOR process)', 'Template->parse');\n\t\tif (func_num_args()> 2) $loop_count = intval(func_get_arg(2));\n\t}\n\telse\n\t\t$curr_pos = 0;\n\t$succ_mode = false;\n\twhile ($curr_pos < sizeof($this->template)){\n\t\t$line = $this->template[$curr_pos]; // current line\n\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\tif (preg_match(PT_START_TAGS, $line, $result)){ // this line contains one of the START tags\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif ($result[1] == 'FOR'){\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){ // invalid FOR variable\n\t\t\t\t\t$error_msg = 'Invalid FOR statement counter named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type <= PT_FOR) $count = intval($this->get_var_val($result[3]));\n\t\t\t\t\t$this->system_vars['cycle_nesting']++;\n\t\t\t\t\t$nesting_saver = $this->system_vars['cycle_nesting'];\n\t\t\t\t\tif ($proc_type> PT_FOR) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($count == 0) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tfor ($c = 0; $c < $count; $c++){\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_counters'][$nesting_saver] = $c;\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_nesting'] = $nesting_saver;\n\t\t\t\t\t\t\t\t$last_pos = $this->parse(PT_FOR, $curr_pos + 1, $c); // create visible FOR process in loop\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$curr_pos = $last_pos;\n\t\t\t\t}\n\t\t\t} else { // this line is IF opening tag\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){\n\t\t\t\t\t$error_msg = 'Invalid IF statement variable named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type>PT_FOR) $curr_type = PT_SILENT_IF;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$var = (bool)$this->get_var_val($result[3]);\n\t\t\t\t\t\tif (strlen($result[2])> 0) $var = !$var;\n\t\t\t\t\t\t$curr_type = ($var)?PT_IF:PT_FALSE_IF;\n\t\t\t\t\t}\n\t\t\t\t\tif ($loop_count!=-1) $curr_pos = $this->parse($curr_type, $curr_pos+1, $loop_count); // create new IF process inside the loop\n\t\t\t\t\telse $curr_pos = $this->parse($curr_type, $curr_pos+1); // create new IF process\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif(preg_match(PT_END_TAGS, $line, $result)){\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (((($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) && ($result[1] == 'FOR')) || ((($proc_type == PT_IF) || ($proc_type == PT_SILENT_IF) || ($proc_type == PT_FALSE_IF)) && ($result[1] == 'IF'))) {\n\t\t\t\tif (($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) $this->system_vars['cycle_nesting']--; // this one was the end of loop block\n\t\t\t\t$succ_mode = true;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t$error_msg = 'Unexpected end of '.$result[1].' statement';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif(preg_match(PT_MIDDLE_TAGS, $line, $result)){ // this line contains one of the MIDDLE tags (ELSE probably)\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (($proc_type == PT_FALSE_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_IF;\n\t\t\t} elseif (($proc_type == PT_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_FALSE_IF;\n\t\t\t} elseif($proc_type != PT_SILENT_IF) { // ELSE inside non IF process or so\n\t\t\t\t$error_msg = 'Unexpected '.$result[1].' statement '.$proc_type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif ($proc_type <= PT_FOR){ // processing of visible contents\n\t\t\tif (!isset($this->result)) $this->result = '';\n\t\t\t\t$matches = array();\n\t\t\t\t$line_is_control = false;\n\n\t\t\t\tif (preg_match_all(PT_COUNTER_TAGS, $line, $matches)){ // We have counter tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[0] as $key => $val){ // process counters\n\t\t\t\t\t\tif ($loop_count >= 0) $replace[$key] = $loop_count + 1;\n\t\t\t\t\t\telse $replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\t\t\t\t// processing variables\n\n\t\t\t\tif (preg_match_all(PT_VARIABLE_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (strlen($matches[4][$key])> 0){ // process array variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]) && is_array($this->vars[$val]) && array_key_exists($matches[4][$key], $this->vars[$val])){\n\t\t\t\t\t\t\t\t\t$replace[$key] = $this->vars[$val][$matches[4][$key]];\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif (isset($this->vars[$val]) && is_object($this->vars[$val])) {\n\t\t\t\t\t\t\t\t \t$_obj = &$this->vars[$val];\n\t\t\t\t\t\t\t\t\t$_name = $matches[4][$key];\n\t\t\t\t\t\t\t\t\t$replace[$key] = $_obj->$_name;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\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\tif ($this->debug_mode) $this->show_notice($val.$matches[3][$key], 4); // show stupid notice\n\t\t\t\t\t\t\t\t$replace[$key] = ''; // and insert complete emptyness\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else{ // process common variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]))\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($val);\n\t\t\t\t\t\t\telseif (preg_match('/\\\\//', $val))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$v_row = $this->Registry->_internal_get_value($val);\n\t\t\t\t\t\t\t\tif ( ($v_row !== false) && (!$v_row->eof()) ) {\n\t\t\t\t\t\t\t\t\t$out = $v_row->Rows[0]->Fields['value'];\n\t\t\t\t\t\t if ($v_row->Rows[0]->Fields['key_type'] == KEY_TYPE_IMAGE)\n\t\t\t\t\t\t\t\t\t\t$out = $GLOBALS['app']->template_vars['REGISTRY_WEB'] . $v_row->Rows[0]->Fields['id_path'] . '/' . $out;\n\t\t\t\t\t\t\t\t\t$replace[$key] = $out;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$replace[$key] = '';\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$replace[$key] = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\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$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing ternary operators\n\n\t\t\t\tif (preg_match_all(PT_TERNARY_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (isset($this->vars[$val])){\n\t\t\t\t\t\t\t$var = (bool)$this->get_var_val($val);\n\t\t\t\t\t\t\tif (strlen($matches[1][$key])> 0) $var = !$var;\n\t\t\t\t\t\t\t$res_num = ($var)?4:6;\n\t\t\t\t\t\t\tif (isset($this->vars[$matches[$res_num][$key]])) {\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($matches[$res_num][$key]);\n\t\t\t\t\t\t\t\tif (strlen($matches[$res_num - 1][$key])> 0) $replace[$key] = htmlspecialchars($replace[$key]); // escape html entries\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($res_var, 1);\n\t\t\t\t\t\t\t\t$result[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // we have tag but haven't got variable\n\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($val, 1); // curse them out in debug mode\n\t\t\t\t\t\t\t$replace[$key] = ''; // and insert pretty nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing controls\n\t\t\t\tif (preg_match_all(PT_CONTROL_TAGS, $line, $matches)){ // Yes! This line contains control definition\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[1] as $key => $name){ // go through the matches\n\t\t\t\t\t\tif (strlen($matches[3][$key])> 0) $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name), strtolower($matches[3][$key])); // here is control with id\n\t\t\t\t\t\telse $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name)); // here is control without id\n\t\t\t\t\t\tif (!is_null($tcontrol)){\n\t\t\t\t\t\t\t$tcontrol->parse_vars($matches[5][$key]);\n\t\t\t\t\t\t\tif (!$tcontrol->is_inited)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tcontrol->on_page_init();\n\t\t\t\t\t\t\t\t$tcontrol->is_inited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$replace[$key] = $tcontrol->process($loop_count);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace control statements with control results\n\t\t\t\t}\n\n\t\t\t\t// compress and delete blank lines\n\t\t\t\t$line = preg_replace('/[\\r\\n]*$/', '', trim($line));\n\t\t\t\tif (strlen($line)> 0) $this->result .= $line . \"\\n\";\n\t\t\t}\n\t\t\t$curr_pos++;\n\t\t}\n\n// And what we have here?\n\t\tif (!isset($error_msg) && ($proc_type != PT_ROOT) && !$succ_mode) $error_msg = 'Unexpected end of file'; // invalid template - show error\n\t\tif (isset($error_msg)){\n\t\t\t$error_txt = 'Template parsing error on line '.($curr_pos + 1);\n\t\t\tif (isset($this->filename))\t$error_txt .= ' of file \"'.$this->filename.'\"';\n\t\t\t$error_txt .= ' - '.$error_msg;\n\t\t\tsystem_die($error_txt, 'Template->parse'); // invalid template - show error\n\t\t}\n\t\tif ($proc_type == PT_ROOT)\n\t\t\tif (!isset($this->result))\n\t\t\t\t$this->result = ''; // probably there were one big false IF?\n\t\treturn $curr_pos; // HURRA! HURRA! This one is successfully completed!\n\t}", "abstract public function scrape();", "public function parser()\n\t{\n\t\tif ( ! $this->parser)\n\t\t{\n\t\t\t$this->parser = $this->_app->get_object('Parser');\n\t\t}\n\t\treturn $this->parser;\n\t}", "abstract public function parse($data, $type);" ]
[ "0.760181", "0.7516859", "0.7516859", "0.6877647", "0.6763747", "0.66711414", "0.6605192", "0.6569226", "0.6569226", "0.6569226", "0.65049416", "0.64889014", "0.648757", "0.648757", "0.648757", "0.648757", "0.6450833", "0.64057964", "0.63813233", "0.63702357", "0.63501704", "0.62796867", "0.6269172", "0.6237938", "0.6167129", "0.61259806", "0.60887384", "0.60644853", "0.6051537", "0.60399973", "0.6021673", "0.59968114", "0.5983755", "0.5973826", "0.59494114", "0.59125054", "0.59125054", "0.5900848", "0.5894707", "0.58666915", "0.5840762", "0.5823746", "0.5818157", "0.5800672", "0.5788024", "0.5751079", "0.5748699", "0.57486683", "0.57480925", "0.57480925", "0.5733371", "0.56759375", "0.56756884", "0.56756884", "0.56167936", "0.5612666", "0.56039375", "0.5569992", "0.55517036", "0.55517036", "0.5539106", "0.5523323", "0.55227953", "0.5507537", "0.54888105", "0.54888105", "0.54888105", "0.54882735", "0.5478873", "0.54782665", "0.5474737", "0.5456855", "0.54525745", "0.54479533", "0.54472893", "0.543281", "0.54327375", "0.54079616", "0.5389326", "0.53872705", "0.5380522", "0.53770447", "0.53625804", "0.5354106", "0.53480506", "0.53471553", "0.53337896", "0.53200877", "0.5314633", "0.5286471", "0.5283969", "0.52759457", "0.52713937", "0.52668685", "0.52639914", "0.52621794", "0.5260332", "0.5255972", "0.52510875", "0.525044", "0.5249457" ]
0.0
-1
/ set parser extension handler ...parser>html = $handlebars
public function __set(string $extension, TemplateParserInterface $parser) { $this->parsers[$this->normalizeExtension($extension)] = &$parser; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseHTML(){\n\t\t$code = preg_replace_callback('~(href|src|codebase|url|action)\\s*=\\s*([\\'\\\"])?(?(2) (.*?)\\\\2 | ([^\\s\\>]+))~isx',array('self','parseExtURL'),$this->source);\n\t\t$code = preg_replace_callback('~(<\\s*style.*>)(.*)<\\s*/\\s*style\\s*>~iUs',Array('self','parseCSS'),$code);\n\t\t$code = preg_replace_callback('~(style\\s*=\\s*)([\\'\\\"])(.*)\\2~iUs',Array('self','parseStyle'),$code);\n\t\t$code = preg_replace_callback('~<script(\\s*.*)>(.*)<\\s*/\\s*script>~iUs',Array('self','parseScriptTag'),$code);\n\t\t$this->output = $code;\n\t}", "function defaultHandler($parser, $data) {\n // virtual\n }", "protected function _parseTemplate() {}", "public function setParser(Parser $parser);", "public function parse()\n {\n $config = \\CB::getInstance()['pom'];\n $template = $this->tpl->getTemplate();\n $this->UID = 'v' . sha1(get_class(MVC\\Page::$current) . $template . serialize($this->vars) . \\CB::getSiteUniqueID());\n if (!empty($config['cacheEnabled']) && !$this->isExpired(true)) $this->pull(true);\n else\n {\n $ctx = $this->parseTemplate($this->prepareTemplate($template, $this->vars));\n $body = array_pop($ctx['controls']);\n if ($body)\n {\n if (!($body instanceof Body) || count($ctx['controls'])) throw new Core\\Exception($this, 'ERR_VIEW_5');\n $this->controls[$body->attr('id')] = $body;\n $this->commit();\n static::decodePHPTags($body, $ctx['marks']);\n $src = \\CB::url('framework-web') . '/js/jquery/jquery.min.js';\n if (empty($this->js['top'][$src])) $this->addJS(['src' => $src], null, true, -1000);\n $src = \\CB::url('framework-web') . '/js/cb.full.min.js?v=2';\n if (empty($this->js['top'][$src])) $this->addJS(['src' => $src], null, true, -999);\n }\n $this->tpl->setTemplate($ctx['html']);\n if (!empty($config['cacheEnabled'])) \n {\n $this->commit();\n $this->push(true);\n }\n }\n return $this;\n }", "function dataHandler($parser, $data) {\r\n echo $data;\r\n}", "protected function _getParser() {}", "protected function parseMiddleware()\n {\n return function (callable $handler) {\n return function (Request $request, array $options) use ($handler) {\n // Skip if option 'parse' isn't set\n if (empty($options['parse'])) return $handler($request, $options);\n\n $options['http_errors'] = false;\n $request = $request->withHeader('Accept', \"{$options['parse']}; q=1.0, text/plain; q=0.5\");\n \n $promise = $handler($request, $options);\n \n return $promise->then(function(Response $response) use ($request, $options) {\n return $this->parseResponse($request, $response, $options);\n });\n };\n };\n }", "function setHandlers($a_xml_parser)\n\t{\n\t\txml_set_object($a_xml_parser,$this);\n\t\txml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');\n\t\txml_set_character_data_handler($a_xml_parser,'handlerCharacterData');\n\t}", "public static function handle() {\n\t\t\n\t\tif(!static::$multiline) {\n\t\t\t$node = nodes\\Tag::new_from_parser(static::$parser);\n\t\t\tstatic::parse_start($node);\n\t\t\t\n\t\t\tif(static::$multiline) {\n\t\t\t\tstatic::$parser->force_handler(get_called_class());\n\t\t\t\tstatic::$parser->expect_indent(Parser::EXPECT_MORE);\n\t\t\t}\n\t\t} else {\n\t\t\t$node = static::$parser->context();\n\t\t\t$node->content .= ' ' . static::$parser->content();\n\t\t\t\n\t\t\tswitch(static::$multiline) {\n\t\t\t\tcase self::MULTILINE_HTML_ATTRIBUTES:\n\t\t\t\t\tstatic::$multiline = false;\n\t\t\t\t\tstatic::parse_html_attributes($node);\n\t\t\t\tbreak;\n\t\t\t\tcase self::MULTILINE_RUBY_ATTRIBUTES:\n\t\t\t\t\tstatic::$multiline = false;\n\t\t\t\t\tstatic::parse_ruby_attributes($node);\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$node->exception('Sanity error: unknown multiline modifier');\n\t\t\t}\n\t\t\t\n\t\t\tif(static::$multiline)\n\t\t\t static::$parser->force_handler(get_called_class());\n\t\t}\n\t\t\n\t}", "public function getParser() {}", "public function getParser() {}", "public function getParser() {}", "public function parse(): void\n {\n $this->template->assign('page_title', BL::getLabel($this->url->getModule()));\n $this->cssFiles->parse($this->template, 'cssFiles');\n $this->jsFiles->parse($this->template, 'jsFiles');\n\n $this->jsData->add('site', 'domain', SITE_DOMAIN);\n $this->jsData->add('editor', 'language', $this->getCKEditorLanguage());\n $this->jsData->add('Core', 'session_timeout', $this->getFirstPossibleSessionTimeout());\n\n if (!empty($this->get('fork.settings')->get('Core', 'theme'))) {\n $this->jsData->add('theme', 'theme', $this->get('fork.settings')->get('Core', 'theme'));\n $themePath = FRONTEND_PATH . '/Themes/' . $this->get('fork.settings')->get('Core', 'theme');\n $this->jsData->add('theme', 'path', $themePath);\n $this->jsData->add('theme', 'has_css', is_file($themePath . '/Core/Layout/Css/screen.css'));\n $this->jsData->add('theme', 'has_editor_css', is_file($themePath . '/Core/Layout/Css/editor_content.css'));\n }\n $this->template->assign('jsData', $this->jsData);\n }", "protected function initializeExternalParsers() {}", "public static function handle() {\n\t\t\n\t\t// Ideally context-locking should work for single-lines, however something is broken\n\t\t// this will have to do just now...\n\t\tif(strlen(static::$parser->content()) > 2)\n\t\t\treturn;\n\n\t\tif(static::$parser->context_locked() === false)\n\t\t\tstatic::$parser->lock_context();\n\t\tstatic::$parser->force_handler(get_called_class());\n\t\t\n\t}", "function BugzillaParserInit( Parser &$parser ) {\n global $wgBugzillaTagName;\n\n // Register the desired tag\n $parser->setHook( $wgBugzillaTagName, 'BugzillaRender' );\n\n // Let the other hooks keep processing\n return TRUE;\n}", "function Setup(&$parser) {\n\t\t\n\t\t// LaTeX-commands, which we want to offer to a wiki-article\n\t\t$parser->setHook(\"noindent\", array($this, \"NoIndent\"));\n\t\t$parser->setHook(\"newpage\", array($this, \"NewPage\"));\n\t\t$parser->setHook(\"label\", array($this, \"Label\"));\n\t\t$parser->setHook(\"pageref\", array($this, \"PageRef\"));\n\t\t$parser->setHook(\"chapref\", array($this, \"ChapRef\"));\n\t\t\n\t\t// Extension-tags, which we need for w2l:\n\t\t$parser->setHook(\"templatevar\", array($this, \"TemplateVar\"));\n\t\t$parser->setHook(\"latex\", array($this, \"Latex\"));\n\t\t$parser->setHook(\"latexpage\", array($this, \"LatexPage\"));\n\t\t$parser->setHook(\"latexfile\", array($this, \"LatexFile\"));\n\t\t\n\t\t// By this one, you can directly input latex to a wiki article. LaTeX code is not interpreted in wiki-mode, though.\n\t\t$parser->setHook(\"rawtex\", array($this, \"RawTex\"));\n\n\t\treturn true;\n\t}", "public function parse(): void\n {\n $footerLinks = (array) Navigation::getFooterLinks();\n $this->template->assignGlobal('footerLinks', $footerLinks);\n\n $siteHTMLFooter = (string) $this->get('fork.settings')->get('Core', 'site_html_footer', null);\n\n // assign site wide html\n $this->template->assignGlobal('siteHTMLFooter', $siteHTMLFooter);\n }", "protected function parse(): void\n {\n parent::parse();\n $this->template->assign('dataGrid', (string) $this->dataGrid->getContent());\n }", "public static function init( Parser $parser ) {\n\t $parser->setHook( 'latex', [ self::class, 'renderLatex' ] );\n }", "protected function parseHtml() {\r\n\t\tif (is_array($this->cfg->html))\r\n\t\t\t$this->cfg->html = utils::render($this->cfg->html);\r\n\t}", "function wfExampleExtension() {\n global $wgParser; // MediaWiki global variable\n $wgParser->setHook(\"server\", \"renderServer\");\n}", "function xmlData($parser, $handler){\n\t\t\t$eval = \"\\$this->tags\";\n\t\t\tforeach($this->beguns AS $value){\n\t\t\t\t$eval .= \"['\" . $value . \"']\";\n\t\t\t}\n\t\t\t\n\t\t\t$eval .= \" = '\" . $handler . \"';\";\n\t\t\teval($eval);\n\t\t}", "function handle()\n {\n $this->page = file_get_contents('./pages/details.html');\n $this->page = str_replace('<!-- HEADER -->', file_get_contents('./pages/header.html'), $this->page);\n\n }", "function pparse($handle)\n\t{\n\t\tif ( defined('DEBUG_TEMPLATE') && !$this->no_debug )\n\t\t{\n\t\t\techo '<!-- Start of : ' . $this->files[$handle] . ' :: ' . $handle . ' -->' . \"\\n\";\n\t\t}\n\t\tif ($filename = $this->_tpl_load($handle))\n\t\t{\n\t\t\tinclude($filename);\n\t\t}\n\t\telse\n\t\t{\n\t\t\teval(' ?>' . $this->compiled_code[$handle] . '<?php ');\n\t\t}\n\t\tif ( defined('DEBUG_TEMPLATE') && !$this->no_debug )\n\t\t{\n\t\t\techo '<!-- End of : ' . $this->files[$handle] . ' :: ' . $handle . ' -->' . \"\\n\";\n\t\t}\n\n\t\treturn true;\n\t}", "public function load() {\n\t\tglobal $apps;\n\n\t\t$self = $this;\n\t\t$this->add_parser(function(&$body) use($self, $apps) {\n\t\t\tif(ENVIRONMENT == 'development') {\n\t\t\t\tif(isset($apps->debug)) {\n\t\t\t\t\t$debug = $apps->debug;\n\t\t\t\t\t$body = $body . '$debug';\n\t\t\t\t\t$body = preg_replace('/\\$debug/', $debug->get_message(), $body);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(IS_RESTFUL_CALL) {\n\t\t\t\tif($self->is_error_404) $body = json_encode(array('error' => 'The page does not exist!'));\n\t\t\t\tif($body === NULL) $body = json_encode(array());\n\t\t\t}\n\t\t});\n\n\t\tob_start(array($this, \"output\"));\n\t}", "public function setShortcodeParser(ShortcodeParser $parser);", "public function html() {}", "public function injectParser(F3_Contentparser_Domain_Parser $parser) {\n\t\t$this->parser = $parser;\n\t}", "function show_parsed(){ // parsing template (if needed) and showing the result of parsing\n\tif (isset($this->result)) echo $this->result;\n\telse {\n\t\t$this->parse();\n\t\techo $this->result;\n\t}\n}", "public function registerHamlCompiler() {\n\n\t\t// Add resolver\n\t\t$this->app['view.engine.resolver']->register('haml', function() {\n\t\t\treturn new CompilerEngine($this->app['Bkwld\\LaravelHaml\\HamlCompiler']);\n\t\t});\n\n\t\t// Add extensions\n\t\t$this->app['view']->addExtension('haml', 'haml');\n\t\t$this->app['view']->addExtension('haml.php', 'haml');\n\t}", "public function run()\n {\n// $this->parse();\n }", "protected function registerHttpParsers()\n {\n $this->app->singleton(AcceptParser::class, function ($app) {\n return new AcceptParser(\n $this->config('standardsTree'),\n $this->config('subtype'),\n $this->config('version'),\n $this->config('defaultFormat')\n );\n });\n }", "public function setParser(Twig_Parser $parser)\n {\n $this->parser = $parser;\n }", "abstract public function parse(\\SHH\\Parser &$parser);", "public function getPageHandler();", "private function enableBladeEngine(): void\n {\n $app = $this->app;\n\n $app->view->getEngineResolver()->register('blademd', function () use ($app): BladeCommonMarkEngine {\n $compiler = $app['blade.compiler'];\n $files = $app['files'];\n $converter = $app['markdown.converter'];\n\n return new BladeCommonMarkEngine($compiler, $files, $converter);\n });\n\n $app->view->addExtension('md.blade.php', 'blademd');\n }", "function contentHandler ( $parser, $contentHandler ) {\n\n\t\t// remove all spaces;\n\t\tif(!preg_match('#^\\s*$#', $contentHandler)) {\n\n\t\t\t// $contentHandler is a string;\n\t\t\tif(is_string($this->pOut[key($this->track)][current($this->track)])) {\n\n\t\t\t\t// then $contentHandler is a pointer : {{int ptr}} case 1;\n\t\t\t\tif(preg_match('#{{([0-9]+)}}#', $this->pOut[key($this->track)][current($this->track)]))\n\t\t\t\t\t$this->pOut[key($this->track)][current($this->track)] = $contentHandler;\n\n\t\t\t\t// or then $contentHandler is a multi-tag content case 2;\n\t\t\t\telse {\n\t\t\t\t\t$this->pOut[key($this->track)][current($this->track)] = array(\n\t\t\t\t\t\t0 => $this->pOut[key($this->track)][current($this->track)],\n\t\t\t\t\t\t1 => $contentHandler\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// or $contentHandler is an array;\n\t\t\telse {\n\n\t\t\t\t// then $contentHandler is the multi-tag array case 1;\n\t\t\t\tif(isset($this->pOut[key($this->track)][current($this->track)][0]))\n\t\t\t\t\t$this->pOut[key($this->track)][current($this->track)][] = $contentHandler;\n\n\t\t\t\t// or then $contentHandler is a node-tag case 2;\n\t\t\t\telse\n\t\t\t\t\t$this->pOut[key($this->track)][current($this->track)] = array(\n\t\t\t\t\t\t0 => $this->pOut[key($this->track)][current($this->track)],\n\t\t\t\t\t\t1 => $contentHandler\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function __handler()\n {\n $this->view('index')->title('Main page');\n }", "public function init()\n {\n $this->shortcode->getHandlers()->add('div', function (ShortcodeInterface $sc) {\n $id = $sc->getParameter('id');\n $class = $sc->getParameter('class');\n $style = $sc->getParameter('style');\n\n $id_output = $id ? ' id=\"' . $id . '\" ' : '';\n $class_output = $class ? ' class=\"' . $class . '\"' : '';\n $style_output = $style ? ' style=\"' . $style . '\"' : '';\n\n $content = $this->parseDown->line($sc->getContent());\n\n return '<div ' . $id_output . $class_output . $style_output . '>' . $content . '</div>';\n });\n }", "public function registerHamlBladeCompiler() {\n\n\t\t// Add resolver\n\t\t$this->app['view.engine.resolver']->register('haml.blade', function() {\n\t\t\treturn new CompilerEngine($this->app['Bkwld\\LaravelHaml\\HamlBladeCompiler']);\n\t\t});\n\n\t\t// Add extensions\n\t\t$this->app['view']->addExtension('haml.blade', 'haml.blade');\n\t\t$this->app['view']->addExtension('haml.blade.php', 'haml.blade');\n\t}", "public function setParser($parser)\n {\n $this->_parser = $parser;\n }", "public function parser()\n\t{\n\t\tif ( ! $this->parser)\n\t\t{\n\t\t\t$this->parser = $this->_app->get_object('Parser');\n\t\t}\n\t\treturn $this->parser;\n\t}", "public function run()\n {\n $block = trim(ob_get_clean());\n $this->registerCssBlock($block);\n $this->registerJsBlock($block);\n }", "function cDataHandler($parser, $data) {\n // virtual\n }", "protected function initParsers() {\n return array();\n }", "protected function registerHtmlBuilder()\n {\n $this->app->singleton('html', function ($app) {\n return new HtmlComponent($app['url'], $app['view']);\n });\n }", "function _helpermethods_xhtml(Doku_Renderer &$renderer){\n $plugins = plugin_list('helper');\n foreach($plugins as $p){\n if (!$po = plugin_load('helper',$p)) continue;\n\n if (!method_exists($po, 'getMethods')) continue;\n $methods = $po->getMethods();\n $info = $po->getInfo();\n\n $hid = $this->_addToTOC($info['name'], 2, $renderer);\n $doc = '<h2><a name=\"'.$hid.'\" id=\"'.$hid.'\">'.hsc($info['name']).'</a></h2>';\n $doc .= '<div class=\"level2\">';\n $doc .= '<p>'.strtr(hsc($info['desc']), array(\"\\n\"=>\"<br />\")).'</p>';\n $doc .= '<pre class=\"code\">$'.$p.\" = plugin_load('helper', '\".$p.\"');</pre>\";\n $doc .= '</div>';\n foreach ($methods as $method){\n $title = '$'.$p.'->'.$method['name'].'()';\n $hid = $this->_addToTOC($title, 3, $renderer);\n $doc .= '<h3><a name=\"'.$hid.'\" id=\"'.$hid.'\">'.hsc($title).'</a></h3>';\n $doc .= '<div class=\"level3\">';\n $doc .= '<div class=\"table\"><table class=\"inline\"><tbody>';\n $doc .= '<tr><th>Description</th><td colspan=\"2\">'.$method['desc'].\n '</td></tr>';\n if ($method['params']){\n $c = count($method['params']);\n $doc .= '<tr><th rowspan=\"'.$c.'\">Parameters</th><td>';\n $params = array();\n foreach ($method['params'] as $desc => $type){\n $params[] = hsc($desc).'</td><td>'.hsc($type);\n }\n $doc .= join($params, '</td></tr><tr><td>').'</td></tr>';\n }\n if ($method['return']){\n $doc .= '<tr><th>Return value</th><td>'.hsc(key($method['return'])).\n '</td><td>'.hsc(current($method['return'])).'</td></tr>';\n }\n $doc .= '</tbody></table></div>';\n $doc .= '</div>';\n }\n unset($po);\n\n $renderer->doc .= $doc;\n }\n }", "public function setParser(ParserInterface $parser): void;", "public function getHandler(&$output)\n {\n parent::getHandler($output);\n\n $serverData = $this->model->getServerInfo();\n\n $tags = array(\n '{APACHEVERSION}' => $serverData['version_apache'],\n '{PHPVERSION}' => $serverData['version_php'],\n '{MYSQLVERSION}' => $serverData['version_mysql'],\n '{PDOMYSQLEXT}' => $serverData['extension_pdo_mysql'],\n '{PHPCURLEXT}' => $serverData['extension_curl'],\n '{PHPJSONEXT}' => $serverData['extension_json'],\n '{PHPDATEEXT}' => $serverData['extension_date'],\n '{PHPFILTEREXT}' => $serverData['extension_filter'],\n '{PHPHASHEXT}' => $serverData['extension_hash'],\n '{PHPSESSIONEXT}' => $serverData['extension_session'],\n '{PHPPCREEXT}' => $serverData['extension_pcre'],\n '{PHPMCRYPTEXT}' => $serverData['extension_mcrypt'],\n '{PHPMBSTRINGEXT}' => $serverData['extension_mbstring'],\n '{PASSWORDHASH}' => $serverData['function_pass_hash'],\n '{HTTPRESPONSECODE}' => $serverData['function_http_code'],\n );\n $this->templateEngine->parseTags($tags, $output);\n }", "public function handle()\n {\n $this->parse();\n }", "function pparse($handle)\n\t{\n\t\tglobal $config;\n\n\t\t// Mighty Gorgon - Extra Debug - BEGIN\n\t\tif (defined('DEBUG_EXTRA') && DEBUG_EXTRA && !empty($_REQUEST['explain']))\n\t\t{\n\t\t\tglobal $user, $db;\n\t\t\tif (($user->data['user_level'] == ADMIN) && method_exists($db, 'sql_report'))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Mighty Gorgon - Extra Debug - END\n\n\t\tif (!defined('CSS_JS_PARSED'))\n\t\t{\n\t\t\t$this->add_css_js();\n\t\t}\n\n\t\t// parsing header if there is one\n\t\tif($this->preparse || $this->postparse)\n\t\t{\n\t\t\t$preparse = $this->preparse;\n\t\t\t$postparse = $this->postparse;\n\t\t\t$this->preparse = '';\n\t\t\t$this->postparse = '';\n\t\t\tif($preparse)\n\t\t\t{\n\t\t\t\t$this->pparse($preparse);\n\t\t\t}\n\t\t\tif($postparse)\n\t\t\t{\n\t\t\t\t$str = $handle;\n\t\t\t\t$handle = $postparse;\n\t\t\t\t$this->pparse($str);\n\t\t\t}\n\t\t}\n\n\t\t// checking if handle exists\n\t\tif (empty($this->files[$handle]) && empty($this->files_cache[$handle]))\n\t\t{\n\t\t\tif(isset($this->files[$handle]) && ($this->files[$handle] === false))\n\t\t\t{\n\t\t\t\t// skip file\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tdie(\"Template->loadfile(): No files found for handle $handle\");\n\t\t}\n\t\t$this->xs_startup();\n\t\t$force_recompile = empty($this->uncompiled_code[$handle]) ? false : true;\n\n\t\t// checking if php file exists.\n\t\tif (!empty($this->files_cache[$handle]) && !$force_recompile)\n\t\t{\n\t\t\t// php file exists - running it instead of tpl\n\t\t\t$this->execute($this->files_cache[$handle], '', $handle);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!$this->loadfile($handle))\n\t\t{\n\t\t\tdie(\"Template->pparse(): Couldn't load template file for handle $handle\");\n\t\t}\n\n\t\t// actually compile the template now.\n\t\tif (empty($this->compiled_code[$handle]))\n\t\t{\n\t\t\t// Actually compile the code now.\n\t\t\tif(!empty($this->files_cache2[$handle]) && empty($this->files_cache[$handle]) && !$force_recompile)\n\t\t\t{\n\t\t\t\t$this->compiled_code[$handle] = $this->compile2($this->uncompiled_code[$handle], $handle, $this->files_cache2[$handle]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->compiled_code[$handle] = $this->compile2($this->uncompiled_code[$handle], '', '');\n\t\t\t}\n\t\t}\n\n\t\t// Run the compiled code.\n\t\tif (empty($this->files_cache[$handle]) || $force_recompile)\n\t\t{\n\t\t\t$this->execute('', $this->compiled_code[$handle], $handle);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->execute($this->files_cache[$handle], '', $handle);\n\t\t}\n\t\treturn true;\n\t}", "public function getTokenParsers()\n {\n return array(new Twig_TokenParser_AutoEscape());\n }", "public static function parse() {\n if (\\CMS::$_vars[3] == 'submit') {\n switch (\\CMS::$_vars[2]) {\n case 'add':\n self::add_submit();\n break;\n \n case 'edit':\n self::edit_submit();\n break;\n }\n }\n\n\n /* Page Content Handlers */\n switch (\\CMS::$_vars[2]) {\n case 'add':\n self::$_pagemode = 'add';\n self::add();\n break;\n \n case 'edit':\n self::$_pagemode = 'edit';\n self::edit();\n break;\n \n case 'confirmdelete':\n self::$_pagemode = 'confirmdelete';\n self::confirmdelete();\n break;\n \n case 'delete':\n self::$_pagemode = 'delete';\n self::delete();\n break;\n \n \n case 'list':\n self::$_pagemode = 'listall';\n self::listall();\n break;\n \n default:\n self::$_pagemode = 'listall';\n self::listall(); \n }\n\n if (self::$_status) {\n \\Html::set('{status}', self::$_status);\n }else{\n \\Html::set('{status}', '');\n }\n }", "public function render()\r\n {\r\n $this->data['menu'] = build_menu(\r\n $this->choices, $this->uri->segment(1));\r\n \r\n $this->data['header'] = $this->parser->parse(\r\n '_header', $this->data, true);\r\n $this->data['content'] = $this->parser->parse(\r\n $this->data['page_body'], $this->data, true);\r\n $this->data['footer'] = $this->parser->parse(\r\n '_footer', $this->data, true);\r\n \r\n $this->data['data'] = &$this->data;\r\n \r\n $this->parser->parse('_template', $this->data);\r\n }", "function create_parser() {}", "protected function registerParser()\n {\n $this->app->singleton(EmojiParser::class, function (Container $app) {\n return new EmojiParser($app->make(RepositoryInterface::class));\n });\n }", "function get_html()\n\t{\n\n\t// incrase views\n\n\t}", "protected function registerHtmlBuilder()\n {\n $this->app->singleton('html', function ($app) {\n return new HtmlBuilder($app['url'], $app['view']);\n });\n }", "public function getTokenParsers()\n {\n return array(new Twig_TokenParser_AutoEscape());\n }", "protected function registerHtmlBuilder()\n {\n $this->app->bindShared('html', function($app)\n {\n return new HtmlBuilder($app['url']);\n });\n }", "private function initHtmlTags($di) {\n\t\t\t$di->set('htmlTags', function(){\n\t\t\t\n\t\t\t\treturn new TagCollection();\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t}", "function ob_tidyhandler($input, $mode = null) {}", "protected static function getFacadeAccessor() { return 'parse.twig'; }", "public function get_handler()\n {\n }", "function registerHandler($format, $callback);", "function yy_accept()\r\n {\r\n if (self::$yyTraceFILE) {\r\n fprintf(self::$yyTraceFILE, \"%sAccept!\\n\", self::$yyTracePrompt);\r\n }\r\n while ($this->yyidx >= 0) {\r\n $stack = $this->yy_pop_parser_stack();\r\n }\r\n /* Here code is inserted which will be executed whenever the\r\n ** parser accepts */\r\n#line 52 \"smarty_internal_templateparser.y\"\r\n\r\n $this->successful = !$this->internalError;\r\n $this->internalError = false;\r\n $this->retvalue = $this->_retvalue;\r\n //echo $this->retvalue.\"\\n\\n\";\r\n#line 2606 \"smarty_internal_templateparser.php\"\r\n }", "public static function onParserFirstCallInit( $parser ) {\n\t\t$parser->setHook( 'video', 'VideoHooks::videoEmbed' );\n\t}", "function start_html($extra = '')\n{\n /** Starting the HTML document */\n start_tag('html', '', true, $extra) ;\n}", "public function createParser();", "function TEMPLATE_ENGINE_HAML_TO_PHP_info(){\nhttp://titanpad.com/moZN7Lm1Nr\n return array(\n \"template_engine_name\" => 'HAML-TO-PHP',\n \"template_engine_version\" => 'WEB '.date('Y-m-d'),\n \"template_engine_settings\" => \"\",\n \"template_engine_url\" => \"haml-to-php.com\"\n );\n}", "function __construct() {\n debug (\"Yay class afMarkupParser loaded!\",0);\n }", "public function getTokenParsers()\n\t{\n\t\treturn array(\n\t\t\tnew \\phpbb\\template\\twig\\tokenparser\\defineparser,\n\t\t\tnew \\phpbb\\template\\twig\\tokenparser\\includeparser,\n\t\t\tnew \\phpbb\\template\\twig\\tokenparser\\includejs,\n\t\t\tnew \\phpbb\\template\\twig\\tokenparser\\includecss,\n\t\t\tnew \\phpbb\\template\\twig\\tokenparser\\event,\n\t\t\tnew \\phpbb\\template\\twig\\tokenparser\\includephp,\n\t\t\tnew \\phpbb\\template\\twig\\tokenparser\\php,\n\t\t);\n\t}", "public function parse(): OptionPage;", "public static function setup( &$parser ) {\r\n global $wgMessageCache, $wgHooks;\r\n \r\n // These functions accept DOM-style arguments\r\n foreach( self::$parserFunctions as $hook => $function )\r\n $parser->setFunctionHook( $hook,\r\n array( __CLASS__, $function ), SFH_OBJECT_ARGS );\r\n \r\n require_once( dirname( __FILE__ ) . '/Loops.i18n.php' );\r\n \r\n foreach( Loops_i18n::getMessages() as $lang => $messages )\r\n $wgMessageCache->addMessages( $messages, $lang );\r\n \r\n $wgHooks['ParserClearState'][] = __CLASS__ . '::parserClearState';\r\n \r\n return true;\r\n }", "public function __viewTemplate()\n {\n $this->_context[2] = 'single';\n $this->addStylesheetToHead(self::$assets_base_url . 'editor.css');\n $this->addStylesheetToHead(self::$assets_base_url . 'highlighters/highlight-xsl.css');\n $this->addScriptToHead(self::$assets_base_url . 'editor.js');\n $this->addScriptToHead(self::$assets_base_url . 'highlighters/highlight-xsl.js');\n $name = $this->_context[1];\n $filename = $name . '.xsl';\n $title = $filename;\n $this->setTitle(__(('%1$s &ndash; %2$s &ndash; %3$s'), array($title, __('Pages'), __('Symphony'))));\n //$this->setPageType('table');\n $this->Body->setAttribute('spellcheck', 'false');\n $this->appendSubheading($title);\n $breadcrumbs = array(\n Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/'),\n new XMLElement('span', __(Helpers::capitalizeWords($name)))\n );\n $this->insertBreadcrumbs($breadcrumbs);\n \n $this->insertAction(\n Widget::Anchor(\n __('Edit Page'), \n SYMPHONY_URL . '/blueprints/pages/edit/' . PageManager::fetchIDFromHandle($name) . '/',\n __('Edit Page Configuration'),\n 'button'\n )\n );\n\n $this->Form->setAttribute('class', 'columns');\n $this->Form->setAttribute('action', SYMPHONY_URL . '/blueprints/pages/' . $name . '/');\n\n $fieldset = new XMLElement('fieldset');\n $fieldset->appendChild(Widget::Input('fields[name]', $filename, 'hidden'));\n $fieldset->appendChild($label);\n //$fieldset->appendChild((isset($this->_errors['name']) ? Widget::Error($label, $this->_errors['name']) : $label));\n\n $label = Widget::Label(__('Body'));\n $label->appendChild(\n Widget::Textarea(\n 'fields[body]',\n 30,\n 100,\n $filename ? htmlentities(file_get_contents(WORKSPACE . '/pages/' . $filename), ENT_COMPAT, 'UTF-8') : '',\n array('id' => 'text-area', 'class' => 'code hidden')\n )\n );\n //$fieldset->appendChild((isset($this->_errors['body']) ? Widget::Error($label, $this->_errors['body']) : $label));\n\n $fieldset->appendChild($label);\n $this->Form->appendChild($fieldset);\n\n $this->Form->appendChild(\n new XMLElement(\n 'div',\n new XMLElement('p', __('Saving')),\n array('id' => 'saving-popup')\n )\n );\n //$this->_context = array('edit', 'pages', 'single');\n $this->Form->appendChild(\n new XMLElement(\n 'div',\n Widget::Input(\n 'action[save]',\n __('Save Changes'),\n 'submit',\n array('class' => 'button', 'accesskey' => 's')\n ),\n array('class' => 'actions')\n )\n );\n }", "function handle()\n {\n\n if(isset($_POST['submit-report'])){\n $this->handleSubmission();\n }\n\n\n $this->page = file_get_contents('./pages/dispatch.html');\n $departments = $this->generateDepartments();\n $this->page = str_replace(\"<!-- Fill Departments -->\", $departments, $this->page);\n $this->page = str_replace(\"<!-- HEADER -->\", file_get_contents('./pages/header.html'), $this->page);\n //$this->page = str_replace('<!-- javascript -->', $this->getJS(), $this->page);\n }", "public function loadparser($data){\n\t\t$this->hakakses = $this->gethakakses();\n\t\tif ($this->hakakses=='admin') {\n\t\t\t$this->parser->parse('admin/v-index-admin', $data);\n\t\t}else{\n\t\t\techo \"forbidden access\"; \t\t\n\t\t}\n\t}", "function html()\n {\n }", "function html()\n {\n }", "function html()\n {\n }", "public function setParser(Twig_ParserInterface $parser)\n {\n $this->parser = $parser;\n }", "public function handle()\n {\n $template = new BackendTemplate('be_member_import_analysis');\n\n $this->collectSettings();\n\n $template->information = $this->settings;\n\n return $template->parse();\n }", "public function html();", "public function getHandler() {}", "function get_handler() {\r\n }", "public static function handle() {\n $whoops = new \\Whoops\\Run;\n $whoops->prependHandler(new \\Whoops\\Handler\\PrettyPageHandler);\n $whoops->register();\n }", "protected function parse() {}", "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n $this->uri = $request->getUri();\n $this->app->getContainer()->get('view')->loadExtension($this);\n return $handler->handle($request);\n }", "function registerEmbedPDFHandler( &$parser ) {\r\n\t$parser->setHook( 'pdf', 'embedPDFHandler' );\r\n\treturn true;\r\n}", "function piHandler($parser, $target, $data) {\n // virtual\n }", "public function getHandler()\n {\n }", "function parse($str, $structure = false, $php = true, $info = null)\n\t{\n\t\tif(!is_string($str)) return false;\n\n\t\t// render or delete php\n\t\tif($php && strpos($str, '<?php') !== false) {\n\t\t\ttry { $str = $this->php_render($str, $info); }\n\t\t\tcatch(Exception $phperror) {}\n\t\t}\n\t\tif(!$php || isset($phperror)) $str = preg_replace('`<\\?php.*\\?>`mUi', '', $str);\n\n\t\t// find and extract items to preserve\n\t\tglobal $p_items;\n\t\tif(!isset($p_items)) $p_items = array();\n\t\t$p_patterns = array(\n\t\t\t'`<\\s*noparse[^>]*>(.*)</\\s*noparse[^>]*>`smUi',\n\t\t\t'`<\\s*script[^>]*>.*</\\s*script[^>]*>`smUi');\n\t\t$p_func = create_function('$out', '\n\t\t\tglobal $p_items;\n\t\t\t$p_items[] = isset($out[1]) ? $out[1] : $out[0];\n\t\t\treturn \"<THIISpreserve\".(count($p_items)-1).\"/>\";');\n\t\tforeach($p_patterns as $p) $str = preg_replace_callback($p, $p_func, $str);\n\t\t// parse code\n\t\t$str = preg_replace_callback('`(\\n?)<code([^>]*)>(.*)(</\\s*code[^>]*>)`smUi', array(&$this, 'parse_code'), $str);\n\n\t\t// hr\n\t\t$str = preg_replace('`___+`', '<hr />', $str);\n\t\t// lists\n\t\t$str = preg_replace_callback('`(?:\\n(?: |\\t)+[-*][^\\n]*)+`', array(&$this, 'parse_list'), $str);\n\n\t\t// find and render markups\n\t\t$markup_list = array('**'=>'**', '//'=>'//', '__'=>'__', '\\'\\''=>'\\'\\'', '{{'=>'}}', 'href=\"[['=>']]\"', '[['=>']]', '(('=>'))');\n\t\t$markup_pattern = '`(\\*\\*|(?<!:)//|__|\\'\\'|\\{\\{|\\}\\}|\\[\\[|\\]\\]|\\(\\(|\\)\\))`';\n\t\t$markup_matches = preg_split($markup_pattern, $str, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\t$tree = $this->markup_tree_create($markup_list, $markup_matches);\n\t\t$str = $this->markup_tree_render($tree);\n\n\t\t// headers and paragraphs\n\t\tif($structure) {\n\t\t\t$str = $this->parse_headers($str);\n\t\t\t$str = $this->parse_breaks($str);\n\t\t}\n\n\t\t// dashes\n\t\t$str = preg_replace(\n\t\t\tarray('`[^-](?<!<!)---(?!>)[^-]`', '`[^-](?<!<!)--(?!>)[^-]`'),\n\t\t\tarray('&mdash;', '&ndash;'),\n\t\t\t$str);\n\n\t\t// retrieve preserved items\n\t\tforeach($p_items as $id => $item)\n\t\t\t$str = preg_replace('`<THIISpreserve'.$id.'/>`', $item, $str, 1);\n\n\t\treturn $str;\n\t}", "function callback_html(array $args)\n {\n }", "function handlerEndTag($a_xml_parser,$a_name)\r\n\t{\r\n\t \tif(isset($this->element_handlers[$a_name]))\r\n\t \t{\r\n\t \t\t$this->handler_in_use = false;\r\n\t \t\t$this->current_handler = $this->element_handlers[$a_name];\r\n\t \t\treturn $this->element_handlers[$a_name]->handlerEndTag($a_xml_parser,$a_name);\r\n\t \t}\r\n\t \telseif($this->handler_in_use)\r\n\t \t{\r\n\t \t\t$this->current_handler = $this->handler_in_use;\r\n\t \t\treturn $this->current_handler->handlerEndTag($a_xml_parser,$a_name);\r\n\t \t}\r\n\t \t$this->handler_in_use = false;\r\n\t \t$this->current_handler = $this->default_handler;\r\n\t \treturn $this->default_handler->handlerEndTag($a_xml_parser,$a_name);\r\n\t}", "public function process($html);", "private function enableCompiler(): void\n {\n $app = $this->app;\n\n $app->view->getEngineResolver()->register('md', function () use ($app): CompilerEngine {\n $compiler = $app['markdown.compiler'];\n\n return new CompilerEngine($compiler);\n });\n\n $app->view->addExtension('md', 'md');\n }", "function _defaultHandler($parser, $data)\r\n {\r\n if (preg_match('/<\\?xml (\\w+=\".+\")\\?>/', $data, $matches)) {\r\n $pinode =& $this->_dom->createProcessingInstruction('xml', $matches[1]);\r\n $this->_parent->appendChild(&$pinode);\r\n } elseif ($data == '<![CDATA[') {\r\n $this->_cdata = true;\r\n } elseif ($data == ']]>') {\r\n $this->_cdata = $this->_cdata !== true ? $this->_cdata : '';\r\n $CDATANode =& $this->_dom->createCDATASection($this->_cdata);\r\n $this->_parent->appendChild(&$CDATANode);\r\n $this->_cdata = false;\r\n }\r\n }", "public static function enableHtmlExtension()\r\n {\r\n self::$html = true;\r\n }" ]
[ "0.5805227", "0.5675295", "0.56749547", "0.5512151", "0.5437239", "0.54315567", "0.54147184", "0.5386036", "0.5372445", "0.5342599", "0.532771", "0.532771", "0.5327521", "0.5304721", "0.5279891", "0.52602494", "0.52445376", "0.5241771", "0.5240835", "0.52349627", "0.52177465", "0.5213743", "0.5202633", "0.5186553", "0.51552325", "0.5144239", "0.51095533", "0.510464", "0.5104005", "0.50983816", "0.5096128", "0.5090846", "0.5082376", "0.5070518", "0.50617355", "0.50608486", "0.5046866", "0.50405455", "0.50215816", "0.4998282", "0.49661103", "0.49646017", "0.49611512", "0.4945851", "0.4941254", "0.49396467", "0.4936689", "0.49253008", "0.49237746", "0.49191958", "0.4905282", "0.49012116", "0.48781684", "0.48697084", "0.48653835", "0.48547894", "0.48513144", "0.48192078", "0.48189622", "0.48145127", "0.48102492", "0.4801404", "0.47797573", "0.4778838", "0.4773896", "0.47703144", "0.47651923", "0.47605404", "0.4757312", "0.47551534", "0.47478402", "0.47398633", "0.47393972", "0.47358114", "0.47315", "0.47279787", "0.47278258", "0.47228205", "0.47211725", "0.4719232", "0.4719232", "0.4719232", "0.47099158", "0.47043622", "0.47033456", "0.46983662", "0.46971816", "0.46953222", "0.46922156", "0.4681086", "0.46717414", "0.46708557", "0.4661911", "0.46552774", "0.4653251", "0.46480387", "0.46476883", "0.4641598", "0.4640482", "0.46334854" ]
0.49481326
43
/ parse the router provided template
public function parse(string $key, array $data = []): string { $html = $this->_parse($key, $data); /** * If somewhere on the orginal template they set the reparseKey * we need to re-parse the new template with the same data * this replaces the current output */ while ($this->reparseKey) { $data = array_replace($data, $this->reparseData); /* clear it so we don't loop */ unset($this->reparseKey); $html = $this->_parse($this->reparseKey, $data); } /* return the output */ return $html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _parseTemplate() {}", "protected function getCurrentParsedTemplate() {}", "public function get_router();", "protected function parse($template) {\n return (new MustacheParser())->parse(new StringTokenizer($template));\n }", "private function _Parsing($template)\n {\n // ДИРЕКТИВЫ\n // Literal\n preg_match_all(\"~{literal}(.+?){/literal}~si\", $template, $match);\n foreach ($match[0] as $key => $val)\n {\n $template = str_replace($val, \"<LITERAL{$key}LITERAL>\", $template);\n }\n\n // подключение шаблонов директивой инклуде {инклуде \"дирнаме/филенаме\"}\n $template = preg_replace_callback(self::PATTERN_INCLUDE, [$this, '_Parsing_Include'], $template);\n // парсинг языковых конструкций\n $template = preg_replace_callback(self::PATTERN_TRANSLATION1, [$this, '_Parsing_Translation1'], $template);\n $template = preg_replace_callback(self::PATTERN_TRANSLATION2, [$this, '_Parsing_Translation2'], $template);\n // парсинг плагинов\n $template = preg_replace_callback(self::PATTERN_PLUGIN, [$this, '_Parsing_Controller'], $template);\n //\n\n // Вырезаем служебные комментарии\n $template = preg_replace('~{#(.*?)#}~s', '', $template);\n\n //\tциклы и логика\n $template = preg_replace('~{((foreach|for|while|if|switch|case|default) .+?)}~si', '<' . '?php $1 { ?' . '>', $template);\n $template = preg_replace('~{(/|/foreach|/for|/while|/if|/switch|/case|/default)}~si', '<' . '?php } ?' . '>', $template);\n $template = preg_replace('~{else if (.+?)}~si', '<' . '?php } else if $1 { ?' . '>', $template);\n $template = preg_replace('~{else}~si', '<' . '?php } else { ?' . '>', $template);\n $template = preg_replace('~{(break|continue)}~si', '<' . '?php $1; ?' . '>', $template);\n //\tпеременные установка\n $template = preg_replace('~{set ([^}]{1,255})}~si', '<' . '?php $1; ?' . '>', $template);\n\n //\tпеременные вывод\n $template = preg_replace('~{(\\$[^}]{1,255})}~si', '<' . '?php echo $1; ?' . '>', $template);\n //\tфункции и константы\n $template = preg_replace('~{([a-z]{1}[^}]{0,150})}~si', '<' . '?php echo $1; ?' . '>', $template);\n\n // Literal\n foreach ($match[1] as $key => $val)\n {\n $template = str_replace(\"<LITERAL{$key}LITERAL>\", trim($val), $template);\n }\n\n // ////\tпеременные вывод\n // $template = preg_replace('~([^{]?){(\\$[^}]{1,255})}([^}]?)~si', '$1<' . '?php echo $2; ?' . '>$3', $template);\n // ////\tфункции и константы\n // $template = preg_replace('~([^{]?){([a-z]{1}[^}]{0,150})}([^}]?)~si', '$1<' . '?php echo $2; ?' . '>$3', $template);\n\n //\n return $template;\n }", "protected function parse($template)\n {\n if ($template) {\n $regex = $this->getTag()->getTagRegex();\n // check if template has cached\n $md5 = md5($template);\n if (!in_array($md5, $this->hashes)) {\n $matches = null;\n preg_match_all($regex, $template, $matches, PREG_PATTERN_ORDER);\n $this->matches[$md5] = $matches;\n $this->hashes[] = $md5;\n } else {\n $matches = $this->matches[$md5];\n }\n // scan for EACH tags\n $eachs = $this->parseEach($template, $matches);\n // scan for TBL tags\n $tables = $this->parseTable($template, $matches);\n // parse regular tags\n for ($i = 0; $i < count($matches[1]); $i ++) {\n $match = $matches[0][$i];\n $tag = $matches[1][$i];\n // ignore non exist match\n if (false === strpos($template, $match)) {\n continue;\n }\n if (false !== ($tag = $this->parseTag($tag))) {\n if ($tag instanceof \\DateTime) {\n $tag = $tag->format(\\DateTime::ISO8601);\n }\n $template = str_replace($match, $tag, $template);\n }\n }\n // process EACH\n foreach ($eachs as $tag => $params) {\n $content = $this->parseSub($params['content'], $params['expr']);\n $template = str_replace('%%EACH:'.$tag.'%%', $content, $template);\n }\n // process TBL\n foreach ($tables as $tag => $params) {\n $content = $this->parseSub($params['content'], $params['expr'], \"\\n\");\n $template = str_replace('%%TBL:'.$tag.'%%', $content, $template);\n }\n }\n return $template;\n }", "function parse($template, $data = array(), $return = FALSE)\n\t{\n\t\t$string = $this->ci->load->view($template, $data, TRUE);\n\t\t\n\t\treturn $this->_parse($string, $data, $return);\t\n\t}", "public function processaTemplate() {\n return $this->fetch('ricerca_'.$this->_layout.'.tpl');\n }", "public function resolve($template);", "function get_template($template){\n\n\t\t\t$login_arr = $this->action_parser($this->action,'template') ;\n\n\t\t\t$pos = array_search($template, $login_arr['template']['name']); \n\n\t\t\treturn $login_arr['template']['path'][$pos];\n\n\t\t}", "protected function process()\n {\n // Assign raw URI\n $uri = $this->getRequest()->getRequestUri();\n $this->view()->assign('uri', $uri);\n\n // Assign all route params\n $params = $this->params()->fromRoute();\n $this->view()->assign('params', $params);\n\n // Specify template,\n // otherwise template will be set up as {controller}-{action}\n $this->view()->setTemplate('demo-route');\n\n // Assign route list to template\n $this->loadRoutes();\n }", "public function parse ($template, $text = null)\n\t{\n\t\t$this->set ('STATIC_URL', TEMPLATE_DIR);\n\t\t\n\t\t// SEt unique id\n\t\t$this->set ('templateID', self::getUniqueId ());\n\n\t\tob_start ();\n\t\t\n\t\tif (! $filename = $this->getFilename ($template))\n\t\t{\n\t\t\techo '<h1>Template not found</h1>';\n\t\t\techo '<p>The system could not find template \"'.$template.'\"</p>';\n\t\t\t\n\t\t\t$filename = null;\n\t\t}\n\t\t\n\t\tforeach ($this->values as $k => $v)\n\t\t{\n\t\t\t$$k = $v;\n\t\t}\n\t\t\n\t\tforeach ($this->lists as $k => $v)\n\t\t{\n\t\t\t$n = 'list_'.$k;\t\n\t\t\t$$n = $v;\n\t\t}\n\t\t\n\t\t\n\t\tif (isset ($filename))\n\t\t{\n\t\t\tinclude $filename;\n\t\t}\n\t\t\n\t\t$val = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $val;\n\t}", "function Get($template)\r\n\t{\r\n\t\t$this->template = $template;\r\n\t\t$this->out = \"\";\r\n\t\tif (!file_exists($template)) { trigger_error(\"Template not found (\" . $template . \")\", E_USER_ERROR); return NULL; }\r\n\t\t$parser = xml_parser_create_ns();\r\n\t\t$data = array();\r\n\t\t$index = array();\r\n\t\txml_set_object($parser, $this);\r\n\t\txml_set_element_handler($parser, \"Start_Tag\", \"End_Tag\");\r\n\t\txml_set_character_data_handler($parser, \"CData\");\r\n \t\txml_set_default_handler($parser, \"CData\");\r\n \t\txml_set_processing_instruction_handler($parser, \"Process\");\r\n\r\n\t\t$lines = file($template);\r\n\t\tforeach ($lines as $line)\r\n\t\t{\r\n\t\t\tif (!xml_parse($parser, $line))\r\n\t\t\t{\r\n\t\t\t\techo \"XML Error: \" . xml_error_string(xml_get_error_code($parser)) .\r\n\t\t\t\t\" on line \" . xml_get_current_line_number($parser) .\r\n\t\t\t\t\" of file \" . $template . \"<br/>\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\txml_parser_free($parser);\r\n\t\treturn preg_replace_callback(\"/\\{{([^}]+)\\}}/\", array($this, \"parse_vars\"), $this->out);\r\n\t}", "function process($router) {\n if (isset($_SESSION['user'])) {\n $user = $_SESSION['user'];\n $username = $user->getUsername();\n $userdata = $user->getUser();\n // Custom array to not give the password in the array to twig.\n $user = array(\n 'id' => $userdata['id'],\n 'firstname' => $userdata['firstname'],\n 'lastname' => $userdata['lastname'],\n 'username' => $username,\n 'email' => $userdata['email'],\n 'reg_date' => $userdata['reg_date']\n );\n $params = $this->getParams();\n $params['user'] = $user;\n $this->setParams($params);\n unset($user);\n }\n $this->view->setTwig($router->getTwig());\n $this->preRender($router);\n }", "protected function parseTemplate($template)\n\t{\n\t\t$this->references = [\n\t\t\t'anywhere' => [],\n\t\t\t'asUrl' => [],\n\t\t\t'inText' => []\n\t\t];\n\n\t\tpreg_match_all($this->referencesRegexp, $template, $matches);\n\t\tforeach ($matches[0] as $match)\n\t\t{\n\t\t\t$key = trim($match, '\\\\${}');\n\t\t\t$this->references['anywhere'][$key] = $key;\n\t\t}\n\n\t\t$dom = TemplateLoader::load($template);\n\t\t$xpath = new DOMXPath($dom);\n\t\tforeach ($xpath->query('//text()') as $node)\n\t\t{\n\t\t\tpreg_match_all($this->referencesRegexp, $node->textContent, $matches);\n\t\t\tforeach ($matches[0] as $match)\n\t\t\t{\n\t\t\t\t$key = trim($match, '\\\\${}');\n\t\t\t\t$this->references['inText'][$key] = $key;\n\t\t\t}\n\t\t}\n\n\t\tforeach (NodeLocator::getURLNodes($dom) as $node)\n\t\t{\n\t\t\t// We only bother with literal attributes that start with a capture\n\t\t\tif ($node instanceof DOMAttr\n\t\t\t && preg_match('(^(?:[$\\\\\\\\]\\\\d+|\\\\$\\\\{\\\\d+\\\\}))', trim($node->value), $m))\n\t\t\t{\n\t\t\t\t$key = trim($m[0], '\\\\${}');\n\t\t\t\t$this->references['asUrl'][$key] = $key;\n\t\t\t}\n\t\t}\n\n\t\t$this->removeUnknownReferences();\n\t}", "public static function parse()\n\t{\n\t\t// get the template\n\t\t$tpl = Spoon::get('template');\n\n\t\t// logged in\n\t\tif(FrontendProfilesAuthentication::isLoggedIn())\n\t\t{\n\t\t\t// get profile\n\t\t\t$profile = FrontendProfilesAuthentication::getProfile();\n\n\t\t\t// display name set?\n\t\t\tif($profile->getDisplayName() != '') $tpl->assign('profileDisplayName', $profile->getDisplayName());\n\n\t\t\t// no display name -> use email\n\t\t\telse $tpl->assign('profileDisplayName', $profile->getEmail());\n\n\t\t\t// show logged in\n\t\t\t$tpl->assign('isLoggedIn', true);\n\t\t}\n\n\t\t// ignore these url's in the querystring\n\t\t$ignoreUrls = array(\n\t\t\tFrontendNavigation::getURLForBlock('profiles', 'login'),\n\t\t\tFrontendNavigation::getURLForBlock('profiles', 'register'),\n\t\t\tFrontendNavigation::getURLForBlock('profiles', 'forgot_password')\n\t\t);\n\n\t\t// querystring\n\t\t$queryString = (isset($_GET['queryString'])) ? SITE_URL . '/' . urldecode($_GET['queryString']) : SELF;\n\n\t\t// check all ignore urls\n\t\tforeach($ignoreUrls as $url)\n\t\t{\n\t\t\t// querystring contains a boeboe url\n\t\t\tif(stripos($queryString, $url) !== false)\n\t\t\t{\n\t\t\t\t$queryString = '';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// no need to add this if its empty\n\t\t$queryString = ($queryString != '') ? '?queryString=' . urlencode($queryString) : '';\n\n\t\t// useful urls\n\t\t$tpl->assign('loginUrl', FrontendNavigation::getURLForBlock('profiles', 'login') . $queryString);\n\t\t$tpl->assign('registerUrl', FrontendNavigation::getURLForBlock('profiles', 'register'));\n\t\t$tpl->assign('forgotPasswordUrl', FrontendNavigation::getURLForBlock('profiles', 'forgot_password'));\n\t}", "public function parse_template($template, $vars = array())\n\t{\n\t\t$this->EE->load->library('template_helper');\n\t\treturn $this->EE->template_helper->fetch_and_parse($template, $vars); \n\t}", "public function processTemplate($template = '') {\n\t\tif(is_object($this->registry->get('config')) && $this->registry->get('config')->get('embed_mode') == true ){\n\t\t \t//get template if it was set earlier\n\t\t\tif (empty($template)) {\n\t\t\t\t$template = $this->view->getTemplate();\n\t\t\t}\n\t\t\t//only substitute the template for page templates\n\t\t\tif(substr($template, 0, 6) == 'pages/' && substr($template, 0, 6) != 'embed/'){\n\t\t \t//load special headers for embed as no page/layout needed\n\t \t\t$this->addChild('responses/embed/head', 'head');\n\t \t$this->addChild('responses/embed/footer', 'footer');\n\t \t$template = preg_replace('/pages\\//', 'embed/', $template);\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\tif (!empty($template)) {\n\t\t\t$this->view->setTemplate($template);\n\t\t}\n\t\t$this->view->assign('block_details',$this->block_details);\n\t\t$this->view->assign(\"children_blocks\", $this->getChildrenBlocks());\n\t\t$this->view->enableOutput();\n\t}", "function parse($template, $data, $return = FALSE)\n\t{\n\t\tglobal $OUT;\n\n\t\t$template = $this->object->load->view($template, '', TRUE);\n\t\t\n\t\tif ($template == '')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tforeach ($data as $key => $val)\n\t\t{\n\t\t\tif ( ! is_array($val))\n\t\t\t{\n\t\t\t\t$template = $this->_parse_single($key, $val, $template);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$template = $this->_parse_pair($key, $val, $template);\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($return == FALSE)\n\t\t{\n\t\t\t$OUT->final_output = $template;\n\t\t}\n\t\t\n\t\treturn $template;\n\t}", "function get_template()\n {\n }", "public function template();", "protected function parse() {}", "protected function parseRoute()\n { \n $matches = explode(\"/\", $this->route);\n\n $pattern = '/^([a-zA-Z0-9_-])+$/';\n \n if (preg_match($pattern, $matches[0])) {\n $this->controller = ucfirst(strtolower($matches[0]));\n }\n\n if (!empty($matches[1]) && preg_match($pattern, $matches[1])) {\n $this->action = $this->convert($matches[1]);\n }\n }", "public function processaTemplate() {\n return $this->fetch('partita_'.$this->_layout.'.tpl');\n }", "public static function parse(): void\n {\n // get the template\n $tpl = FrontendModel::getContainer()->get('templating');\n\n // logged in\n if (FrontendProfilesAuthentication::isLoggedIn()) {\n // get profile\n $profile = FrontendProfilesAuthentication::getProfile();\n\n // display name set?\n if ($profile->getDisplayName() != '') {\n $tpl->assign('profileDisplayName', $profile->getDisplayName());\n } else {\n // no display name -> use email\n $tpl->assign('profileDisplayName', $profile->getEmail());\n }\n\n // show logged in\n $tpl->assign('isLoggedIn', true);\n }\n\n // ignore these urls in the query string\n $ignoreUrls = [\n FrontendNavigation::getUrlForBlock('Profiles', 'Login'),\n FrontendNavigation::getUrlForBlock('Profiles', 'Register'),\n FrontendNavigation::getUrlForBlock('Profiles', 'ForgotPassword'),\n ];\n\n // query string\n $queryString = FrontendModel::getRequest()->query->has('queryString')\n ? SITE_URL . '/' . urldecode(FrontendModel::getRequest()->query->get('queryString'))\n : SITE_URL . FrontendModel::get('url')->getQueryString();\n\n // check all ignore urls\n foreach ($ignoreUrls as $url) {\n // query string contains a boeboe url\n if (mb_stripos($queryString, $url) !== false) {\n $queryString = '';\n break;\n }\n }\n\n // no need to add this if its empty\n $queryString = ($queryString !== '') ? '?queryString=' . rawurlencode($queryString) : '';\n\n // useful urls\n $tpl->assign('loginUrl', FrontendNavigation::getUrlForBlock('Profiles', 'Login') . $queryString);\n $tpl->assign('registerUrl', FrontendNavigation::getUrlForBlock('Profiles', 'Register'));\n $tpl->assign('forgotPasswordUrl', FrontendNavigation::getUrlForBlock('Profiles', 'ForgotPassword'));\n }", "function process_route( $params, $node ){\n global $FUNCS, $CTX;\n\n $routes = &$CTX->get_object( '_tpl_routes', '__ROOT__' );\n\n if( is_array($routes) ){ // if template is routable\n\n // create route ..\n $route = array(\n 'name' => null,\n 'path' => null,\n 'params' => null,\n 'values' => null,\n 'method' => null,\n 'secure' => null,\n 'validators' => null,\n 'generate' => null,\n 'filters' => null,\n /*\n 'routable' => true,\n 'is_match' => null,\n 'name_prefix' => null,\n 'path_prefix' => null,\n */\n );\n\n $attr = $FUNCS->get_named_vars(\n array(\n 'name'=>'',\n 'path'=>'',\n 'secure'=>'',\n 'method'=>'',\n 'generate'=>'',\n 'filters'=>'',\n ),\n $params);\n extract( $attr );\n\n $name = trim( $name );\n if( !strlen($name) ){die(\"ERROR: Tag \\\"\".$node->name.\"\\\" - 'name' is a required parameter\");}\n\n $route['name'] = $name;\n $route['path'] = trim( $path );\n $secure = trim( $secure );\n if( strlen($secure) ){\n $route['secure'] = ( $secure==1 ) ? 1 : 0;\n }\n $method = array_filter( array_map(\"trim\", explode('|', $method)) );\n if( count($method) ) $route['method'] = array_map( \"strtoupper\", $method );\n $route['generate'] = trim( $generate );\n $route['filters'] = trim( $filters );\n\n $CTX->set_object( '_tpl_route', $route );\n foreach( $node->children as $child ){\n $child->get_HTML();\n }\n\n // add route\n $routes[] = $route;\n }\n }", "public function parse()\n {\n // turn the url into an array by nodes\n $this->nodes = explode('/', $this->url);\n \n // slide the controller off the first element\n $this->controller = array_shift($this->nodes);\n\t // break the path apart into its segments\n\t // controller - params ( node will always be empty for restful urls )\n\t //@list( , $this->nodes ) = explode( '/', $this->url, 2 );\n\t\n\t // add params to the to the params array\n/*\n\t if ( !empty( $params ) ) {\n\t \n\t // break apart the params\n\t $params = explode( '/', $params );\n\t\n\t for ( $i = 0; $i < count( $params ); $i++ ) {\n\t $this->params[] = str_replace( KEYWORD_SEPARATOR, ' ', $params[$i]);\n\t }\n\t }\n*/\n \n \n }", "protected function parsedTemplateData(){\n if( $this->_parsedTemplateData === null ){\n $this->_parsedTemplateData = $this->getHelper('json')->decode( $this->templateData );\n }\n return $this->_parsedTemplateData;\n }", "public function getTemplate() {}", "public function loadTemplate()\n\t\t{\n\t\t}", "protected function parse($template, $data = array())\n {\n $view = $this->app['view'];\n\n return $view->renderAsStr($template, $data);\n }", "function parse(){ // parsing template\n\t$loop_count = -1;\n\tif (func_num_args()>= 1){\n\t\t$proc_type = func_get_arg(0);\n\t\t//if (!in_array($proc_type, array(PT_ROOT, PT_IF, PT_FOR, PT_SILENT_IF, PT_SILENT_FOR, PT_FALSE_IF))) system_die('Invalid process type', 'Template->parse');\n\t} else {\n\t\tif ( (PT_COMPILE) && (isset($this->filename)) ) // file parsing\n\t\t{\n\t\t\tif (file_exists($this->filename . '.php'))\n\t\t\t\tif (filemtime($this->filename . '.php') > filemtime($this->filename))\n\t\t\t\t{\n\t\t\t\t\tinclude($this->filename . '.php');\n\t\t\t\t\t$this->result = $r;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t$nesting = 0;\n\t\t\t$tplc = '<?$r=\\'\\';';\n\t\t\tfor ($i=0; $i<count($this->template); $i++)\n\t\t\t{\n\t\t\t\t// process\n\t\t\t\t$line = trim($this->template[$i]);\n\t\t\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\t\t\t$result = array();\n\t\t\t\tif (preg_match(PT_START_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'for ($i' . $nesting . '=0;$i' . $nesting . '<intval(' . $this->get_var_ref($result[3], $nesting) . ');$i' . $nesting . '++){' . \"\\n\";\n\t\t\t\t\t\t$nesting++;\n\t\t\t\t\t}\n\t\t\t\t\telse // this line is IF opening tag\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'if ('.$result[2].'(bool)('.$this->get_var_ref($result[3], $nesting).')){' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t} elseif (preg_match(PT_END_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}' . \"\\n\";\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t\t$nesting--;\n\t\t\t\t} elseif (preg_match(PT_MIDDLE_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}else{' . \"\\n\";\n\t\t\t\t} elseif (preg_match('/<%/', $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$j = 0;\n\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\twhile ($j<strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( ($line[$j] == '<') && ($line[$j+1] == '%') )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_f_value(substr($line, $j), $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t$j += $dw;\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$tmp_str .= $line[$j];\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t\t$tplc .= '$r.=\"\\\\n\";';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($line, $nesting, $dw) . \".\\\"\\\\n\\\";\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tplc .= '?>';\n\t\t\t\n\t\t\t$fh = fopen($this->filename . '.php', 'wt');\n\t\t\tif ($fh)\n\t\t\t{\n\t\t\t\tfwrite($fh, $tplc);\n\t\t\t\tfclose($fh);\n\t\t\t}\n\t\t\telse\n\t\t\t\tsystem_die('Cannot save compiled template');\n\t\t\tinclude($this->filename . '.php');\n\t\t\t$this->result = $r;\n\t\t\treturn 0;\n\t\t} // if compile and filename\n\t\t$proc_type = PT_ROOT;\n\t\tunset($this->result);\n\t}\n\tif (func_num_args()> 1){\n\t\t$curr_pos = intval(func_get_arg(1));\n\t\tif (($proc_type == PT_FOR) && (func_num_args() < 3)) system_die('Undefined loop count (FOR process)', 'Template->parse');\n\t\tif (func_num_args()> 2) $loop_count = intval(func_get_arg(2));\n\t}\n\telse\n\t\t$curr_pos = 0;\n\t$succ_mode = false;\n\twhile ($curr_pos < sizeof($this->template)){\n\t\t$line = $this->template[$curr_pos]; // current line\n\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\tif (preg_match(PT_START_TAGS, $line, $result)){ // this line contains one of the START tags\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif ($result[1] == 'FOR'){\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){ // invalid FOR variable\n\t\t\t\t\t$error_msg = 'Invalid FOR statement counter named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type <= PT_FOR) $count = intval($this->get_var_val($result[3]));\n\t\t\t\t\t$this->system_vars['cycle_nesting']++;\n\t\t\t\t\t$nesting_saver = $this->system_vars['cycle_nesting'];\n\t\t\t\t\tif ($proc_type> PT_FOR) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($count == 0) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tfor ($c = 0; $c < $count; $c++){\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_counters'][$nesting_saver] = $c;\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_nesting'] = $nesting_saver;\n\t\t\t\t\t\t\t\t$last_pos = $this->parse(PT_FOR, $curr_pos + 1, $c); // create visible FOR process in loop\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$curr_pos = $last_pos;\n\t\t\t\t}\n\t\t\t} else { // this line is IF opening tag\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){\n\t\t\t\t\t$error_msg = 'Invalid IF statement variable named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type>PT_FOR) $curr_type = PT_SILENT_IF;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$var = (bool)$this->get_var_val($result[3]);\n\t\t\t\t\t\tif (strlen($result[2])> 0) $var = !$var;\n\t\t\t\t\t\t$curr_type = ($var)?PT_IF:PT_FALSE_IF;\n\t\t\t\t\t}\n\t\t\t\t\tif ($loop_count!=-1) $curr_pos = $this->parse($curr_type, $curr_pos+1, $loop_count); // create new IF process inside the loop\n\t\t\t\t\telse $curr_pos = $this->parse($curr_type, $curr_pos+1); // create new IF process\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif(preg_match(PT_END_TAGS, $line, $result)){\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (((($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) && ($result[1] == 'FOR')) || ((($proc_type == PT_IF) || ($proc_type == PT_SILENT_IF) || ($proc_type == PT_FALSE_IF)) && ($result[1] == 'IF'))) {\n\t\t\t\tif (($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) $this->system_vars['cycle_nesting']--; // this one was the end of loop block\n\t\t\t\t$succ_mode = true;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t$error_msg = 'Unexpected end of '.$result[1].' statement';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif(preg_match(PT_MIDDLE_TAGS, $line, $result)){ // this line contains one of the MIDDLE tags (ELSE probably)\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (($proc_type == PT_FALSE_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_IF;\n\t\t\t} elseif (($proc_type == PT_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_FALSE_IF;\n\t\t\t} elseif($proc_type != PT_SILENT_IF) { // ELSE inside non IF process or so\n\t\t\t\t$error_msg = 'Unexpected '.$result[1].' statement '.$proc_type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif ($proc_type <= PT_FOR){ // processing of visible contents\n\t\t\tif (!isset($this->result)) $this->result = '';\n\t\t\t\t$matches = array();\n\t\t\t\t$line_is_control = false;\n\n\t\t\t\tif (preg_match_all(PT_COUNTER_TAGS, $line, $matches)){ // We have counter tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[0] as $key => $val){ // process counters\n\t\t\t\t\t\tif ($loop_count >= 0) $replace[$key] = $loop_count + 1;\n\t\t\t\t\t\telse $replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\t\t\t\t// processing variables\n\n\t\t\t\tif (preg_match_all(PT_VARIABLE_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (strlen($matches[4][$key])> 0){ // process array variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]) && is_array($this->vars[$val]) && array_key_exists($matches[4][$key], $this->vars[$val])){\n\t\t\t\t\t\t\t\t\t$replace[$key] = $this->vars[$val][$matches[4][$key]];\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif (isset($this->vars[$val]) && is_object($this->vars[$val])) {\n\t\t\t\t\t\t\t\t \t$_obj = &$this->vars[$val];\n\t\t\t\t\t\t\t\t\t$_name = $matches[4][$key];\n\t\t\t\t\t\t\t\t\t$replace[$key] = $_obj->$_name;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\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\tif ($this->debug_mode) $this->show_notice($val.$matches[3][$key], 4); // show stupid notice\n\t\t\t\t\t\t\t\t$replace[$key] = ''; // and insert complete emptyness\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else{ // process common variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]))\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($val);\n\t\t\t\t\t\t\telseif (preg_match('/\\\\//', $val))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$v_row = $this->Registry->_internal_get_value($val);\n\t\t\t\t\t\t\t\tif ( ($v_row !== false) && (!$v_row->eof()) ) {\n\t\t\t\t\t\t\t\t\t$out = $v_row->Rows[0]->Fields['value'];\n\t\t\t\t\t\t if ($v_row->Rows[0]->Fields['key_type'] == KEY_TYPE_IMAGE)\n\t\t\t\t\t\t\t\t\t\t$out = $GLOBALS['app']->template_vars['REGISTRY_WEB'] . $v_row->Rows[0]->Fields['id_path'] . '/' . $out;\n\t\t\t\t\t\t\t\t\t$replace[$key] = $out;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$replace[$key] = '';\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$replace[$key] = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\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$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing ternary operators\n\n\t\t\t\tif (preg_match_all(PT_TERNARY_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (isset($this->vars[$val])){\n\t\t\t\t\t\t\t$var = (bool)$this->get_var_val($val);\n\t\t\t\t\t\t\tif (strlen($matches[1][$key])> 0) $var = !$var;\n\t\t\t\t\t\t\t$res_num = ($var)?4:6;\n\t\t\t\t\t\t\tif (isset($this->vars[$matches[$res_num][$key]])) {\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($matches[$res_num][$key]);\n\t\t\t\t\t\t\t\tif (strlen($matches[$res_num - 1][$key])> 0) $replace[$key] = htmlspecialchars($replace[$key]); // escape html entries\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($res_var, 1);\n\t\t\t\t\t\t\t\t$result[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // we have tag but haven't got variable\n\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($val, 1); // curse them out in debug mode\n\t\t\t\t\t\t\t$replace[$key] = ''; // and insert pretty nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing controls\n\t\t\t\tif (preg_match_all(PT_CONTROL_TAGS, $line, $matches)){ // Yes! This line contains control definition\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[1] as $key => $name){ // go through the matches\n\t\t\t\t\t\tif (strlen($matches[3][$key])> 0) $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name), strtolower($matches[3][$key])); // here is control with id\n\t\t\t\t\t\telse $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name)); // here is control without id\n\t\t\t\t\t\tif (!is_null($tcontrol)){\n\t\t\t\t\t\t\t$tcontrol->parse_vars($matches[5][$key]);\n\t\t\t\t\t\t\tif (!$tcontrol->is_inited)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tcontrol->on_page_init();\n\t\t\t\t\t\t\t\t$tcontrol->is_inited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$replace[$key] = $tcontrol->process($loop_count);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace control statements with control results\n\t\t\t\t}\n\n\t\t\t\t// compress and delete blank lines\n\t\t\t\t$line = preg_replace('/[\\r\\n]*$/', '', trim($line));\n\t\t\t\tif (strlen($line)> 0) $this->result .= $line . \"\\n\";\n\t\t\t}\n\t\t\t$curr_pos++;\n\t\t}\n\n// And what we have here?\n\t\tif (!isset($error_msg) && ($proc_type != PT_ROOT) && !$succ_mode) $error_msg = 'Unexpected end of file'; // invalid template - show error\n\t\tif (isset($error_msg)){\n\t\t\t$error_txt = 'Template parsing error on line '.($curr_pos + 1);\n\t\t\tif (isset($this->filename))\t$error_txt .= ' of file \"'.$this->filename.'\"';\n\t\t\t$error_txt .= ' - '.$error_msg;\n\t\t\tsystem_die($error_txt, 'Template->parse'); // invalid template - show error\n\t\t}\n\t\tif ($proc_type == PT_ROOT)\n\t\t\tif (!isset($this->result))\n\t\t\t\t$this->result = ''; // probably there were one big false IF?\n\t\treturn $curr_pos; // HURRA! HURRA! This one is successfully completed!\n\t}", "public function parse($params = [])\n {\n if (empty($params))\n {\n return;\n }\n\n foreach($params as $key => $value)\n {\n $this->template = str_replace('{$' . $key . '}', $value, $this->template);\n }\n }", "abstract public function getTemplate();", "public function initTemplate() {}", "function TreetrackerParseRoute($segments)\r\n{\r\n return TreetrackerHelperRoute::parse($segments);\r\n}", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "public function renderTemplate();", "public function & GetRouter ();", "function parseTemplate() {\n $this->initParsing();\n $this->beginMainBlock();\n if (!$this->parseTemplateCommands()) return false;\n $this->endMainBlock();\n if (!$this->checkBlockDefinitionsComplete()) return false;\n if (!$this->parseTemplateVariables()) return false;\n $this->associateVariablesWithBlocks();\n return true; }", "public function loadMatchingTemplate()\n {\n $assignments = self::getAssignments();\n $hlp = $this;\n $matches = array_filter($assignments, function ($data) use ($hlp) {\n return $hlp::matchPagePattern($data['pattern']);\n });\n\n $template = array_pop($matches);\n return $template;\n }", "public function parse(Route $route) : ParsedRoute;", "function getTemplate();", "public function parse($template)\n\t{\n\t\t$dom = TemplateLoader::load($template);\n\n\t\t$ir = new DOMDocument;\n\t\t$ir->loadXML('<template/>');\n\n\t\t$this->createXPath($dom);\n\t\t$this->parseChildren($ir->documentElement, $dom->documentElement);\n\t\t$this->normalizer->normalize($ir);\n\n\t\treturn $ir;\n\t}", "function load_template()\n{\n $CI =& get_instance();\n $CI->load->library('sistema');\n $CI->parser->parse($CI->sistema->tema['template'],get_tema());\n}", "function show_parsed(){ // parsing template (if needed) and showing the result of parsing\n\tif (isset($this->result)) echo $this->result;\n\telse {\n\t\t$this->parse();\n\t\techo $this->result;\n\t}\n}", "private function _parse_template($extra = null)\n\t\t{\n\t\t\t// Create an alias of the template file property to save space\n\t\t\t$template = $this->_template;\n\n\t\t\t// Remove any PHP-style comments from the template\n\t\t\t$comment_pattern = ['#/\\*.*?\\*/#s','#(?<!:)//.*#'];\n\t\t\t$template = preg_replace($comment_pattern, NULL, $template);\n\n\t\t\t// Extract the main entry loop from the file\n\t\t\t$pattern = '#.*{loop}(.*){/loop}.*#is';\n\t\t\t$entry_template = preg_replace($pattern, \"$1\", $template);\n\n\t\t\t// Extract the header from the template if one exists\n\t\t\t$header = trim(preg_replace('/^(.*)?{loop.*$/is', \"$1\", $template));\n\n\t\t\t if( $header===$template )\n\t {\n\t $header = NULL;\n\t }\n\n\t // Extract the footer from the template if one exists\n\t $footer = trim(preg_replace('#^.*?{/loop}(.*)$#is', \"$1\", $template));\n\t if( $footer===$template )\n\t {\n\t $footer = NULL;\n\t }\n\n\t // Define a regex to match any template tag\n \t\t$tag_pattern = '/{(\\w+)}/';\n\n \t\t//Curry the function that will replace the tags with entry data\n \t\t$callback = $this->_curry('Template::replace_tags',2);\n\n \t\t// Process each entry and insert its values into the loop\n \t\t$markup = NULL;\n\n \t\tfor($i=0, $c = count($this->entries); $i<$c; ++$i)\n \t\t{\n \t\t\t$markup.=preg_replace_callback($tag_pattern, $callback(serialize($this->entries[$i])), $entry_template);\n \t\t}\n\n \t\t//If extra data was passed to fill the header/footer, parse it here\n \t\tif(is_object($extra))\n \t\t{\n \t\t\tforeach ($extra as $key => $props) {\n \t\t\t\t$$key = preg_replace_callback($tag_pattern, $callback(serialize($extra->$key)), $$key);\n \t\t\t}\n \t\t}\n\n \t\t// Return the formatted entries with the header and footer reattached\n\t\t\treturn $header . $markup . $footer;\n\t\t}", "function _parse($template, $data, $return = FALSE)\n\t{\n\t\tif ($template == '')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tforeach ($data as $key => $val)\n\t\t{\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$template = $this->_parse_pair($key, $val, $template);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$template = $this->_parse_single($key, (string)$val, $template);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#$template = preg_replace('/\\{.*\\}/','',$template);\n\t\t$patron = '/\\\\'.$this->l_delim.'.*\\\\'.$this->r_delim.'/';\n\t\t#die($patron);\n\t\t$template = preg_replace($patron,'',$template);\n\t\tif ($return == FALSE)\n\t\t{\n\t\t\t$CI =& get_instance();\n\t\t\t$CI->output->append_output($template);\n\t\t}\n\n\t\treturn $template;\n\t}", "function get_template($template)\n {\n $login_arr = $this->action_parser($this->action, 'template');\n $pos = array_search($template, $login_arr['template']['name']);\n return $login_arr['template']['path'][$pos];\n }", "function get_template($template)\n {\n\n $login_arr = $this->action_parser($this->action, 'template');\n\n $pos = array_search($template, $login_arr['template']['name']);\n\n return $login_arr['template']['path'][$pos];\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function parse(SpoonTemplate $template)\n {\n $this->form->parse($template);\n }", "public function router()\n\t{\n\t\t$this->getDomainName();\n\t\t$current_page = $this->getCurentPage();\t\n\t\tif($current_page){\n\t\t\t$this->getContent($current_page);\n\t\t}\n\t\t$this->initPageController($current_page);\n\t}", "abstract public function map(Router $router);", "public function parse(): void\n {\n $footerLinks = (array) Navigation::getFooterLinks();\n $this->template->assignGlobal('footerLinks', $footerLinks);\n\n $siteHTMLFooter = (string) $this->get('fork.settings')->get('Core', 'site_html_footer', null);\n\n // assign site wide html\n $this->template->assignGlobal('siteHTMLFooter', $siteHTMLFooter);\n }", "public function parse()\n\t{\t\n\t if(isset($this->_cache))\n\t {\n\t $identifier = md5($this->_path);\n\t \n\t if (!$template = $this->_cache->get($identifier)) \n\t {\n\t $template = parent::parse();\n\t \n\t //Store the object in the cache\n\t\t \t $this->_cache->store($template, $identifier);\n\t }\n\t \n\t return $template;\n\t }\n\t \n\t return parent::parse();\n\t}", "function parseTemplateText()\r\n\t{\r\n\t\t$buf = '';\r\n\t\t// we only need this if we are going to use JSP tags for wrapping\r\n\t\t// scriptlet blocks\r\n\t\t//if ($this->reader->matches('<' . '\\\\%'))\r\n\t\t//{\r\n\t\t//\t$buf .= '<' . '%';\r\n\t\t//}\r\n\r\n\t\t$buf .= $this->reader->nextContent();\r\n\r\n\t\t// don't output meaningless whitespace\r\n\t\tif (trim($buf) == '')\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif ($this->ctxt->options->isElIgnored() || strpos($buf, '${') === false)\r\n\t\t{\r\n\t\t\treturn $buf;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '<?php echo $pageContext->evaluateTemplateText(' . StringUtils::quote($buf) . ');?>';\r\n\t\t}\r\n\t}", "function _parse_routes()\n {\n // Do we even have any custom routing to deal with?\n // There is a default scaffolding trigger, so we'll look just for 1\n if (count($this->routes) == 1)\n {\n $this->_set_request($this->uri->segments);\n return;\n }\n\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->segments);\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n\n //Art\n $i = $this->_search_by_key($this->routes, self::MAIN, $uri);\n if ($i !== FALSE)\n {\n $this->_set_request(explode('/', $this->routes[$i][self::ROUTE]));\n return;\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n if(is_int($key))\n {\n $key = $val[self::MAIN];\n $val = $val[self::ROUTE];\n }\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // Do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request($this->uri->segments);\n }", "private function parseRoutes()\n\t{\n\t\t@list($controller, $action, $params) = explode('/', $this->routes, 3);\n\t\tif (isset($controller)) {\n\t\t\t$this->setController($controller);\t\n\t\t}\n\t\tif (isset($action)) {\n\t\t\t$this->setAction($action);\n\t\t}\n\t\tif (isset($params)) {\n\t\t\t$this->setParams(explode('/', $params));\n\t\t}\n\t}", "function template($template=\"simple\"){\n\n\t\t// THE PHYSICAL TEMPLATE SHOULD BE IN THE RESPECTIVE \n\t\t// TEMPLATE/TYPE/$template.php\n\t\t$this->template = $template;\n\t}", "private function getRoute(){\n\t}", "private function get_router()\n\t{\n\t\treturn $this->m_router;\n\t}", "function read_router_url()\n{\n return explode(\";\", $_GET[\"nodeid\"]);\n}", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "function ClubDataParseRoute($segments)\n{\n\t$app = JFactory::getApplication();\n\t$router = new ClubDataRouter($app, $app->getMenu());\n\n\treturn $router->parse($segments);\n}", "private function renderTemplate(){\n\t\trequire($this->TemplateFile);\n\t}", "abstract public function getTemplate($tpl);", "function SimulationParseRoute($segments)\n{\n\t$vars = array();\n\n\t//Get the active menu item.\n\t$app\t= JFactory::getApplication();\n\t$menu\t= $app->getMenu();\n\t$item\t= $menu->getActive();\n\t$params = JComponentHelper::getParams('com_content');\n\t$advanced = $params->get('sef_advanced_link', 0);\n\t$db = JFactory::getDBO();\n\n\t// Count route segments\n\t$count = count($segments);\n\n\t// Standard routing for articles. If we don't pick up an Itemid then we get the view from the segments\n\t// the first segment is the view and the last segment is the id of the article or category.\n\t//if (!isset($item)) {\n\t\t$vars['view']\t= $segments[0];\n\t\t$vars['layout']\t= $segments[1];\n\t\tif($count==1){\n\t\t\t$vars['id'] = 1;\n\t\t}else{\n\t\t$vars['id']\t\t= $segments[2];\n\t\t}\n\n\t\treturn $vars;\n\t//}\n\n\t// if there is only one segment, then it points to either an article or a category\n\t// we test it first to see if it is a category. If the id and alias match a category\n\t// then we assume it is a category. If they don't we assume it is an article\n\tif ($count == 1) {\n\t\t// we check to see if an alias is given. If not, we assume it is an article\n\t\tif (strpos($segments[0], ':') === false) {\n\t\t\t$vars['layout'] = 'prop';\n\t\t\t$vars['id'] = (int) $segments[0];\n\t\t\treturn $vars;\n\t\t}\n\n\t\t//list($id, $alias) = explode(':', $segments[0], 2);\n\n\t}\n\n\treturn $vars;\n}", "public function parse()\n {\n $config = \\CB::getInstance()['pom'];\n $template = $this->tpl->getTemplate();\n $this->UID = 'v' . sha1(get_class(MVC\\Page::$current) . $template . serialize($this->vars) . \\CB::getSiteUniqueID());\n if (!empty($config['cacheEnabled']) && !$this->isExpired(true)) $this->pull(true);\n else\n {\n $ctx = $this->parseTemplate($this->prepareTemplate($template, $this->vars));\n $body = array_pop($ctx['controls']);\n if ($body)\n {\n if (!($body instanceof Body) || count($ctx['controls'])) throw new Core\\Exception($this, 'ERR_VIEW_5');\n $this->controls[$body->attr('id')] = $body;\n $this->commit();\n static::decodePHPTags($body, $ctx['marks']);\n $src = \\CB::url('framework-web') . '/js/jquery/jquery.min.js';\n if (empty($this->js['top'][$src])) $this->addJS(['src' => $src], null, true, -1000);\n $src = \\CB::url('framework-web') . '/js/cb.full.min.js?v=2';\n if (empty($this->js['top'][$src])) $this->addJS(['src' => $src], null, true, -999);\n }\n $this->tpl->setTemplate($ctx['html']);\n if (!empty($config['cacheEnabled'])) \n {\n $this->commit();\n $this->push(true);\n }\n }\n return $this;\n }", "abstract public function getRoute();", "function defineRoutes(&$router) {\n /*\n * example routers\n * \n * \n */\n //$router->map('modulename', 'modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('dashboard_modulename', 'dashboard/modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('modulename_view_project', 'modulename/:project_id/view', array('controller' => 'modulename', 'action' => 'view'), array('project_id' => '\\d+'));\n }", "public function loadTemplate()\n {\n return json_decode(file_get_contents(app_path(self::BASE_TEMPLATE_PATH)), true);\n }", "public function run()\n {\n echo $this->router->resolve();\n }", "protected function setupTemplate() {\r\n \r\n }", "private function parseRoutesPHP()\n {\n $routesConfig = include $this->rootPath.'/config/routes.php';\n foreach ($routesConfig as $route => $routeInfo) {\n\t if (!is_array($routeInfo) && is_callable($routeInfo)) {\n\t\t\t\t$this->router->addRoute($route, $route, $routeInfo);\n\t }\n\t else {\n\t $defaults = (isset($routeInfo['defaults']) && is_array($routeInfo['defaults'])) ? $routeInfo['defaults'] : [];\n\t $requirements = (isset($routeInfo['requirements']) && is_array($routeInfo['requirements'])) ? $routeInfo['requirements'] : [];\n\t $methods = (isset($routeInfo['methods']) && is_array($routeInfo['methods'])) ? $routeInfo['methods'] : [];\n\t $destination = arrayPath($routeInfo, 'controller', null);\n\t if (! $destination) {\n\t $template = arrayPath($routeInfo, 'template', null);\n\t if ($template) {\n\t $destination = function () use ($template) {\n\t return new Response($template, ['request' => $this->request]);\n\t };\n\t } else {\n\t $destination = arrayPath($routeInfo, 'function', null);\n\t }\n\t }\n\n\t if ($destination) {\n\t $this->router->addRoute($route, $route, $destination, $defaults, $requirements, $methods);\n\t } else {\n\t Log::error(\"Invalid destination for route '$route'.\");\n\t }\n\t }\n }\n }", "function parseLetterTemplate($template_name, $param=NULL) {\n global $dbAccess;\n $this->db = $dbAccess;\n $data = $this->db->SimpleQuery(\"SELECT * FROM \" . TBL_LETTER_TEMPLATES . \" WHERE letter_pseudo_name=\\\"\" . $template_name . \"\\\"\");\n\n $tmpl_data = $data[0];\n if (count($tmpl_data) > 0) {\n if (isset($param[\"mail_vars\"])) {\n $vars = $param[\"mail_vars\"];\n } else {\n $vars = array();\n }\n\n $message = $this->srepltags_array($vars, $tmpl_data[\"body\"]);\n return $message;\n } else {\n return false;\n }\n }", "public function fetch_builder_template()\n\t\t{\n\t\t $error = false;\n $name = isset($_POST['templateName']) ? $_POST['templateName'] : false;\n if(empty($name)) \n $error = true;\n \n $key = $this->generate_key($name);\n $template = $this->get_meta_values($key);\n \n if(empty($template)) $error = true;\n \n \n if($error)\n {\n echo \"avia_fetching_error\";\n }\n else\n {\n $text = str_replace('{{{'.$name.'}}}','',$template[0]);\n $return = $this->builder->text_to_interface($text);\n \n echo $return;\n }\n \n die();\n\t\t}", "public static function preRouter(){\n\t\t\n\t}", "function f_get_template(){\n /// you need get info config in setting then insert here. the present it default\n $host = $this->host;\n $slugs = $this->slugs;\n $key = $this->key;\n $ajax_url = $this->ajax_url;\n $elementor = $this->elementor;\n/// get slug from url and remove element empty\n $slug = array_filter( explode('/', $_SERVER['REQUEST_URI']) );\n // check exist in slugs config\n if( isset( $slugs[$slug[1]] )){\n $template_api = $slugs[$slug[1]];\n $template_api['action'] = 'action_slug_api';\n $template_api['key'] = $key;\n $template_api['ajax_url'] = $ajax_url;\n $template_api['elementor'] = $elementor;\n $template_api['name'] = $slug[1];\n // check type template list or template single\n if($template_api['slug']){\n $template_api['url'] = $host.$template_api['url'].$slug[2];\n }else{\n $template_api['url'] = $host.$template_api['url'];\n }\n $this->do_template($template_api);\n\n }\n }", "public function parse($template, $data, $return = FALSE)\r\n\t{\r\n\t\t$template = $this->CI->load->view($template, $data, TRUE);\r\n\t\t$template = $this->_parse_double($template, $data);\r\n\t\treturn $this->_parse($template, $data, $return);\r\n\t}", "protected function initRouter()\n {\n $xml = new \\DOMDocument;\n $xml->load(ROOT_DIR . '/configs/routing.xml');\n\n $routes = $xml->getElementsByTagName('route');\n\n $routeList = new RouteList();\n\n /** @var $DOMRoute DOMElement */\n foreach ($routes as $DOMRoute) {\n $attrController = $DOMRoute->getAttribute('controller');\n list($controller, $action) = explode('::', $attrController);\n\n /** @var Route $route */\n $route =\n new Route(\n $DOMRoute->getAttribute('path'),\n $controller,\n $action\n );\n\n if ($DOMRoute->hasChildNodes()) {\n /** @var \\DOMElement $node */\n $requirements = [];\n foreach ($DOMRoute->childNodes as $node) {\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"requirement\") {\n $requirements[$node->getAttribute('key')] = $node->nodeValue;\n }\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"condition\") {\n $route->setCondition($node->nodeValue);\n }\n }\n $route->setRequirements($requirements);\n }\n\n $routeList->offsetSet(\n $DOMRoute->getAttribute('id'),\n $route\n );\n }\n\n $this->router = new Router($routeList);\n }", "public function parseTemplate($template, $students, $teachers, $messageVars)\n {\n $viewsDirectory = path('app') . 'views/'; //directory to make temporary files\n\n// foreach ($this->knownVariables as $key => $value) {\n $template = preg_replace_callback('/<%[^%>]*%>/',\n function ($match) {\n if (preg_match('/<%text_[^%>]*%>/', $match[0]))\n return $match[0];\n return Util::getFormatSMSTemplate($match[0]);\n },\n $template\n );\n// }\n $template = preg_replace_callback('/<%text_[^%>]*%>/',\n function ($match) {\n return Util::getFormattedTemplate(str_replace('text_', '$text_', $match[0]));\n },\n $template\n );\n $studentsData = array();\n $teachersData = array();\n\n //setting default variables value\n $data = array();\n foreach ($messageVars as $key => $val) {\n $data[trim($key)] = $val;\n }\n\n //create file for storing template content and render it via blade template engine\n $fileName = 'tmp/' . Str::lower(Str::random(64, 'alpha'));\n File::put($viewsDirectory . $fileName . '.blade.php', $template);\n\n if (!empty($students)) {\n\n foreach ($students as $student) {\n $data['name'] = isset($student->name) ? $student->name : ''; //name\n $data['dob'] = isset($student->dob) ? $student->dob : ''; //dob\n $classStandard = isset($student->classStandard) ? $student->classStandard : '';\n $classSection = isset($student->classSection) ? ucfirst($student->classSection) : '';\n $data['class'] = $classStandard . '-' . $classSection;\n $data['section'] = isset($student->classSection) ? $student->classSection : '';\n $data['mornigbusroute'] = isset($student->morningBusRoute) ? $student->morningBusRoute : '';\n $data['eveningbusroute'] = isset($student->eveningBusRoute) ? $student->eveningBusRoute : '';\n $data['today'] = date('d M Y');\n $completeMessage = View::make($fileName, $data)->render();\n $studentsData[$student->code] = $completeMessage;\n }\n }\n\n if (!empty($teachers)) {\n foreach ($teachers as $teacher) {\n $data['name'] = isset($teacher->name) ? $teacher->name : '';\n $data['dob'] = isset($teacher->dob) ? $teacher->dob : '';\n $data['department'] = isset($teacher->department) ? $teacher->department : '';\n $data['mornigbusroute'] = isset($teacher->morningBusRoute) ? $teacher->morningBusRoute : '';\n $data['eveningbusroute'] = isset($teacher->eveningBusRoute) ? $teacher->eveningBusRoute : '';\n $data['today'] = date('d M Y');\n $completeMessage = View::make($fileName, $data)->render();\n $teachersData[$teacher->code] = $completeMessage;\n }\n }\n //delete the temporary view file\n File::delete($viewsDirectory . $fileName . '.blade.php');\n if (count($studentsData) == 0 && count($teachersData) == 0)\n return array();\n $result = array('studentsCode' => $studentsData, 'teachersCode' => $teachersData);\n return $result;\n }", "protected function render($template, $view_data)\n {\n\n $uri = explode ( '/' , $this->route_data['route'] ) ;\n\n switch ($uri[0]) {\n\n case 'api' : echo \"BasePage\" ;\n $result = $this->vehicle_logic->activity('','',$uri[0],'','');\n exit();\n break; \n\n case 'ajax' : break; \n\n case 'changepassword' : \n case 'forgotpassword' :\n case 'forgotusername' : \n case 'fulfillment' :\n case 'login' :\n case 'mobile' : \n case 'orders' : \n case 'orderstatus' :\n case 'repo' :\n case 'warehouse' : // $result = $this->vehicle_logic->activity('','',$uri[0],'','');\n break;\n\n default : $user_id = $this->user_session->getUserId();\n $account_id = $this->user_session->getAccountId();\n $view_data['account_id'] = $account_id;\n $view_data['user_id'] = $user_id;\n\n $legal = $this->user_logic->getLegalId($user_id);\n if($legal['account'][0]['legal_id']!=$legal['legal'][0]['legal_id']){\n $view_data['legal_id'] = $legal['legal'][0]['legal_id'];\n $view_data['ts_and_cs'] = $legal['legal'][0]['legal'];\n $in = array('-',':',' ');\n $out = array('','','');\n $view_data['legal_version'] = str_replace ( $in , $out , $legal['legal'][0]['updated'] ) . '-' . $legal['legal'][0]['legal_id'];\n $view_data['legal_updated'] = $legal['legal'][0]['updated'];\n $view_data['account_name'] = $legal['account'][0]['account_name'];\n $view_data['user_first'] = $legal['account'][0]['user_first'];\n $view_data['user_last'] = $legal['account'][0]['user_last'];\n $view_data['user_name'] = $legal['account'][0]['user_name'];\n $view_data['user_email'] = $legal['account'][0]['user_email'];\n if($legal['account'][0]['user_roles']==''){\n $view_data['user_authority'] = 'Account Owner' ;\n $legal['account'][0]['usertype_id'] = 1;\n } else {\n $view_data['user_authority'] = $legal['account'][0]['usertype'];\n }\n if($legal['account'][0]['usertype_id'] == 1){\n $template='page/account/legal.html.twig';\n } else {\n $template='page/account/legalUnauthorized.html.twig';\n }\n }\n \n $result = $this->vehicle_logic->activity($account_id,$user_id,$uri[0],'','');\n \n /**\n * Default Permissions Variables\n */\n $buffer = null;\n $view_data['permissions'] = $this->user_logic->getPermissions();\n foreach ( $view_data['permissions'] as $key => $val ) {\n if($val){\n $buffer = 'permissions_' . $val['object'] . '_' . $val['action'];\n if(($buffer != 'permissions__')&&(!($view_data[$buffer]))){\n $view_data[$buffer] = false;\n }\n if($val['action']=='write'){\n $val['action'] = 'read'; \n $buffer = 'permissions_' . $val['object'] . '_' . $val['action'];\n if(($buffer != 'permissions__')&&(!($view_data[$buffer]))){\n $view_data[$buffer] = false;\n }\n }\n }\n }\n /**\n * Actual Permissions Settings\n */\n $buffer = null;\n $view_data['permissions'] = $this->user_logic->getPermissions($account_id,$user_id);\n foreach ( $view_data['permissions'] as $key => $val ) {\n //\n $buffer[$val['object']][$val['action']] = $val['label'];\n $view_data['permissions'] = $buffer;\n $buffer2 = 'permissions_' . $val['object'] . '_' . $val['action'];\n if(($buffer2 != 'permissions__')&&(!($view_data[$buffer2]))){\n $view_data[$buffer2] = true;\n }\n //\n if($val['action']=='write'){\n $val['action']='read';\n $buffer[$val['object']][$val['action']] = $val['label'];\n $view_data['permissions'] = $buffer;\n $buffer2 = 'permissions_' . $val['object'] . '_' . $val['action'];\n if(($buffer2 != 'permissions__')&&(!($view_data[$buffer2]))){\n $view_data[$buffer2] = true;\n }\n }\n //\n }\n $this->access = $buffer;\n $view_data['permissions'] = $buffer;\n\n }\n\n /**\n * Permission Control Over Primary/Secondary Navigation\n */\n $view_data['blank'] = $this->route_data['route'];\n switch ($this->route_data['route']) {\n\n case 'admin/export' :\n case 'admin/list' :\n case 'admin/repo' :\n case 'admin/users' :\n case 'admin/usertypes' :\n case 'users/list' :\n case 'users/type' : $this->secondaryNavigation = array();\n if($view_data['permissions_device_write']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'DEVICES',\n 'route' => 'admin/list'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'DEVICE IMPORT/EXPORT',\n 'route' => 'admin/export'\n ));\n } else {\n switch($this->route_data['route']){\n case 'admin/export' :\n case 'admin/list' : $blank=1;\n break;\n }\n }\n if($view_data['permissions_user_write']){\n // array_push($this->secondaryNavigation, array(\n // 'label' => 'USERS',\n // 'route' => 'users/list'\n // ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'USERS',\n 'route' => 'admin/users'\n ));\n } else {\n switch($this->route_data['route']){\n case 'admin/users' :\n case 'users/list' : $blank=1;\n break;\n }\n }\n if($view_data['permissions_usertype_write']){\n // array_push($this->secondaryNavigation, array(\n // 'label' => 'USER TYPES',\n // 'route' => 'users/type'\n // ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'USER TYPES',\n 'route' => 'admin/usertypes'\n ));\n } else {\n switch($this->route_data['route']){\n case 'admin/usertypes' :\n case 'users/type' : $blank=1;\n break;\n }\n }\n if($view_data['permissions_repo_write']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'REPOSSESSION',\n 'route' => 'admin/repo'\n ));\n }\n if($blank){\n $this->route_data['method'] = 'blank';\n $template = \"page/blank.html.twig\";\n }\n\n break;\n\n case 'alert/contact' :\n case 'alert/history' :\n case 'alert/list' : $this->secondaryNavigation = array();\n if($view_data['permissions_alert_read']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'HISTORY',\n 'route' => 'alert/history'\n ));\n if($view_data['permissions_alert_write']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'MANAGEMENT',\n 'route' => 'alert/list'\n ));\n } else if ($this->route_data['route']=='alert/list') {\n $blank = 1;\n }\n if($view_data['permissions_alert_write']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'CONTACTS',\n 'route' => 'alert/contact'\n ));\n } else if ($this->route_data['route']=='alert/contact') {\n $blank = 1;\n }\n } else {\n $blank = 1;\n }\n if($blank){\n $this->route_data['method'] = 'blank';\n $template = \"page/blank.html.twig\";\n }\n break;\n\n case 'landmark/group' :\n case 'landmark/incomplete' :\n case 'landmark/list' :\n case 'landmark/map' :\n case 'landmark/verification' : $this->secondaryNavigation = array();\n if($view_data['permissions_landmark_read']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'MAP',\n 'route' => 'landmark/map'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'LIST',\n 'route' => 'landmark/list'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'PENDING',\n 'route' => 'landmark/incomplete'\n ));\n if($view_data['permissions_landmark_group_write']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'GROUPS',\n 'route' => 'landmark/group'\n ));\n } else if ($this->route_data['route']=='landmark/group') {\n $this->route_data['method'] = 'blank';\n $template = \"page/blank.html.twig\";\n }\n if($view_data['permissions_reference_address_read']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'VERIFICATION ADDRESSES',\n 'route' => 'landmark/verification'\n ));\n } else if ($this->route_data['route']=='landmark/verification') {\n $this->route_data['method'] = 'blank';\n $template = \"page/blank.html.twig\";\n }\n } else {\n $view_data['landmarks'] = null ;\n $this->route_data['method'] = 'blank';\n $template = \"page/blank.html.twig\";\n }\n break;\n\n case 'report/contact' :\n case 'report/list' :\n case 'report/scheduled' : $this->secondaryNavigation = array();\n if($view_data['permissions_report_read']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'GENERATE',\n 'route' => 'report/list'\n ));\n // array_push($this->secondaryNavigation, array(\n // 'label' => 'Saved',\n // 'route' => 'report/saved'\n // ));\n if($view_data['permissions_report_write']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'SCHEDULED',\n 'route' => 'report/scheduled'\n ));\n } else if ($this->route_data['route']=='report/scheduled') {\n $blank = 1;\n }\n // array_push($this->secondaryNavigation, array(\n // 'label' => 'HISTORY',\n // 'route' => 'report/history'\n // ));\n if($view_data['permissions_report_write']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'CONTACTS',\n 'route' => 'report/contact'\n ));\n } else if ($this->route_data['route']=='report/contact') {\n $blank = 1;\n }\n } else {\n $blank = 1;\n }\n if($blank){\n $this->route_data['method'] = 'blank';\n $template = \"page/blank.html.twig\";\n }\n break;\n\n case 'system/' :\n case 'system/airtime' :\n case 'system/devices' :\n case 'system/library' :\n case 'system/logins' :\n case 'system/sales' :\n case 'system/ux' : $this->secondaryNavigation = array();\n array_push($this->secondaryNavigation, array(\n 'label' => 'Activity',\n 'route' => 'system/logins'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'Airtime',\n 'route' => 'system/airtime'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'Devices',\n 'route' => 'system/devices'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'Library',\n 'route' => 'system/library'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'Sales',\n 'route' => 'system/sales'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'User Experience',\n 'route' => 'system/ux'\n ));\n break;\n\n case 'vehicle/batch' :\n case 'vehicle/batchqueue' :\n case 'vehicle/commandhistory' :\n case 'vehicle/commandqueue' :\n case 'vehicle/group' :\n case 'vehicle/list' :\n case 'vehicle/map' : $this->secondaryNavigation = array();\n if($view_data['permissions_vehicle_read']){\n array_push($this->secondaryNavigation, array(\n 'label' => 'Map',\n 'route' => 'vehicle/map'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'List',\n 'route' => 'vehicle/list'\n ));\n if ($view_data['permissions_vehicle_group_write']) {\n array_push($this->secondaryNavigation, array(\n 'label' => 'Groups',\n 'route' => 'vehicle/group'\n ));\n } else if ($this->route_data['route']=='vehicle/group') {\n $this->route_data['method'] = 'blank';\n $template = \"page/blank.html.twig\";\n }\n if (($view_data['permissions_vehicle_location_read'])||($view_data['permissions_vehicle_reminder_write'])||($view_data['permissions_vehicle_starter_write'])) {\n array_push($this->secondaryNavigation, array(\n 'label' => 'Command History',\n 'route' => 'vehicle/commandhistory'\n ));\n array_push($this->secondaryNavigation, array(\n 'label' => 'Pending Commands',\n 'route' => 'vehicle/commandqueue'\n ));\n }\n } else {\n $view_data['vehicles'] = null ;\n $this->route_data['method'] = 'blank';\n $template = \"page/blank.html.twig\";\n }\n break;\n\n }\n\n /**\n * The 'theme' can be stored in an account record, which is added to the user session upon login\n */\n if (isset($this->user_session) && NULL !== $this->user_session->getAccountTheme()) {\n array_push($this->css_files, '../theme/'.$this->user_session->getAccountTheme().'/theme');\n } else {\n array_push($this->css_files, '../theme/'.$this->defaultTheme.'/theme');\n }\n\n $view_data['logopath']='/assets_responsive/img/logo.png';\n $url=$this->user_logic->getURL($_SERVER['HTTP_HOST']);\n if(!empty($url))\n {\n if($url['logo']!='logo.png'){\n $view_data['whitelabel']=$url['logo'];\n }\n $view_data['logo']=$url['logo'];\n $view_data['logopath']='/assets/media/logos/'.$url['logo'];\n $view_data['apple_touch_icon'] = $url['apple_touch_icon'];\n if(!($view_data['apple_touch_icon'])){\n $view_data['apple_touch_icon'] = 'apple-touch-114-whitelabel.png';\n }\n $view_data['browser_title']=$url['title'];\n }\n\t\t\n // pass all designated css/js files to the view\n $view_data['css_files'] = $this->css_files;\n $view_data['js_files'] = $this->js_files;\n\n // pass the logged in user to the view\n $view_data['user'] = $this->user_session;\n\n // pass the controller & route vars to the view\n // this could be cleaned up as route and context are redundant\n $view_data['controller'] = $this->route_data['controller'];\n $view_data['method'] = $this->route_data['method'];\n $this->route_data['route'] = $view_data['controller'] . '/' . $view_data['method'] ;\n $view_data['route'] = $this->route_data['route'];\n $view_data['context'] = $this->route_data['route'];\n\n // pass the access data to the view\n $view_data['environment'] = md5(ENVIRONMENT);\n\n // pass this to javascript\n $view_data['session_timeout'] = $this->session_timeout;\n\n // pass access data to view\n $view_data['access'] = (NULL !== $this->user_session) ? $this->user_session->getAccess() : array();\n\n $validation = new Validation;\n // add field types array to view for additional client-side validation\n $view_data['validation'] = $validation->getFieldTypes();\n\n // set global navigation links all viewable controller display\n if (isset($view_data['permissions'])) {\n\n if ($this->access['vehicle']['read']) {\n array_push($this->primaryNavigation, array(\n 'label' => 'Vehicles',\n 'route' => 'vehicle/map'\n ));\n }\n\n if ($this->access['landmark']['read']) {\n array_push($this->primaryNavigation, array(\n 'label' => 'Landmarks',\n 'route' => 'landmark/map'\n ));\n }\n /*\n if ($this->access['boundary_read']) {\n array_push($this->primaryNavigation, array(\n 'label' => 'Boundaries',\n 'route' => 'boundary/map'\n ));\n }\n */\n if ($this->access['alert']['read']) {\n array_push($this->primaryNavigation, array(\n 'label' => 'Alerts',\n 'route' => 'alert/history'\n ));\n }\n\n if ($this->access['report']['read']) {\n array_push($this->primaryNavigation, array(\n 'label' => 'Reports',\n 'route' => 'report/list'\n ));\n }\n\n if ( ($this->access['device']['write']) || ($this->access['user']['write']) || ($this->access['usertype']['write']) ) {\n array_push($this->primaryNavigation, array(\n 'label' => 'Admin',\n 'route' => 'admin/list'\n ));\n }\n\n switch($user_id){\n\n case '2482' :\n case '2510' : array_push($this->primaryNavigation, array(\n 'label' => 'System',\n 'route' => 'system'\n ));\n break;\n\n }\n\n } else {\n\n array_push($this->primaryNavigation, array(\n 'label' => 'account_id:' . $view_data['account_id'] . ':user_id:' . $view_data['user_id'],\n 'route' => 'vehicle/map'\n ));\n\n }\n\n $this->view_data['primary_navigation'] = $this->primaryNavigation;\n\n // set per controller\n $this->view_data['secondary_navigation'] = $this->secondaryNavigation;\n\n // merge any view_data set in a controller, over-writting may occur in the controller\n $view_data = array_merge($this->view_data, $view_data);\n\n // echo out the response\n echo $this->twig->render($template, $view_data);\n\n if(!($user_id)){\n $user_id = 999999999 ;\n }\n define ( 'CYCLE_END', microtime(true) );\n $miliseconds = ( CYCLE_END - CYCLE_START ) ;\n // echo '<hr>' . $miliseconds . '=' . CYCLE_END . '-' . CYCLE_START ;\n $metrics['uri'] = $this->route_data['route'] ;\n $metrics['miliseconds'] = floor ( $miliseconds * 1000 ) ;\n // $metrics['miliseconds'] = $miliseconds ;\n $result = $this->vehicle_logic->codebaseMetrics($_SERVER['HTTP_HOST'],$user_id,'uri',$metrics);\n\n exit();\n }", "public static function router()\n {\n $routerOutput = '[Router]' . PHP_EOL;\n Router::init();\n $routes = Router::dump();\n $routerOutput .= CLITableBuilder::init(\n $routes,\n ['identifier', 'name', 'controller', 'action', 'method'],\n false,\n 10\n );\n CLIShellColor::commandOutput($routerOutput.PHP_EOL, 'white', 'green');\n }", "public function getRouter();", "function parseRouterFromHtaccess($route)\n{\n\t///////////////////////////////////////////////\n\t//START customize URL\n\t$parts = explode('/', $route);\n\t\n\t//not check URL Rewrite if specified controller group\n\tif($parts[0] == 'admin' || $parts[0] == 'site')\n\t\treturn $route;\n\t\n\t$controllergroup = '';\n\t$controller = '';\n\t$action = '';\n\t$routerArgString = '';\n\t\n\tfor($i = 0; $i < count($parts); $i++)\n\t{\n\t\t$partValue = $parts[$i]; \n\t\t\n\t\tif(preg_match('/([a-z]+)\\.php$/', $partValue, $match)) //normal controller, such as(login,logout,register,tos,...)\n\t\t{\n\t\t\tif($controller != '')\n\t\t\t{\n\t\t\t\t$action = $partValue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controllergroup = 'site';\n\t\t\t\t$controller = $match[1];\n\t\t\t}\n\t\t}\n\t\telseif(preg_match('/page-(\\d+)/', $partValue, $match)) //this is a page group: page-1, page-2...\n\t\t{\n\t\t\t$_GET['page'] = $match[1];\n\t\t}\n\t\telseif(preg_match('/^[a-z0-9\\_-]+-(\\d+)$/', $partValue, $match))\t//photo detail url\n\t\t{\n\t\t\t$controllergroup = 'site';\n\t\t\t$controller = 'index';\n\t\t\t$action = 'detail';\n\t\t\t$_GET['photoid'] = $match[1];\n\t\t}\n\t\telseif(preg_match('/^[a-z0-9\\_-]+-c(\\d+)$/', $partValue, $match)) //category photos\n\t\t{\n\t\t\t$controllergroup = 'site';\n\t\t\t$controller = 'index';\n\t\t\t$action = 'index';\n\t\t\t$_GET['category'] = $match[1];\n\t\t}\n\t\telse if(strlen($partValue) > 0)\t// appending remain of route string parts\n\t\t{\n\t\t\t$routerArgString .= $partValue . '/';\n\t\t}\n\t}\n\t\n\t//assign default value for group,controller,action\n\tif($controllergroup == '') $controllergroup = 'site';\n\tif($controller == '') $controller = 'index';\n\tif($action == '') $action = 'index';\n\t\n\t//packing the route again after processing\n\t$route = '';\n\tif($controllergroup != '')\n\t\t$route .= $controllergroup . '/';\n\tif($controller != '')\n\t\t$route .= $controller . '/' ;\n\tif($action != '')\n\t\t$route .= $action . '/';\n\tif($routerArgString != '')\n\t\t$route .= $routerArgString;\n\t\t\n\t//die($route);\n\t\n\t//END customize URL\n\t/////////////////////////////////////////////////\n\t\n\treturn $route;\n}", "private function _prepareTemplate()\r\n {\r\n $this->_template = array();\r\n $this->_prepareTemplateDirectory($this->_templateXml->children(), $this->_template);\r\n }", "function _resolve_home_block_template()\n {\n }", "protected function parse(): void\n {\n parent::parse();\n $this->template->assign('dataGrid', (string) $this->dataGrid->getContent());\n }", "function templates_example()\n{\n /* Get post object by its template */\n $post = \\ActiTemplate\\Template::getTemplatePageObject('page-contact.php');\n\n /* Get post ID by its template */\n $postID = \\ActiTemplate\\Template::getTemplatePageId('page-contact.php');\n\n /* Get post url by its template */\n $url = \\ActiTemplate\\Template::getTemplatePageUrl('page-contact.php');\n}", "function render_template($template, $settings) {\n $text = file_get_contents($template); \n $text = transform_text($text, $settings);\n return $text;\n }", "public function extractRoutingInfo()\n {\n // Category\n $category = \"\";\n if (!empty($this->get[\"c\"])) {\n $category = $this->get[\"c\"];\n }\n $this->setController($category);\n unset($this->get[\"c\"]);\n\n // Action\n $action = \"\";\n if (!empty($this->get[\"a\"])) {\n $action = $this->get[\"a\"];\n }\n $this->setAction($action);\n unset($this->get[\"a\"]);\n\n // Property ID\n $property_id = null;\n if (!empty($this->get[\"pid\"])) {\n $property_id = $this->get[\"pid\"];\n }\n $this->setPropertyID($property_id);\n unset($this->get[\"pid\"]);\n\n // Debug flag\n $in_debug = (new \\Helpers\\Config)->getDebugMode() ?? false;\n if (!empty($this->get[\"debug\"])) {\n $in_debug = true;\n }\n $this->setInDebug($in_debug);\n unset($this->get[\"in_debug\"]);\n }", "protected function ParseTemplate($template, $return = false)\n\t{\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"../includes/converter/templates/\".$template);\n\t\treturn $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate($return);\n\t}", "private function transform() {\n $parts = explode('/', $this->route);\n\n if (end($parts) === '') {\n array_pop($parts);\n }\n\n $controller = ucfirst($parts[0]);\n $method = (isset($parts[1])) ? $parts[1] : $this->method;\n\n unset($parts[0]);\n unset($parts[1]);\n\n $this->getConfig(array('controller' => $controller, 'method' => $method, 'parameters' => $parts));\n }", "protected function parse($data)\n {\n $base = dirname(__FILE__) . '/Templates';\n\n $root = (string) $this->path;\n\n $callback = function (&$value) use ($base, $root)\n {\n $value = str_replace('$BASE$', $base, $value);\n\n $value = str_replace('$ROOT$', $root, $value);\n };\n\n array_walk_recursive($data, $callback);\n\n return $data;\n }" ]
[ "0.76295924", "0.64018375", "0.604868", "0.6040008", "0.60232085", "0.57545197", "0.57506967", "0.5732368", "0.56143016", "0.561063", "0.55926687", "0.5578856", "0.5545403", "0.5535251", "0.55217284", "0.54656565", "0.5459198", "0.54452515", "0.54401016", "0.54387677", "0.54337454", "0.5423554", "0.54161346", "0.54116625", "0.53964806", "0.538733", "0.53842324", "0.5370697", "0.5349991", "0.53489727", "0.53352046", "0.5321472", "0.53054404", "0.53049445", "0.5295892", "0.52895325", "0.52795374", "0.52784085", "0.5275451", "0.5265634", "0.5262413", "0.5239244", "0.52349377", "0.52243125", "0.52226204", "0.5217408", "0.52138454", "0.5203291", "0.52008533", "0.5198217", "0.5183135", "0.5172351", "0.5172351", "0.5172351", "0.5172351", "0.5172351", "0.5172351", "0.51648426", "0.51442116", "0.51333845", "0.5098343", "0.5091204", "0.50858134", "0.50853556", "0.5076839", "0.50737554", "0.5072237", "0.50642186", "0.5058596", "0.5051328", "0.5047818", "0.5045452", "0.5035064", "0.50318736", "0.5014915", "0.501425", "0.5006048", "0.49986422", "0.49961275", "0.49960712", "0.49893433", "0.49773455", "0.49604428", "0.4955859", "0.49546826", "0.49527887", "0.49514756", "0.49502912", "0.49460486", "0.49397272", "0.49370632", "0.49319658", "0.4931321", "0.4929816", "0.49270713", "0.49233896", "0.49200878", "0.49117908", "0.48946884", "0.4891591", "0.48827624" ]
0.0
-1
/Controlador $controlador = "alumnos"; $modelo = $this>getModel($controlador); $modelo>modificarImagen("fede.jpg",array(1)); exit;
public function uploader(){ // Recuperando imagem em base64 // Exemplo: data:image/png;base64,AAAFBfj42Pj4 $imagen = $_POST['imagen']; // Separando tipo dos datos da imagen // $tipo: data:image/png // $datos: base64,AAAFBfj42Pj4 list($tipo, $datos) = explode(';', $imagen); // Isolando apenas o tipo da imagen // $tipo: image/png list(, $tipo) = explode(':', $tipo); // Isolando apenas os datos da imagen // $datos: AAAFBfj42Pj4 list(, $datos) = explode(',', $datos); //Convertendo base64 para imagen $datos = base64_decode($datos); //Gerando nombre aleatório para a imagen $nombre = 'upl_' . $_POST['nombre']; //Controlador $controlador = $_POST['controlador']; $modelo = $this->getModel($controlador); //Ruta $ruta = ROOT . 'public' . DS . 'img' . DS . $controlador . DS; // Salvando imagen em disco if (file_put_contents($ruta."{$nombre}.jpg", $datos)){ //$parametro = json_decode(stripslashes($_POST['datos']),true); $parametro = $_POST['datos']; if($modelo->modificarImagen($nombre.".jpg",$parametro)){ //$modelo->modificarImagen($parametro[0],array(1)); // El modelo debe contener este metodo en el cual recibe el nombre de la imagen y un Array de datos auxiliares $thumb = new upload($ruta."{$nombre}.jpg"); $thumb->image_resize = true; $thumb->image_y = $thumb->image_dst_y / 2; $thumb->image_x = $thumb->image_dst_x / 2; $thumb->file_name_body_pre = 'thumb_'; $thumb->process($ruta . 'thumb' . DS); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Editar($idMotorista){\n $motorista = new Motorista();\n\n require_once('trata_imagem.php');\n\n // echo $idOnibus;\n\n // iniciado variaveis\n $diretorio_completo=Null;\n $MovUpload=false;\n $imagem_file=Null;\n $foto=\"nada\";\n\n //pegando a foto\n if (!empty($_FILES['imagem']['name'])) {\n $imagem_file = true;\n $diretorio_completo=salvarFoto($_FILES['imagem'],'arquivo');\n if ($diretorio_completo == \"Erro\") {\n $MovUpload=false;\n }else {\n $MovUpload=true;\n }\n }else {\n $imagem_file = false;\n }\n\n if ($imagem_file == true && $MovUpload==true) {\n $foto =$diretorio_completo;\n }else {\n $foto=\"nada\";\n }\n $motorista->id = $idMotorista;\n $motorista->imagem=$diretorio_completo;\n $motorista->imagem = $foto;\n $motorista->nome = $_POST['txtNome'];\n $motorista->email = $_POST['txtEmail'];\n $motorista->data_nasc = $_POST['txtDataNasc'];\n $motorista->sexo = $_POST['rdoSexo'];\n $motorista->telefone = $_POST['txtTelefone'];\n $motorista->celular = $_POST['txtCelular'];\n $motorista->cpf = $_POST['txtCPF'];\n $motorista->rg = $_POST['txtRG'];\n $motorista->cnh = $_POST['txtcnh'];\n $motorista->ativar = $_POST['chkAtivo'];\n if(isset($_POST['ativo'])){\n $motorista->ativo = '1';\n }else{\n $motorista->ativo = '0';\n }\n\n $motorista::Update($motorista);\n\n }", "public static function modifImage($fichier,$id){\r\n $im = ModelProgramme::getImage($id);\r\n $var = str_replace(\"images/\",\"\",$im);\r\n $fichier=\"images/\".$var;\r\n $fichier= str_replace(\" \",\"\",$fichier);\r\n $array = array(\r\n \"suppression\" => \"bar\",\r\n \"edit\" => \"foo\",\r\n );\r\n\r\n\r\n\r\n if (file_exists($fichier)) {\r\n if (@unlink($fichier)) {\r\n $array[\"suppression\"]=\"Suppression de $fichier réussite </br>\";\r\n } else {\r\n $array[\"suppression\"]=\"Echec de suppression de $fichier : $php_errormsg\";\r\n }\r\n } else {\r\n $array[\"suppression\"]=\"Le fichier $fichier n'existe pas </br>\";\r\n\r\n }\r\n\r\n // Vérifier si le formulaire a été soumis\r\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\r\n // Vérifie si le fichier a été uploadé sans erreur.\r\n if (isset($_FILES[\"photo\"]) && $_FILES[\"photo\"][\"error\"] == 0) {\r\n $allowed = array(\"jpg\" => \"image/jpg\", \"jpeg\" => \"image/jpeg\", \"gif\" => \"image/gif\", \"png\" => \"image/png\");\r\n $filename = $_FILES[\"photo\"][\"name\"];\r\n $filetype = $_FILES[\"photo\"][\"type\"];\r\n $filesize = $_FILES[\"photo\"][\"size\"];\r\n\r\n // Vérifie l'extension du fichier\r\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\r\n if (!array_key_exists($ext, $allowed)) die(\"Erreur : Veuillez sélectionner un format de fichier valide.\");\r\n\r\n // Vérifie la taille du fichier - 5Mo maximum\r\n $maxsize = 5 * 1024 * 1024;\r\n if ($filesize > $maxsize) die(\"Error: La taille du fichier est supérieure à la limite autorisée.\");\r\n\r\n // Vérifie le type MIME du fichier\r\n if (in_array($filetype, $allowed)) {\r\n // Vérifie si le fichier existe avant de le télécharger.\r\n if (file_exists(\"upload/\" . $_FILES[\"photo\"][\"name\"])) {\r\n $array[\"edit\"]=$_FILES[\"photo\"][\"name\"] . \" existe déjà.\";\r\n\r\n } else {\r\n move_uploaded_file($_FILES[\"photo\"][\"tmp_name\"], \"images/\" . $_FILES[\"photo\"][\"name\"]);\r\n $array[\"edit\"]= \"Votre fichier a été téléchargé avec succès. \".$_FILES[\"photo\"][\"name\"];\r\n\r\n\r\n $adresse = \"images/\".$filename;\r\n $adresse = str_replace(\" \",\"\",$adresse);\r\n ModelProgramme::update($id,\"urlImage\",$adresse);\r\n }\r\n } else {\r\n $array[\"edit\"]= \"Error: Il y a eu un problème de téléchargement de votre fichier. Veuillez réessayer.\";\r\n }\r\n } else {\r\n echo \"Error: \" . $_FILES[\"photo\"][\"error\"];\r\n }\r\n\r\n }\r\n return $array;\r\n }", "public function carregar_imagem()\n\t{\n\t\t$id = $this->input->get(\"id_aluno\");\n\t\t$dados[\"aluno\"] = $this->Aluno_Model->retorna_aluno($id);\t\n\t\t//\tCARREGA A VIZUALIZACAO DA VIEW LISTA\n\t\t$this->load->view('layout/cabecalho_secretaria');\n\t\t$this->load->view('layout/menu_lateral_secretaria');\n\t\t$this->load->view('conteudo/_secretaria/_aluno/fotografia', $dados);\n\t\t$this->load->view('layout/rodape');\n\t\t$this->load->view('layout/script');\n\t}", "public function Editar(){\n \n $id = $_GET['id'];\n $imagem = $_GET['imagem'];\n \n if(!empty($_FILES['btnImagem']['name'])){\n // Caminho da pasta onde as imagens serão armazenadas.\n $upload_dir = \"imagens/\";\n\n // Para manipular arquivos, deve ser usado \"$_FILES\"!!!\n // Armazenando o nome e a extensão do arquivo que foi selecionado.\n $nome_arq = basename($_FILES['btnImagem']['name']);\n\n // Verifica o tipo de extensão permitida para o upload do arquivo,\n // usamos o comando \"strstr()\" para localizar a sequência de caracteres.\n if(strstr($nome_arq,'.jpg') || strstr($nome_arq,'.png') || strstr($nome_arq,'.gif')){\n\n $upload_file = $upload_dir . $nome_arq;\n\n if(move_uploaded_file($_FILES['btnImagem']['tmp_name'], $upload_file)){\n\n $frota = new Frota();\n\n $frota->id = $id;\n// $frota->titulo_frota = $_POST['titulo_frota'];\n $frota->imagem = $upload_file;\n $frota->descricao = $_POST['txt_sobre'];\n $frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];\n\n $frota::Update($frota);\n \n \n// var_dump($frota);\n\n }else{\n echo(\"Falha ao mover o arquivo!\");\n }\n\n }\n }else{\n \n\n $idFrota = $_GET['id'];\n\n $frota = new Frota();\n\n $frota->id = $idFrota;\n// $frota->titulo_frota = $_POST['titulo_frota'];\n $frota->imagem = $imagem;\n $frota->descricao = $_POST['txt_sobre'];\n $frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];\n\n $frota::Update($frota);\n \n }\n }", "public function image_promotional() {\n // por el metodo de HTTP\n\n $api = $this->Api->findByTag(\"IMAGE_PROMOTIONAL\");\n $vdata[\"image\"] = $api->value;\n\n if ($this->input->server(\"REQUEST_METHOD\") == \"POST\") {\n $save = array(\"value\" => $this->do_upload('api'));\n $this->Api->update($api->api_id, $save);\n }\n\n // Capa de la Vista\n $view['body'] = $this->load->view(\"core/api/image_promotional/save\", $vdata, TRUE);\n $view['title'] = \"Registrar película\";\n $this->parser->parse('core/templates/body', $view);\n }", "static public function ctrActualizarMarca()\n {\n\n if (isset($_POST[\"editNomMarca\"])) {\n\n $tabla = \"marca\";\n $datos = array( \n \"nombre\" => $_POST[\"editNomMarca\"],\n \"idMarca\" => $_POST[\"editIdMarca\"]\n );\n\n $verificarDuplicado = ModeloMarca::mdlVerificarMarca($tabla, $datos, false);\n\n if ($verificarDuplicado) {\n return \"duplicado\";\n } else {\n /*=============================================\n VALIDAR LA EXISTENCIA DE LA IMAGEN\n =============================================*/\n if (isset($_FILES[\"editfotoMarca\"][\"tmp_name\"]) && $_FILES[\"editfotoMarca\"][\"tmp_name\"] != \"\") {\n list($ancho, $alto) = getimagesize($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n $nuevoAncho = 512;\n $nuevoAlto = 512;\n\n #Preguntar si existe una Imagen en la BD\n if (!empty($_POST[\"editFotoActualMarca\"])) {\n unlink($_POST[\"editFotoActualMarca\"]);\n }\n\n #Ruta Actual\n $directorioActual = \"views/img/Marcas/\" . $_POST[\"editNomActualMarca\"];\n\n #Valida si existe el directorio y con la imagen actual\n if (file_exists($directorioActual)) {\n #Ruta Nueva\n $directorioNuevo = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"];\n rename($directorioActual, $directorioNuevo);\n } else {\n mkdir(\"views/img/Marcas/\" . $_POST[\"editNomMarca\"], 0755);\n }\n\n #Vincular foto de acuerdo al tipo de foto\n if ($_FILES[\"editfotoMarca\"][\"type\"] == \"image/jpeg\") {\n #Guardar la imagen JPG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $aleatario . \".jpg\";\n\n $origen = imagecreatefromjpeg($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n }\n\n if ($_FILES[\"editfotoMarca\"][\"type\"] == \"image/png\") {\n #Guardar la imagen PNG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $aleatario . \".png\";\n\n $origen = imagecreatefrompng($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagepng($destino, $ruta);\n }\n } else { #En caso de no venir una imagen nueva\n #Asigna la ruta actual que tiene el producto\n $ruta = $_POST[\"editFotoActualMarca\"];\n if ($ruta) { #Evaluar si el producto tiene un imagen o no en la ruta actual\n #Separa la ruta\n $valoresRuta = explode(\"/\", $ruta);\n #Obtiene el nombre de la imagen\n $nombreImagen = $valoresRuta[4];\n #Asinga un nueva ruta cambiando el nombre de la carpeta por el nuevo nombre del producto\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $nombreImagen;\n } else {\n #Deja la ruta vacía en caso de que el producto no tenga una imagen asignada\n $ruta = \"\";\n }\n\n #Ruta Actual\n $directorioActual = \"views/img/Marcas/\" . $_POST[\"editNomActualMarca\"];\n #Ruta Nueva\n $directorioNuevo = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"];\n rename($directorioActual, $directorioNuevo);\n }\n\n $datos += [\"foto\" => $ruta];\n\n $actualizar = ModeloMarca::mdlActualizarMarca($tabla, $datos);\n\n return $actualizar;\n }\n }\n }", "function setModificarJugador($id,$nombre,$url_img){\n\t$this->nombre = $nombre;\n\t$this->id = $id;\n\t$this->url_img = $url_img;\n}", "public function editar() {\n\t\t$POST = array();\n\n\t\tif(!empty($this->request->data['img']))\n\t\t{\t\t\t\t\t\n\t\t\t$this->request->data['img'] = $this->DIRUPLOAD.$this->request->data['img'];\t\t\t\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\t$imgAtual = $this->Produto->query(sprintf(\"Select img FROM produtos where id = %d\", $this->request->data['id']));\n\t\t\t$this->request->data['img'] = $imgAtual[0]['produtos']['img'];\n\t\t}\t\t\n\n\t\t##apagando indice de tokenrequest pois ele não existe na tabela de categorias\n\t\tunset($this->request->data['TokenRequest']);\t\t\t\n\n\t\t$POST = array('Produto'=>$this->request->data);\t\n\t\tif ($this->Produto->save($POST)) \n\t\t{\n\t\t\t$this->Message = 'Produto editado com sucesso';\n\t\t\t$this->Return = true;\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$this->Message = 'Ocorreu um erro na edição de seu produto.';\n\t\t\t$this->Return = false;\t\n\t\t}\n\n\t\t$this->EncodeReturn();\t\n\t}", "function upImagenAction(){\n\t\t\n\t\t$request = $this->get('request');\n\t\t\n\t\t$estetica=$request->request->get('id');\n\t\t$img=$request->request->get('img');\n\t\t\t\t\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t$hcEstetica = $em->getRepository('HcBundle:Hc')->find($estetica);\n\t\t\n\t\t\t\t\n\t\tif($hcEstetica){\t\t\n\t\t\t$ruta = $this->container->getParameter('dlaser.directorio.imagenes');\n\t\t\t\n\t\t\tif ($img) {\n\t\t\t\t\n\t\t\t\t$imgData = base64_decode(substr($img,22));\n\t\t\t\t\n\t\t\t\t$file = $ruta.'grafico_'.$estetica.'.png';\n\t\t\t\t\n\t\t\t\tif (file_exists($file)) { unlink($file); }\n\t\t\t\t$fp = fopen($file, 'w');\n\t\t\t\tfwrite($fp, $imgData);\n\t\t\t\tfclose($fp);\n\t\t\t\t\n\t\t\t\t$response=array(\"responseCode\"=>200, \"msg\"=>\"La operación ha sido exitosa.\");\n\t\t\t}\n\t\t}else{\n\t\t\t$response=array(\"responseCode\"=>400, \"msg\"=>\"Ha ocurrido un error al crear la imagen.\");\n\t\t}\n\t\t\n\t\t$return=json_encode($response);\n\t\treturn new Response($return,200,array('Content-Type'=>'application/json'));\n\t}", "function actualizarDatos(){\n $e = new Empresa();\n \n $e->ruc = $_POST['ruc'];\n\n $imagenName = $_FILES['file']['name']; \n\n if($_POST['nameimage'] ==\"\"){\n\n \n \n //-------- MODIFIED NAME --------------\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n //copy($imagenTemp,$imagenUrl);\n }else{\n \n\n $eliminarimage = \"./vistas/panel_usuario/logoemp/\" . $_POST['nameimage'];\n unlink($eliminarimage);\n\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n\n }\n //ad in controller \n $e->logo = $newname;\n $e->logoUrl = $imageurl;\n\n $e->emailEmp = str_replace(\" \",\"\",$_POST['email']);\n $e->descripcion = trim($_POST['descripcion']);\n $e->direccion = trim($_POST['direccion']);\n $e->distrito = $_POST['distrito'];\n $e->telefono = $_POST['telefono'];\n $e->whatsapp = $_POST['whatsapp'];\n $e->facebook = trim($_POST['facebook']);\n $e->instagram = trim($_POST['instagram']);\n if (empty($e->descripcion) || empty($e->direccion) || $_POST['departamento'] == '0' || strlen($e->telefono) != 9 || strlen($e->whatsapp) > 9) {\n return ['bool' => false, 'msg' => 'datosIncorrectos'];\n }\n return ($this->modelo->actualizarEmpresa($e)) ?\n $this->modelo->buscarByRuc($e->ruc) :\n ['bool' => true, 'msg' => 'problemaSQL'];\n }", "function guardarImagen($name, $tipo, $path, $id){\n\t\n\t$path=\"img\\modelos\\\\\".$id.\"_\".$path;\n\t//Si reemplaza la imagen\n\t$existeImagen= sprintf(\"SELECT * FROM imagenes WHERE modelo_idmodelo = '%s' AND\n\t\t\ttipo = '%s' \", $id,$tipo);\n\t$result = mysql_query( $existeImagen);\n\t//Borrar la imagen antigua\n\tif($data=mysql_fetch_array($result)){\n\t\t\n\t\t//unlink('..\\\\'.$data['path']);\n\t\t//mysql_query(\"DELETE FROM imagenes WHERE idimagenes='\".$data[\"idimagenes\"].\"'\");\n\t}\t\n\t$insertImagen= sprintf(\"INSERT INTO imagenes (tipo, path, modelo_idmodelo)\n\t\t\tVALUES ('%s','%s','%s');\",$tipo, mysql_real_escape_string($path), $id);\n\t//Guardar la imagen nueva\n\tmove_uploaded_file($_FILES[$name][\"tmp_name\"],\n\t\t\t\"..\\img\\modelos\\\\\" .$id.\"_\". $_FILES[$name][\"name\"]);\n\t$result = mysql_query( $insertImagen);\n}", "function updateHuitre($id,$nomHuitre,$content,$alt,$target_file)\n {\n $upfile=$_FILES[\"img\"];\n if($upfile[\"name\"]!=''){ \n $typelist=array(\"image/jpeg\",\"image/jpg\",\"image/png\",\"image/gif\");\n $path=\"app\\public\\\\front\\images\\\\\";\n\n $target_file = $path . basename($upfile[\"name\"]);\n\n if (isset($_POST[\"submit\"])) \n {\n \n $check = getimagesize($upfile[\"tmp_name\"]);\n if ($check !== false) {\n if($upfile['size']>500000){\n }\n if(!in_array($upfile[\"type\"],$typelist)){\n die(\"Seuls les formats JPG, JPEG, PNG & GIF files sont authorisés.\");\n }\n if (move_uploaded_file($upfile[\"tmp_name\"], $target_file)) {\n\n if($id>0){\n $huitres = new HuitreManager();\n $updateHuitre = $huitres->updateHuitre($id,$nomHuitre,$content,$target_file);\n var_dump($target_file);\n header('Location: hbAdmin.php?action=huitres');\n }else{\n $huitres = new HuitreManager();\n $newHuitre = $huitres->newHuitre($nomHuitre,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=huitres');}\n }else\n {\n echo \"Désolé, une erreur est survenue dans l'envoi de votre fichier. \";\n } \n }\n \n } else {\n echo \"Ce fichier n'est pas une image. \";\n }\n }else{\n if($id>0){\n $huitres = new HuitreManager();\n $updateHuitre = $huitres->updateHuitre($id,$nomHuitre,$content,$target_file);\n\n header('Location: hbAdmin.php?action=huitres');\n }else{\n $huitres = new HuitreManager();\n $newHuitre = $huitres->newHuitre($nomHuitre,$content,$alt,$target_file);\n\n header('Location: hbAdmin.php?action=huitres');}\n }\n }", "public function ActualizarPerfilAlumnoC(){\n\n\t\tif(isset($_POST[\"idAl\"])){\n\n\t\t\t$rutaImg = $_POST[\"imgActual\"];\n\n\t\t\tif(isset($_FILES[\"imgAl\"][\"tmp_name\"]) && !empty($_FILES[\"imgAl\"][\"tmp_name\"])){\n\n\t\t\t\tif(!empty($_POST[\"imgActual\"])){\n\n\t\t\t\t\tunlink($_POST[\"imgActual\"]);\n\n\t\t\t\t}\n\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".png\";\n\n\t\t\t\t\t$foto = imagecreatefrompng($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagepng($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".jpg\";\n\n\t\t\t\t\t$foto = imagecreatefromjpeg($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagejpeg($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$tablaBD = \"alumnos\";\n\n\t\t\t$datosC = array(\"id\"=>$_POST[\"idAl\"], \"nombre\"=>$_POST[\"nombreAl\"], \"apellidopaterno\"=>$_POST[\"apellidopaternoAl\"], \"apellidomaterno\"=>$_POST[\"apellidomaternoAl\"], \"noControl\"=>$_POST[\"noControl\"], \"correo\"=>$_POST[\"correoAl\"], \"clave\"=>$_POST[\"claveAl\"], \"foto\"=>$rutaImg);\n\n\t\t\t$resultado = AlumnosM::ActualizarPerfilAlumnoM($tablaBD, $datosC);\n\n\t\t\tif($resultado == true){\n\n\t\t\t\tif ($_SESSION[\"rol\"] == \"Alumno\") {\n\t\t\t\t\t\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/perfil-'.$_SESSION[\"rol\"].'\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}else if ($_SESSION[\"rol\"] == \"Administrador\"){\n\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/alumnos\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function ctrActualizarPerfil()\n {\n if (isset($_POST['editarNombre'])) {\n\n\n /*====================================*/\n /*VALIDAR IMAGEN QUE SUBE COMO FOTO*/\n /*====================================*/\n $ruta = \"\";\n $directorio = \"vistas/img/usuarios/{$_POST['idUsuario']}\";\n if (isset($_FILES['datosImagen']['tmp_name'])) {\n\n //primero preuntamos si existe otra imagen en la base de datos\n if (!empty($_POST['foto'])) { // valido el post oculto de foto\n unlink($_POST['foto']); //eliminamos el archivo en el hosting\n unlink($directorio);\n } else {\n // si no existe ninguna imagen, creamos el directorio\n @mkdir($directorio, 0755); // pasamos el directorio, y los permisos\n }\n\n\n $aleatorio = mt_rand(100, 999);\n $ruta = \"vistas/img/usuarios/{$_POST['idUsuario']}/\" . $aleatorio . \".jpg\"; // ruta de la foto a almcenar\n\n //Modificamos tamaño de la foto\n //capturao en un array las medidas ancho y alto\n // list (0 , 1) // indices\n list($ancho, $alto) = getimagesize($_FILES['datosImagen']['tmp_name']);\n\n $nuevoAncho = 500;\n $nuevoAlto = 500;\n\n\n /*=====================================*/\n /*SOLO SIRVE PARA IAMGEN JPG JPEG*/\n /*=====================================*/\n\n //creamos una nueva imagen\n $origen = imagecreatefromjpeg($_FILES['datosImagen']['tmp_name']);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n //cortamos la imagen pasando los parametros\n //(destino, origen, posicionx, posiciony, )\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n\n\n }\n\n\n //validacion si se escibio algo en el input de contraseña\n if ($_POST['editarPassword'] != \"\") {\n $password = $_POST['passUsuario'];\n } else {\n\n $password = crypt($_POST['editarPassword'], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\n }\n\n\n $datos = [\n 'nombre' => $_POST['editarNombre'],\n 'email' => $_POST['editarEmail'],\n 'password' => $password,\n 'foto' => $ruta,\n 'id' => $_POST['idUsuario']\n ];\n\n $tabla = 'usuarios';\n $respuesta = @ModeloUsuarios::mdlActualizarPerfil($tabla, $datos);\n\n if ($respuesta == 'ok') {\n //si se ejcuto el update, actualizacmos las variables de sesion del usuario\n\n @session_start();\n $_SESSION['validarSesion'] = 'ok';\n $_SESSION['id'] = $datos['id'];\n $_SESSION['nombre'] = $datos['nombre'];\n $_SESSION['foto'] = $datos['foto'];\n $_SESSION['email'] = $datos['email'];\n $_SESSION['password'] = $datos['password'];\n $_SESSION['modo'] = $_POST['modoUsuario'];\n\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡OK!\",\n\t\t\t\t\t\t\t\t text: \"¡Su cuenta ha sido actualizada correctamente\",\n\t\t\t\t\t\t\t\t type:\"success\",\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\t\t\t\t\t\t\t});\n\t\t\t\t\t\t</script>';\n\n }\n\n }\n }", "function actualizar_imagen($id_imagen,$id_tipo_imagen,$estado,$registrado,$id_licencia,$id_autor,$tags,$tipo_pictograma,$validos_senyalectica) {\n\t\t\n\t\t$timestamp=time();\n\t\t$fecha=date(\"Y-m-d H:i:s\",$timestamp);\n\t\t\t\t\n\t\t$UpdateRecords = \"UPDATE imagenes \n\t\tSET estado='$estado', \n\t\tregistrado='$registrado', ultima_modificacion='$fecha',\n\t\tid_licencia='$id_licencia', id_autor='$id_autor',\n\t\ttags_imagen='$tags', id_tipo_imagen='$id_tipo_imagen',\n\t\ttipo_pictograma=$tipo_pictograma,\n\t\tvalidos_senyalectica='$validos_senyalectica'\n\t\tWHERE id_imagen='$id_imagen'\";\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); \n\t\tmysql_close($connection);\n\t\t\t\n\t}", "public function cargarImagen() {\n\n $id = $_REQUEST[\"id\"];\n\n echo $this->usuario->getCampo($id,'imagen');\n\n }", "public function actualizarperfil($id,$nombre,$primer_apellido,$segundo_apellido,$ano,$email,$telefono,$alias,$foto)\n {\n \n //busca en la tabla usuarios los campos donde el id sea el que le ha pasado el controlador\n $usuarios = R::load('usuarios',$id);\n \n //sobreescribe los campos\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios-> fecha_nacimiento=$ano;\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->alias=$alias;\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n $existefichero = is_file( $directorio );\n \n \n \n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n // almacena los datos en la tabla usuarios de la base de datos\n R::store($usuarios);\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/perfil_usuario\");\n \n \n }", "function edit($id_asoc, $imagenasoc_id)\n {\n if($this->acceso(453)){\n //$data['page_title'] = \"Imagen Producto\";\n // check if the imagen_producto exists before trying to edit it\n $data['imagen_asociado'] = $this->Imagen_asociado_model->get_imagen_asociado($imagenasoc_id);\n \n if(isset($data['imagen_asociado']['imagenasoc_id']))\n {\n $this->load->library('form_validation');\n\n\t $this->form_validation->set_rules('imagenasoc_titulo','Imagen Titulo','required');\n\t\t\n\t if($this->form_validation->run()) \n {\n /* *********************INICIO imagen***************************** */\n $foto=\"\";\n $foto1= $this->input->post('imagenasoc_archivo1');\n if (!empty($_FILES['imagenasoc_archivo']['name']))\n {\n $this->load->library('image_lib');\n $config['upload_path'] = './resources/images/imgasociados/';\n //$config['allowed_types'] = 'gif|jpeg|jpg|png';\n $config['allowed_types'] = '*';\n $config['max_size'] = 0;\n $config['max_width'] = 0;\n $config['max_height'] = 0;\n\n $new_name = time();\n $config['file_name'] = $new_name; //.$extencion;\n $config['file_ext_tolower'] = TRUE;\n\n $this->load->library('upload', $config);\n $this->upload->do_upload('imagenasoc_archivo');\n\n $img_data = $this->upload->data();\n $extension = $img_data['file_ext'];\n /* ********************INICIO para resize***************************** */\n if($img_data['file_ext'] == \".jpg\" || $img_data['file_ext'] == \".png\" || $img_data['file_ext'] == \".jpeg\" || $img_data['file_ext'] == \".gif\") {\n $conf['image_library'] = 'gd2';\n $conf['source_image'] = $img_data['full_path'];\n $conf['new_image'] = './resources/images/imgasociados/';\n $conf['maintain_ratio'] = TRUE;\n $conf['create_thumb'] = FALSE;\n $conf['width'] = 800;\n $conf['height'] = 600;\n $this->image_lib->clear();\n $this->image_lib->initialize($conf);\n if(!$this->image_lib->resize()){\n echo $this->image_lib->display_errors('','');\n }\n \n $confi['image_library'] = 'gd2';\n $confi['source_image'] = './resources/images/imgasociados/'.$new_name.$extension;\n $confi['new_image'] = './resources/images/imgasociados/'.\"thumb_\".$new_name.$extension;\n $confi['create_thumb'] = FALSE;\n $confi['maintain_ratio'] = TRUE;\n $confi['width'] = 50;\n $confi['height'] = 50;\n\n $this->image_lib->clear();\n $this->image_lib->initialize($confi);\n $this->image_lib->resize();\n }\n /* ********************F I N para resize***************************** */\n //$directorio = base_url().'resources/imagenes/';\n $directorio = FCPATH.'resources\\images\\imgasociados\\\\';\n //$directorio = $_SERVER['DOCUMENT_ROOT'].'/ximpleman_web/resources/images/productos/';\n if(isset($foto1) && !empty($foto1)){\n if(file_exists($directorio.$foto1)){\n unlink($directorio.$foto1);\n $mimagenthumb = \"thumb_\".$foto1;\n //$mimagenthumb = str_replace(\".\", \"_thumb.\", $foto1);\n if($img_data['file_ext'] == \".jpg\" || $img_data['file_ext'] == \".png\" || $img_data['file_ext'] == \".jpeg\" || $img_data['file_ext'] == \".gif\") {\n unlink($directorio.$mimagenthumb);\n }\n }\n }\n $foto = $new_name.$extension;\n }else{\n $foto = $foto1;\n }\n /* *********************FIN imagen***************************** */\n $params = array(\n 'asociado_id' => $id_asoc,\n 'imagenasoc_titulo' => $this->input->post('imagenasoc_titulo'),\n 'imagenasoc_archivo' => $foto,\n 'imagenasoc_descripcion' => $this->input->post('imagenasoc_descripcion'),\n );\n\n $this->Imagen_asociado_model->update_imagen_asociado($imagenasoc_id,$params); \n redirect('imagen_asociado/catalogo/'.$id_asoc);\n }\n else\n {\n $this->load->model('Documento_model');\n $data['all_documento'] = $this->Documento_model->get_all_documento();\n\t\t$data['id_asoc'] = $id_asoc;\n\n $data['_view'] = 'imagen_asociado/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The imagen_producto you are trying to edit does not exist.');\n }\n }", "public function actionUpdate($id)\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_UPDATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=$this->loadModel($id);\n $modRuanganPegawai=RuanganpegawaiM::model()->findAll('pegawai_id='.$id.'');\n $temLogo=$model->photopegawai;\n \n if(isset($_POST['PegawaiM']))\n\t\t{\n\t\t\t\n $transaction = Yii::app()->db->beginTransaction();\n try {\n// $model=new PegawaiM;\n $random=rand(0000000,9999999);\n $model->attributes=$_POST['PegawaiM'];\n $model->profilrs_id=Params::DEFAULT_PROFIL_RUMAH_SAKIT;\n if($_POST['caraAmbilPhoto']=='file')//Jika User Mengambil photo pegawai dengan cara upload file\n { \n $model->pegawai_aktif=true;\n $model->photopegawai = CUploadedFile::getInstance($model, 'photopegawai');\n $gambar=$model->photopegawai;\n\n if(!empty($model->photopegawai))//Klo User Memasukan Logo\n { \n\n $model->photopegawai =$random.$model->photopegawai;\n\n Yii::import(\"ext.EPhpThumb.EPhpThumb\");\n\n $thumb=new EPhpThumb();\n $thumb->init(); //this is needed\n\n $fullImgName =$model->photopegawai; \n $fullImgSource = Params::pathPegawaiDirectory().$fullImgName;\n $fullThumbSource = Params::pathPegawaiTumbsDirectory().'kecil_'.$fullImgName;\n\n if($model->save())\n {\n if(!empty($temLogo))\n { \n unlink(Params::pathPegawaiDirectory().$temLogo);\n unlink(Params::pathIconModulThumbsDirectory().'kecil_'.$temLogo);\n }\n $gambar->saveAs($fullImgSource);\n $thumb->create($fullImgSource)\n ->resize(200,200)\n ->save($fullThumbSource);\n }\n else\n {\n Yii::app()->user->setFlash('error', 'Data <strong>Gagal!</strong> disimpan.');\n }\n }\n } \n else \n { //Jika user Memasukan Photo Dari Webcam\n if(!empty($temLogo))\n { \n// \n if(!empty($temLogo))\n { \n unlink(Params::pathPegawaiDirectory().$temLogo);\n unlink(Params::pathPegawaiTumbsDirectory().$temLogo);\n }\n }\n $model->photopegawai=$_POST['PegawaiM']['tempPhoto'];\n }\n $model->save(); \n $jumlahRuanganPegawai=COUNT($_POST['ruangan_id']);\n $pegawai_id=$model->pegawai_id;\n $hapusRuanganPegawai= RuanganpegawaiM::model()->deleteAll('pegawai_id='.$pegawai_id.''); \n for($i=0; $i<=$jumlahRuanganPegawai; $i++)\n {\n $modRuanganPegawai = new RuanganpegawaiM;\n $modRuanganPegawai->ruangan_id=$_POST['ruangan_id'][$i];\n $modRuanganPegawai->pegawai_id=$pegawai_id;\n $modRuanganPegawai->save();\n\n }\n $transaction->commit();\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.2'); \n $this->redirect(array('admin')); \n }\n catch (Exception $e)\n {\n $transaction->rollback();\n Yii::app()->user->setFlash('error',\"Data gagal disimpan \".MyExceptionMessage::getMessage($e,true));\n } \n \n\t\t} \n \n\t\t\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,'modRuanganPegawai'=>$modRuanganPegawai\n\t\t));\n\t}", "public function editar_recomendaciones(){\n if($this->input->post()){\n\n //Ruta donde se guardan las imagenes\n $config['upload_path'] = $this->input->post(\"ruta_imagenn\");\n\n //Tipos de ficheros permitidos\n $config['allowed_types'] = 'jpg|png'; \n\n //Se pueden configurar aun mas parámetros.\n //Cargamos la librería de subida y le pasamos la configuración\n $this->load->library('upload', $config);\n\n if(!$this->upload->do_upload('rec_foto')){\n \n show_404(); \n }\n else{\n \n $file_info = $this->upload->data();\n\n //Creamos un array para almacenar los datos del formulario\n $data_update = array(\n 'rec_codigo'=>$this->input->post(\"rec_codigo\"),\n 'rec_descripcion'=>$this->input->post(\"rec_descripcion\"),\n 'rec_estado'=>$this->input->post(\"rec_estado\"),\n 'rec_foto'=>$config['upload_path'].'/'.$file_info['file_name'],\n );\n\n print_r($data_update);\n\n $respuesta=$this->model_admin->update_recomendacion($data_update);\n\n $data['recomendaciones']= $this->model_admin->recomendaciones();\n $this->load->view('view_librerias');\n $this->load->view('view_admin_recomendaciones',$data);\n \n //header('Location: '.$_SERVER['HTTP_REFERER']); \n }\n \n\n }\n else{\n\n show_404();\n }\n\n }", "public function EditarPerfilAlumnoC(){\n\n\t\t$tablaBD = \"alumnos\";\n\t\tif ($_SESSION[\"rol\"] == \"Alumno\") {\n\t\t\t\n\t\t\t$id = $_SESSION[\"id\"];\n\n\t\t}else if ($_SESSION[\"rol\"] == \"Administrador\") {\n\t\t\t\n\t\t\t$id = substr($_GET[\"url\"], 10);\n\n\t\t}\n\t\t\n\n\t\t$resultado = AlumnosM::VerPerfilAlumnoM($tablaBD, $id);\n\n\t\techo '<form method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t\t\t\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"col-md-6 col-xs-12\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<h2>Nombre:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"nombreAl\" value=\"'.$resultado[\"nombre\"].'\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"idAl\" value=\"'.$resultado[\"id\"].'\">\t\n\n\t\t\t\t\t\t\t<h2>Apellido Paterno:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"apellidopaternoAl\" value=\"'.$resultado[\"apellidopaterno\"].'\">\n\n\t\t\t\t\t\t\t<h2>Apellido Materno:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"apellidomaternoAl\" value=\"'.$resultado[\"apellidomaterno\"].'\">\n\n\t\t\t\t\t\t\t<h2>No. Control:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"noControl\" value=\"'.$resultado[\"noControl\"].'\">\n\t\t\t\t\t\n\t\t\t\t\t\t\t<h2>Correo Electronico:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"correoAl\" value=\"'.$resultado[\"correo\"].'\">\n\n\t\t\t\t\t\t\t<h2>Contraseña:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"claveAl\" value=\"'.$resultado[\"clave\"].'\">\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t\t<div class=\"col-md-6 col-xs-12\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<br><br>\n\n\t\t\t\t\t\t\t<input type=\"file\" name=\"imgAl\">\n\t\t\t\t\t\t\t<br>';\n\n\t\t\t\t\t\t\tif($resultado[\"foto\"] == \"\"){\n\n\t\t\t\t\t\t\t\techo '<img src=\"http://localhost/psicologiaitsur/Vistas/img/defecto.png\" class=\"img-responsive\" width=\"200px\">';\n\n\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\techo '<img src=\"http://localhost/psicologiaitsur/'.$resultado[\"foto\"].'\" class=\"img-responsive\" width=\"200px\">';\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"imgActual\" value=\"'.$resultado[\"foto\"].'\">\n\n\t\t\t\t\t\t\t<br><br>\n\n\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-success\">Guardar Cambios</button>\n\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t</div>\n\n\t\t\t\t</form>';\n\n\t}", "public function image()//minuscula modeloforaneo\n {\n return $this->morphOne('App\\Image','imageable'); //1er parametro:direccion modeloforaneo, 2do parametro: modeloforaneo+'able'\n }", "function TipoImagenDAO()\r\n {\r\n parent::DAO();\r\n return;\r\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $img1=$model->ruta;\n $img2=$model->ruta_img;\n\n if ($model->load(Yii::$app->request->post())) {\n echo \"<script>alert('\".$model->ruta.\"');</script>\";\n if(is_null($model->ruta)){\n $model->ruta=$img1;\n }else{\n //Imagen de fondo\n $file = UploadedFile::getInstance($model, 'ruta');\n $ext = end((explode(\".\", $file->name)));\n $path = 'slide_index'.Yii::$app->security->generateRandomString().\".{$ext}\";\n $file->saveAs('uploads/' . $path);\n $this->resize_crop_image(1366, 550, 'uploads/'.$path, 'uploads/'.$path);\n $model->ruta = $path;\n }\n echo \"<script>alert('\".$model->ruta_img.\"');</script>\";\n if(is_null($model->ruta_img)){\n $model->ruta=$img2;\n }else{ \n //Imagen left\n $file2 = UploadedFile::getInstance($model, 'ruta_img');\n $ext2 = end((explode(\".\", $file2->name)));\n $path2 = 'slide_index'.Yii::$app->security->generateRandomString().\".{$ext2}\";\n $file2->saveAs('uploads/' . $path2);\n $model->ruta_img = $path2;\n }\n\n if($model->save()){\n return $this->redirect(['index']);\n }\n \n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "function subidaFichero($bd,$usuario,$entrada){\n if(isset($_FILES['imagen']['name']) && strlen ($_FILES['imagen']['name'])>0) {\n $dir_subida = $usuario . \"/\";\n ///////////NO TENGO PERMISOS DE CREAR CARPETAS!!!!!!!\n if ( !is_dir($dir_subida) && is_writable(\"../redsocial\")) {\n mkdir($dir_subida,0755, true);\n }else\n $dir_subida=\"img/\";\n $path = $_FILES['imagen']['name'];\n $ext = pathinfo($path, PATHINFO_EXTENSION);\n $fichero_subido = $dir_subida . $usuario . date(\"Ymd_Hm\").\".\".$ext;\n /////NO TENGO PERMISOS PARA SUBIR ARCHIVOS!!!!\n if(is_writable($dir_subida)) {\n if (!move_uploaded_file($_FILES['imagen']['tmp_name'], $fichero_subido)) {\n echo \"Problema de ataque de subida de ficheros!.\\n\";\n }\n }\n $imagen = new Imagen(null, $fichero_subido, $entrada->getId());\n $daoImagenes = new Imagenes($bd);\n $daoImagenes->addImagen($imagen, $entrada);\n return $fichero_subido;\n }\n\n}", "static public function ctrCrearMarca()\n {\n\n if (isset($_POST[\"ingNomMarca\"])) {\n\n $tabla = \"marca\";\n $datos = array( \"nombre\" => $_POST[\"ingNomMarca\"] );\n $ruta = \"\";\n\n $verificarDuplicado = ModeloMarca::mdlVerificarMarca($tabla, $datos, true);\n\n if ($verificarDuplicado) {\n return \"duplicado\";\n } else {\n\n if (isset($_FILES[\"ingfotoMarca\"][\"tmp_name\"])) {\n\n list($ancho, $alto) = getimagesize($_FILES[\"ingfotoMarca\"][\"tmp_name\"]);\n $nuevoAncho = 512;\n $nuevoAlto = 512;\n\n #Crear directorio donde se guardaran las imagenes\n $directorio = \"views/img/Marcas/\" . $_POST[\"ingNomMarca\"];\n mkdir($directorio, 0755);\n\n #Vincular foto de acuerdo al tipo de foto\n if ($_FILES[\"ingfotoMarca\"][\"type\"] == \"image/jpeg\") {\n #Guardar la imagen JPG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"ingNomMarca\"] . \"/\" . $aleatario . \".jpg\";\n\n $origen = imagecreatefromjpeg($_FILES[\"ingfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n }\n\n if ($_FILES[\"ingfotoMarca\"][\"type\"] == \"image/png\") {\n #Guardar la imagen PNG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"ingNomMarca\"] . \"/\" . $aleatario . \".png\";\n\n $origen = imagecreatefrompng($_FILES[\"ingfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagepng($destino, $ruta);\n }\n }\n\n $datos += [\"foto\" => $ruta];\n\n $ingresar = ModeloMarca::mdlCrearMarca($tabla, $datos);\n return $ingresar;\n }\n }\n }", "static public function ctrEditProduct(){\n\n\t\t\tif(isset($_POST[\"editarDescripcion\"])){\n\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarDescripcion\"]) &\n\t\t\t\t\t\t\tpreg_match('/^[0-9]+$/', $_POST[\"editarStock\"]) &&\n\t\t\t\t\t\t\tpreg_match('/^[0-9.]+$/', $_POST[\"editarPrecioCompra\"]) && \n\t\t\t\t\t\t\tpreg_match('/^[0-9.]+$/', $_POST[\"editarPrecioVenta\"])){\n\n\t\t\t\t\t\t\t\t$ruta = $_POST[\"imagenActual\"];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(isset($_FILES[\"editarImagen\"][\"tmp_name\"]) && !empty($_FILES[\"editarImagen\"][\"tmp_name\"])){\n\n\t\t\t\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarImagen\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t\t\t// var_dump(getimagesize($_FILES[\"editarImagen\"][\"tmp_name\"]));\n\t\t\t\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t\t\t\t/*========================================\n\t\t\t\t\t\t\t\t\t= Creacion del directorio donde se \n\t\t\t\t\t\t\t\t\t\tguarda la foto del usuario =\n\t\t\t\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t\t\t\t$directorio = \"views/img/products/\".$_POST[\"editarCodigo\"];\n\n\t\t\t\t\t\t\t\t\t// primero preguntamos si existe imagen en la bd.\n\n\n\t\t\t\t\t\t\t\t\tif(!empty($_POST[\"imagenActual\"]) && $_POST[\"imagenActual\"] != \"views/img/products/default/productos.png\"){\n\n\t\t\t\t\t\t\t\t\t\tunlink($_POST[\"imagenActual\"]);\n\n\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t\t// 0705 son los permisos de lectura y escritura\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\tmkdir($directorio, 0755);\n\n\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\t\t\t\t\tde acuerdo a ltipo de imagen se colocan\n\t\t\t\t\t\t\t\t\tlas funciones poor defecto de PHP\n\t\t\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\t\t\tif($_FILES[\"editarImagen\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t\t\t\tGuardamos la imagen en el directrorio.\n\t\t\t\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t\t\t\t\t\t$ruta = \"views/img/products/\".$_POST[\"editarCodigo\"].\"/\".$aleatorio.\".jpg\";\n\t\t\t\t\t\t\t\t\t\t\t// cortando la imagen,\n\t\t\t\t\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// para que mantenga las mimas propiedades\n\t\t\t\t\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t\t\t\t\t\t\t\t\t// ajustar la imagen al tamaño de 500x500\n\t\t\t\t\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\t\t\t\t\t// Guardar la imagen en la ruta que le estamos asignando\n\t\t\t\t\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif($_FILES[\"editarImagen\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t\t\t\tGuardamos la imagen en el directrorio.\n\t\t\t\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$ruta = \"views/img/products/\".$_POST[\"editarCodigo\"].\"/\".$aleatorio.\".png\";\n\t\t\t\t\t\t\t\t\t\t// cortando la imagen,\n\t\t\t\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// para que mantenga las mimas propiedades\n\t\t\t\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t\t\t\t\t\t\t\t// ajustar la imagen al tamaño de 500x500\n\t\t\t\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\t\t\t\t// Guardar la imagen en la ruta que le estamos asignando\n\t\t\t\t\t\t\t\t\t\timagepng($destino, $ruta);\n\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\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$tabla = \"productos\";\n\n\t\t\t\t\t\t\t\t$datos = array(\"id_categoria\" => $_POST[\"editarCategoria\"],\n\t\t\t\t\t\t\t\t\t\"codigo\" => $_POST[\"editarCodigo\"],\n\t\t\t\t\t\t\t\t\t\"descripcion\" => $_POST[\"editarDescripcion\"],\n\t\t\t\t\t\t\t\t\t\"stock\" => $_POST[\"editarStock\"],\n\t\t\t\t\t\t\t\t\t\"precio_compra\" => $_POST[\"editarPrecioCompra\"],\n\t\t\t\t\t\t\t\t\t\"precio_venta\" => $_POST[\"editarPrecioVenta\"],\n\t\t\t\t\t\t\t\t\t\"imagen\" => $ruta);\n\n\n\t\t\t\t\t\t\t\t\t\t$reply = ModelProducts::mdlEditProducts($tabla, $datos);\n\n\t\t\t\t\t\t\t\t\t\tif($reply == \"ok\"){\n\n\t\t\t\t\t\t\t\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\ttitle: \"El producto ha sido editado correctamente\",\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\t}).then(function(result){\n\t\t\t\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"productos\";\n\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\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo'<script>\n\n\t\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: \"¡El producto no puede ir con los campos vacíos o llevar caracteres especiales!\",\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\t}).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t</script>';\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}", "static public function ctrEditarRepuesto(){\n\n\t\tif(isset($_POST[\"editDescripcion\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editDescripcion\"]) &&\n\t\t\t preg_match('/^[0-9]+$/', $_POST[\"editStock\"]) &&\t\n\t\t\t preg_match('/^[0-9.]+$/', $_POST[\"editPrecioCompra\"]) &&\n\t\t\t preg_match('/^[0-9.]+$/', $_POST[\"editPrecioVenta\"])){\n\n\t\t \t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN\n\t\t\t\t=============================================*/\n\n\t\t\t \t$ruta = $_POST[\"imagenActualProducto\"];\n\n\t\t\t \tif(isset($_FILES[\"editImagen\"][\"tmp_name\"]) && !empty($_FILES[\"editImagen\"][\"tmp_name\"])){\n\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editImagen\"][\"tmp_name\"]);\n\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t$directorio = \"vistas/img/productos/\".$_POST[\"editCodigo\"];\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE OTRA IMAGEN EN LA BD\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tif(!empty($_POST[\"imagenActualProducto\"]) && $_POST[\"imagenActualProducto\"] != \"vistas/img/productos/default/anonymous.png\"){\n\n\t\t\t\t\t\tunlink($_POST[\"imagenActualProducto\"]);\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\tmkdir($directorio, 0755);\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tif($_FILES[\"editImagen\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST[\"editCodigo\"].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES[\"editImagen\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST[\"editCodigo\"].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$tabla = \"repuestos\";\n\n\t\t\t\t$datos = array(\"id_categoria\" => $_POST[\"editCategoria\"],\n\t\t\t\t\t\t\t \"codigo\" => $_POST[\"editCodigo\"],\n\t\t\t\t\t\t\t \"descripcion\" => $_POST[\"editDescripcion\"],\n\t\t\t\t\t\t\t \"stock\" => $_POST[\"editStock\"],\n\t\t\t\t\t\t\t \"precio_unidad\" => $_POST[\"editPrecioCompra\"],\n\t\t\t\t\t\t\t \"total_pagar\" => $_POST[\"editPrecioVenta\"],\n\t\t\t\t\t\t\t \"imagen\" => $ruta);\n\n\t\t\t\t$respuesta = ModeloProductos::mdlEditarRepuesto($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t\t title: \"El producto ha sido editado correctamente\",\n\t\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\n\t\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\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El producto no puede ir con los campos vacíos o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\t\t\t}\n\t\t}\n\n\t}", "public static function ctrEditarProducto(){\n\n\n\n\t\tif (isset($_POST['editarDescripcion'])) {\n\n\n\n\t\t\t/*if(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarDescripcion\"])&&\n\n\t\t\t\tpreg_match('/^[0-9]+$/', $_POST[\"editarStock\"])&&\n\n\t\t\t\tpreg_match('/^[0-9]+$/', $_POST[\"editarPrecioCompra\"])&&\n\n\t\t\t\tpreg_match('/^[0-9]+$/', $_POST[\"editarPrecioVenta\"])){*/\n\n\n\n\t\t\t\t\n\n\t\t\t/*=============================================\n\n\t\t\tVALIDAR IMAGEN\n\n\t\t\t=============================================*/\n\n\n\n\n\n\t\t\t$ruta = $_POST[\"imagenActual\"];\n\n\n\n\n\n\t\t\tif (isset($_FILES['editarImagen'][\"tmp_name\"])) {\n\n\n\n\t\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarImagen\"][\"tmp_name\"]); //saber las propiedades\n\n\n\n\t\t\t\t\t\t\t$nuevoAncho = 500;\n\n\t\t\t\t\t\t\t$nuevoAlto = 500;\n\n\n\n\t\t\t\t\t\t\t/*=============================================\n\n\t\t\t\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\n\t\t\t\t\t\t\t=============================================*/\n\n\n\n\t\t\t\t\t\t\t$directorio = \"vistas/img/productos/\".$_POST['editarCodigo'];\n\n\n\n\t\t\t\t\t\t\t/*=============================================\n\n\t\t\t\t\t\t\tPREGUNTAMOS SI NO ESTA VACIO EL IMPUT DE LA FOTO ACTUAL\n\n\t\t\t\t\t\t\t=============================================*/\n\n\n\n\t\t\t\t\t\t\tif (!empty($_POST[\"imagenActual\"])) {\n\n\n\n\t\t\t\t\t\t\t\tunlink(utf8_decode($_POST[\"imagenActual\"]));\n\n\n\n\t\t\t\t\t\t\t}else{\n\n\n\n\t\t\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\n\n\n\n\t\t\t\t\t\t\t/*=============================================\n\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\n\t\t\t\t\t\t\t=============================================*/\n\n\n\n\t\t\t\t\t\t\tif($_FILES[\"editarImagen\"][\"type\"] == \"image/jpeg\"){\n\n\n\n\t\t\t\t\t\t\t\t\t/*=============================================\n\n\t\t\t\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\n\t\t\t\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\n\n\t\t\t\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST['editarCodigo'].\"/\".$aleatorio.\".jpg\";\n\n\n\n\t\t\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarImagen\"][\"tmp_name\"]);\n\n\n\n\t\t\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\n\t\t\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\n\n\t\t\t\t\t\t\t\t\timagejpeg($destino, utf8_decode($ruta));\n\n\n\n\n\n\t\t\t\t\t\t\t\t}\n\n\n\n\n\n\t\t\t\t\t\t\t\tif($_FILES[\"editarImagen\"][\"type\"] == \"image/png\"){\n\n\n\n\t\t\t\t\t\t\t\t\t/*=============================================\n\n\t\t\t\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\n\t\t\t\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\n\n\t\t\t\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST['editarCodigo'].\"/\".$aleatorio.\".png\";\n\n\n\n\t\t\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarImagen\"][\"tmp_name\"]);\n\n\n\n\t\t\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\n\t\t\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\n\n\t\t\t\t\t\t\t\t\timagepng($destino, utf8_decode($ruta));\n\n\n\n\n\n\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t}\n\n\n\n\n\n\n\n\t\t\t/*=============================================\n\n\t\t\tFIN DE VALIDAR IMAGEN\n\n\t\t\t=============================================*/\n\n\n\n\n\n\t\t\t$tabla = 'productos';\t\n\n\n\n\t\t\t$datos = array('id_categoria' => $_POST['editarCategoria'],\n\n\t\t\t\t'codigo' => $_POST['editarCodigo'],\n\n\t\t\t\t'descripcion' => $_POST['editarDescripcion'],\n\n\t\t\t\t'stock' => $_POST['editarStock'],\n\n\t\t\t\t'precio_compra' => $_POST['editarPrecioCompra'],\n\n\t\t\t\t'precio_venta' => $_POST['editarPrecioVenta'],\n\n\t\t\t\t'id' => $_POST['id'],\n\n\t\t\t\t'imagen' => $ruta);\n\n\n\n\t\t\t$respuesta = ModeloProducto::mdlEditarProducto($tabla, $datos);\n\n\n\n\t\t\tif ($respuesta == 'ok') { ?>\n\n\n\n\t\t\t\t<script>\n\n\n\n\t\t\t\t\tswal({\n\n\n\n\t\t\t\t\t\ttype: \"success\",\n\n\t\t\t\t\t\ttitle: \"¡El producto se ha editado correctamente!\",\n\n\t\t\t\t\t\tshowConfirmButton: true,\n\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\n\t\t\t\t\t\tcloseOnConfirm: false\n\n\n\n\t\t\t\t\t}).then((result)=>{\n\n\n\n\t\t\t\t\t\tif(result.value){\n\n\n\n\t\t\t\t\t\t\twindow.location = \"tareas\";\n\n\n\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t});\n\n\n\n\n\n\t\t\t\t</script> \n\n\n\n\t\t\t\t<?php\t\t\n\n\t\t\t} \n\n\n\n\n\n\t\t/*}else{\n\n\n\n\t\t\t?>\n\n\n\n\t\t\t<script>\n\n\n\n\t\t\t\tswal({\n\n\n\n\t\t\t\t\ttype: \"error\",\n\n\t\t\t\t\ttitle: \"¡No puede ir vacío o llevar caracteres especiales!\",\n\n\t\t\t\t\tshowConfirmButton: true,\n\n\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\n\t\t\t\t\tcloseOnConfirm: false\n\n\n\n\t\t\t\t}).then((result)=>{\n\n\n\n\t\t\t\t\tif(result.value){\n\n\n\n\t\t\t\t\t\twindow.location = \"productos\";\n\n\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t});\n\n\n\n\n\n\t\t\t</script> \n\n\n\n\t\t\t<?php \n\n\t\t}*/\n\n\n\n\n\n\t}\n\n\n\n\n\n\n\n\n\n}", "public function agregar_noticia_controlador(){\n\n\t\t$not_titulo = mainModel::limpiar_cadena($_POST['noticia_titulo']);\n\t\t$not_imagen = mainModel::limpiar_cadena($_FILES['imagen']['name']);\n\t\t$not_drescripcion = mainModel::limpiar_cadena($_POST['descripcion']);\n\t\t$dir = SEVERURL.'assets/imagenes/';\n\n\t\tif ($_FILES['imagen']['size'] > 2000000) {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'Solo se permiten archivos menores a 2 MB',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\n\t\t\treturn mainModel::sweetalert($alerta);\n\t\t}\n\n\t\tif ($_FILES['imagen']['type'] != 'image/png') {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'Solo se permiten archivos de tipo imagen',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\n\t\t\treturn mainModel::sweetalert($alerta);\n\t\t}\n\n\t\t/*if (!move_uploaded_file($_FILES['imagen']['tmp_name'], $dir.$not_imagen)) {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'Error al subir archivo',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\n\t\t\treturn mainModel::sweetalert($alerta);\n\t\t}*/\n\n\t\t$notDatos = [\n\t\t\t'titulo' => $not_titulo,\n\t\t\t'imagen' => $not_imagen,\n\t\t\t'descripcion' => $not_drescripcion\n\t\t];\n\n\t\t$respuesta = NoticiasModelo::agregar_noticia_modelo($notDatos);\n\n\t\tif ($respuesta->rowCount() >= 1) {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'limpiar',\n\t\t\t\t'Titulo'=>'Bien hecho!',\n\t\t\t\t'Texto'=>'La noticia se registró exitosamente',\n\t\t\t\t'Tipo'=>'success'\n\t\t\t];\n\t\t}else{\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'No se pudo registrar la noticia',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\t\t}\n\n\t\treturn mainModel::sweetalert($alerta);\n\n\t}", "function edit($publicacion_id)\n {\n if($this->acceso(22)) {\n // check if the publicacion exists before trying to edit it\n $data['publicacion'] = $this->Publicacion_model->get_publicacion($publicacion_id);\n if(isset($data['publicacion']['publicacion_id']))\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('publicacion_fecha','Publicacion Fecha','required');\n if($this->form_validation->run())\n {\n /* *********************INICIO imagen***************************** */\n $foto=\"\";\n $foto1= $this->input->post('publicacion_dcto1');\n if (!empty($_FILES['publicacion_dcto']['name']))\n {\n $this->load->library('image_lib');\n $config['upload_path'] = './resources/images/publicacion/';\n //$config['allowed_types'] = 'gif|jpeg|jpg|png';\n $config['allowed_types'] = '*';\n $config['max_size'] = 0;\n $config['max_width'] = 0;\n $config['max_height'] = 0;\n\n $new_name = time();\n $config['file_name'] = $new_name; //.$extencion;\n $config['file_ext_tolower'] = TRUE;\n\n $this->load->library('upload', $config);\n $this->upload->do_upload('publicacion_dcto');\n\n $img_data = $this->upload->data();\n $extension = $img_data['file_ext'];\n /* ********************INICIO para resize***************************** */\n if($img_data['file_ext'] == \".jpg\" || $img_data['file_ext'] == \".png\" || $img_data['file_ext'] == \".jpeg\" || $img_data['file_ext'] == \".gif\") {\n $conf['image_library'] = 'gd2';\n $conf['source_image'] = $img_data['full_path'];\n $conf['new_image'] = './resources/images/publicacion/';\n $conf['maintain_ratio'] = TRUE;\n $conf['create_thumb'] = FALSE;\n $conf['width'] = 800;\n $conf['height'] = 600;\n $this->image_lib->clear();\n $this->image_lib->initialize($conf);\n if(!$this->image_lib->resize()){\n echo $this->image_lib->display_errors('','');\n }\n\n $confi['image_library'] = 'gd2';\n $confi['source_image'] = './resources/images/publicacion/'.$new_name.$extension;\n $confi['new_image'] = './resources/images/publicacion/'.\"thumb_\".$new_name.$extension;\n $confi['create_thumb'] = FALSE;\n $confi['maintain_ratio'] = TRUE;\n $confi['width'] = 100;\n $confi['height'] = 100;\n\n $this->image_lib->clear();\n $this->image_lib->initialize($confi);\n $this->image_lib->resize();\n }\n /* ********************F I N para resize***************************** */\n //$directorio = base_url().'resources/imagenes/';\n $directorio = FCPATH.'resources\\images\\publicacion\\\\';\n //$directorio = $_SERVER['DOCUMENT_ROOT'].'/ximpleman_web/resources/images/productos/';\n if(isset($foto1) && !empty($foto1)){\n if(file_exists($directorio.$foto1)){\n unlink($directorio.$foto1);\n $mimagenthumb = \"thumb_\".$foto1;\n //$mimagenthumb = str_replace(\".\", \"_thumb.\", $foto1);\n if($img_data['file_ext'] == \".jpg\" || $img_data['file_ext'] == \".png\" || $img_data['file_ext'] == \".jpeg\" || $img_data['file_ext'] == \".gif\") {\n unlink($directorio.$mimagenthumb);\n }\n }\n }\n $foto = $new_name.$extension;\n }else{\n $foto = $foto1;\n }\n $params = array(\n 'dube_id' => $this->input->post('dube_id'),\n 'beca_id' => $this->input->post('beca_id'),\n 'estado_id' => $this->input->post('estado_id'),\n 'publicacion_fecha' => $this->input->post('publicacion_fecha'),\n 'publicacion_autor' => $this->input->post('publicacion_autor'),\n 'publicacion_enlace' => $this->input->post('publicacion_enlace'),\n 'publicacion_texto' => $this->input->post('publicacion_texto'),\n 'publicacion_dcto' => $foto,\n );\n\n $this->Publicacion_model->update_publicacion($publicacion_id,$params); \n redirect('publicacion/index');\n }\n else\n {\n $this->load->model('Dube_model');\n $data['all_dube'] = $this->Dube_model->get_all_dube();\n\n $this->load->model('Beca_model');\n $data['all_beca'] = $this->Beca_model->get_all_beca();\n\n $this->load->model('Estado_model');\n $tipo = 1;\n $data['all_estado'] = $this->Estado_model->get_tipo_estado($tipo);\n\n $data['_view'] = 'publicacion/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The publicacion you are trying to edit does not exist.');\n }\n }", "function ajout_image2($user){\n\n include(\"../../modele/modele.php\");\n\n\n// On creer le chemin du fichier avec des variable et des extensions.\n $dossier = '../../assets/img/users/';\n $fichier = basename($_FILES['avatar']['name']);\n $taille_maxi = 1000000;\n $taille = filesize($_FILES['avatar']['tmp_name']); // ou utiliser $_FILES['avatar']['size']; \n $extensions = array('.png', '.gif', '.jpg', '.jpeg');\n $extension = strrchr($_FILES['avatar']['name'], '.');\n\n//Début des vérifications de sécurité..\n\n if(!in_array($extension, $extensions)) //Si l'extension n'est pas dans le tableau\n {\n $erreur = 'Vous devez uploader un fichier de type png, gif, jpg, jpeg, txt ou doc...';\n }\n if($taille > $taille_maxi) {\n $erreur = 'Le fichier est trop gros...';\n }\n if(!isset($erreur)) { //S'il n'y a pas d'erreur, on upload\n\n //On formate le nom du fichier ici\n $fichier = strtr($fichier, \n 'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ', \n 'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'); // Permet d'accepter les caracteres speciaux et de les remplacer par des caracteres normaux.\n $fichier = preg_replace('/([^.a-z0-9]+)/i', '-', $fichier);\n // Fin formatage\n\n if(move_uploaded_file($_FILES['avatar']['tmp_name'], $dossier . $fichier)) { //Si la condition renvoie TRUE, c'est que ça a fonctionné\n echo 'Upload effectué avec succès !';\n\n// Partie requete SQL pour ajouter le nom de l'image associer à la user\n $sql = ' UPDATE user SET image= \"'.$fichier.'\" WHERE id = \"'.$user.'\" ';\n $req = $bdd -> prepare($sql);\n $req -> execute();\n// Fin de la partie requete SQL\n\n } else {\n echo 'Echec de l\\'upload !';\n }\n } else {\n echo $erreur;\n }\n}", "public function procesar_foto()\n {\n $image = file_get_contents($_FILES['imagen']['tmp_name']);\n $id_carro = $_POST['id_carro'];\n $numero_foto = $_POST['img_number'];\n\n file_put_contents('/home2/gpautos/sv_gpautos/web/images_cont/' . $id_carro . ' (' . $numero_foto . ').jpg', $image);\n }", "function modificarAnuncio($titulo, $descripcion, $imagen, $id_poi, $id_usuario) {\n $sql = \"UPDATE anuncio SET titulo='\" . $titulo . \"',descripcion='\" . $descripcion . \"',imagen='\" . $imagen\n . \"' WHERE id_usuario='\" . $id_usuario . \"' AND id_poi='\" . $id_poi . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public function action_editImage() \n {\n $fieldid = $_POST[\"fieldid\"];\n $field = Wi3::inst()->model->factory(\"site_field\")->set(\"id\", $fieldid)->load();\n \n // Update e-mailaddress\n $email = Wi3::inst()->model->factory(\"site_data\")->setref($field)->setname(\"emailaddress\")->load();\n // If data does not exist, create it\n if (!$email->loaded())\n {\n $email->create();\n }\n // Update data field with image-id\n $emailaddress = $_POST[\"emailaddress\"];\n $email->data = $emailaddress;\n $email->update();\n \n echo Kohana::debug($email); exit;\n \n // Update folder\n $data = Wi3::inst()->model->factory(\"site_data\")->setref($field)->setname(\"folder\")->load();\n // If data does not exist, create it\n if (!$data->loaded())\n {\n $data->create();\n }\n // Update data field with image-id\n $fileid = $_POST[\"image\"];\n $data->data = $fileid;\n $data->update();\n \n //$file = Wi3::inst()->model->factory(\"site_file\")->set(\"id\", $fileid)->load();\n \n echo json_encode(\n Array(\n \"scriptsbefore\" => Array(\n \"0\" => \"$('[type=field][fieldid=\" . $fieldid . \"] [type=fieldcontent]').html('\" . $field->render() . \"');\"\n )\n )\n );\n }", "public function actionDbimage()\r\n {\r\n\tif ( !defined(\"SW_FRAMEWORK_DB_DRIVER\") )\r\n\t{\r\n define('SW_FRAMEWORK_DB_DRIVER','pdo_mysql');\r\n define('SW_FRAMEWORK_DB_USER',Yii::app()->db->username);\r\n define('SW_FRAMEWORK_DB_PASSWORD',Yii::app()->db->password);\r\n define('SW_FRAMEWORK_DB_HOST',\"127.0.0.1\");\r\n define('SW_FRAMEWORK_DB_DATABASE',\"reportico\");\r\n\t}\r\n\r\n\tinclude(\"imageget.php\");\r\n }", "public function cargarDatosArticuloController(){\n\n if(isset($_POST[\"tituloAr\"])){\n\n $imagen = $_FILES[\"imagen\"][\"tmp_name\"];\n $tituloArticulo = $_POST[\"tituloAr\"];\n $introduccionArticulo = $_POST[\"introduccionAr\"] . \"...\"; \n $contenidoArticulo = $_POST[\"contenidoAr\"];\n\n $borrar = glob(\"views/images/articulos/temp/*\");$borrar = glob(\"views/images/articulos/temp/*\");\n\n foreach ($borrar as $file){\n unlink($file);\n }\n\n // GUARDAR IMAGEN EN EL SERVIDOR\n //-----------------------------------\n\n $numAleatorio = mt_rand(100, 999);\n\n $ruta = \"views/images/articulos/articulo\" . $numAleatorio . \".jpg\";\n\n $origen = imagecreatefromjpeg($imagen);\n \n $destino = imagecrop($origen, [\"x\" => 0, \"y\" => 0, \"width\" => 800, \"height\" => 400]); \n \n imagejpeg($destino, $ruta); \n\n // ENVIAR DATOS DEL ARTICULO AL MODELO\n //----------------------------------------\n\n $enviarDatos = array(\"ruta\" => $ruta, \"tituloArticulo\" => $tituloArticulo, \"introduccionArticulo\" => $introduccionArticulo, \"contenidoArticulo\" => $contenidoArticulo); \n \n $res = GestorArticuloModel::cargarDatosArticuloController(\"articulos\", $enviarDatos);\n\n if($res){ \n echo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t title: \"¡OK!\",\n\t\t\t\t\t\t text: \"¡El artículo ha sido creado correctamente!\",\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t},\n\n\t\t\t\t\tfunction(isConfirm){\n\t\t\t\t\t\t\t if (isConfirm) {\t \n\t\t\t\t\t\t\t window.location = \"articulos\";\n\t\t\t\t\t\t\t } \n\t\t\t\t\t});\n\n\n\t\t\t\t</script>';\n }\n }\n\n }", "public function actionIndex()\n {\n $model = User::find()\n ->joinWith(['cars0', 'ya0'])\n ->where(['user.id' => Yii::$app->user->identity->id])->one();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->saveRegulations();\n // Аватарка\n if (Yii::$app->request->post('cropping')) {\n $uploadParam = 'urlUpload';\n $maxSize = 2097152;\n $extensions = 'jpeg, jpg, png';\n $width = 200;\n $height = 200;\n\n $model_img = new DynamicModel([$uploadParam]);\n $model_img->load(Yii::$app->request->post());\n $model_img->{$uploadParam} = UploadedFile::getInstance($model, $uploadParam);\n $model_img->addRule($uploadParam, 'image', [\n 'maxSize' => $maxSize,\n 'extensions' => explode(', ', $extensions),\n ])->validate();\n if ($model_img->hasErrors()) {\n Yii::$app->session->setFlash(\"warning\", $model_img->getFirstError($uploadParam));\n } else {\n $name = Yii::$app->user->identity->id . '.' . $model_img->{$uploadParam}->extension;\n $cropInfo = Yii::$app->request->post('cropping');\n try {\n $image = Image::crop(\n $model_img->{$uploadParam}->tempName,\n intval($cropInfo['width']),\n intval($cropInfo['height']),\n [$cropInfo['x'], $cropInfo['y']]\n )->resize(\n new Box($width, $height)\n );\n } catch (\\Exception $e) {\n Yii::$app->session->setFlash(\"warning\", $e->getMessage());\n }\n\n $directory = Yii::getAlias('@backend/web/avatar/') . Yii::$app->user->identity->id . '/';\n if (!is_dir($directory)) {\n FileHelper::createDirectory($directory);\n }\n\n $model->urlUpload = $name;\n if (isset($image) && $image->save($directory . $name) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Аватарка успешно сохранена');\n }\n }\n }\n // END Аватарка\n }\n\n if ($model->identifier == 2) {\n $identifier = 'passenger';\n } elseif (in_array($model->identifier, [5,6])) {\n $identifier = 'hr';\n } else {\n $identifier = 'driver';\n }\n\n return $this->render($identifier, [\n 'model' => $model,\n ]);\n }", "public function add_article($param)\n{\n\n extract($_POST);\n\n if ($param=='nulle'){\n\n if (isset($_POST['addmethode'])){\n if($_POST['addmethode']==0){\n /*------------------UPDATE MODE --------------------=*/\n if(!empty($id_service) && !empty($old_id_categorie) && !empty($nom_article)) {\n $curent_id_categorie=$old_id_categorie;\n if(isset($id_service) && !empty($id_categorie)) {\n $curent_id_categorie=$id_categorie;\n }\n $this->article = new ArticleEntity();\n $this->article ->setId($id);\n $this->article ->setId_categorie($curent_id_categorie);\n $this->article ->setFiche_technique((!isset($fiche_technique))?'':$fiche_technique);\n $this->article ->setNbrstockage(0);\n $this->article ->setTabidstock((!isset($tabidstock))?'':$tabidstock);\n $this->article ->setFlag_article(0);\n $ok=$this->articledb->updatearticle3($this->article);\n // print_r($_FILES);\n if ($ok>0) {\n $article = $this->articledb->getArticle($id);\n\n if ($article['id_categorie'] != $old_id_categorie) {\n $this->updatearticle_categorie($article['id_categorie'], -1);\n $this->updatearticle_categorie($old_id_categorie, 1);\n }\n }\n //print_r($articleObject);\n // $tdb->updatearticle($articleObject);\n // $ok = 1;\n if (isset($_FILES['photos']) && !empty($_FILES['photos']['name'])) {\n //$this->photo_articledb->resetmaster($id);\n /* print_r($_FILES);\n print_r($_FILES['photos']['name']);\n */\n $this->photo_articledb->resetmaster($id);\n $data[\"ok\"] = $this->savefiles($_FILES, $id_service, $id, $nom_article, 'single', 0);\n\n\n }\n\n\n }\n }\n if($_POST['addmethode']==1){\n\n /*------------------ADD MODE --------------------=*/\n\n $articleObject = $this->articleObjectmaker($_POST);\n\n //echo $tdb->ifArticleexiste($articleObject);\n if ($this->articledb->ifArticleexiste($nom_article,$id_service) == 0) {\n\n // print_r($articleObject);\n $id_article = $this->articledb->addArticle($articleObject);\n if ($id_article > 0) {\n\n $ok = $this->updatearticle_categorie($_POST['id_categorie'],1);\n if ($ok > 0) {\n if (isset($_FILES['photos']) && !empty($_FILES['photos']['name'])) {\n //$this->photo_articledb->resetmaster($id);\n /* print_r($_FILES);\n print_r($_FILES['photos']['name']);\n */\n $this->photo_articledb->resetmaster($id);\n $data[\"ok\"] = $this->savefiles($_FILES, $id_service, $id_article, $nom_article, 'single', 0);\n\n\n\n }\n\n\n }\n }\n }\n\n }\n }\n }\n if ($param=='multiple'){\n if(isset($_POST['addmethode']) && $_POST['addmethode']==2){\n\n\n\n $array=array();\n $array['nom_article']=$_POST['nom_article'];\n $array['id_categorie']=$_POST['id_categorie'];\n $array['fiche_technique']=$_POST['fiche_technique'];\n $articleTab=$this->flip_row_col_array($array);\n\n for ($i=1;$i<=count($articleTab);$i++){\n $array=array();\n $array['name'] = $_FILES['photos_'.$i]['name'];\n $array['size'] = $_FILES['photos_'.$i]['size'];\n $array['tmp_name'] = $_FILES['photos_'.$i]['tmp_name'];\n $photosTab=$this->flip_row_col_array($array);\n $articleTab[$i-1]['id']=0;\n $articleTab[$i-1]['id_service']=$id_service;\n $articleTab[$i-1]['photos']=$photosTab;\n $articleObject =$this->articleObjectmaker($articleTab[$i-1],'multiple');\n\n\n\n if ($this->articledb->ifArticleexiste($articleTab[$i-1]['nom_article'],$id_service)==0){\n\n //print_r($articleObject);\n $idarticle = $this->articledb->addArticle($articleObject );\n\n //echo '<hr>';\n //$ok = 1;\n\n if($idarticle>0){\n $this->updatearticle_categorie($articleObject->getId_categorie(),1);\n $x=0;\n\n foreach($articleTab[$i-1]['photos'] as $photos) {\n\n if ($x==0){\n\n // print_r($photos);\n $this->savefiles($photos,$id_service,$idarticle,$articleTab[$i-1]['nom_article'],'multiple',1 );\n //echo '<br>';\n // echo $idarticle.'<br>'; echo '<br>';\n }\n if ($x>0){\n // print_r($photos);\n // echo $idarticle.'<br>';\n $this->savefiles($photos,$id_service,$idarticle,$articleTab[$i-1]['nom_article'],'multiple',0 );\n }\n $x++;\n }\n // print_r($articleTab[$i-1]['photos']);\n // echo '<hr>';\n\n }\n }\n\n\n }\n\n\n }\n\n }\n return $this->liste($id_service);\n}", "public function updatePhoto(Request $request)\n {\n// 'photo' => 'required', // required| SEPONE ESTO mimes:jpeg,bmp,png'\n// 'apodo'=>'required',\n// 'altura'=>'required',\n// 'peso'=>'required',\n// 'pie_dominante'=>'required'\n// ]);\n\n $token=$request->get('api_token');\n $jugador=DB::table('jugador')\n ->select('id_jugador')\n ->where('api_token','=',$token)\n ->get();\n\n $datos = Jugador::find($jugador[0]->id_jugador);\n\n// OPC Foto\n $file = $request->get('img');\n $publicId=\"fotoPerfil\".$jugador[0]->id_jugador;\n if(Cloudder::upload(\"data:image/png;base64,\".$file,$publicId,array(\"width\" => 250, \"height\" => 250))){\n $datos->tiene_imagen=1;\n $datos->update();\n return response()->json(['success' => true]);\n }else{\n return response()->json(['success' => false]);\n }\n\n }", "public function editar()\n {\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->scenario = 'update';\n \n// if (\\Yii::$app->user->can('updatePost', ['post' => $model])) {\n// die('own');\n// }\n \n $oldFile1 = $model->getImageFile($model->image1);\n $oldFile2 = $model->getImageFile($model->image2);\n $oldFile3 = $model->getImageFile($model->image3);\n $oldFile4 = $model->getImageFile($model->image4);\n $oldFile5 = $model->getImageFile($model->image5);\n $oldFile6 = $model->getImageFile($model->image6);\n $oldFile7 = $model->getImageFile($model->image7);\n $oldFile8 = $model->getImageFile($model->image8);\n $oldFile9 = $model->getImageFile($model->image9);\n $oldImage1 = $model->image1;\n $oldImage2 = $model->image2;\n $oldImage3 = $model->image3;\n $oldImage4 = $model->image4;\n $oldImage5 = $model->image5;\n $oldImage6 = $model->image6;\n $oldImage7 = $model->image7;\n $oldImage8 = $model->image8;\n $oldImage9 = $model->image9;\n \n $model->img2 = 0;\n $model->img3 = 0;\n $model->img4 = 0;\n $model->img5 = 0;\n $model->img6 = 0;\n $model->img7 = 0;\n $model->img8 = 0;\n $model->img9 = 0;\n \n if ($model->load(Yii::$app->request->post())) {\n $image1 = $model->uploadImage(1);\n $image2 = $model->uploadImage(2);\n $image3 = $model->uploadImage(3);\n $image4 = $model->uploadImage(4);\n $image5 = $model->uploadImage(5);\n $image6 = $model->uploadImage(6);\n $image7 = $model->uploadImage(7);\n $image8 = $model->uploadImage(8);\n $image9 = $model->uploadImage(9);\n \n // revert back if image not valid\n if($image1 === FALSE){\n $model->image1 = $oldImage1;\n }\n if($image2 === FALSE){\n if($model->img2 == 1):\n if(is_file($oldFile2)){\n unlink($oldFile2);\n }\n $model->image2 = \"\";\n else:\n $model->image2 = $oldImage2;\n endif;\n }\n if($image3 === FALSE){\n if($model->img3 == 1):\n if(is_file($oldFile3)){\n unlink($oldFile3);\n }\n $model->image3 = \"\";\n else:\n $model->image3 = $oldImage3;\n endif;\n }\n if($image4 === FALSE){\n if($model->img4 == 1):\n if(is_file($oldFile4)){\n unlink($oldFile4);\n }\n $model->image4 = \"\";\n else:\n $model->image4 = $oldImage4;\n endif;\n }\n if($image5 === FALSE){\n if($model->img5 == 1):\n if(is_file($oldFile5)){\n unlink($oldFile5);\n }\n $model->image5 = \"\";\n else:\n $model->image5 = $oldImage5;\n endif;\n }\n if($image6 === FALSE){\n if($model->img6 == 1):\n if(is_file($oldFile6)){\n unlink($oldFile6);\n }\n $model->image6 = \"\";\n else:\n $model->image6 = $oldImage6;\n endif;\n }\n if($image7 === FALSE){\n if($model->img7 == 1):\n if(is_file($oldFile7)){\n unlink($oldFile7);\n }\n $model->image7 = \"\";\n else:\n $model->image7 = $oldImage7;\n endif;\n }\n if($image8 === FALSE){\n if($model->img8 == 1):\n if(is_file($oldFile8)){\n unlink($oldFile8);\n }\n $model->image8 = \"\";\n else:\n $model->image8 = $oldImage8;\n endif;\n }\n if($image9 === FALSE){\n if($model->img9 == 1):\n if(is_file($oldFile9)){\n unlink($oldFile9);\n }\n $model->image9 = \"\";\n else:\n $model->image9 = $oldImage9;\n endif;\n }\n \n if($model->save()){\n // upload jika image nya valid\n \n if($image1 !== FALSE){\n if(is_file($oldFile1)){\n unlink($oldFile1);\n }\n $path1 = $model->getImageFile($model->image1);\n $image1->saveAs($path1);\n }\n if($image2 !== FALSE){\n if(is_file($oldFile2)){\n unlink($oldFile2);\n }\n $path2 = $model->getImageFile($model->image2);\n $image2->saveAs($path2);\n }\n if($image3 !== FALSE){\n if(is_file($oldFile3)){\n unlink($oldFile3);\n }\n $path3 = $model->getImageFile($model->image3);\n $image3->saveAs($path3);\n }\n if($image4 !== FALSE){\n if(is_file($oldFile4)){\n unlink($oldFile4);\n }\n $path4 = $model->getImageFile($model->image4);\n $image4->saveAs($path4);\n }\n if($image5 !== FALSE){\n if(is_file($oldFile5)){\n unlink($oldFile5);\n }\n $path5 = $model->getImageFile($model->image5);\n $image5->saveAs($path5);\n }\n if($image6 !== FALSE){\n if(is_file($oldFile6)){\n unlink($oldFile6);\n }\n $path6 = $model->getImageFile($model->image6);\n $image6->saveAs($path6);\n }\n if($image7 !== FALSE){\n if(is_file($oldFile7)){\n unlink($oldFile7);\n }\n $path7 = $model->getImageFile($model->image7);\n $image7->saveAs($path7);\n }\n if($image8 !== FALSE){\n if(is_file($oldFile8)){\n unlink($oldFile8);\n }\n $path8 = $model->getImageFile($model->image8);\n $image8->saveAs($path8);\n }\n if($image9 !== FALSE){\n if(is_file($oldFile9)){\n unlink($oldFile9);\n }\n $path9 = $model->getImageFile($model->image9);\n $image9->saveAs($path9);\n }\n \n \n return $this->redirect(['view', 'id' => $model->id]);\n }else{\n \n }\n \n \n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "static public function ctrEditarUsuario()\n\t{\n\t\tif(isset($_POST['editarUsuario']))\n\t\t{\n\t\t\t//vamos a permitir caracteres especiales con tilde,espacio en blanco y numericos con expresion regular\n\t\t\t// vamos a solo editar el nombre del usuario y no usuario para evitar crear carpeta basura en img/usuarios\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓü ]+$/', $_POST['editarNombre']))\n\t\t\t{\n\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tVALIDAR IMAGEN\n\t\t\t\t=============================================*/\n\n\t\t\t\t// recuperamos la ruta de la imagen del input oculto\n\t\t\t\t$ruta = $_POST['fotoActual'];\n\n\t\t\t\t// si existe la variable $_FILE(en nuestro caso siempre existe) y viene diferente a vacio el archivo temporal de la imagen\n\t\t\t\tif(isset($_FILES['editarFoto']['tmp_name']) && !empty($_FILES['editarFoto']['tmp_name']))\n\t\t\t\t// if(isset($_FILES['editarFoto']['tmp_name']))\n\t\t\t\t{\n\t\t\t\t\t// vamos a recortar la imagen 500 x 500 px\n\n\t\t\t\t\t// list — Asignar variables como si fueran un array\n\t\t\t\t\t// getimagesize — Obtener el tamaño de una imagen\n\t\t\t\t\t//en list() toma el indice 0 de [nuevaFoto][tmp_name](los indice del archivo temporal son medidas de la imagen) y asigna a $ancho y el indice 1 asigna a $alto \n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t// redimensionamos\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t// creamos la ruta donde se va a guardar la imagen\n\t\t\t\t\t$directorio = 'vistas/img/usuarios/'.$_POST['editarUsuario'];\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/*====================================================================\n\t\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE LA IMAGEN EN LA BD \n\t\t\t\t\t======================================================================*/\n\t\t\t\t\t\n\t\t\t\t\t// si la ruta de la db es diferente a vacio \n\t\t\t\t\tif(!empty($_POST['fotoActual']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// unlink — Borra un fichero\n\t\t\t\t\t\t// vamos a borrar ese archivo en esa carpeta\n\t\t\t\t\t\t// console.log('foto actual');\n\t\t\t\t\t\tunlink($_POST['fotoActual']);\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// en caso de que venga vacio, vamos a crear el directorioo carpeta\n\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t/*====================================================================\n\t\t\t\t\tDEACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP \n\t\t\t\t\t======================================================================*/\n\n\t\t\t\t\tif($_FILES['editarFoto']['type'] == \"image/jpeg\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['editarUsuario'].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES['editarFoto']['type'] == \"image/png\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['editarUsuario'].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagepng($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\t// var_dump($_FILES['nuevaFoto']['tmp_name']);\n\t\t\t\t\t// var_dump(getimagesize($_FILES['nuevaFoto']['tmp_name']));\n\n\t\t\t\t}\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t\n\t\t\t\t// si el nuevo pass es diferente a vacio\n\t\t\t\tif($_POST['editarPassword'] != \"\")\n\t\t\t\t{\n\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"editarPassword\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t//almacenamos en la variable encriptar y encriptamos el nuevo pass y usamos el hash de tipo CRYPT_BLOWFISH\n\t\t\t\t\t\t// crypt — Hash de cadenas de un sólo sentido, se encripta la pass ingresado\n\t\t\t\t\t\t$encriptar = crypt($_POST[\"editarPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\ttitle: \"La contrasena no puede ir vacio o lleva caracteres especiales\",\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{\n\t\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\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</script>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse //si editarPassword viene vacio\n\t\t\t\t{\n\t\t\t\t\t$encriptar = $_POST[\"passwordActual\"];\n\t\t\t\t}\n\n\t\t\t\t$datos = array\n\t\t\t\t(\n\t\t\t\t\t\"nombre\"=> $_POST['editarNombre'],\n\t\t\t\t\t\"usuario\"=> $_POST['editarUsuario'],\t\n\t\t\t\t\t\"password\"=> $encriptar,\t\n\t\t\t\t\t\"perfil\"=> $_POST['editarPerfil'],\n\t\t\t\t\t\"ruta\" => $ruta\t\n\t\t\t\t);\n\n\t\t\t\t// llamamos al metodo mdlEditarUsuario de la clase modelo Usuario\n\t\t\t\t$respuesta = ModeloUsuarios::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t// mostramos mensaje de edicion exitosa\n\t\t\t\tif($respuesta == \"ok\")\n\t\t\t\t{\n\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\ttitle: \"El usuario se editó correctamente!\",\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{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t</script>';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\ttitle: \"El nombre no puede ir vacio o lleva 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{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t</script>';\t\n\t\t\t}\n\t\t}\n\t}", "public function edit($id_ormawa)\n { \n $dataormawa = $this->dataormawa_model->detail($id_ormawa);\n\n //Validasi input\n $valid = $this->form_validation;\n\n $valid->set_rules('nama_ormawa','nama_ormawa ','required',\n array('required' => '%s harus diisi'\n ));\n\n if($valid->run()) {\n // Check jika gambar diganti\n\n if(!empty($_FILES['logo']['name'])) {\n\n $config['filename'] = $_FILES['logo']['name'];\n $config['upload_path'] = \"./assets/upload/logoormawa/\";\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n $config['max_size'] = '2400';\n $config['max_width'] = '2024';\n $config['max_height'] = '2024';\n \n $this->load->library('upload', $config);\n $this->upload->initialize($config);\n \n if ( !$this->upload->do_upload('logo')){\n $error = array('error' => $this->upload->display_errors());\n var_dump($error);\n die();\n }\n else{\n $data = array('upload_data' => $this->upload->data('logo'));\n echo \"success\";\n\n }\n \n\n if($valid->run()==FALSE){\n //End Validasi\n $data = array('title' => 'Edit Data Ormawa',\n 'dataormawa' => $dataormawa,\n 'isi' => 'admin/dataormawa/edit');\n $this->load->view('admin/layout/wrapper', $data, FALSE);\n //Masuk database\n } else {\n $upload_gambar = array('upload_data' => $this->upload->data());\n\n // Create thumbnail logo\n $config['image_library'] = 'gd2';\n $config['source_image'] = '/assets/upload/logoormawa/'.$upload_gambar['upload_data']['file_name'];\n // Lokasi folder thumbnail\n $config['new_image'] = './assets/upload/logoormawa/';\n $config['create_thumb'] = TRUE;\n $config['maintain_ratio'] = TRUE;\n $config['width'] = 250;\n $config['height'] = 250;\n\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n\n // End create thumbnail \n\n\n $i = $this->input;\n $data = array( 'id_ormawa'=> $i->post('id_ormawa'),\n 'logo'=> $upload_gambar['upload_data']['file_name'],\n 'pembina'=> $i->post('pembina'),\n );\n $datauser = array(\n 'id_user' => $i->post('id_user'),\n 'nama'=> $i->post('nama_ormawa'),\n 'kontak' => $i->post('kontak'),\n );\n\n $this->dataormawa_model->edit($data,$datauser);\n $this->session->set_flashdata('sukses', 'Data telah diubah');\n redirect(base_url('admin/dataormawa'),'refresh');\n }\n } else {\n // Edit produk tanpa ganti gambar\n\n }\n }\n //End masuk database\n $data = array( 'title' => 'Edit Data Jurusan',\n 'dataormawa' => $dataormawa,\n 'isi' => 'admin/dataormawa/edit'\n );\n $this->load->view('admin/layout/wrapper', $data, FALSE);\n}", "public function crearAction()\n {\n $this->view->headScript()->appendScript(\"\n function donamId(id)\n {\n var valorId = document.getElementById(id).value;\n document.getElementById('idValor').value = valorId;\n\t\t\t\t\t\t }\t \n \"\n );\n\n $idGal = (int) $this->getRequest()->getParam(\"id\",0);\n \n //al formulari de la vista galeria.phtml li em de passar l'id de galeria\n \n $this->view->galId = $idGal;\n \n $imatges = $this->_imagenDoctrineDao->obtenerTodosDeGaleriaPorId($idGal);\n \n $numImg = count($imatges);\n \n //passo el javascript\n $this->view->headScript()->appendScript(\"\n var num = $numImg;\n $(function () {\n for(i=1;i<=num;i++)\n {\n $('#edita'+i).tooltip();\n $('#publica'+i).tooltip();\n $('#despublica'+i).tooltip();\n $('#borra'+i).tooltip();\n $('#sube'+i).tooltip();\n }\n //alert(i);\n });\"\n ); \n \n \n //codi per fer desapareixer l'alert\n $this->view->headScript()->appendScript(\"\n \n $(document).ready\n (\n function()\n {\n setTimeout(function() { $('.alert_lila').fadeOut('slow')}, 2500);\n }\n );\n\n \"\n );\n \n \n \n //print_r($idGal);\n $galeriaId = $this->_galeriaDoctrineDao->obtenerGaleriaPorId($idGal);\n \n $this->view->galDades = $galeriaId;\n \n //var_dump($galeriaId);\n \n //////// CODI PER INSERTAR IMATGES A LA GALERIA N ///////////\n \n $form = $this->_getFormImagen();\n $formImg = $this->_getFormImagenEdit();\n \n /////// EDITAR LA IMATGE /////////\n /*\n foreach ($imatges as $imatge){\n \n echo $imatge->getTitol();\n echo $imatge->getDescripcio();\n \n }\n\n $formImg->populate(array('titol'=>$imatge->getTitol(),\n 'descripcio'=>$imatge->getDescripcio()\n ));\n */\n \n //assignem a la vista el form\n $this->view->form = $form;\n $this->view->formImg = $formImg;\n \n $neteja = new MisLibrerias_View_Helper_NetejaTags();\n \n try\n\n {\n //$neta = $neteja->netejaNomImatges($string);\n //instancia de zend file \n $upload = new Zend_File_Transfer_Adapter_Http();\n // això equival a $_FILE\n $files = $upload->getFileInfo();\n //cridem la ruta per fer l'upload (está al config)\n $ruta = $this->_config->parametros->mvc->admin->imagen->index->upload; \n \n //recorem les files per treure en name\n foreach ($files as $fileName=>$fileInfo)\n {\n $nom = $neteja->netejaNomImatges($fileInfo['name']);\n \n $time = substr(time(),6);\n \n //agafo l'extensió o format després del '.'\n $extensio = substr($nom, strpos($nom,'.') + 1);\n \n //separo el nom abans del punt\n $nomAnt = substr($nom,0, strpos($nom,'.'));\n \n $nomFinal = $nomAnt.$time.'.'.$extensio;\n \n if($upload->isUploaded($fileInfo['name'])){\n \n //afegim un filtre per renombrar les imatges\n $upload->addFilter('Rename', array('target' => $ruta.$nomFinal,\n 'overwrite' => true));\n //això és el move_uploaded_file\n $upload->receive();\n \n //variables classe Imagen \n $id = null;\n $data = new \\DateTime(date(\"Y-m-d H:i:s\"));\n $titol = null;\n $ruta = $nomFinal;\n $descripcio = null;\n $galeria = new Admin_Model_Galeria($galeriaId->getId(), $galeriaId->getData(), $galeriaId->getTitol(), $galeriaId->getDescripcio(), $galeriaId->getIdioma(), $galeriaId->getPublicar(),$galeriaId->getTipo());\n //$galeria = null;\n $entradaId = null;\n $ordre = null;\n \n //aquí farem l'insert\n \n $img = new Admin_Model_Imagen($id, $data, $titol, $ruta, $descripcio, $galeria, $entradaId, $ordre);\n \n //ha de ser update és a dir merge perquè sinó em crea una galeria i no ho volem\n $this->_imagenDoctrineDao->updateImagenes($img);\n \n }\n }\n }\n catch (Exception $ex)\n {\n echo '¡Ups! Tenemos problemas al subir la imágen.';\n echo $ex->getMessage();\n }\n //print_r($galeriaId->getId());\n //passem a la vista el llistat de imatges per galeria\n $this->view->listImagenes = $imatges;\n \n $frase = '<b><em>'.$this->view->user->nom.'</b></em>, aquí podrás subir imágenes a la galeria creada';\n $this->_helper->layout->assign(\"welcome\", $frase);\n \n //passo paràmetre de l'alert\n $a = (int) $this->getRequest()->getParam(\"a\",0);\n \n if($a===1){\n $this->view->alert=\"Imágen eliminada correctamente\";\n }else if($a===2){\n $this->view->alert=\"Puedes modificar esta galeria insertando más imágenes\";\n }\n }", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n $old_image = $model->path;\n $old_image_1 = $model->banner_icon_1;\n $old_image_2 = $model->banner_icon_2;\n $old_image_3 = $model->banner_icon_3;\n $old_image_4 = $model->banner_icon_4;\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n function manageImage($image) {\n $image_extention = $image->extension;\n if ($image_extention == \"jpg\" || $image_extention == \"jpeg\" || $image_extention == \"png\") {\n if ($image->saveAs($full_path = dirname(__FILE__) . '/../../' . \"/frontend/web/images/projects/\" . $path = $image->baseName . \"_\" . Yii::$app->security->generateRandomString() . '.' . $image->extension)) {\n\n Image::frame($full_path)\n ->resize(new Box(145, 105))\n ->save(dirname(__FILE__) . '/../../' . \"/frontend/web/images/projects_145x105/\" . $path, ['quality' => 80]);\n\n Image::frame($full_path)\n ->resize(new Box(200, 155))\n ->save(dirname(__FILE__) . '/../../' . \"/frontend/web/images/projects_200x155/\" . $path, ['quality' => 80]);\n\n Image::frame($full_path)\n ->resize(new Box(224, 114))\n ->save(dirname(__FILE__) . '/../../' . \"/frontend/web/images/projects_224x114/\" . $path, ['quality' => 80]);\n\n Image::frame($full_path)\n ->resize(new Box(224, 116))\n ->save(dirname(__FILE__) . '/../../' . \"/frontend/web/images/projects_224x116/\" . $path, ['quality' => 80]);\n\n return $path;\n } else {\n return \"error\";\n }\n } else {\n return \"not image\";\n }\n }\n\n $model->path = UploadedFile::getInstance($model, 'path');\n $model->banner_icon_1 = UploadedFile::getInstance($model, 'banner_icon_1');\n $model->banner_icon_2 = UploadedFile::getInstance($model, 'banner_icon_2');\n $model->banner_icon_3 = UploadedFile::getInstance($model, 'banner_icon_3');\n $model->banner_icon_4 = UploadedFile::getInstance($model, 'banner_icon_4');\n\n if (isset($model->path)) {\n $manage_image = manageImage($model->path);\n if ($manage_image == \"not image\") {\n Yii::$app->session->setFlash('error', 'image must be image (jpg or jpeg or png');\n return $this->redirect(['projects/update/' . $model->id]);\n } else if ($manage_image == \"error\") {\n Yii::$app->session->setFlash('error', 'Something went wrong, could not upload images');\n return $this->redirect(['projects/update/' . $model->id]);\n } else {\n $model->path = $manage_image;\n }\n } else {\n $model->path = $old_image;\n }\n\n if (isset($model->banner_icon_1)) {\n $manage_image = manageImage($model->banner_icon_1);\n if ($manage_image == \"not image\") {\n Yii::$app->session->setFlash('error', 'image must be image (jpg or jpeg or png');\n return $this->redirect(['projects/update/' . $model->id]);\n } else if ($manage_image == \"error\") {\n Yii::$app->session->setFlash('error', 'Something went wrong, could not upload images');\n return $this->redirect(['projects/update/' . $model->id]);\n } else {\n $model->banner_icon_1 = $manage_image;\n }\n } else {\n $model->banner_icon_1 = $old_image_1;\n }\n\n if (isset($model->banner_icon_2)) {\n $manage_image = manageImage($model->banner_icon_2);\n if ($manage_image == \"not image\") {\n Yii::$app->session->setFlash('error', 'image must be image (jpg or jpeg or png');\n return $this->redirect(['projects/update/' . $model->id]);\n } else if ($manage_image == \"error\") {\n Yii::$app->session->setFlash('error', 'Something went wrong, could not upload images');\n return $this->redirect(['projects/update/' . $model->id]);\n } else {\n $model->banner_icon_2 = $manage_image;\n }\n } else {\n $model->banner_icon_2 = $old_image_2;\n }\n\n if (isset($model->banner_icon_3)) {\n $manage_image = manageImage($model->banner_icon_3);\n if ($manage_image == \"not image\") {\n Yii::$app->session->setFlash('error', 'image must be image (jpg or jpeg or png');\n return $this->redirect(['projects/update/' . $model->id]);\n } else if ($manage_image == \"error\") {\n Yii::$app->session->setFlash('error', 'Something went wrong, could not upload images');\n return $this->redirect(['projects/update/' . $model->id]);\n } else {\n $model->banner_icon_3 = $manage_image;\n }\n } else {\n $model->banner_icon_3 = $old_image_3;\n }\n\n if (isset($model->banner_icon_4)) {\n $manage_image = manageImage($model->banner_icon_4);\n if ($manage_image == \"not image\") {\n Yii::$app->session->setFlash('error', 'image must be image (jpg or jpeg or png');\n return $this->redirect(['projects/update/' . $model->id]);\n } else if ($manage_image == \"error\") {\n Yii::$app->session->setFlash('error', 'Something went wrong, could not upload images');\n return $this->redirect(['projects/update/' . $model->id]);\n } else {\n $model->banner_icon_4 = $manage_image;\n }\n } else {\n $model->banner_icon_4 = $old_image_4;\n }\n\n\n if ($model->save()) {\n Yii::$app->session->setFlash('success', 'Project successfully Edited ');\n } else {\n Yii::$app->session->setFlash('error', 'Did not save, Please fill all the fields and make sure to upload correct images');\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "private function saveNewImg($type,$type_id){\n\n if (Yii::$app->request->post('Imgnew') && isset($_FILES['Imgnew'])){\n $imgs = Yii::$app->request->post('Imgnew');\n //ex($imgs);\n $files = (isset($_FILES['Imgnew']['name'])) ? $_FILES['Imgnew']['name'] : [];\n\n\n foreach ($files as $num => $file_name){\n\n //if ((int)$imgs[$num]['img_0']['valid'] == 1){\n\n $imgOrg = $this->saveOriginalNew($num,$type,$type_id);\n\n\n //mine list size Image\n // create&set model\n // resize img\n\n if ( $imgOrg != null ){\n\n $img = new Img();\n $img->alt = $imgs[$num]['alt'];\n $img->title = $imgs[$num]['title'];\n $img->width = (int)$imgs[$num]['width'];\n $img->height = (int)$imgs[$num]['height'];\n $img->size = $imgs[$num]['size'];\n $img->watermark = (isset($imgs[$num]['watermark'])) ? (int)$imgs[$num]['watermark'] : 0;\n $img->resize =(isset($imgs[$num]['resize'])) ? (int)$imgs[$num]['resize'] : 0;\n $img->harshness =(isset($imgs[$num]['harshness'])) ? (int)$imgs[$num]['harshness'] : 0;\n\n\n\n $img->crop_x = (int)$imgs[$num]['crop_x'];\n $img->crop_y = (int)$imgs[$num]['crop_y'];\n\n $img->crop_width = (int)$imgs[$num]['crop_width'];\n $img->crop_height = (int)$imgs[$num]['crop_height'];\n\n $img->wrap_width = (int)$imgs[$num]['wrap_width'];\n $img->wrap_height = (int)$imgs[$num]['wrap_height'];\n\n // $img->ord = (int) $imgs[$num]['ord'];\n\n\n if ($img->resize)\n if ( (! $img->width || ! $img->height) ){\n $size =explode('_', $img->size);\n if (count( $size )){\n $img->width = (int)$size[0];\n $img->height = (int)$size[1];\n }\n\n }\n\n $this->resizeImg($imgOrg,$img,$type,$type_id);\n }\n // }\n\n }\n }\n\n $this->saveImgLinks($type_id,$type);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $modelFoto = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n\n $foto = UploadedFile::getInstance($model,'use_foto');\n\n if ($foto == ''){\n $model->use_foto = $modelFoto->use_foto;\n }else{\n\n if($modelFoto->use_foto != 'usuario_anonimo.jpg'){\n unlink('img/user/'.$modelFoto->use_foto);\n }\n\n $modelFoto = User::find()->count();\n $foto->saveAs('img/user/'. $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension);\n $model->use_foto = $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension;\n\n }\n\n if($model->rol_id != 2){\n $model ->use_estado = 1;\n //Aqui va codigo borrar el perfil del investigador\n $investigador = new Investigador();\n if($investigador->find()->where(['usu_id'=>$model->id])->count() != 0 ){\n $investigador->find()->where(['usu_id'=>$model->id])->one()->delete();\n }\n\n }\n\n $model -> use_fechaAudit = date('y-m-d H:i:s');\n $model -> use_accion = 'M';\n\n if($model->signup()){\n Yii::$app->session->setFlash('msg', '\n <div class=\"alert alert-success alert-dismissable\">\n <button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">X</button>\n <h4><i class=\"bx bx-check\"></i>Registro modificado!</h4>\n El registro se modificó correctamente.\n </div>\n ');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "private function aksi_upload_foto_profil_profil_saya($id_admin)\n {\n $config['upload_path'] = './../assets/uploads/admin/';\n $config['allowed_types'] = 'gif|jpg|png|jpeg|pdf';\n $config['file_name'] = 'foto_admin-' . date('ymd') . '-' . substr(md5(rand()), 0, 10);\n\n $this->load->library('upload', $config);\n $id_admin = $this->input->post('id_admin');\n\n if (!empty($_FILES['berkas']['name'])) {\n\n if ($this->upload->do_upload('berkas')) {\n\n $uploadData = $this->upload->data();\n\n //Compres Foto\n $config['image_library'] = 'gd2';\n $config['source_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $config['create_thumb'] = FALSE;\n $config['maintain_ratio'] = TRUE;\n $config['quality'] = '50%';\n $config['width'] = 600;\n $config['height'] = 400;\n\n $config['new_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n\n $item = $this->db->where('id_admin', $id_admin)->get('admin')->row();\n\n //replace foto lama \n if ($item->foto_profil_admin != \"placeholder_profil.png\") {\n $target_file = './../assets/uploads/admin/' . $item->foto_profil_admin;\n unlink($target_file);\n }\n\n $data['foto_profil_admin'] = $uploadData['file_name'];\n\n $this->db->where('id_admin', $id_admin);\n $this->db->update('admin', $data);\n }\n }\n }", "function EDIT()\r\n{\r\n\t// se construye la sentencia de busqueda de la tupla en la bd\r\n $sql = \"SELECT * FROM NOTICIA WHERE (idNoticia = '$this->idNoticia')\";\r\n // se ejecuta la query\r\n $result = $this->mysqli->query($sql);\r\n // si el numero de filas es igual a uno es que lo encuentra\r\n if ($result->num_rows == 1)\r\n {\t// se construye la sentencia de modificacion en base a los atributos de la clase\r\n\t\t$sql = \"UPDATE NOTICIA SET \r\n\t\t\t\t\tidNoticia = '$this->idNoticia',\r\n\t\t\t\t\timageURL = '$this->imageURL',\r\n\t\t\t\t\tenlace = '$this->enlace',\r\n\t\t\t\t\ttexto = '$this->texto'\t\t\t\t\t\r\n\t\t\t\tWHERE ( idNoticia = '$this->idNoticia')\";\r\n\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\r\n if (!($resultado = $this->mysqli->query($sql))){\r\n\t\t\treturn 'Error en la modificación'; \r\n\t\t}\r\n\t\telse{ \r\n\t\t\treturn 'Modificado correctamente.';\r\n\t\t\t\r\n\t\t}\r\n }\r\n else // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\r\n \treturn 'No existe en la base de datos';\r\n}", "static public function ctrEditarUsuario(){\n\n\t\tif (isset($_POST['editUser'])) {\n\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"newName\"])) {\n\t\t\t \t/*======================================\n\t\t\t \t= Validar Imagen =\n\t\t\t \t======================================*/\n\t\t\t \t$ruta=$_POST['lastPhoto'];\n\t\t\t \tif (isset($_FILES['photo']['tmp_name']) && !empty($_FILES['photo']['tmp_name'])) {\n\t\t\t \t\tlist($ancho,$alto) = getimagesize($_FILES['photo']['tmp_name']);\n\t\t\t \t\t$nuevoAncho = 500;\n\t\t\t \t\t$nuevoAlto = 500;\n\t\t\t \t\t/*==========================================\n\t\t\t \t\t= CREANDO DIRECTORIO =\n\t\t\t \t\t==========================================*/\n\t\t\t \t\t$directorio = \"Views/img/usuarios/\".$_POST['newUsername'];\n\t\t\t \t\tif (!empty($_POST['lastPhoto'])) {\n\t\t\t \t\t\tunlink($_POST['lastPhoto']);\n\t\t\t \t\t}else{\n\t\t\t \t\t\tmkdir($directorio,0755);\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \t\t/*===========================================================================\n\t\t\t \t\t= Funciones defecto PHP dependiendo de tipo de imagen =\n\t\t\t \t\t===========================================================================*/\n\t\t\t \t\tswitch ($_FILES['photo']['type']) {\n\t\t\t \t\t\tcase 'image/jpeg':\n\t\t\t \t\t\t\t$preruta = date('Y-m-d_his');\n\t\t\t \t\t\t\t$preruta = (string)$preruta;\n\t\t\t \t\t\t\t$ruta = $directorio.'/'.$_POST['newUsername'].'_'.$preruta.'.jpg';\n\t\t\t \t\t\t\t$origen = imagecreatefromjpeg($_FILES['photo']['tmp_name']);\n\t\t\t \t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t \t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t \t\t\t\timagejpeg($destino,$ruta);\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t\tcase 'image/png':\n\t\t\t \t\t\t\t$preruta = date('Y-m-d_his');\n\t\t\t \t\t\t\t$preruta = (string)$preruta;\n\t\t\t \t\t\t\t$ruta = $directorio.'/'.$_POST['newUsername'].'_'.$preruta.'.png';\n\t\t\t \t\t\t\t$origen = imagecreatefrompng($_FILES['photo']['tmp_name']);\n\t\t\t \t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t \t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t \t\t\t\timagepng($destino,$ruta);\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t\tdefault:\n\t\t\t \t\t\t\t# code...\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \t}\n\t\t\t\t$answer = adminph\\User::where('username',$_POST['newUsername'])->first();\n\t\t\t \tif ($_POST['newPassword'] != \"\") {\n\t\t\t \t\t$password = password_hash($_POST[\"newPassword\"], PASSWORD_DEFAULT);\n\t\t\t \t}else{\n\t\t\t \t\t$password=$_POST['password'];\n\t\t\t \t}\n\t\t\t \t$answer->name = $_POST['newName'];\n\t\t\t \t$answer->username = $_POST['newUsername'];\n\t\t\t \t$answer->password = $password;\n\t\t\t \t$answer->type = $_POST['rol'];\n\t\t\t \t$answer->code = $_POST['newOrganizationCode'];\n\t\t\t \t$answer->photo = $ruta;\n\t\t\t if ($answer->save()) {\n\t\t\t \treturn redirect('usuarios');\t\t\t }\n\t\t\t } else {\n\t\t\t \treturn view('layouts.users_error');\n\t\t\t }\n\t\t}\n\n\t}", "public function getUpdatetoRevisado() {\n\n $id_boleta = \"\";\n $destino = \"\";\n $nombre = \"\";\n $time = \"\";\n $fecha = \"\";\n\n $id_boleta = $_POST['id_boleta'];\n\n $target_dir = \"public/uploads/recibos/\";\n\n opendir($target_dir);\n\n $destino = $target_dir.$_FILES['archivo']['name'];\n\n copy($_FILES['archivo']['tmp_name'], $destino);\n\n echo '<div class=\"notification success\" style=\"\"><div></div><p><span>LISTO:</span> El archivo se ha cargado correctamente.</p></div>';\n\n $nombre = $_FILES['archivo']['name'];\n\n\n $time = date(\"H:i:s\", time());\n $fecha = date(\"y-m-d\");\n\n $sql_model = \"\";\n\n $sql_model = \"UPDATE recibos SET estado = 'REVISADA', archivo='$nombre', horarevision = '$time', fecharevision = '$fecha' WHERE id_boleta = \".$id_boleta;\n\n $query = $this->db->prepare($sql_model);\n $inserted=$query->execute();\n\n if ($inserted) {\n\n return true;\n } else {\n\n return false;\n }\n }", "private function obter_imagem_secao()\n\t{\n\t\t$id = $this->request->param('id_secao_imagem');\n\n\t\t$imagem_secao = ORM::factory('Secao_Imagem', $id);\n\t\tif ( ! $imagem_secao->loaded()) {\n\t\t\tthrow new RuntimeException('Imagem da Seção inválida');\n\t\t}\n\t\tif ($imagem_secao->id_secao != $this->request->param('id_secao')) {\n\t\t\tthrow new RuntimeException('Imagem nao pertence à seção informada.');\n\t\t}\n\t\tif ($imagem_secao->secao->id_aula != $this->request->param('id_aula')) {\n\t\t\tthrow new RuntimeException('Seção nao pertence à aula informada.');\n\t\t}\n\t\t/*\n\t\tif ($imagem_secao->secao->aula->id_usuario != Auth::instance()->get_user()->pk()) {\n\t\t\tthrow new RuntimeException('Aula nao pertence ao usuario logado');\n\t\t}\n\t\t*/\n\t\treturn $imagem_secao;\n\t}", "static public function ctrEditUser(){\n\t\t\tif(isset($_POST[\"editarUsuario\"])){\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"editarNombre\"]) ){\n\n\t\t\t\t\t/*==========================================================\n\t\t\t\t\t\tV A L I D A R I M A G E N\n\t\t\t\t\t==========================================================*/\n\t\t\t\t\t$ruta = $_POST[\"fotoActual\"];\n\t\t\t\t\tif(isset($_FILES[\"editarFoto\"][\"tmp_name\"]) && $_FILES[\"editarFoto\"][\"tmp_name\"] != \"\"){\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tCREAR DIRECTORIO DONDE SE GUARDA LA FOTO\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$directorio = \"view/img/usuarios/\".$_POST[\"editarUsuario\"];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--------------------------------------------\n\t\t\t\t\t\t\tPREGUNTAR SI EXISTE FOTO EN LA DB\n\t\t\t\t\t\t--------------------------------------------*/\n\t\t\t\t\t\tif(!empty($_POST[\"fotoActual\"])){\n\t\t\t\t\t\t\tunlink($_POST[\"fotoActual\"]);\n\t\t\t\t\t\t}else{//Creamos Directorio\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN ACCIONES\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$rand = mt_rand(100, 999);\n\n\t\t\t\t\t\t//------------------ IMAGEN JPEG ------------------\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/jpeg\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".jpeg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/png\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".png\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t//Posible Cambio de Contraseña\n\t\t\t\t\t$crPassword = \"\";\n\t\t\t\t\tif($_POST[\"editarPassword\"] != \"\"){\n\t\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"editarPassword\"])){\n\t\t\t\t\t\t\t$crPassword = crypt($_POST[\"editarPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"La contraseña no puede llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t//Editar Password viene vacio, no se modificara contraseña\n\t\t\t\t\t\t$crPassword = $_POST[\"passwordActual\"];\n\t\t\t\t\t}\n\t\t\t\t\t$tabla = \"usuarios\";\n\t\t\t\t\t$datos = array(\n\t\t\t\t\t\t\"nombre\"=>$_POST[\"editarNombre\"],\n\t\t\t\t\t\t\"usuario\" => $_POST[\"editarUsuario\"],\n\t\t\t\t\t\t\"password\" => $crPassword,\n\t\t\t\t\t\t\"perfil\" => $_POST[\"editarPerfil\"],\n\t\t\t\t\t\t\"foto\" => $ruta);\n\t\t\t\t\t\n\t\t\t\t\t$respuesta = ModelUsers::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t\tif($respuesta){//Usuario guardado con exito\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Usuario guardado con exito\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t}else{//Error al guardar usuario\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Error al guardar usuario '.$respuesta.'\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t}\n\t\t\t\t}else{//Nombre no valido\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Nombre no puede ir vacio o llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function editar()\n {\n }", "function saveLinkToPhoto(){\n if(isset($_SESSION['temp_photo_loc'])){\n $randomString = $this->generateRandomString();\n $this->car_photo=$randomString;\n $new_file = \"C:/Apache24/htdocs/sola-avto-stran/yii-appli/frontend/web/assets/car_photos/\".$randomString.\".png\";\n rename(\"C:/Apache24/htdocs/sola-avto-stran/yii-appli/frontend/web/assets/temp/\".$_SESSION[\"temp_photo_loc\"].\".png\",$new_file);\n $this->save();\n //da deletamo sliko iz temporery loc\n $temporery = TempPhotos::findOne(([\"temp_photo\"=>$_SESSION['temp_photo_loc']]));\n $temporery->delete();\n //ko damo submit, sliko shranimo in jo potem lahko odstranimo iz session\n unset($_SESSION['temp_photo_loc']);\n }else{\n $this->car_photo=\"no_photo\";\n $this->save();\n }\n }", "public function actionActualizarDatosGenerales() {\n\n\n\t\t//trae los datos correctos\n\t\t$id = $_REQUEST['id'];\n\t\tif (isset($id)) {\n\t\t\t$mensajeError = '';\n\t\t\t//$model = new ZonaEducativa;\n\t\t\t$model = $this->loadModel($_REQUEST['id']);\n\t\t\t$model->attributes = $_REQUEST['ZonaEducativa'];\n\t\t\t$model->usuario_act_id = Yii::app()->user->id;\n\t\t\t$model->fecha_act = date(\"Y-m-d H:i:s\");\n\t\t\t$model->estatus = \"A\";\n\t\t\t$nombre = null;\n\t\t\t$estado = null;\n\t\t\t$telefonoF = null;\n\t\t\t$telefonoO = null;\n\t\t\t$correo = null;\n\t\t\t$direccion = null;\n\n\t\t\tif (isset($_REQUEST['ZonaEducativa']['nombre'])) {\n\t\t\t\t$nombre = $_REQUEST['ZonaEducativa']['nombre'];\n\t\t\t}\n\n\t\t\t$model->nombre = $nombre;\n\n\t\t\tif (isset($_REQUEST['ZonaEducativa']['estado_id'])) {\n\t\t\t\t$estado = $_REQUEST['ZonaEducativa']['estado_id'];\n\t\t\t}\n\n\t\t\t$model->estado_id = $estado;\n\t\t\tif (isset($_REQUEST['ZonaEducativa']['telefono_fijo'])) {\n\t\t\t\t$telefonoF = $_REQUEST['ZonaEducativa']['telefono_fijo'];\n\t\t\t}\n\n\t\t\t$model->telefono_fijo = $telefonoF;\n\t\t\tif (isset($_REQUEST['ZonaEducativa']['$telefono_otro'])) {\n\t\t\t\t$telefonoO = $_REQUEST['ZonaEducativa']['$telefono_otro'];\n\t\t\t}\n\n\t\t\t$model->telefono_otro = $telefonoO;\n\t\t\tif (isset($_REQUEST['ZonaEducativa']['direccion_referencial'])) {\n\t\t\t\t$direccion = $_REQUEST['ZonaEducativa']['direccion_referencial'];\n\t\t\t\t$model->direccion_referencial = trim(strtoupper($direccion));\n\t\t\t}\n\t\t\tif ($model->save()) {\n\t\t\t\t//echo 'guardo';\n\t\t\t\tYii::app()->user->setFlash('mensajeExitoso', \"Actualización Exitosa\");\n\t\t\t\t$this->renderPartial('flashMsg', array('estatus' => \"success\"));\n\t\t\t\t//$this->redirect('index', array('id' => base64_encode($id)));\n\t\t\t\t//$this->redirect(array('index', 'id' => base64_encode($model->id)));\n\t\t\t\t$this->registrarTraza('Actualizó la Zona Educativa ' . $model->id, 'ActualizarDatosGenerales');\n\t\t\t\tYii::app()->end();\n\t\t\t} else {\n\t\t\t\t// echo 'no guardo';\n\t\t\t\t$this->renderPartial('//errorSumMsg', array('model' => $model));\n\t\t\t\tYii::app()->end();\n\t\t\t}\n\t\t} else {\n\t\t\t// echo 'no guardo';\n\t\t\t$this->renderPartial('//errorSumMsg', array('model' => $model));\n\t\t\tYii::app()->end();\n\t\t}\n\t}", "public function actualizar($imagen)\n\t{\n\t\t$db = DB::conectar();\n\t\t$update = $db->prepare('UPDATE imagen SET nombre = :nombre, \n\t\t\t\t\t\t\tdireccion = :direccion, extencion = :extencion, \n\t\t\t\t\t\t\tcategoria = :categoria WHERE id = :id;');\n\n\t\t$update->bindValue('id', $imagen->getId());\n\t\t$update->bindValue('nombre', $imagen->getNombre());\n\t\t$update->bindValue('direccion', $imagen->getDireccion());\n\t\t$update->bindValue('extencion', $imagen->getExtencion());\n\t\t$update->bindValue('categoria', $imagen->getCategoria());\n\t\t$update->execute();\n\t}", "public function insertImageToDb() \n {\n }", "function cl_editalrua() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"editalrua\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function edit_with_image\n\t\t(\n\t\t\t$id_karyawan\n\t\t\t,$id_jabatan\n\t\t\t,$no_karyawan\n\t\t\t,$nik_karyawan\n\t\t\t,$nama_karyawan\n\t\t\t,$pnd\n\t\t\t,$tlp\n\t\t\t,$email\n\t\t\t,$avatar\n\t\t\t,$avatar_url\n\t\t\t,$alamat\n\t\t\t,$keterangan\n\t\t\t,$user_updt\n\t\t)\n\t\t{\n\t\t\t\n\t\t\t$query = \"UPDATE tb_karyawan SET \n\t\t\t\t\t\tid_jabatan = '\".$id_jabatan.\"'\n\t\t\t\t\t\t, nik_karyawan = '\".$nik_karyawan.\"'\n\t\t\t\t\t\t, nama_karyawan = '\".$nama_karyawan.\"'\n\t\t\t\t\t\t, pnd = '\".$pnd.\"'\n\t\t\t\t\t\t, tlp = '\".$tlp.\"'\n\t\t\t\t\t\t, email = '\".$email.\"'\n\t\t\t\t\t\t, avatar = '\".$avatar.\"'\n\t\t\t\t\t\t, avatar_url = '\".$avatar_url.\"'\n\t\t\t\t\t\t, alamat = '\".$alamat.\"'\n\t\t\t\t\t\t, ket_karyawan = '\".$ket_karyawan.\"'\n\t\t\t\t\t\t, user_updt = '\".$user_updt.\"'\n\t\t\t\t\t\t, tgl_updt = NOW() \n\t\t\t\t\t\tWHERE id_karyawan = '\".$id_karyawan.\"';\";\n\t\t\t$this->db->query($query);\n\t\t}", "public function actionCreate()\n {\n $model = new Artikel();\n $model->scenario = 'create';\n \n if ($model->load(Yii::$app->request->post())) {\n $image1 = $model->uploadImage(1);\n $image2 = $model->uploadImage(2);\n $image3 = $model->uploadImage(3);\n $image4 = $model->uploadImage(4);\n $image5 = $model->uploadImage(5);\n $image6 = $model->uploadImage(6);\n $image7 = $model->uploadImage(7);\n $image8 = $model->uploadImage(8);\n $image9 = $model->uploadImage(9);\n// print_r(Yii::$app->request->post());die;\n if($model->save()){\n // upload only if valid uploaded file instance found\n if($image1 !== FALSE){\n $path1 = $model->getImageFile($model->image1);\n $image1->saveAs($path1);\n }\n if($image2 !== FALSE){\n $path2 = $model->getImageFile($model->image2);\n $image2->saveAs($path2);\n }\n if($image3 !== FALSE){\n $path3 = $model->getImageFile($model->image3);\n $image3->saveAs($path3);\n }\n if($image4 !== FALSE){\n $path4 = $model->getImageFile($model->image4);\n $image4->saveAs($path4);\n }\n if($image5 !== FALSE){\n $path5 = $model->getImageFile($model->image5);\n $image5->saveAs($path5);\n }\n if($image6 !== FALSE){\n $path6 = $model->getImageFile($model->image6);\n $image6->saveAs($path6);\n }\n if($image7 !== FALSE){\n $path7 = $model->getImageFile($model->image7);\n $image7->saveAs($path7);\n }\n if($image8 !== FALSE){\n $path8 = $model->getImageFile($model->image8);\n $image8->saveAs($path8);\n }\n if($image9 !== FALSE){\n $path9 = $model->getImageFile($model->image9);\n $image9->saveAs($path9);\n }\n return $this->redirect(['view', 'id' => $model->id]);\n }else{\n \n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionAtualizar($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) ) {\n\n\n $foto1 = UploadedFile::getInstanceByName('foto1');\n $foto2 = UploadedFile::getInstanceByName('foto2');\n $foto3 = UploadedFile::getInstanceByName('foto3');\n $foto4 = UploadedFile::getInstanceByName('foto4');\n $foto5 = UploadedFile::getInstanceByName('foto5');\n\n// dd( Yii::$app->request->post(), $foto1, $model);\n\n $model->save();\n\n $caminho = $model->localSalvarImagens();\n\n if ($foto1 && Yii::$app->request->post('atualiza_foto1') == 'on') {\n @unlink($caminho . '/' . $model->foto1);\n $arq = 'foto1_' . time() . '.' . $foto1->getExtension();\n $model->foto1 = $arq;\n $foto1->saveAs($caminho . '/'.$arq);\n }\n if (Yii::$app->request->post('atualiza_foto2') == 'on') {\n if ($foto2) {\n @unlink($caminho . '/' . $model->foto2);\n $arq = 'foto2_' . time() . '.' . $foto2->getExtension();\n $model->foto2 = $arq;\n $foto2->saveAs($caminho . '/' . $arq);\n } else\n $model->foto2 = null;\n }\n if (Yii::$app->request->post('atualiza_foto3') == 'on') {\n if ($foto3) {\n @unlink($caminho . '/' . $model->foto3);\n $arq = 'foto3_' . time() . '.' . $foto3->getExtension();\n $model->foto3 = $arq;\n $foto3->saveAs($caminho . '/' . $arq);\n } else\n $model->foto3 = null;\n }\n if (Yii::$app->request->post('atualiza_foto4') == 'on') {\n if ($foto4) {\n @unlink($caminho . '/' . $model->foto4);\n $arq = 'foto4_' . time() . '.' . $foto4->getExtension();\n $model->foto4 = $arq;\n $foto4->saveAs($caminho . '/' . $arq);\n } else\n $model->foto4 = null;\n }\n if (Yii::$app->request->post('atualiza_foto5') == 'on') {\n if ($foto5) {\n @unlink($caminho . '/' . $model->foto5);\n $arq = 'foto5_' . time() . '.' . $foto5->getExtension();\n $model->foto5 = $arq;\n $foto5->saveAs($caminho . '/' . $arq);\n } else\n $model->foto5 = null;\n }\n\n Yii::$app->session->setFlash('success', 'Produto atualizado com sucesso');\n $model->update(false);\n\n\n return $this->redirect(['exibir', 'id' => $model->id]);\n }\n\n return $this->render('atualizar', [\n 'model' => $model,\n ]);\n }", "public function actionModificar()\n {\n $model = Yii::$app->user->identity->usuariosDatos;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->localidad === null && $model->direccion === null) {\n $model->geoloc = null;\n }\n if ($model->save() && $model->upload()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Has actualizado tus datos correctamente'));\n }\n }\n\n return $this->render('/usuarios/update', [\n 'modelDatos' => $model,\n 'seccion' => 'personal',\n 'generos' => Utiles::translateArray(UsuariosGeneros::find()\n ->select('sexo')\n ->indexBy('id')\n ->column()),\n ]);\n }", "public function Recortar()\n\t{\n\t\t// pega o ID do aluno\n\t\t$id = $this->input->post(\"id_aluno\"); \n\t\t// Configurações para o upload da imagem\n\t\t// Diretório para salvar a imagem\n\t\t$configUpload['upload_path'] = FCPATH .\"_assets/upload/alunos\";\n\t\t// Tipos de imagem permitidos\n\t\t$configUpload['allowed_types'] = 'jpg|png';\n\t\t// Usar nome de arquivo aleatório, ignorando o nome original do arquivo\n\t\t$configUpload['encrypt_name'] = TRUE;\n\t\t// Aplica as configurações para a library upload\n\t\t$this->upload->initialize($configUpload);\n\t\t// Verifica se o upload foi efetuado ou não\n\t\t// Em caso de erro carrega a home exibindo as mensagens\n\t\t// Em caso de sucesso faz o processo de recorte\n\t\tif ( ! $this->upload->do_upload('imagem'))\n\t\t{\n\t\t\t// Recupera as mensagens de erro e envia o usuário para a home\n\t\t\t$dados= array('error' => $this->upload->display_errors());\n\t\t\t// $this->load->view('home',$dados);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Recupera os dados da imagem\n\t\t\t$dadosImagem = $this->upload->data();\n\t\t\t// Calcula os tamanhos de ponto de corte e posição\n\t\t\t// de forma proporcional em relação ao tamanho da\n\t\t\t// imagem original\n\t\t\t$tamanhos = $this->CalculaPercetual($this->input->post());\n\t\t\t// Define as configurações para o recorte da imagem\n\t\t\t// Biblioteca a ser utilizada\n\t\t\t$configCrop['image_library'] = 'gd2';\n\t\t\t//Path da imagem a ser recortada\n\t\t\t$configCrop['source_image'] = $dadosImagem['full_path'];\n\t\t\t// Diretório onde a imagem recortada será gravada\n\t\t\t$configCrop['new_image'] = FCPATH .\"_assets/upload\";\n\t\t\t// Proporção\n\t\t\t$configCrop['maintain_ratio'] = FALSE;\n\t\t\t// Qualidade da imagem\n\t\t\t$configCrop['quality'] = 100;\n\t\t\t// Tamanho do recorte\n\t\t\t$configCrop['width'] = $tamanhos['wcrop'];\n\t\t\t$configCrop['height'] = $tamanhos['hcrop'];\n\t\t\t// Ponto de corte (eixos x e y)\n\t\t\t$configCrop['x_axis'] = $tamanhos['x'];\n\t\t\t$configCrop['y_axis'] = $tamanhos['y'];\n\t\t\t// Aplica as configurações para a library image_lib\n\t\t\t$this->image_lib->initialize($configCrop);\n\t\t\t// Verifica se o recorte foi efetuado ou não\n\t\t\t// Em caso de erro carrega a home exibindo as mensagens\n\t\t\t// Em caso de sucesso envia o usuário para a tela\n\t\t\t// de visualização do recorte\n\t\t\tif ( ! $this->image_lib->crop())\n\t\t\t{\n\t\t\t\t// Recupera as mensagens de erro e envia o usuário para a home\n\t\t\t\t$dados = array('error' => $this->image_lib->display_errors());\n\t\t\t\t// $this->load->view('home',$dados);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$info_arquivo = $this->upload->data(); // recupera os dados do arquivo em caso de sucesso\n\t\t\t\t$nome_arquivo = $dadosImagem['file_name'];\t// pega o nome do arquivo da array\n\t\t\t\t$aluno = array(\n\t\t\t\t\t\"id_aluno\" => $id,\n\t\t\t\t\t\"photo\" => $nome_arquivo\n\t\t\t\t);\n\t\t\t\t$this->db->where('id_aluno', $id);\n\t\t\t\t$this->db->update('aluno', $aluno);\n\t\t\t\techo $this->session->set_flashdata('msg',\"<div class='alert alert-success text-center'>FOTOGRAFIA ALTERADA COM SUCESSO</div>\");\t\n\t\t\t\tredirect('secretaria/aluno/detalhe?id_aluno='.$id); // redireciona para o pefil do aluno\n\t\t\t}\n\t\t}\n\t}", "function modificar()\n {\n if (isset($_POST[\"nombre\"])) {\n \n $datos[\"numero\"] = $_GET[\"numero\"];\n \n if (isset($_POST[\"nombre\"])) {\n $datos[\"nombre\"] = $_POST[\"nombre\"];\n }\n if (isset($_POST[\"tipo1\"])) {\n $datos[\"tipo1\"] = $_POST[\"tipo1\"];\n }\n if (isset($_POST[\"tipo2\"])) {\n $datos[\"tipo2\"] = $_POST[\"tipo2\"];\n }\n if (isset($_POST[\"descripcion\"])) {\n $datos[\"descripcion\"] = $_POST[\"descripcion\"];\n }\n \n if ($_FILES && isset($_FILES[\"imagen\"]) && $_FILES[\"imagen\"][\"size\"] != 0) {\n $datos[\"imagen\"] = time() . \"_imagen_\" . $_FILES[\"imagen\"][\"name\"];\n if (!$this->upLoadFile->guardarImagen($_FILES[\"imagen\"], $datos[\"imagen\"])) {\n $this->falla();\n }\n }\n \n if ($_FILES && isset($_FILES[\"sprite\"]) && $_FILES[\"sprite\"][\"size\"] != 0) {\n $datos[\"sprite\"] = time() . \"_sprite_\" . $_FILES[\"sprite\"][\"name\"];\n if (!$this->upLoadFile->guardarImagen($_FILES[\"sprite\"], $datos[\"sprite\"])) {\n $this->falla();\n }\n }\n \n if ($this->pokemonModel->updatePokemon($datos)) {\n $_SESSION[\"mensaje\"][\"mensaje\"] = \"Pokemon modificado con exito\";\n $_SESSION[\"mensaje\"][\"class\"] = \"w3-pale-green \";\n header('Location: /');\n } else {\n $_SESSION[\"mensaje\"][\"mensaje\"] = \"Error al actualizar el pokemon\";\n $_SESSION[\"mensaje\"][\"class\"] = \"w3-pale-red \";\n $this->falla();\n }\n \n } //Si no, llamo a la vista con los datos\n else {\n $this->falla();\n }\n }", "public function ctrCambiarFotoPerfil(){\n\n\t\tif(isset($_POST[\"idUsuarioFoto\"])){\n\n\t\t\t$ruta = $_POST[\"fotoActual\"];\n\n\t\t\tif(isset($_FILES[\"cambiarImagen\"][\"tmp_name\"]) && !empty($_FILES[\"cambiarImagen\"][\"tmp_name\"])){\n\n\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"cambiarImagen\"][\"tmp_name\"]);\n\n\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t/*=============================================\n\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\t\t\t\t=============================================*/\n\n\t\t\t\t$directorio = \"views/img/usuarios/\".$_POST[\"idUsuarioFoto\"];\n\n\t\t\t\t/*=============================================\n\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE OTRA IMAGEN EN LA BD Y EL CARPETA\n\t\t\t\t=============================================*/\n\n\t\t\t\tif($ruta != \"\"){\n\n\t\t\t\t\tunlink($ruta);\n\n\t\t\t\t}else{\n\n\t\t\t\t\tif(!file_exists($directorio)){\t\n\n\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t=============================================*/\n\n\t\t\t\tif($_FILES[\"cambiarImagen\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio.\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"cambiarImagen\"][\"tmp_name\"]);\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\timagejpeg($destino, $ruta);\t\n\n\n\t\t\t\t}else if($_FILES[\"cambiarImagen\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio.\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"cambiarImagen\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\t\n\n\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\n\t\t\t\t\timagesavealpha($destino, TRUE);\t\t\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\t\t\n\n\t\t\t\t\timagepng($destino, $ruta);\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: \"¡CORREGIR!\",\n\t\t\t\t\t\t\t \ttext: \"¡No se permiten formatos diferentes a JPG y/o PNG!\",\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\t\t\t\n\t\t\t}\n\n\t\t\t// final condicion\n\n\t\t\t$tabla = \"genusuario\";\n\t\t\t$id = $_POST[\"idUsuarioFoto\"];\n\t\t\t$item = \"usufoto\";\n\t\t\t$valor = $ruta;\n\n\t\t\t$respuesta = UserModel::mdlActualizarUsuario($tabla, $id, $item, $valor);\n\n\t\t\tif($respuesta == \"ok\"){\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: \"¡CORRECTO!\",\n\t\t\t\t\t \ttext: \"¡La foto de perfil ha sido actualizada!\",\n\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t \n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t } \n\t\t\t\t\t});\n\n\t\t\t\t</script>';\n\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function UpdatePersonnage(){\r\n $this->idPost();\r\n $this->lastFileNamePost();\r\n $this->titlePost();\r\n $this->contentPost();\r\n $this->personnage(); \r\n // Testons si le fichier a bien été envoyé et s'il n'y a pas d'erreur\r\nif (isset($_FILES['file']) AND $_FILES['file']['error'] == 0){\r\n // Testons si le fichier n'est pas trop gros\r\n if ($_FILES['file']['size'] <= 2000000)\r\n {\r\n \r\n unlink(\"public/images/personnage/\" . $_POST['lastFileName']);\r\n \r\n $infosfichier = pathinfo($_FILES['file']['name']);// le'extention du fichier envoye .jpg etc\r\n \r\n $extension_upload = $infosfichier['extension'];//on le met dans un tableau\r\n \r\n $extensions_autorisees = array('jpg', 'jpeg', 'gif', 'png');// les extention qu'on acceptes\r\n \r\n\t\t $name = $infosfichier['filename'];// On recupere le nom du fichier envoye\r\n \r\n\t\t $file = 'Time' .time(). 'Name' .$name. '.' .$extension_upload;\r\n //Nom du fichier qu'on lui donne Time du moment + name + nom du fichier + extention\r\n \r\n // Testons si l'extension du fichier est egale a celle que l'on autorise\r\n if (in_array($extension_upload, $extensions_autorisees))\r\n {\r\n // On peut valider le fichier et le stocker définitivement\r\n move_uploaded_file($_FILES['file']['tmp_name'], 'public/images/personnage/' . $file);\r\n }else{\t \r\n echo \"<script>alert(\\\"L'extension du fichier n'est pas autorisée. Seuls les fichiers jpg, jpeg, png sont acceptés.\\\")</script>\";\r\n}\r\n }else{\r\n echo \"<script>alert(\\\"Le fichier est trop volumineux (Poids limité à 4Mo)\\\")</script>\";\r\n\t\t}\r\n }else{\r\n $file = $this->_lastFileNamePostSecure;\r\n} \r\n $this->_personnageManager->updatePersonnage($this->_idPostSecure, $this->_titlePostSecure, $this->_contentPostSecure, $file);\r\n \r\n header('location: GestionPersonnage'); \r\n }", "public function actionUpdate($id)\n {\n $tipo = 2;\n //Se busca el modelo a editar dos veces, una para que el usuario modifique\n //Y la otra para comparar las modiciaciones que se realizarón\n $model = $this->findModel($id);\n $modelAnt = $this->findModel($id);\n\n //Se crea las listas de las tablas que tienen relación con archivos\n $pais = ArrayHelper::map(Pais::find()->orderBy('pai_nombre')->all(),'pai_id', 'pai_nombre');\n $genero = ArrayHelper::map(Genero::find()->orderBy('gen_nombre')->all(),'gen_id', 'gen_nombre');\n $idioma = ArrayHelper::map(Idioma::find()->orderBy('idi_nombre')->all(),'idi_id', 'idi_nombre');\n $derecho = ArrayHelper::map(Derecho::find()->orderBy('der_nombre')->all(),'der_id', 'der_nombre');\n\n //Se buscan los atributos extra para el tipo de archivo de la colección.\n $ta = Archivoatributoex::find()->select(['aex_id'])->where(['tar_id'=>$model->tar_id])->all();\n $ae =ArrayHelper::map(Atributoextra::findAll($ta),'aex_id', 'aex_nombre');\n\n\n if(Detallearchivoatributoex::find()->where(['arc_id'=> $id])->count() != 0){\n $borrarDAAE = Detallearchivoatributoex::find()->where(['arc_id'=> $model->arc_id])->all();\n $detalleAE = Detallearchivoatributoex::find()->where(['arc_id'=> $id])->all();\n }\n else{\n $borrarDAAE = 0;\n $detalleAE = [new Detallearchivoatributoex];\n }\n\n //Si existen valores por el metodo POST (cuando el usuario de clic en guardar en el form)\n if ($model->load(Yii::$app->request->post())){\n //*** MANEJO DEL ARCHIVO ***//\n //Se instancia el archivo de portada subida por el investigador\n $archivo = UploadedFile::getInstance($model,'arc_archivo');\n //Se verifica que exista el archivo, sino se le asigna el nombre anterior\n if ($archivo == ''){\n //Nombre anterior\n $model->arc_archivo = $modelAnt->arc_archivo;\n }else{\n //Elimna el archivo antiguo\n if($modelAnt->arc_archivo != 'temporal'){\n unlink('../../frontend/web/img/archivo/'.$modelAnt->arc_archivo);\n }\n //Se asigna sube el nuevo archivo\n $contArchivo = \\frontend\\models\\archivo\\Archivo::find()->count();\n $archivo->saveAs('@frontend/web/img/archivo/' . $archivo->baseName . ($contArchivo+1). '.' . $archivo->extension);\n $model->arc_archivo = $archivo->baseName . ($contArchivo+1) . '.' . $archivo->extension;\n if($archivo->extension == 'jpg' || $archivo->extension == 'jpeg' || $archivo->extension == 'png' ){\n $model->arc_tipo = 'Imagen';\n }else{\n if($archivo->extension == 'mp3'){\n $model->arc_tipo = 'Audio';\n }else{\n if($archivo->extension == 'mp4'){\n $model->arc_tipo = 'Video';\n }else{\n if($archivo->extension == 'pdf'){\n $model->arc_tipo = 'PDF';\n }else{\n $model->arc_tipo = 'Otro';\n }\n }\n\n }\n }\n }\n //*** FINALIZA MANEJO DEL ARCHIVO ***//\n\n\n //*** MANEJO DE AUDITORIA ***//\n $model -> arc_fechaAudit = date('y-m-d H:i:s');\n $model -> arc_accion = 'M';\n //*** FINALIZAMANEJO DE AUDITORIA ***//\n\n\n //*** MANEJO DE DETALLE ATRIBUTOS EXTRA ***//\n $dataAE = Yii::$app->request->post('Detallearchivoatributoex', []);\n\n\n if( $model->save()) {\n\n/*\n if($borrarDAAE != 0){\n ///Eliminado de registro antiguos\n foreach ($borrarDAAE as $index){\n if($index->dae_id != null ) {\n $tempX = new Detallearchivoatributoex();\n $tempX->find()->where(['dae_id' => $index->dae_id])->one()->delete();\n }\n }\n }*/\n\n\n/*\n //Guardan los valores de la relación coleccion-pais\n foreach ($dataAE as $index) {\n $tempAtributoExtra = ArrayHelper::getValue($index, 'aex_id');\n\n if($tempAtributoExtra != null){\n $temp = new Detallearchivoatributoex();\n $temp -> arc_id = $model ->arc_id;\n $consulta = Archivoatributoex::find()->select(['aae_id'])\n ->where(['aex_id'=>$tempAtributoExtra])\n ->andWhere(['tar_id'=>$model->tar_id])->one();\n $temp -> aae_id = $consulta->aae_id;\n\n $temp -> dae_descripcion = ArrayHelper::getValue($index, 'dae_descripcion');\n $temp -> dae_estado = 'N';\n $temp -> dae_fechaCreacion = date('y-m-d H:i:s');\n $temp -> dae_fechaAudit = date('y-m-d H:i:s');\n $temp -> dae_accion = 'N';\n $temp -> aex_id = $tempAtributoExtra;\n echo $temp -> dae_descripcion . '--';\n if( $temp -> dae_descripcion != null && $temp -> dae_descripcion != '' ){\n $temp->save();\n }\n }\n\n };*/\n\n //Mensaje de confirmación\n Yii::$app->session->setFlash('msg', '\n <div class=\"alert alert-success alert-dismissable\">\n <button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">X</button>\n <h4><i class=\"bx bx-check\"></i>Archivo modificado!</h4>\n El archivo fue modificado correctamente.\n </div>\n ');\n\n $col = Coleccion::find()->select(['col_titulo','inv_id'])->where(['col_id' => $model->col_id])->one();\n\n $inv = Investigador::find()->where(['inv_id'=>$col->inv_id])->one();\n $user = User::find()->where(['id'=>$inv->usu_id])->one();\n\n $this->sendEmail($user,$col->col_titulo,$model->arc_estadoarc,$model->observacion);\n\n return $this->redirect(['view', 'id' => $model->arc_id]);\n }\n }\n\n\n return $this->render('update', [\n 'tipo' => $tipo,\n 'model' => $model,\n 'pais' => $pais,\n 'genero' => $genero,\n 'idioma' => $idioma,\n 'derecho' => $derecho,\n 'ae' => $ae,\n //'atributoExtra' => $atributoExtra,\n 'detalleAE' => $detalleAE ,\n\n //\n //'detalleAE' => $detalleAE ,\n //'archivoAE' => $archivoAE,\n //'atributoE'=>$atributoE,\n\n ]);\n }", "public function newNoticiaimgAction(Request $request)\n {\n $image = new Image();\n //$form = $this->createFormBuilder($image)->add('file')->add('ruta');\n //$form->handleRequest($request);\n //$name = $form['name']->getData();\n\n $em = $this->getDoctrine()->getManager();\n\n\n// $tipo = gettype($request->get('username'));\n //$image->upload();\n $dale1 = $request->get('name');\n $dale = $request->get('file');\n $mit = $request->files->get('file');\n //$mit = $this->getRequest()->files->get('file'); este funciona\n $datos = array('name' => $dale1, 'imagen'=> $mit);\n\n $image->setFile($mit);\n $image->upload();\n $em->persist($image);\n\n $em->flush();\n\n //return the response whit status ok\n $data = array(\"estado\" => \"realizado\");\n $view = $this->view($data, 200);\n return $this->handleView($view);\n\n\n }", "public function update($id)\n\t{\t\n\t\t$proyecto = Proyectos::find($id);\n\t\t$images = Input::file('images');\n\t\t$portada = Input::file('imgPortada');\n\t\t\n\t\t// Imágenes\n\t\tif (!is_null($images[0])) { // Si hay imágenes\n\t\t\t$img_paths = json_decode($proyecto->img_paths);\t// Decodificamos el json\n\t\t\tforeach ($images as $image) { // Por cada imágen nueva\n\t\t\t\t$imgName = $image->getClientOriginalName();\n\t\t\t\t$i = Image::make($image);\n\t\t\t\t$fullPath = 'imagenes/proyecto/'.$imgName;\n\t\t\t\t$i->save($fullPath);\n\t\t\t\tarray_push($img_paths, $fullPath); // La agregamos al array\n\t\t\t}\n\t\t\t$proyecto -> img_paths =json_encode($img_paths); // Guardamos el nuevo array como json\n\t\t}\n\t\t\n\t\t// Foto de Portada\n\t\tif(!is_null($portada)){\t\n\t\t\t$portadaName = \t$portada->getClientOriginalName();\n\t\t\t$portadaImg = \tImage::make($portada);\n\t\t\t$portadaPath = \t'imagenes/proyecto/'.$portadaName;\n\t\t\t$portadaImg\t ->\tsave($portadaPath);\n\t\t\t$proyecto->imgPortada =$portadaPath;\n\t\t}\n\n\t\t// Guardar Proyecto\n\t\t$proyecto -> title \t = Input::get('title');\n\t\t$proyecto -> content = Input::get('content');\n\t\t$proyecto -> year \t = Input::get('year');\n\t\t$proyecto -> size \t = Input::get('size');\n\t\t$proyecto -> category = Input::get('category');\n\t\t//dd($proyecto); // Descomentar para hacer pruebas sin que se guarden en DB\n\t\t$proyecto -> save();\n\t\treturn redirect('backend/proyectos');\n\t}", "function aceptar($idimagen, $catgaleria)\r\n{\r\n\tglobal $db;\r\n\t$query = \"UPDATE \"._TBLCATEGORIA.\" SET idpadre = $catgaleria WHERE IDCATEGORIA = $idimagen\";\r\n\t$db->Execute($query) or errorQuery(__LINE__, __FILE__);\r\n\treturn true;\r\n\t\r\n}", "function saveImage($idPublicacion, $instancia) {\r\n require_once 'class/funciones.php';\r\n \r\n // 01 session de imagenes\r\n $dataSession['productos'] = (isset($_SESSION['productos']) && count($_SESSION['productos']) > 0) ? $_SESSION['productos'] : false;\r\n \r\n // 02 recorrido de estas ('productos')\r\n $dataInsert = array();\r\n if(isset($dataSession['productos']) && count($dataSession['productos']) > 0 && $dataSession['productos'] != false) {\r\n foreach ($dataSession['productos'] as $array) {\r\n $targetFile = realpath(__DIR__ .\"/images/productos/\") .'/'. $array['img_tmp']['name'];\r\n \r\n if (!copy($array['img_tmp']['path'], $targetFile)) { echo \"failed to copy image\"; exit; }\r\n \r\n $dataInsert['publicacionID'] = $idPublicacion;\r\n $dataInsert['nombre'] = $array['img_tmp']['name'];\r\n $dataInsert['fecha_registro'] = date(\"Y-m-d h:i:s\");\r\n $dataInsert['estado'] = 1;\r\n \r\n $instancia->insertImagesByPublicacion($dataInsert);\r\n // 02.1 crear thumbnail\r\n $updir = realpath(__DIR__ .\"/images/productos/\") . \"/\";\r\n $dirLocation = realpath(__DIR__ .\"/images/productos/thumb\") . \"/\"; \r\n $extension = getFileExtension($array['img_tmp']['name']);\r\n $id = str_replace($extension, '', $array['img_tmp']['name']);\r\n makeThumbnails($updir, $extension, $id, $dirLocation);\r\n \r\n }\r\n }\r\n // 03 limpiar imagenes en session\r\n if (isset($_SESSION['productos'])) { unset($_SESSION['productos']); } \r\n}", "function mostrar_producto_img(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM producto WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$id=$resultado['id_pro'];\n\t\t\t$sql2=\"SELECT directorio_image, nombre_image FROM imagen WHERE galeria_image='$id' AND tabla_image='producto'ORDER BY id_image\";\n\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\n\t\t\twhile ($resultado2 = mysql_fetch_array($consulta2)){\n\t\t\t\t$this->listado[]=$resultado2;\n\t\t\t}\n\t\t}\n\t}", "public function modificarConcurso() {\n\n\t\tif(!$_SESSION[\"currentuser\"]){\n\t\t\techo \"<script>window.location.replace('index.php');</script>\";\n\t\t}\n\n\t\t$concu= new Concurso();\n\n\t\tif (isset($_POST[\"nombreC\"])){\n\t\t\t/*Metodo de la clase concurso que devuelve un boolean indicando si\n\t\t\tel concurso existe en la base de datos*/\n\t\t\t$existe=$concu->existConcurso();\n\n\t\t\t/*Si el concurso no existe devuelve un mensaje de error*/\n\t\t\tif(!$existe){\n\t\t\t\t$errors = array();\n\t\t\t\t$errors[\"nombreC\"] = \"Este concurso no existe, por lo que no se puede modificar\";\n\t\t\t\t$this->view->setVariable(\"errors\", $errors);\n\t\t\t\t/*Si el concurso si que existe, se guardan los valores introducidos en la\n\t\t\t\tmodificacion en la clase concurso*/\n\t\t\t}else{\n\t\t\t\t$concu->setIdC('1');\n\t\t\t\t$concu->setNombreC($_POST[\"nombreC\"]);\n\n\t\t\t\t$ruta=\"./resources/bases/\";//ruta carpeta donde queremos copiar las imagenes\n\t\t\t\t$basesCTemp=$_FILES['basesC']['tmp_name'];//guarda el directorio temporal en el que se sube la imagen\n\t\t\t\t$basesC=$ruta.$_FILES['basesC']['name'];//indica el directorio donde se guardaran las imagenes\n\t\t\t\tmove_uploaded_file($basesCTemp, $basesC);\n\n\t\t\t\t$concu->setBasesC($basesC,$basesCTemp);\n\t\t\t\t$concu->setCiudadC($_POST[\"ciudadC\"]);\n\t\t\t\t$concu->setFechaInicioC($_POST[\"fechaInicioC\"]);\n\t\t\t\t$concu->setFechaFinalC($_POST[\"fechaFinalC\"]);\n\t\t\t\t$concu->setFechaFinalistasC($_POST[\"fechaFinalistasC\"]);\n\t\t\t\t$concu->setPremioC($_POST[\"premioC\"]);\n\t\t\t\t$concu->setPatrocinadorC($_POST[\"patrocinadorC\"]);\n\n\t\t\t\ttry{\n\t\t\t\t\t/*Comprueba si los datos introducidos son validos*/\n\t\t\t\t\t$concu->checkIsValidForRegister();\n\n\t\t\t\t\t// Actualiza los datos del concurso\n\t\t\t\t\t$concu->update();\n\n\t\t\t\t\t//mensaje de confirmación y redirige al metodo consultarConcurso del controlador ConcursoCotroller\n\t\t\t\t\techo \"<script> alert('Modificación realizada correctamente'); </script>\";\n\t\t\t\t\techo \"<script>window.location.replace('index.php?controller=concurso&action=consultarConcurso');</script>\";\n\n\t\t\t\t}catch(ValidationException $ex) {\n\n\t\t\t\t\t$errors = $ex->getErrors();\n\t\t\t\t\t$this->view->setVariable(\"errors\", $errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*Devuelve los datos del concurso para mostrarlos en la vista*/\n\t\t$concu = $this->concurso->ver_datos();\n\n\t\t/* Guarda el valor de la variable $concu en la variable concu accesible\n\t\tdesde la vista*/\n\t\t$this->view->setVariable(\"concu\", $concu);\n\n\t\t/*Permite visualizar: view/vistas/modificacionConcurso.php */\n\t\t$this->view->render(\"vistas\", \"modificacionConcurso\");\n\t}", "public function callFormEdit($id){\n // $imagen = Storage::get('/public/viviendas/1/0.png');\n // $imagen = str_replace('+', ' ', $imagen);\n // $imagen = base64_encode($imagen);\n // $imagen = \"data:image/png;base64\".$imagen;\n\n $propiedad = DB::table('propiedades')->where('id', '=', $id)->get()->first();\n $regiones = DB::table('regiones')->select('*')->where('id','=',11)->get();\n $comunas = DB::table('comunas')->select('*')->where('region_id','=',11)->get();\n $tipopropiedades = DB::table('tipo_propiedades')->select('*')->get();\n $tipoamoblados = DB::table('tipo_amoblados')->select('*')->get();\n $tipopisos = DB::table('tipo_pisos')->select('*')->get();\n $tipofinanciamientos = DB::table('tipo_financiamientos')->select('*')->get();\n // Recuperamos los financiamientos aceptados anteriores\n $contadoaux = DB::table('financiamientos')->where([\n ['propiedades_id', '=', $id],\n ['tipofinanciamientos_id','=',1],\n ])->get();\n if($contadoaux->count() == 0)$contado=0;\n else $contado=1;\n $subsidioaux = DB::table('financiamientos')->where([\n ['propiedades_id', '=', $id],\n ['tipofinanciamientos_id','=',2],\n ])->get();\n if($subsidioaux->count() == 0)$subsidio=0;\n else $subsidio=1;\n $leasingaux = DB::table('financiamientos')->where([\n ['propiedades_id', '=', $id],\n ['tipofinanciamientos_id','=',3],\n ])->get();\n if($leasingaux->count() == 0)$leasing=0;\n else $leasing=1;\n $creditoaux = DB::table('financiamientos')->where([\n ['propiedades_id', '=', $id],\n ['tipofinanciamientos_id','=',4],\n ])->get();\n if($creditoaux->count() == 0)$credito=0;\n else $credito=1;\n //Para recuperar el valor de la UF en la variable $UF\n $apiUrl = 'https://mindicador.cl/api';\n if ( ini_get('allow_url_fopen') ) {\n $json = file_get_contents($apiUrl);\n } else {\n //De otra forma utilizamos cURL\n $curl = curl_init($apiUrl);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $json = curl_exec($curl);\n curl_close($curl);\n }\n\n if(Auth::check()){\n $mispropiedades = DB::table('propiedades')->select('*')->where('usuario_id',Auth::user()->id)->get();\n }else{\n $mispropiedades = null;\n }\n $dailyIndicators = json_decode($json);\n $UF = intval($dailyIndicators->uf->valor);\n $fotos = DB::table('imagenes')->where('codigo', '=', $propiedad->codigo)->get();\n $active_tab=\"edicion_datos\";\n return view('propiedades.form',compact('mispropiedades','UF','contado','leasing','credito','subsidio','propiedad','regiones','comunas','tipopropiedades','tipoamoblados','tipopisos','tipofinanciamientos','fotos','active_tab'));\n }", "function updateProducer($id,$nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file)\n {\n $upfile=$_FILES[\"img\"];\n if($upfile[\"name\"]!=''){ \n $typelist=array(\"image/jpeg\",\"image/jpg\",\"image/png\",\"image/gif\");\n $path=\"app\\public\\\\front\\images\\\\\";\n $target_file = $path . basename($upfile[\"name\"]);\n if (isset($_POST[\"submit\"])) \n {\n $check = getimagesize($upfile[\"tmp_name\"]);\n if ($check !== false)\n {\n if($upfile['size']>500000){\n }\n if(!in_array($upfile[\"type\"],$typelist)){\n die(\"Seuls les formats JPG, JPEG, PNG & GIF files sont authorisés.\");\n }\n if (move_uploaded_file($upfile[\"tmp_name\"], $target_file)) {\n\n if($id>0){\n $producers = new ProducerManager();\n $updateProducer = $producers->updateProducer($id,$nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=producers');\n }else{\n $producers = new ProducerManager();\n $newProducer = $producers->newProducer($nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n\n header('location: hbAdmin.php?action=producers');}\n }else\n {\n echo \"Désolé, une erreur est survenue dans l'envoi de votre fichier. \";\n } \n }\n } else {\n echo \"Ce fichier n'est pas une image. \";\n }\n }else{\n if($id>0){\n $producers = new ProducerManager();\n $updateProducer = $producers->updateProducer($id,$nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=producers');\n }else{\n $producers = new ProducerManager();\n $newProducer = $producers->newProducer($nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n\n header('location: hbAdmin.php?action=producers');}\n }\n}", "function add($asociado_id)\n {\n if($this->acceso(422)){\n //$this->load->library('form_validation');\n /* *********************INICIO imagen***************************** */\n $foto=\"\";\n if (!empty($_FILES['galeria_imagen']['name'])){\n\t\t\n $this->load->library('image_lib');\n $config['upload_path'] = './resources/images/imgasociados/';\n $img_full_path = $config['upload_path'];\n\n //$config['allowed_types'] = 'gif|jpeg|jpg|png';\n $config['allowed_types'] = '*';\n $config['image_library'] = 'gd2';\n $config['max_size'] = 0;\n $config['max_width'] = 0;\n $config['max_height'] = 0;\n \n $new_name = time(); //str_replace(\" \", \"_\", $this->input->post('proveedor_nombre'));\n $config['file_name'] = $new_name; //.$extencion;\n $config['file_ext_tolower'] = TRUE;\n\n $this->load->library('upload', $config);\n $this->upload->do_upload('galeria_imagen');\n\n $img_data = $this->upload->data();\n $extension = $img_data['file_ext'];\n /* ********************INICIO para resize***************************** */\n if ($img_data['file_ext'] == \".jpg\" || $img_data['file_ext'] == \".png\" || $img_data['file_ext'] == \".jpeg\" || $img_data['file_ext'] == \".gif\") {\n $conf['image_library'] = 'gd2';\n $conf['source_image'] = $img_data['full_path'];\n $conf['new_image'] = './resources/images/imgasociados/';\n $conf['maintain_ratio'] = TRUE;\n $conf['create_thumb'] = FALSE;\n $conf['width'] = 800;\n $conf['height'] = 600;\n $this->image_lib->clear();\n $this->image_lib->initialize($conf);\n if(!$this->image_lib->resize()){\n echo $this->image_lib->display_errors('','');\n }\n $confi['image_library'] = 'gd2';\n $confi['source_image'] = './resources/images/imgasociados/'.$new_name.$extension;\n $confi['new_image'] = './resources/images/imgasociados/'.\"thumb_\".$new_name.$extension;\n $confi['create_thumb'] = FALSE;\n $confi['maintain_ratio'] = TRUE;\n $confi['width'] = 50;\n $confi['height'] = 50;\n\n $this->image_lib->clear();\n $this->image_lib->initialize($confi);\n $this->image_lib->resize();\n }\n /* ********************F I N para resize***************************** */\n \n\n $foto = $new_name.$extension;\n }\n /* *********************FIN imagen***************************** */\n $estado_id = 1;\n $params = array(\n 'asociado_id' => $asociado_id,\n 'imagenasoc_titulo' => $this->input->post('imagenasoc_titulo'),\n 'imagenasoc_archivo' => $foto,\n 'imagenasoc_descripcion' => $this->input->post('imagenasoc_descripcion'),\n );\n \n $imagenprod_id = $this->Imagen_asociado_model->add_imagen_asociado($params);\n redirect('imagen_asociado/catalogo/'.$asociado_id);\n \n }\n }", "function admin_restore($id){\n if($id!=null){\n\t\t\t $this->personne->id = $id ;\n\t\t\t\t$image1= $this->personne->field('image') ;\n\t\t\t\t$image2= $this->personne->field('image2Prod') ;\n\t\t\t\t$image3= $this->personne->field('image3Prod') ;\n if($this->personne->saveField('deleted',0) ) {\n\t\t\t\t $this->Session->setFlash(\"Le personne a été restauré avec succès.\" ,\"default\",array('class'=>'valid_box'));\n\t\t\t\t $this->redirect($this->referer()) ;\n\t\t\t\t }else{\n\t\t\t\t\t $this->Session->setFlash(\"Une erreur a été rencontré lors de la restauration du Personne.\" ,\"default\",array('class'=>'error_box'));\n\t\t\t\t\t$this->redirect($this->referer()) ;\t\t\t\t \n\t\t\t\t }\n\t\t\t\t \n }\n }", "public function index()\n {\n //validamos los datos\n request()->validate([\n 'nombreTorneo'=>'required',\n 'logo'=>['max:2000','mimes:jpeg,bmp,png','required'],\n 'tipoEliminacion'=>'required',\n 'modoJuego'=>'required',\n 'numeroEquipos'=>'required'\n ]);\n\n //codigo del usuario\n $codigoUS=auth()->id();\n //para la imagen\n\n $archivo;\n\n if($_FILES['logo']['error']>0){\n echo '<script language=\"javascript\">alert(\"error al cargar el archivos\");</script>';\n }else{\n $permitidos= array(\"image/gif\",\"image/png\",\"image/jpg\");\n $limite_kb=10000;\n if(in_array($_FILES['logo']['type'],$permitidos) && $_FILES['logo']['size'] <= $limite_kb*1024){\n $url='C:\\laragon\\www\\GamingUmpires\\public\\logo_pictures/'.$codigoUS.'/';\n $archivo=$url.$_FILES['logo']['name'];\n\n if(!file_exists($url)){\n mkdir($url);\n }\n\n if(!file_exists($archivo)){\n $resultado=@move_uploaded_file($_FILES['logo']['tmp_name'],$archivo);\n if($resultado){\n echo '<script language=\"javascript\">alert(\"Imagen Guardada Con Exito!!\");</script>';\n }else{\n echo '<script language=\"javascript\">alert(\"no guadado\");</script>';\n }\n }\n }else{\n echo '<script language=\"javascript\">alert(\"tamaño o formato invalido\");</script>';\n }\n }\n\n //creamos nuestro objeto sala y\n $sala=new sala;\n $sala->codigo_Usuario=$codigoUS;\n $sala->nombre_Torneo= request('nombreTorneo');\n $sala->logo= \"../logo_pictures/\".$codigoUS.'/'.$_FILES['logo']['name'];\n $sala->tipo_Eliminacion= request('tipoEliminacion');\n $sala->modo_Juego= request('modoJuego');\n $sala->numero_Equipos= request('numeroEquipos');\n //el equipo ganador no existe aun\n $sala->equipo_ganador= \"por concluir\";\n unset($_SESSION[\"creacionD2\"]);\n return View('sala/creacion-equipos-sala-dota2')->with('sala',$sala);\n\n }", "private function aksi_upload_foto_kk_profil_saya($id_admin)\n {\n $config['upload_path'] = './../assets/uploads/admin/';\n $config['allowed_types'] = 'gif|jpg|png|jpeg|pdf';\n $config['file_name'] = 'foto_kk_admin-' . date('ymd') . '-' . substr(md5(rand()), 0, 10);\n\n $this->load->library('upload', $config);\n $id_admin = $this->input->post('id_admin');\n\n if (!empty($_FILES['berkas']['name'])) {\n\n if ($this->upload->do_upload('berkas')) {\n\n $uploadData = $this->upload->data();\n\n //Compres Foto\n $config['image_library'] = 'gd2';\n $config['source_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $config['create_thumb'] = FALSE;\n $config['maintain_ratio'] = TRUE;\n $config['quality'] = '90%';\n $config['width'] = 900;\n $config['height'] = 700;\n $config['new_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n\n $item = $this->db->where('id_admin', $id_admin)->get('admin')->row();\n\n //replace foto lama \n if ($item->foto_kk_admin != \"placeholder_kk.png\") {\n $target_file = './../assets/uploads/admin/' . $item->foto_kk_admin;\n unlink($target_file);\n }\n\n $data['foto_kk_admin'] = $uploadData['file_name'];\n\n $this->db->where('id_admin', $id_admin);\n $this->db->update('admin', $data);\n }\n }\n }", "public function update()\n {\n\n $id = null;\n $velo_id = null;\n $description = null;\n $image = null;\n\n if (!empty($_POST['id']) && ctype_digit($_POST['id'])) {\n $id = $_POST['id'];\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n if (!empty($_POST['image']) && $_POST['image'] != \"\") {\n $image = htmlspecialchars($_POST['image']);\n }\n\n if (!empty($_POST['description'])) {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!$id || !$image || !$description) {\n die(\"formulaire mal rempli $id, $image, $description\");\n }\n\n $voyage_to_edit = $this->model->find($id, $this->modelName);\n\n if (!$voyage_to_edit) {\n die(\"Does Not Exist\");\n }\n\n $this->model->edit($id, $description, $image);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "function editarPerfil(){\n \t//Llamo a la vista editar perfil\n \trequire \"app/Views/EditarPerfil.php\";\n \t\t$usuario = new Usuario();\n\t\t//Paso datos\n \t\t$usuario->nombre=$_POST['nombre'];\n \t\t$usuario->apellidoPaterno=$_POST['apellido_p'];\n \t\t$usuario->apellidoMaterno=$_POST['apellido_m'];\n \t\t$usuario->nombreUsuario=$_POST['nom_usuario'];\n \t\t$usuario->correo=$_POST['correo'];\n \t\t$usuario->contrasenia=$_POST['contrasenia'];\n \t\t$usuario->sexo=$_POST['sexo'];\n \t\t$usuario->descripcion=$_POST['descripcion'];\n \t\t$usuario->id=$_POST['id'];\n \t\t$usuario->contrasenia['password'];\n \t\t$usuario->editarUsuario();\n header(\"Location:/Proyecto/index.php?controller=Publicaciones&action=home\");\t\n }", "public function editar(){\n $cedula = $_GET['cedula'];\n //2. usar el modelo para traer de la BD el estudiante\n $estudiante = $this->model->buscarEstudiante($cedula);\n //3. llamar a la vista de editar\n require_once 'view/include/header.php';\n require_once 'view/estudiante/editar.php';\n require_once 'view/include/footer.php';\n }", "private function updateModel(){\n $id = trim(filter_input(INPUT_GET, 'info'));\n $fname = trim(filter_input(INPUT_POST, 'fname'));\n $lname = trim(filter_input(INPUT_POST, 'lname'));\n $nick = trim(filter_input(INPUT_POST, 'nick'));\n $about = trim(filter_input(INPUT_POST, 'about'));\n $eyes = trim(filter_input(INPUT_POST, 'eyes'));\n $height = trim(filter_input(INPUT_POST, 'height'));\n $biust = trim(filter_input(INPUT_POST, 'biust'));\n $waist = trim(filter_input(INPUT_POST, 'waist'));\n $hips = trim(filter_input(INPUT_POST, 'hips'));\n $shoes = trim(filter_input(INPUT_POST, 'shoes'));\n $type = trim(filter_input(INPUT_POST, 'type'));\n \n $email = trim(filter_input(INPUT_POST, 'email'));\n $phone = trim(filter_input(INPUT_POST, 'phone'));\n $address = trim(filter_input(INPUT_POST, 'address'));\n \n $fb = trim(filter_input(INPUT_POST, 'fb'));\n $tw = trim(filter_input(INPUT_POST, 'tw'));\n $gp = trim(filter_input(INPUT_POST, 'gp'));\n $ln = trim(filter_input(INPUT_POST, 'ln'));\n $pin = trim(filter_input(INPUT_POST, 'pin'));\n \n\t $name = $_FILES['photo']['name'];\n\t if(!empty($name)){\n\t $filename = stripslashes($_FILES['photo']['name']);\n $uploadDir = 'uploads/';\n $ext = Utils::getExtension($filename);\n $validFormats = ['jpg', 'png', 'jpeg', 'JPG'];\n if(in_array($ext, $validFormats)){\n $photo = time() . '-' . $filename; //Save this to the DB\n $targetPath = $uploadDir . $photo;\n $upload = @move_uploaded_file($_FILES['photo']['tmp_name'], $targetPath);\n if($upload){\n $update = $this->changeModelWithPic($id, $fname, $lname, $nick, $about, $eyes, $height, $biust, $waist, $hips, $shoes, $email, $phone, $address, $fb, $tw, $gp, $ln, $pin, $photo, $type);\n if($update){\n header('Location: /model');\n }\n else die('Error inserting image into the product table');\n }\n else die('Error uploading image');\n }\n else die('Invalid image format');\n\t }\n\t else{\n\t $update = $this->changeModel($id, $fname, $lname, $nick, $about, $eyes, $height, $biust, $waist, $hips, $shoes, $email, $phone, $address, $fb, $tw, $gp, $ln, $pin, $type);\n\t if($update > 0){\n \t header('Location: /model');\n exit;\n \t }\n \t else{\n \t echo 'Error updating model profile details';\n \t }\n\t }\n }", "public function saveAction()\n {\n $data = $this->getRequest()->getPost();\n if ($data) {\n try {\n if (isset($data['image']['delete'])) {\n $data['image'] = '';\n } else {\n unset($data['image']);\n\n if (isset($_FILES)) {\n if ($_FILES['image']['name']) {\n if ($this->getRequest()->getParam('id')) {\n $model = Mage::getModel('pugnet_uploader/images')->load($this->getRequest()->getParam('id'));\n if ($model->getData('image')) {\n $io = new Varien_Io_File();\n $io->rm(Mage::getBaseDir('media') . DS . implode(DS, explode('/', $model->getData('image'))));\n }\n }\n $path = Mage::getBaseDir('media') . DS . 'uploader' . DS . 'images' . DS;\n $uploader = new Varien_File_Uploader('image');\n $uploader->setAllowedExtensions(['jpg', 'png', 'gif']);\n $uploader->setAllowRenameFiles(false);\n $uploader->setFilesDispersion(false);\n $destFile = $path . $_FILES['image']['name'];\n $filename = $uploader->getNewFileName($destFile);\n $uploader->save($path, $filename);\n\n $data['image'] = 'uploader/images/' . $filename;\n }\n }\n }\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $this->_redirectReferer();\n }\n\n try {\n $model = Mage::getModel('pugnet_uploader/images')\n ->addData($data)\n ->setId($this->getRequest()->getParam('id'))\n ->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image was successfully saved'));\n Mage::getSingleton('adminhtml/session')->setItemsData(false);\n $this->_redirectReferer();\n\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setItemsData($this->getRequest()->getPost());\n $this->_redirectReferer();\n }\n }\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image has not been saved'));\n $this->_redirectReferer();\n }", "function generar_layout() {\r\n //Es imprescindible especificar la extension del archivo que estamos abriendo, caso contrario dicho\r\n //archivo no se puede abrir.\r\n// $ruta=\"C:/Users/Bruno/Desktop/mosaico_de_japon.png\";\r\n// print_r($ruta);\r\n \r\n //abrimos el achivo en modo lectura para transferir su contenido al archivo temporal\r\n// $fp= fopen($ruta, 'r');\r\n \r\n //obtenemos una ruta a un directorio temporal\r\n// $img=toba::proyecto()->get_www_temp('mosaico_de_japon.png');\r\n \r\n //abrimos el archivo temporal en modo escritura para guardar el contenido de $fp\r\n// $temp_fp= fopen($img['path'], 'w');\r\n //copiamos el contenido de $fp en $temp_fp\r\n// stream_copy_to_stream($fp, $temp_fp);\r\n //cerramos $temp_fp y $fp\r\n// fclose($temp_fp);\r\n// fclose($fp);\r\n// print_r($img);\r\n \r\n //imprimimos la imagen en la pantalla\r\n// echo \"<img src='{$img['url']}'>\";\r\n// ------------------------------------------------------------------------------------------------ \r\n \r\n //desactivamos la pantalla pant_edicion\r\n $this->controlador()->pantalla()->tab('pant_edicion')->desactivar();\r\n \r\n //recuperamos el id_aula almacenado en el arreglo $_SESSION\r\n $id_aula=toba::memoria()->get_dato_operacion(1);\r\n //print_r(\"Este es el id_aula en memoria : \".$id_aula);\r\n \r\n //cargarmos el datos tabla aula con un unico registro\r\n $this->controlador()->dep('datos')->tabla('aula')->cargar(array('id_aula' => $id_aula));\r\n \r\n //obtenemos el registro almacenado en el datos tabla, lo que nos interesa es poder utilizar el\r\n //atributo x_dbr_clave\r\n $aula=$this->controlador()->dep('datos')->tabla('aula')->get();\r\n \r\n //obtenemos el blob almacenado el la bd, usando el atributo x_dbr_clave\r\n $fp_imagen=$this->controlador()->dep('datos')->tabla('aula')->get_blob('imagen', $aula['x_dbr_clave']);\r\n \r\n if(isset($fp_imagen)){\r\n \r\n //creamos un nombre temporal para el archivo de imagen que vamos a mostrar por pantalla\r\n $temp_nombre= md5(uniqid(time()));\r\n \r\n //obtenemos path y url del archivo temporal\r\n $temp_archivo=toba::proyecto()->get_www_temp($temp_nombre);\r\n //print_r($temp_archivo);\r\n \r\n //abrimos el archivo temporal en modo escritura para guardar el blob que sacamos de la bd\r\n $fp= fopen($temp_archivo['path'], 'w');\r\n //copiamos el contenido del blob almacenado en la bd a nuestro archivo temporal\r\n stream_copy_to_stream($fp_imagen, $fp);\r\n //cerramos el archivo temporal\r\n fclose($fp);\r\n \r\n echo \"<div style='background-color:#C5C4CB;border:2px solid;margin-bottom:10px;'><p style='font-size:15px'>{$aula['ubicacion']}</p></div>\";\r\n //pegamos la imagen en la pantalla usando la url del archivo temporal\r\n echo \"<div ><img src='{$temp_archivo['url']}' width='750px' height='400px' id=1></div>\";\r\n \r\n //reseteamos el datos tabla para que el cursor no quede posicionado en el mismo registro. \r\n //Si esto ocurre, en la pantalla, vamos a visualizar siempre la misma imagen\r\n $this->controlador()->dep('datos')->tabla('aula')->resetear();\r\n }\r\n \r\n }", "function editImage()\n\t{\n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from product_images_table where type=\"sub\" and product_id='.$id;\n\t\t\t$query=new Bin_Query();\n\t\t\tif($query->executeQuery($sql))\n\t\t\t{\n\t\t\t\treturn Display_DManageProducts::editImage($query->records);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Display_DManageProducts::editImage(0);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public function editarUsuarioSinFoto($datos)\n {\n $id= (int)$datos[\"id\"];\n $stmt = Conexion::conectar()->prepare(\"UPDATE usuarios SET nombre=:nombre , apellido=:apellido,\n nombre_usuario=:nombre_usuario, password=:password,correo=:correo WHERE idUsuario=:id\");\n $stmt->bindParam(\":nombre\", $datos[\"nombre\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":apellido\", $datos[\"apellido\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":nombre_usuario\", $datos[\"user\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":password\", $datos[\"contrasena\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":correo\", $datos[\"correo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":id\", $id);\n if($stmt->execute()){\n return \"success\";\n }else{\n return \"error\";\n }\n $stmt->close();\n }", "public function registroAlumnoModel($data){\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO alumnos(matricula,nombre,apellidos, id_carrera, id_grupo, imagen) VALUES(:matricula, :nombre, :apellidos, :carrera, :id_grupo, :imagen)\");\n\t\t//preparacion de parametros\n\t\t$stmt->bindParam(\":matricula\", $data['matricula']);\n\t\t$stmt->bindParam(\":nombre\", $data['nombre']);\n\t\t$stmt->bindParam(\":apellidos\", $data['apellidos']);\n\t\t$stmt->bindParam(\":carrera\", $data['carrera']);\n\t\t$stmt->bindParam(\":id_grupo\", $data['id_grupo']);\n\t\t$stmt->bindParam(\":imagen\", $data['imagen']);\n\t\tif($stmt->execute()) //ejecucion\n\t\t\treturn \"success\"; //respuesta\n\t\telse{\n\t\t\t//echo print_r($stmt->errorInfo());\n\t\t\treturn \"error\";\n\t\t}\n\t\t$stmt->close();\n\t}", "public function actionActualiza_perfilApoderado() {\n// $idp = Yii::app()->user->id;\n\n $dniA = $_POST['dni'];\n $nombreA = $_POST['nombre'];\n $ap = $_POST['ap'];\n $am = $_POST['am'];\n $c = $_POST['celular'];\n $o = $_POST['ocupacion'];\n\n $distrito = $_POST['distrito'];\n $sector = $_POST['sector'];\n $direccion = $_POST['direccion'];\n $puntoReferencia = $_POST['preferencia'];\n $correo = $_POST['correo'];\n $infoColegio = $_POST['infocolegio'];\n $especiOcupacion = $_POST['especiocupacion'];\n $genero = $_POST['genero'];\n\n try {\n $command = Yii::app()->db->createCommand();\n //Actualizando datos...\n $command->UPDATE('apoderado', array(\n 'nombre' => $nombreA,\n 'apellidoP' => $ap,\n 'apellidoM' => $am,\n 'celular' => $c,\n 'ocupacion' => $o,\n 'domicilio' => $direccion,\n 'distrito' => $distrito,\n 'sector' => $sector,\n 'puntoreferencia' => $puntoReferencia,\n 'infocolegio' => $infoColegio,\n 'especiocupacion' => $especiOcupacion,\n 'correo' => $correo,\n 'genero' => $genero\n ), 'DNIapoderado=:DNIapoderado', array(':DNIapoderado' => $dniA));\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n echo 'ok';\n }", "public function actionCreate()\n {\n $model = new Presentacion();\n\n if ($model->load(Yii::$app->request->post())) {\n //var_dump($_POST);\n //exit();\n \n //Imagen de fondo\n $file = UploadedFile::getInstance($model, 'ruta');\n $ext = end((explode(\".\", $file->name)));\n $path = 'slide_index'.Yii::$app->security->generateRandomString().\".{$ext}\";\n $file->saveAs('uploads/' . $path);\n $model->ruta = $path;\n\n //Imagen left\n $file2 = UploadedFile::getInstance($model, 'ruta_img');\n $ext2 = end((explode(\".\", $file2->name)));\n $path2 = 'slide_index'.Yii::$app->security->generateRandomString().\".{$ext2}\";\n $file2->saveAs('uploads/' . $path2);\n $model->ruta_img = $path2;\n\n if($model->save()){\n return $this->redirect(['index']);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function supprimerImageMorphoAction()\n\t{\n\t\t$id_cons = $this->params()->fromPost('id_cons');\n\t\t$id = $this->params()->fromPost('id'); //numero de l'image dans le diapo\n\t\t$typeExamen = $this->params()->fromPost('typeExamen');\n\t\n\t\t/**\n\t\t * RECUPERATION DE TOUS LES RESULTATS DES EXAMENS MORPHOLOGIQUES\n\t\t*/\n\t\t $result = $this->demandeExamensTable()->recupererDonneesExamenMorpho($id_cons, $id, $typeExamen);\n\t\t/**\n\t\t * SUPPRESSION PHYSIQUE DE L'IMAGE\n\t\t*/\n\t\t unlink ( 'C:\\wamp\\www\\simens\\public\\images\\images\\\\' . $result['NomImage'] . '.jpg' );\n\t\t/**\n\t\t * SUPPRESSION DE L'IMAGE DANS LA BASE\n\t\t*/\n\t\t $this->demandeExamensTable()->supprimerImage($result['IdImage']);\n\t\n\t\t$this->getResponse()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html' );\n\t\treturn $this->getResponse ()->setContent(Json::encode ());\n\t}", "public function UpdateManga(){\r\n $this->idPost();\r\n $this->titlePost();\r\n $this->contentPost();\r\n $this->manga();\r\n $this->lastFileNamePost();\r\n // Testons si le fichier a bien été envoyé et s'il n'y a pas d'erreur\r\nif (isset($_FILES['file']) AND $_FILES['file']['error'] == 0){ \r\n // Testons si le fichier n'est pas trop gros\r\n if ($_FILES['file']['size'] <= 2000000)\r\n {\r\n \r\n unlink(\"public/images/manga/\" . $_POST['lastFileName']);\r\n \r\n $infosfichier = pathinfo($_FILES['file']['name']);// le'extention du fichier envoye .jpg etc\r\n \r\n $extension_upload = $infosfichier['extension'];//on le met dans un tableau\r\n \r\n $extensions_autorisees = array('jpg', 'jpeg', 'gif', 'png');// les extention qu'on acceptes\r\n \r\n\t\t $name = $infosfichier['filename'];// On recupere le nom du fichier envoye\r\n \r\n\t\t $file = 'Time' .time(). 'Name' .$name. '.' .$extension_upload;\r\n //Nom du fichier qu'on lui donne Time du moment + name + nom du fichier + extention\r\n \r\n // Testons si l'extension du fichier est egale a celle que l'on autorise\r\n if (in_array($extension_upload, $extensions_autorisees))\r\n {\r\n // On peut valider le fichier et le stocker définitivement\r\n move_uploaded_file($_FILES['file']['tmp_name'], 'public/images/manga/' . $file);\r\n }else{\t \r\n echo \"<script>alert(\\\"L'extension du fichier n'est pas autorisée. Seuls les fichiers jpg, jpeg, png sont acceptés.\\\")</script>\";\r\n}\r\n }else{\r\n echo \"<script>alert(\\\"Le fichier est trop volumineux (Poids limité à 4Mo)\\\")</script>\";\r\n\t\t}\r\n }else{\r\n $file = $this->_lastFileNamePostSecure;\r\n} \r\n $this->_mangaManager->updateManga($this->_idPostSecure, $this->_titlePostSecure, $this->_contentPostSecure, $file);\r\n \r\n header('location: GestionManga'); \r\n }", "public function actionCreate()\n {\n $model = new Usuario();\n $imageModel = new Imageupload();\n if ($model->load(Yii::$app->request->post())) {\n if($model->validate()){\n\n $model->save();\n\n $imageModel->image = UploadedFile::getInstance($imageModel,'image');\n \n $imageModel->image->saveAs('uploads/'.$model->legajo.'_'.$model->empresa. $imageModel->image->extension);\n\n $imageModel->upload();\n // file is uploaded successfully\n //$model->imageFile = 'dgfg';\n \n \n return $this->redirect(['view', 'id' => $model->id]);\n }else{\n return $this->render('create', [\n 'model' => $model,\n 'imageModel' => $imageModel,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'imageModel' => $imageModel,\n ]);\n }\n }", "public function promenaSlike(){\n $korisnik=$this->session->get('korisnik');\n \n \n //---------------- puzimanje ekstenzije slike\n $target_dir = \"../../public/uploads\";\n $target_file = $target_dir . basename($_FILES[\"profilna_slika\"][\"name\"]);\n $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));\n if($imageFileType != \"jpg\" && $imageFileType != \"jpeg\" && $imageFileType != \"jfif\") {\n return $this->prikaz('mojProfil', ['poruka'=>\"Dozvoljeni su samo JPG, JPEG i JFIF fajlovi\"]);\n }\n //----------\n \n $file = $this->request->getFile('profilna_slika');\n \n if (! $file->isValid())\n {\n return $this->prikaz('mojProfil', []);\n }\n \n //provera\n $korisnikModel1 = new KorisnikModel();\n $korisnikIzBaze = $korisnikModel1->find($korisnik->idKor);\n \n if (!empty($korisnikIzBaze->profilna_slika)) {\n unlink(\"../public/uploads/\".\"$korisnik->korisnicko_ime\".\"_profilna.jpg\");\n } //prvo obrisemo postojecu\n \n \n $path = $file->store('../../public/uploads',$korisnik->korisnicko_ime.\"_profilna.jpg\");\n \n $data = array(\n 'korisnicko_ime' => $korisnik->korisnicko_ime,\n 'slika' => $path\n );\n\n $korisnikModel = new KorisnikModel(); // First load the model\n $korisnikModel->update_photo($data);\n \n if($korisnikModel->update_photo($data)){ // call the method from the controller\n // update uspesan...\n return redirect()->to(site_url(\"Korisnik/mojProfil\"));\n }else{\n // update neuspesan...\n return $this->prikaz('mojProfil', ['poruka'=>\"Doslo je do grese pri promeni slike.\"]);\n }\n \n \n \n }", "function fotoalben() {\r\n if(isset($_POST['ansehen']))\r\n {\r\n $_SESSION['gid'] = $_POST['idvalue'];\r\n setValue('phpmodule', $_SERVER['PHP_SELF'].\"?id=\".__FUNCTION__);\r\n return runTemplate( \"../templates/showpic.htm.php\" );\r\n }\r\n \r\n if(isset($_POST['delete']))\r\n {\r\n $id = $_POST['iddelete'];\r\n db_delete_bilder($id);\r\n }\r\n \r\n if(isset($_POST['deleteg']))\r\n {\r\n $id = $_POST['idvalue'];\r\n db_delete_galerie($id);\r\n }\r\n \r\n // Template abfüllen und Resultat zurückgeben\r\n setValue('phpmodule', $_SERVER['PHP_SELF'].\"?id=\".__FUNCTION__);\r\n return runTemplate( \"../templates/fotoalben.htm.php\" );\r\n}", "public function produtoStore(Request $request, $id)\n {\n $model = Produto::find($id);\n \n // Carrega Imagens do SLIM\n $images = Slim::getImages();\n if (!isset($images[0])) {\n abort(500, 'Nenhuma imagem informada!');\n }\n $image = $images[0];\n \n // Se tipo for diferente de JPEG\n if ($image['input']['type'] != 'image/jpeg') {\n abort(500, 'Imagem deve ser um JPEG!');\n }\n \n // Salva para ganhar o ID\n $imagem = new Imagem();\n $imagem->save();\n \n // Grava nome do arquivo nas observacoes\n $arquivo = \"{$imagem->codimagem}.jpg\";\n $imagem->observacoes = $arquivo;\n $imagem->arquivo = $arquivo;\n $imagem->save();\n \n // Anexa imagem ao produto\n $ret = $model->ImagemS()->attach($imagem->codimagem);\n\n // Anexa imagem as variacoes sem imagem\n $sql = '\n update tblprodutovariacao\n set codprodutoimagem = (\n select i.codprodutoimagem \n from tblprodutoimagem i \n where i.codimagem = :codimagem\n and i.codproduto = tblprodutovariacao.codproduto \n ) \n where codprodutoimagem is null\n and codproduto = :codproduto \n ';\n DB::update($sql, [\n 'codimagem' => $imagem->codimagem,\n 'codproduto' => $model->codproduto\n ]);\n \n // Salva o arquivo\n Slim::saveFile($image['output']['data'], $arquivo, './public/imagens', false);\n \n // Se havia alguma imagem para inativar\n if($request->get('imagem')) {\n $imagem_inativa = Imagem::find($request->get('imagem'));\n $imagem_inativa->inativo = Carbon::now();\n $imagem_inativa->save();\n $model->ImagemS()->detach($request->get('imagem'));\n }\n \n // Redireciona\n Session::flash('flash_update', 'Imagem inserida.');\n return redirect(\"produto/$id\"); \n \n }", "function edit_image($id,$image) {\n\t\t\t\n\t\t\t$this->db->set('Picture',$image);\n\t\t\t$this->db->where('Id',$id);\n\t\t\t$this->db->update('User');\n\t\t}", "public function actionCompleteEditImage()\n\t{\n\t\t$saveThis = Image::model()->findByPk($_POST['Image']['imageid']);\n\n\t\t$saveableThings = Image::model()->allowedSaves();\n\t\t\n\t\t$tags=Image::model()->tags();\n\t\tforeach($tags as $tag)\n\t\t{\n\t\t\tif ($_POST['Image'][$tag] == true)\n\t\t\t{\n\t\t\t\t$_POST['Image'][$tag] = 'k';\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$_POST['Image'][$tag] = 'e';\n\t\t\t}\n\t\t}\n\t\t\n\t\t// parsing the date from the 3 input fields\n\t\t$saveThis->pvm = $this->parseDateInput($_POST['day'], $_POST['month'], $_POST['year']);\n\t\t\n\t\t/*\n\t\t * For details on this for loop structure and the contents of $saveableThings,\n\t\t * go see the actionSearch. This is copy pasted and modified from it.\n\t\t */\n\t\tfor($i=0;$i<count($saveableThings);$i++)\n\t\t{\t\n\t\t\tif (!is_null($_POST['Image'][$saveableThings[$i]]))\n\t\t\t{\n\t\t\t\t$saveThis->$saveableThings[$i] = $_POST['Image'][$saveableThings[$i]];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$saveThis->save();\n\t\t\n\t\t$this->actionBuildingSave($_POST['kohteet'], $saveThis->imageid, $saveThis->cd, $saveThis->id);\n\t\t\t\t\n\t\tif(isset($_GET['id']))\n\t\t{\n\t\t\t$this->renderPartial('_metadatabox',array(\n\t\t\t\t\t'dataProvider'=>$saveThis,\n\t\t\t\t\t'hideimage'=>true,\n\t\t\t\t),\n\t\t\t\tfalse, \t// \"whether the rendering result should be returned instead of being displayed ot end users\"\n\t\t\t\tfalse\t// \"whether the rendering result should be postprocessed using processOutput\"\n\t\t\t);\n\t\t\n\t\t\t$this->renderPartial('_imageControlBox',array(\n\t\t\t\t'dataProvider'=>$saveThis,\n\t\t\t)); \t\n\t\t\t\n\t\t}\n\t}" ]
[ "0.7508992", "0.72009486", "0.69476485", "0.6885894", "0.6820499", "0.6791899", "0.6761958", "0.67573035", "0.6748638", "0.6705417", "0.6534911", "0.6488294", "0.64874023", "0.6447541", "0.64415777", "0.64284414", "0.6417565", "0.6410309", "0.6359098", "0.6354334", "0.63167346", "0.6304342", "0.62978154", "0.6288671", "0.6283578", "0.6274776", "0.62667483", "0.6241885", "0.6230598", "0.62188613", "0.62149596", "0.6188092", "0.6166149", "0.6152616", "0.6150301", "0.6147317", "0.61448413", "0.6129936", "0.61274314", "0.61161745", "0.61156803", "0.61086434", "0.6095052", "0.60894513", "0.6086159", "0.6085777", "0.60847044", "0.6083246", "0.60822266", "0.60800123", "0.60709643", "0.60682464", "0.60676503", "0.6067414", "0.6062528", "0.60463566", "0.60451984", "0.6040627", "0.6039104", "0.603824", "0.60366076", "0.6033811", "0.603168", "0.6030651", "0.6028057", "0.6027973", "0.60275435", "0.6027301", "0.60264593", "0.60211", "0.60184294", "0.6017948", "0.6014943", "0.6012923", "0.60046697", "0.600321", "0.5987753", "0.59833527", "0.59829986", "0.59822273", "0.59812", "0.59726524", "0.5971621", "0.5970568", "0.5965275", "0.59597784", "0.59593683", "0.5957448", "0.59522384", "0.59489733", "0.5944179", "0.5943182", "0.59425277", "0.5942441", "0.59411174", "0.5940722", "0.59381425", "0.5936111", "0.59318954", "0.5931683" ]
0.6425257
16
Return an encrypted password hash we can use in the db rather than plaintext password
function getEncryptedPassword($password){ return password_hash($password, PASSWORD_DEFAULT ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetPasswordHash ();", "public function getHashedPassword(): string\n {\n return $this->getPassword();\n }", "public function getHashedPassword(){\n\n // query the database to get the users password\n // database instance\n $db = database::getPDOobject();\n\n // query\n $checkUser = $db->prepare('SELECT `password` FROM `users` WHERE BINARY `user_name` = BINARY :userName LIMIT 1');\n $checkUser->bindParam(':userName',$this->username);\n $checkUser->execute();\n $encyptedPassword = $checkUser->fetch()['password'];\n\n return $encyptedPassword;\n}", "public function GetPasswordHash() {\n return $this->passwdHash;\n }", "function _hash_password($password)\n {\n //return altered pw\n\n }", "function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\n\t}", "function twe_encrypt_password($plain) {\n\n $password=md5($plain);\n\n return $password;\n\n }", "public function encryptPassword($password) {\n return $this->crypto()->generateHash($password);\n }", "function hash_password($cleartext_password) {\n if (config\\HASHING_ALGORITHM == \"crypt\") {\n return crypt($cleartext_password, \"$1$\" . \\melt\\string\\random_hex_str(8) . \"$\");\n } else if (config\\HASHING_ALGORITHM == \"sha1\") {\n $salt = \\melt\\string\\random_hex_str(40);\n return $salt . sha1($salt . $cleartext_password, false);\n } else if (config\\HASHING_ALGORITHM == \"md5\") {\n $salt = \\melt\\string\\random_hex_str(32);\n return $salt . \\md5($salt . $cleartext_password, false);\n } else\n trigger_error(\"The configured hashing algorithm '\" . config\\HASHING_ALGORITHM . \"' is not supported.\", \\E_USER_ERROR);\n}", "public function getPass()\n {\n return password_hash($this->db->real_escape_string($this->pass), PASSWORD_BCRYPT, ['COST'=>4]);;\n }", "public function getPasswordHash() : string{\n \treturn $this->getConfig()->getAll()[\"passwordHash\"];\n }", "public static function encryptPassword($password) {\n return self::Crypto()->generateHash($password);\n }", "function makeHash($password) {\r\n return crypt($password, makeSalt());\r\n}", "function get_password_hash($password) {\n return crypt($password, \"$2a$07$\" . salt() . \"$\");\n}", "public function generateHash (string $password): string;", "protected function encryptPassword($password) \n {\n $passwordHash = password_hash($password, PASSWORD_BCRYPT, array('cost' => 12));\n \n return $passwordHash;\n }", "function HashPassword($input)\n{\n//Credits: http://crackstation.net/hashing-security.html\n//This is secure hashing the consist of strong hash algorithm sha 256 and using highly random salt\n$salt = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)); \n$hash = hash(\"sha256\", $salt . $input); \n$final = $salt . $hash; \nreturn $final;\n}", "function encript($password){\n\t$password_md5 = md5($password);\n\t$enc_password = crypt($password,$password_md5);\n\treturn $enc_password;\n}", "public function getHashedPassword()\n {\n return $this->password;\n }", "function getPasswordHash($password)\r\n {\r\n return ( hash( 'whirlpool', $password ) );\r\n }", "public function password() {\n return Hash::make('MonsterRXBOCS');\n }", "public static function makeEncrypt($password) {\n $password_hash = password_hash($password, PASSWORD_DEFAULT);\n return $password_hash;\n }", "protected function hashPassword() {\n\t\t$this->password = Password::hash($this->password);\n\t}", "public function getSecuredPassword();", "public function encode($pswd){\r\n $hash = password_hash($pswd, PASSWORD_DEFAULT);\r\n return $hash;\r\n }", "public function getPasswordHash() {\n return $this->password_hash;\n\n }", "public static function encryptPassword(string $password): string\n {\n return password_hash($password, PASSWORD_DEFAULT);\n }", "function getPasswordHash($password){\n\t\t$salt = $this->getPasswordSalt();\n\t\treturn $salt . ( hash('sha256', $salt . $password ) );\n\t}", "function getHashedPass($password, $salt)\n{\n $saltedPass = $password . $salt;\n return hash('sha256', $saltedPass);\n}", "function hashPassword($password) {\n $cost = 10;\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n $salt = sprintf(\"$2a$%02d$\", $cost) . $salt;\n return crypt($password, $salt);\n }", "public function encryptPass($password){\n if(!empty($password)){\n return password_hash($password, PASSWORD_DEFAULT);\n }\n }", "function generateEncryptedPassword($userinfo) {\r\n if (!class_exists('PasswordHash')) {\r\n require_once JFUSION_PLUGIN_PATH . DS . $this->getJname() . DS . 'PasswordHash.php';\r\n }\r\n $t_hasher = new PasswordHash(8, true);\r\n $check = $t_hasher->CheckPassword($userinfo->password_clear, $userinfo->password);\r\n\r\n if ($check) {\r\n //password is correct and return the phpbb3 password hash\r\n return $userinfo->password;\r\n } else {\r\n //no phpbb3 encryption used and return the phpbb2 password hash\r\n\t\t\t$password_old_format = addslashes($userinfo->password_clear);\r\n\r\n\t\t\tif ($t_hasher->CheckPassword($userinfo->password_clear, md5($this->utf8_to_cp1252($password_old_format)))) {\r\n\t\t\t\t//password is correct\r\n\t\t\t\treturn $userinfo->password;\r\n\t\t\t} elseif ($t_hasher->CheckPassword($userinfo->password_clear, md5($password_old_format))) {\r\n\t\t\t\t//password is correct\r\n\t\t\t\treturn $userinfo->password;\t\t\t\t\r\n\t\t\t} elseif (md5($this->utf8_to_cp1252($password_old_format)) === $userinfo->password) {\r\n\t\t\t\t//password is correct\r\n\t\t\t\treturn $userinfo->password;\t\t\t\t\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t//ah who cares lets just a md5 standar encryption\r\n\t\t\t\t$encrypt_password = md5($password_old_format);\r\n return $encrypt_password;\r\n\t\t\t}\t\t\t\t\r\n\r\n }\r\n }", "function cafet_generate_hashed_pwd(string $password): string\n {\n $salt = base64_encode(random_bytes(32));\n $algo = in_array(Config::hash_algo, hash_algos()) ? Config::hash_algo : 'sha256';\n \n return $algo . '.' . $salt . '.' . cafet_digest($algo, $salt, $password);\n }", "protected function encryptPassword($password) {\n\t\t// get the security service and hash\n\t\t$password = $this->getDI()\n\t\t\t->getSecurity()\n\t\t\t->hash($password);\n\n\t\treturn $password;\n\t}", "public function encryptPwd($pwd) {\r\n\t\t$passPhrase = SALT_PASS . $pwd;\r\n\t\t$sha512 = hash('sha512', $passPhrase);\r\n\t\treturn $sha512;\r\n\t}", "private static function _password($password, $hash)\n\t{\n\t\treturn md5(md5(md5($password)));\n\t}", "public function hash_pword($hashme){\n return password_hash($hashme, PASSWORD_BCRYPT);/* md5(sha1($hashme)) */;\n\n}", "public function hashPass($str)\n {\n // Phalcon's hashing system\n //return $this->_security->hash($str);\n\n // Using PHP5.5's built in system\n return password_hash($str, PASSWORD_DEFAULT, ['cost' => \\Phalcon\\DI::getDefault()->getShared('config')->auth->hash_workload]);\n }", "private function hashPass($password) {\n\t\t// Hash that password\n $hashed_password = password_hash(\"$password\", PASSWORD_DEFAULT);\n return $hashed_password;\n }", "public static function hashPassword($password){\n $config = App_DI_Container::get('ConfigObject');\n $module = strtolower(CURRENT_MODULE);\n return sha1($config->{$module}->security->passwordsalt . $password);\n //return sha1($password);\n }", "function passwordHash_admin($input_password){\n $pass_hash = password_hash($input_password, PASSWORD_DEFAULT);\n return($pass_hash);\n}", "public function getHash() {\n return md5($this->email . $this->getSalt() . $this->getPassword());\n }", "function hashPassword($password){\r\n\r\n\t$hash =password_hash($password,PASSWORD_DEFAULT);\r\n\treturn $hash;\r\n}", "function my_password_hash($password)\n{\n $salt = createSalt();\n $hash = md5($salt.$password);\n return array(\"hash\" => $hash, \"salt\" => $salt);\n}", "public function password() : ?string\n {\n return (isset($this->data['password_hash'])) ? $this->data['password_hash'] : null;\n }", "private function encryptPassword($password) {\r\n \r\n \r\n return $password;\r\n }", "public function getPassword()\n {\n $encrypted_pass = Mage::getStoreConfig('smsnotifier/main_conf/apipassword');\n\n return Mage::helper('core')->decrypt($encrypted_pass);\n\n }", "protected function encrypt($password)\n {\n \t# this is currently VERY bad encryption. Later on, I'll change it to work with bcrypt, which is way better.\n \treturn md5(sha1($password) . md5($password));\n }", "function get_config_password()\n\t{\n\t\tglobal $_CONFIG;\n\n\t\t$hash_salt = $_CONFIG->auth_hash_salt__or(WARP_DEFAULT_SALT);\n\t\treturn $_CONFIG->password_hashed ? $_CONFIG->admin_password : sha1($_CONFIG->admin_password.$hash_salt);\n\t}", "function external_hash_password($password)\n{\n $external_hasher = new PasswordHash(8, FALSE);\n\n return $external_hasher->HashPassword($password);\n}", "public function hash_user_pass($password) {\n\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n\n//PASSWORD_DEFAULT is a default function in PHP it contains BCRYPT algo at backend PHP is using BCRYPT currently\n//as it is most secure password hashing algorithm using today the term DEFAULT means that if another hashing algorithm is introduced in\n//future it will automatically updated to the library ny PHP so the developer has no need to update in the code.\n $hashing = password_hash($password.$salt, PASSWORD_DEFAULT);\n $hash = array(\"salt\" => $salt, \"hashing\" => $hashing);\n\n return $hash;\n\n}", "function hashit($password){\n\t$salt = config('password.salt');\n\t$salt = sha1( md5($password.$salt) );\n\treturn md5( $password.$salt );\n}", "function getPasswordHash($password,$salt){\n\t\treturn hash('sha256',$salt.$password);\n}", "public static function EncodePasswordToHash ($password = '', $options = []);", "function get_password_hash( $password )\r\n\t\t{\r\n\t\t\treturn hash_hmac( 'sha256', $password, 'c#haRl891', false );\r\n\t\t\t\r\n\t\t}", "public static function get_hashed_password($username) {\n $connection = DatabaseConnection::connection();\n $sql = \"SELECT password FROM users WHERE username=:username\";\n $statement = $connection->prepare($sql);\n $statement->execute(['username' => $username]);\n $result = $statement->fetch();\n return $result['password'];\n }", "function CreateHash($password){\n\t$salt = date('U'); //creates different password each time\n\t$pass = crypt($password, $salt);\n\treturn $pass;\n}", "public function getAuthPassword()\n\t{\n\t\treturn $this->crypted_password;\n\t}", "protected function encryptPassword($password)\n {\n if (!empty($password)) {\n return $this->security->hash($password);\n }\n return \"\";\n }", "function\nauth_hash($password, $salt = \"\")\n{\n // The password hash is crypt(\"password\", \"sha512-salt\")\n if ($salt == \"\")\n $salt = \"\\$6\\$\" . bin2hex(openssl_random_pseudo_bytes(8));\n\n return (crypt($password, $salt));\n}", "function cryptPasswordCrypt( $password, $key )\r\n{\r\n\treturn base64_encode( $password );\r\n}", "function wp_hash_password( $password ) {\n\t\t$cost = apply_filters( 'wp_hash_password_cost', 10 );\n\n\t\treturn password_hash( $password, PASSWORD_DEFAULT, [ 'cost' => $cost ] );\n\t}", "public function createHash($password){\r\n $options = [\r\n 'cost' => 10,\r\n ];\r\n $hash = password_hash($password, PASSWORD_DEFAULT, $options);\r\n return $hash;\r\n}", "public function cryptPass($password) {\n return CPasswordHelper::hashPassword($password);\n }", "public function hashPassword($password)\n { \t\n \treturn md5($password);\n\t}", "private function generate_pass()\n {\n echo password_hash('admin', PASSWORD_BCRYPT);\n }", "function crypt_password($password)\n {\n return util::cryptPassword($password);\n }", "function verifyHash($password, $hash) {\r\n return $hash == crypt($password, $hash);\r\n}", "protected function hashPassword($password)\n {\n return Hash::make($password);\n }", "public function getPassword(): string;", "public static function hash($password): string\n {\n return md5($password);\n }", "public function password() {\n return $this->db['password'];\n }", "public function hash($str)\n\t{\n\t\t// on some servers hash() can be disabled :( then password are not encrypted \n\t\tif (empty($this->config['hash_method']))\n\t\t\treturn $this->config['salt_prefix'].$str.$this->config['salt_suffix']; \n\t\telse\n\t\t\treturn hash($this->config['hash_method'], $this->config['salt_prefix'].$str.$this->config['salt_suffix']); \n\t}", "function getHashedPassword($pass){\n\t\t$newhashed= password_hash($pass,PASSWORD_DEFAULT);\n\t\treturn $newhashed;\n\t}", "public function getAuthPassword()\n {\n \treturn $this->getGuarded('password');\n }", "public function hashPassword(string $password) : string\n {\n return $this->encoder->encodePassword(new User(), $password);\n }", "function gethashpass($password,$salt,$timestamp) {\n\t\t\t$ps = $password.$salt;\n\t\t\t$joinps = md5($ps);\n\t\t\t$timehash = md5($timestamp);\n\t\t\t$joinallstr = $joinps.$timehash;\n\t\t\t$hashpass = md5($joinallstr);\n\t\t\t$encodepass = substr(base64_encode($hashpass),0,32);\n\t\t\treturn $encodepass;\n\t\t}", "private function cryptPassword($pass)\n {\n //hasher le mot de passe\n //https://www.php.net/manual/fr/function.openssl-encrypt\n\n return openssl_encrypt($pass, \"AES-128-ECB\", SECRETKEY);\n }", "function salt_and_encrypt($password) {\n\t$hash_format=\"$2y$10$\";\n\t$salt_length=22;\n\t$salt=generate_salt($salt_length);\n\t$format_and_salt=$hash_format.$salt;\n\t$hash=crypt($password,$format_and_salt);\t\n\treturn $hash;\n}", "public function encryptPassword($password) {\n\t\treturn sha1($password);\n\t}", "private function encryptPassword($password, $salt) {\n\t\treturn hash('sha256', strrev($GLOBALS[\"random1\"] . $password . $salt . 'PIZZAPHP'));\n\t}", "function encryptWithAppSecret($password)\n{\n return hash_hmac('sha256', $password, env('APP_HASH'));\n}", "public function password_encrypt($password) {\n\t\treturn $password;\n\t}", "function hash_password($password){\n\t// Hashing options\n\t$options = [\n 'cost' => 12,\t// Cost determines the work required to brute-force\n //'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),\n\t];\n\n\treturn password_hash($password, PASSWORD_BCRYPT, $options);\n}", "public function Password($password)\r\n {\r\n return password_hash($password, PASSWORD_DEFAULT);\r\n }", "function nthash($password = \"\") {\n return strtoupper(bin2hex(mhash(MHASH_MD4, iconv(\"UTF-8\", \"UTF-16LE\", $password))));\n }", "public function getPassword()\n {\n return base64_decode($this->clave);\n }", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function hashPassword(string $password) : string {\n return password_hash($password, PASSWORD_DEFAULT);\n }", "public function hashPassword($string)\n {\n return crypt($string, self::CREDENTIALS_SALT);\n }", "protected function getConfiguredPassword() {}", "public static function createHashPassword($originalPassword, $passwordSalt)\r\n {\r\n return md5(substr($passwordSalt,3,23).md5($originalPassword).md5(USER_PASSWORD_SALT));\r\n }", "public function hashPassword($password)\t{\n\t\treturn crypt($password, $this->generateSalt());\n\t}", "protected function hashPassword($password = false) {\n\t if (!function_exists('__hash')) {\n\t\t\t$this->load->helper('auth');\n\t\t}\n\t\tif ($password === false) {\n\t return false;\n\t }\n\t\treturn __hash($password,$this->config->item('password_crypt'));\n\t}" ]
[ "0.7281959", "0.71484715", "0.71249187", "0.7095988", "0.7093895", "0.70756304", "0.706168", "0.7059311", "0.69757086", "0.69672954", "0.6942945", "0.6918917", "0.69110096", "0.6900126", "0.68480164", "0.683222", "0.6828834", "0.6814981", "0.6801565", "0.67780596", "0.6760846", "0.67451215", "0.6741649", "0.6723346", "0.67009", "0.66915804", "0.6688466", "0.66599154", "0.6656816", "0.6645416", "0.66256076", "0.6608181", "0.65936744", "0.65858346", "0.6585501", "0.65833104", "0.65628093", "0.65503144", "0.6546116", "0.6538636", "0.65134776", "0.6506328", "0.6499337", "0.64915335", "0.64877397", "0.6483126", "0.6480004", "0.64738256", "0.6471602", "0.6466274", "0.6465952", "0.64641774", "0.64545935", "0.6448237", "0.6443304", "0.644038", "0.64330995", "0.6426985", "0.6415754", "0.6414349", "0.6414178", "0.64088774", "0.6408701", "0.6399329", "0.6399022", "0.6391176", "0.63909644", "0.6387083", "0.6385847", "0.6367982", "0.6365475", "0.63643944", "0.6363903", "0.63604474", "0.6359832", "0.63589376", "0.6357914", "0.63536584", "0.6353088", "0.6352049", "0.6346848", "0.6346503", "0.6342076", "0.6341768", "0.634169", "0.63387406", "0.63276416", "0.6327233", "0.6327233", "0.6327233", "0.6327233", "0.6327233", "0.6327233", "0.6327233", "0.63265485", "0.63255405", "0.63223785", "0.6318807", "0.63172215", "0.6313638" ]
0.7629254
0
get a state dropdown ex: echo get_state_dropdown($_REQUEST['state'], "name", "id", "class";)
function get_state_dropdown($selected, $name='state', $id='state', $class='' ){ $stateselect = "<select name='{$name}' id='{$id}' class='{$class}'>"; $stateselect .= "<option value=''>Select a State</option>" . "<option value='AL' state='AL' ". ($selected == 'AL' ? 'selected' : '') .">Alabama</option>" . "<option value='AK' state='AK' ". ($selected == 'AK' ? 'selected' : '') .">Alaska</option>" . "<option value='AZ' state='AZ' ". ($selected == 'AZ' ? 'selected' : '') .">Arizona</option>" . "<option value='AR' state='AR' ". ($selected == 'AR' ? 'selected' : '') .">Arkansas</option>" . "<option value='CA' state='CA' ". ($selected == 'CA' ? 'selected' : '') .">California</option>" . "<option value='CO' state='CO' ". ($selected == 'CO' ? 'selected' : '') .">Colorado</option>" . "<option value='CT' state='CT' ". ($selected == 'CT' ? 'selected' : '') .">Connecticut</option>" . "<option value='DE' state='DE' ". ($selected == 'DE' ? 'selected' : '') .">Delaware</option>" . "<option value='DC' state='DC' ". ($selected == 'DC' ? 'selected' : '') .">District Of Columbia</option>" . "<option value='FL' state='FL' ". ($selected == 'FL' ? 'selected' : '') .">Florida</option>" . "<option value='GA' state='GA' ". ($selected == 'GA' ? 'selected' : '') .">Georgia</option>" . "<option value='HI' state='HI' ". ($selected == 'HI' ? 'selected' : '') .">Hawaii</option>" . "<option value='ID' state='ID' ". ($selected == 'ID' ? 'selected' : '') .">Idaho</option>" . "<option value='IL' state='IL' ". ($selected == 'IL' ? 'selected' : '') .">Illinois</option>" . "<option value='IN' state='IN' ". ($selected == 'IN' ? 'selected' : '') .">Indiana</option>" . "<option value='IA' state='IA' ". ($selected == 'IA' ? 'selected' : '') .">Iowa</option>" . "<option value='KS' state='KS' ". ($selected == 'KS' ? 'selected' : '') .">Kansas</option>" . "<option value='KY' state='KY' ". ($selected == 'KY' ? 'selected' : '') .">Kentucky</option>" . "<option value='LA' state='LA' ". ($selected == 'LA' ? 'selected' : '') .">Louisiana</option>" . "<option value='ME' state='ME' ". ($selected == 'ME' ? 'selected' : '') .">Maine</option>" . "<option value='MD' state='MD' ". ($selected == 'MD' ? 'selected' : '') .">Maryland</option>" . "<option value='MA' state='MA' ". ($selected == 'MA' ? 'selected' : '') .">Massachusetts</option>" . "<option value='MI' state='MI' ". ($selected == 'MI' ? 'selected' : '') .">Michigan</option>" . "<option value='MN' state='MN' ". ($selected == 'MN' ? 'selected' : '') .">Minnesota</option>" . "<option value='MS' state='MS' ". ($selected == 'MS' ? 'selected' : '') .">Mississippi</option>" . "<option value='MO' state='MO' ". ($selected == 'MO' ? 'selected' : '') .">Missouri</option>" . "<option value='MT' state='MT' ". ($selected == 'MT' ? 'selected' : '') .">Montana</option>" . "<option value='NE' state='NE' ". ($selected == 'NE' ? 'selected' : '') .">Nebraska</option>" . "<option value='NV' state='NV' ". ($selected == 'NV' ? 'selected' : '') .">Nevada</option>" . "<option value='NH' state='NH' ". ($selected == 'NH' ? 'selected' : '') .">New Hampshire</option>" . "<option value='NJ' state='NJ' ". ($selected == 'NJ' ? 'selected' : '') .">New Jersey</option>" . "<option value='NM' state='NM' ". ($selected == 'NM' ? 'selected' : '') .">New Mexico</option>" . "<option value='NY' state='NY' ". ($selected == 'NY' ? 'selected' : '') .">New York</option>" . "<option value='NC' state='NC' ". ($selected == 'NC' ? 'selected' : '') .">North Carolina</option>" . "<option value='ND' state='ND' ". ($selected == 'ND' ? 'selected' : '') .">North Dakota</option>" . "<option value='OH' state='OH' ". ($selected == 'OH' ? 'selected' : '') .">Ohio</option>" . "<option value='OK' state='OK' ". ($selected == 'OK' ? 'selected' : '') .">Oklahoma</option>" . "<option value='OR' state='OR' ". ($selected == 'OR' ? 'selected' : '') .">Oregon</option>" . "<option value='PA' state='PA' ". ($selected == 'PA' ? 'selected' : '') .">Pennsylvania</option>" . "<option value='RI' state='RI' ". ($selected == 'RI' ? 'selected' : '') .">Rhode Island</option>" . "<option value='SC' state='SC' ". ($selected == 'SC' ? 'selected' : '') .">South Carolina</option>" . "<option value='SD' state='SD' ". ($selected == 'SD' ? 'selected' : '') .">South Dakota</option>" . "<option value='TN' state='TN' ". ($selected == 'TN' ? 'selected' : '') .">Tennessee</option>" . "<option value='TX' state='TX' ". ($selected == 'TX' ? 'selected' : '') .">Texas</option>" . "<option value='UT' state='UT' ". ($selected == 'UT' ? 'selected' : '') .">Utah</option>" . "<option value='VT' state='VT' ". ($selected == 'VT' ? 'selected' : '') .">Vermont</option>" . "<option value='VA' state='VA' ". ($selected == 'VA' ? 'selected' : '') .">Virginia</option>" . "<option value='WA' state='WA' ". ($selected == 'WA' ? 'selected' : '') .">Washington</option>" . "<option value='WV' state='WV' ". ($selected == 'WV' ? 'selected' : '') .">West Virginia</option>" . "<option value='WI' state='WI' ". ($selected == 'WI' ? 'selected' : '') .">Wisconsin</option>" . "<option value='WY' state='WY' ". ($selected == 'WY' ? 'selected' : '') .">Wyoming</option>" . "</select>"; return $stateselect; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CB_STATES($vState = NULL) \r\n{ \r\n\t$dataSet=\"\"; \r\n\t$DBconn=\"\"; \r\n\t$stateRS=\"\"; \r\n\t$lb=\"\"; \r\n\t$statearr=GetAllStates(); \r\n\t$lb=\"<select name='textState' size='1'>\"; \r\n\twhile(list($key,$val)=each($statearr)){ \r\n\t\t$lb=$lb . \"<option value='$key'\"; \r\n\t\tif (!is_null($vState)) \r\n\t\t\tif (trim($vState)==trim($key)) $lb=$lb . \" Selected \"; \r\n \t$lb=$lb . \">$val</option>\"; \r\n\t} //end while \r\n\t$lb = $lb . \"</Select>\"; \r\n\treturn $lb; \r\n}", "public function action_getlist_state() {\n $package = Model::factory('package');\n $output = '';\n $country_id = arr::get($_REQUEST, 'country_id');\n $state_id = arr::get($_REQUEST, 'state_id');\n\n $getmodel_details = $package->getstate_details($country_id);\n\n if (isset($country_id)) {\n\n $count = count($getmodel_details);\n if ($count > 0) {\n\n /* $output .='<select name=\"state\" id=\"state\" onchange=change_city_drop(\"\",\"\",\"\") class=\"form_control required\" title=\"'.__('select_the_state').'\">\n <option value=\"\">--Select--</option>'; */\n\n $output .= '<label>State</label><select class=\"form_control\" name=\"state\" id=\"state\" onchange=\"change_city_drop();\"><option>Select state</option>';\n\n foreach ($getmodel_details as $modellist) {\n $output .= '<option value=\"' . $modellist[\"state_id\"] . '\"';\n if ($state_id == $modellist[\"state_id\"]) {\n $output .= 'selected=selected';\n }\n $output .= '>' . $modellist[\"state_name\"] . '</option>';\n }\n\n $output .= '</select>';\n } else {\n $output .= '<label>State</label><select class=\"form_control\" name=\"state\" id=\"state\" onchange=\"change_city_drop();\"><option>Select state</option>';\n }\n }\n echo $output;\n exit;\n }", "public function state_options()\n\t{\n\t\t$states = ee()->db\n\t\t\t\t->where('country_id', 233)\n\t\t\t\t->get('store_states');\n\n\t\t$output = '<option value=\"\">--Select State--</option>' . \"\\n\";\n\n\t\tforeach($states->result() as $state)\n\t\t{\n\t\t\tif($state->code == ee()->TMPL->fetch_param('state_code'))\n\t\t\t{\n\t\t\t\t$selected = ' selected=\"selected\"';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$selected = '';\n\t\t\t}\n\n\t\t\t$output .= '<option value=\"' . $state->code . '\"' . $selected . ' >' . $state->name . '</option>' . \"\\n\";\n\n\t\t}\t\t\n\n\t\treturn $output;\n\t}", "public function getStateList($state='') {\n\t\t$states = array(\"AL\", \"AK\", \"AZ\", \"AR\", \"CA\", \"CO\", \"CT\", \"DC\", \"DE\", \"FL\", \"GA\", \"HI\", \"ID\", \"IL\", \"IN\", \"IA\", \"KS\", \"KY\", \"LA\", \"ME\", \"MD\", \"MA\", \"MI\", \"MN\", \"MS\", \"MO\", \"MT\", \"NE\", \"NV\", \"NH\", \"NJ\", \"NM\", \"NY\", \"NC\", \"ND\", \"OH\", \"OK\", \"OR\", \"PA\", \"RI\", \"SC\", \"SD\", \"TN\", \"TX\", \"UT\", \"VT\", \"VA\", \"WA\", \"WV\", \"WI\", \"WY\");\n\t\t\n\t\t$options = '';\n\t\tforeach ($states as $eachState) {\n\t\t\t$selected = ($state == $eachState) ? ' selected=\"selected\"' : '';\n\t\t\t\n\t\t\t$options .= '<option value=\"'. $eachState .'\"'. $selected .'>'. $eachState .\"</option>\\n\";\n\t\t}\n\t\treturn $options;\n\t}", "public function getStateList()\n\t{\n\t\t$country_id = $this->input->post('country_id');\n\t\t$state_list = $this->company_details_model->getStateListByCountryId($country_id);\n\n\t\t$html = '';\n\t\tif(count($state_list) > 0)\n\t\t{\n\t\t\tforeach ($state_list as $s_list) \n\t\t\t{\n\t\t\t\t$html .= '<option value=\"'.$s_list->state_id.'\">'.$s_list->state_name.'</option>';\n\t\t\t}\n\t\t\t\n\t\t\techo $html; \n\t\t}\n\t\telse\n\t\t{\n\t\t\techo $html;\n\t\t}\n\t}", "function state_select($selected_code='', $default_abbr='', $country_code='', $select_name='state_code', $class='')\n\t{\n\t\t$CI =& get_instance();\n\t\t\n\t\tif (empty($country_code))\n\t\t\t$country_code = $CI->session->userdata('country') ? $CI->session->userdata('country') : 'US';\n\t\n\t\t// First, grab the states from the config\n\t\t//$all_states = config_item('address.states');\t\t\n\t\t$CI->load->model('localization/region_model');\n\t\t$states = $CI->region_model->find_all_by('country_iso', $country_code);\n\n\t\t// Get the states for the selected country\n\t\t//$states = $all_states[$country_code];\n\t\t$class = ( !empty($class) && $class != '' ) ? ' class=\"' . $class . '\" ' : '';\n\t\t\n\t\t$output = '<select name=\"'. $select_name . '\" id=\"' . $select_name . '\" ' . $class . ' >' . PHP_EOL;\t\t\n\t\tif (is_array($states) && count($states)) {\n\t\t\t$output .= '<option '.(empty($selected_code) ? ' selected=\"selected\"' : '').' value=\"\">&nbsp;</option>' . PHP_EOL;\n\t\t\tforeach ($states as $state)\n\t\t\t{\n\t\t\t\t$output .= \"<option value='{$state->id}'\";\n\t\t\t\t$output .= ($state->id == $selected_code) ? ' selected=\"selected\"' : '';\n\t\t\t\t$output .= \">{$state->name}</option>\\n\";\n\t\t\t}\n\t\t} else {\n\t\t\t$output .= '<option '.(empty($selected_code) ? ' selected=\"selected\"' : '').' value=\"\">'. lang('bf_select_no_state').'</option>' . PHP_EOL;\n\t\t}\n\t\t$output .= \"</select>\\n\";\n\n\t\treturn $output;\n\n\t}", "public function actionGet_states(){\n if (isset($_POST['country_id']) != 0) {\n $output = '';\n $country_id = $_POST['country_id'];\n $att_name = $_POST['att_name'];\n $all_states = DvStates::find()->where(['country_id' => $country_id])->all();\n $allstates = ArrayHelper::map($all_states, 'id', 'name');\n if ($att_name == 'DvRegistration[country]') {\n $output .= '<select id=\"dvusers-state\" class=\"form-control\" name=\"DvRegistration[state]\" required=\"required\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select State\">';\n } else {\n $output .= '<select id=\"dvusers-state\" class=\"form-control\" name=\"usermeta[state]\" required=\"required\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select State\">';\n }\n $output .= '<option value=\"\">Select State</option>';\n foreach ($allstates as $id => $name) {\n $output .= '<option value=\"' . $id . '\">' . $name . '</option>';\n }\n $output .= '</select>';\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }", "public function actionGetstate($id)\n\t{\n\t\t$rows = \\app\\models\\State::find()->where(['state_country_id' => $id,'is_status'=>0])->all();\t \n\t\techo \"<option value=''>\".Yii::t('app', '--- Select State ---').\"</option>\";\t \n\t\tif(count($rows)>0){\n\t\t foreach($rows as $row){\n\t\t echo \"<option value='$row->state_id'>$row->state_name</option>\";\n\t\t }\n\t\t}\n\t\telse{\n\t\t echo \"\";\n\t\t} \n \t}", "function getDropDown() ;", "public function us_states() \n\t{\n\t\t// include file with predefined lists\n\t\tinclude PATH_THIRD.'select_tag/includes/predefined_lists.php';\n\t\n\t\t// collect params, false if not provided\n\t\t$value_format = $this->EE->TMPL->fetch_param('value_format', 'short');\n\t\t\n\t\t// start building our output\n\t\t$output = $this->_open_tag();\n\t\t$options = $this->_default_option();\n\t\t\n\t\t// build our options\n\t\tif($value_format == 'long') {\n\t\t\tforeach($us_states as $short => $long) {\n\t\t\t\t$options .= '<option value=\"'.$long.'\">'.$long.'</option>';\n\t\t\t}\n\t\t} else {\n\t\t\tforeach($us_states as $short => $long) {\n\t\t\t\t$options .= '<option value=\"'.$short.'\">'.$long.'</option>';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$output .= $options . '</select>';\n\t\treturn $output;\n\t}", "public function list_states($state_abbr) {\n\t\t$sql = \"SELECT `state`,`state_abbr` FROM `state` ORDER BY `state` ASC\";\n $result = $this->new_mysql($sql);\n while ($row = $result->fetch_assoc()) {\n\t\t\tif ($row['state_abbr'] == $state_abbr) {\n\t\t\t\t$option .= \"<option selected value=\\\"$row[state_abbr]\\\">$row[state]</option>\";\n\t\t\t} else {\n\t\t\t\t$option .= \"<option value=\\\"$row[state_abbr]\\\">$row[state]</option>\";\n\t\t\t}\n\t\t}\n\t\treturn($option);\n\t}", "public function get_state($id=0){\n $states = State::where('country_id', $id)->orderBy('name', 'asc')->get();\n $output = '';\n if(count($states)>0){\n $output .= '<option value=\"\">Select state</option>';\n foreach($states as $state){\n $output .='<option '. (Session::get('state') == $state->id ? \"selected\" : \"\" ).' value=\"'.$state->id.'\">'.$state->name.'</option>';\n }\n }\n echo $output;\n }", "function getStatesOfCntry($country_id,$customer_id=null,$post_back_state_id=null){\t\r\n\t\t$this->db->select('id,title,is_default');\r\n\t\t$this->db->where(array('mst_countries_id'=>$country_id,'is_active'=>true));\r\n\t\t$this->db->order_by('title','asc');\r\n\t\t$recordSet = $this->db->get(TBL_MST_STATES);\r\n\t\t$states=$recordSet->result();\r\n\t\t\r\n\t/*\tif($customer_id!=''){\r\n\t\t\t$this->db->select('mst_states_id');\r\n\t\t\t$this->db->where(array('id'=>$customer_id));\r\n\t\t\t$recordSet = $this->db->get(TBL_CUSTOMERS);\r\n\t\t\t$data=$recordSet->result();\r\n\t\t\t$state_customer=$data[0]->mst_states_id;\r\n\t\t\tforeach($states as $row){\r\n\t\t\t\tif($state_customer==$row->id){\r\n\t\t\t\t\techo $xmlinner=\"<option value='$row->id' selected='selected'>$row->title</option>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}*/\r\n\t\techo $xmlinner=\"<option value=''>Please Select State</option>\";\r\n\t\tforeach($states as $row){\r\n\t\t\tif($row->id==$post_back_state_id){\r\n\t\t\t\t$selected='selected=selected';\r\n\t\t\t}else{\r\n\t\t\t\t$selected='';\r\n\t\t\t}\r\n\t\t\techo $xmlinner=\"<option value='$row->id' $selected>$row->title</option>\";\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "public function actionGetorgstate($id)\n\t{\n\t\t$rows = \\app\\models\\State::find()->where(['country_id' => $id,'is_status'=>0])->ALL();\t\n\t\techo Html::tag('option', Html::encode(Yii::t('app', '--- Select State ---')), ['value'=>'']); \n\t\tforeach($rows as $row)\n\t\t\techo Html::tag('option',Html::encode($row->state_name), ['value'=>$row->state_id]); \n \t}", "function get_list_states($preselect = null){\n $states = array('AL'=>\"Alabama\",\n 'AK'=>\"Alaska\",\n 'AZ'=>\"Arizona\",\n 'AR'=>\"Arkansas\",\n 'CA'=>\"California\",\n 'CO'=>\"Colorado\",\n 'CT'=>\"Connecticut\",\n 'DE'=>\"Delaware\",\n 'DC'=>\"District Of Columbia\",\n 'FL'=>\"Florida\",\n 'GA'=>\"Georgia\",\n 'HI'=>\"Hawaii\",\n 'ID'=>\"Idaho\",\n 'IL'=>\"Illinois\",\n 'IN'=>\"Indiana\",\n 'IA'=>\"Iowa\",\n 'KS'=>\"Kansas\",\n 'KY'=>\"Kentucky\",\n 'LA'=>\"Louisiana\",\n 'ME'=>\"Maine\",\n 'MD'=>\"Maryland\",\n 'MA'=>\"Massachusetts\",\n 'MI'=>\"Michigan\",\n 'MN'=>\"Minnesota\",\n 'MS'=>\"Mississippi\",\n 'MO'=>\"Missouri\",\n 'MT'=>\"Montana\",\n 'NE'=>\"Nebraska\",\n 'NV'=>\"Nevada\",\n 'NH'=>\"New Hampshire\",\n 'NJ'=>\"New Jersey\",\n 'NM'=>\"New Mexico\",\n 'NY'=>\"New York\",\n 'NC'=>\"North Carolina\",\n 'ND'=>\"North Dakota\",\n 'OH'=>\"Ohio\",\n 'OK'=>\"Oklahoma\",\n 'OR'=>\"Oregon\",\n 'PA'=>\"Pennsylvania\",\n 'RI'=>\"Rhode Island\",\n 'SC'=>\"South Carolina\",\n 'SD'=>\"South Dakota\",\n 'TN'=>\"Tennessee\",\n 'TX'=>\"Texas\",\n 'UT'=>\"Utah\",\n 'VT'=>\"Vermont\",\n 'VA'=>\"Virginia\",\n 'WA'=>\"Washington\",\n 'WV'=>\"West Virginia\",\n 'WI'=>\"Wisconsin\",\n 'WY'=>\"Wyoming\");\n foreach ($states as $key=>$val) {\n if ($preselect == $key) {\n $selected = 'selected';\n } else {\n $selected = null;\n }\n echo '<option value=\"' . $key . '\" ' . $selected . '>' . $val . '</option>';\n }\n }", "public function load_states()\n {\n if (!$this->input->is_ajax_request()) {\n show_404();\n exit;\n }\n $data = $this->ajax_model->load_state();\n if($this->input->post('isSelected'))\n {\n $selected = ' selected=\"selected\" ';\n }\n else\n {\n $selected = '';\n }\n $op = '<option value=\"0\">انتخاب کنید...</option>';\n if($data AND is_array($data) AND count($data) > 0)\n {\n for($i = 0; $i < count($data); $i++)\n {\n if($this->input->post('isSelected') == $data[$i]['id'])\n {\n $op .= '<option value=\"' . $data[$i]['id'] . '\"' . $selected . '>' . $data[$i]['name'] . '</option>';\n }\n else\n {\n $op .= '<option value=\"' . $data[$i]['id'] . '\">' . $data[$i]['name'] . '</option>';\n }\n }\n }\n \n echo $op;\n }", "public function actionGetCodeDropdowns()\n\t{\t\t\n\t\ttry\n\t\t{\n\t\t\t//set db target\n\t\t\tStateCode::setClient(BaseActiveController::urlPrefix());\n\t\t\t\n\t\t\t// RBAC permission check\n\t\t\tPermissionsController::requirePermission('stateCodeGetDropdown');\n\t\t\n\t\t\t$codes = StateCode::find()\n\t\t\t\t->all();\n\t\t\t$namePairs = [null => \"None\"];\n\t\t\t$tempPairs = [];\n\t\t\t$codesSize = count($codes);\n\t\t\t\n\t\t\tfor($i=0; $i < $codesSize; $i++)\n\t\t\t{\n\t\t\t\t$namePairs[$codes[$i]->StateNames]= $codes[$i]->StateNumber . \": \" . $codes[$i]->StateNames ;\n\t\t\t}\n\t\t\t$namePairs = $namePairs + $tempPairs;\t\t\t\t\n\t\t\t\n\t\t\t$response = Yii::$app ->response;\n\t\t\t$response -> format = Response::FORMAT_JSON;\n\t\t\t$response -> data = $namePairs;\n\t\t\t\n\t\t\treturn $response;\n\t\t}\n\t\tcatch(\\Exception $e) \n\t\t{\n\t\t\tthrow new \\yii\\web\\HttpException(400);\n\t\t}\n\t}", "public function dropDownPostStatus($selected = \"\")\n{\n \n $name = 'post_status';\n \n $posts_status = array('publish' => 'Publish', 'draft' => 'Draft');\n \t\n if ($selected != '') {\n \n $selected = $selected;\n\n }\n \t\n return dropdown($name, $posts_status, $selected);\n \t\n}", "function getFieldPortalAddressState($val = null){\n\t\tinclude('axcelerate_link_array_list.php');\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_state');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_state');\n\t\t$tooltip = setToolTipNotification(\"state\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('state') === 'state' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><select name='state' id='sel_state1' class='srms-field \".(get_axl_req_fields('state') === 'state' ? 'input-select-required' : '').\"'><option value=''>-- Select -- </option>\";\n\t\t\tforeach ($states as $key => $value) {\n\t\t\t\t$form_ret .= \"<option value='\".$key.\"' \".($val == $value ? 'selected' : '').\">\".$value.\"</option>\";\n\t\t\t}\n\t\t\t$form_ret .= \"</select></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "function getCitiesOfState($state_id,$post_back_city_id=null){\t\t\r\n\t\t$this->db->select('id,title');\r\n\t\t$this->db->where(array('mst_states_id'=>$state_id,'is_active'=>true));\r\n\t\t$this->db->where(array(TBL_MST_CITIES.'.added_by'=>ADMIN_NAME));\r\n\t\t$this->db->order_by('title','asc');\r\n\t\t$recordSet = $this->db->get(TBL_MST_CITIES);\r\n\t\t$cities=$recordSet->result();\r\n\r\n\t\techo $xmlinner=\"<option value=''>Please Select City</option>\";\r\n\t\tforeach($cities as $row){\r\n\t\t\tif($row->id==$post_back_city_id){\r\n\t\t\t\t$selected='selected=selected';\r\n\t\t\t}else{\r\n\t\t\t\t$selected='';\r\n\t\t\t}\r\n\t\t\techo $xmlinner=\"<option value='$row->id' $selected>$row->title</option>\";\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "function currSelection()\n{\n\tif(isset($_GET['p_drop']))\n\t\techo \"Municipality\";\n\telse if(isset($_GET['o_drop']))\n\t\techo \"District\";\n\telse if(isset($_GET['m_drop']))\n\t\techo \"Township\";\n\telse\n\t\techo \"Province\";\n}", "function getFieldStreetAddressState($val = null){\n\t\tinclude('axcelerate_link_array_list.php');\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_sstate');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_sstate');\n\t\t$tooltip = setToolTipNotification(\"sstate\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('sstate') === 'sstate' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><select name='sstate' id='sel_state2' class='srms-field \".(get_axl_req_fields('sstate') === 'sstate' ? 'input-select-required' : '').\"'><option value=''>-- Select -- </option>\";\n\t\t\tforeach ($states as $key => $value) {\n\t\t\t\t$form_ret .= \"<option value='\".$key.\"' \".($val == $value ? 'selected' : '').\">\".$value.\"</option>\";\n\t\t\t}\n\t\t\t$form_ret .= \"</select></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "function doc_get_state_box($checkedval = 'xzxz', $removedval = '') {\n //echo \"remove: \" . $removedval . \"<br />\";\n\t$sql_statement = \"select * from doc_states where stateid not in ($removedval)\";\n\t//echo \"sql: \" . $sql_statement . \"<br />\";\n\tif (!empty($removedval)) {\n\t\t//$res_states = db_query_params('select * from doc_states where stateid not in ($1)', array($removedval));\n\t\t$res_states = db_query_params($sql_statement, array());\n\t} else {\n\t\t$res_states = db_query_params('select * from doc_states', array());\n\t}\n\techo html_build_select_box($res_states, 'stateid', $checkedval, false);\n}", "public function getDropDown() {}", "public function getDropDown() {}", "function _field_state_select($fval) \n {\n $abbrs = (!isset($this->attribs) or !isset($this->attribs['abbrs']) or $this->attribs['abbrs'] != false);\n if (isset($this->attribs) and isset($this->attribs['canada'])) {\n $this->opts = $this->get_states_opts($abbrs) + $this->get_canadian_provs($abbrs);;\n }\n else {\n $this->opts = $this->get_states_opts($abbrs);\n }\n return $this->_field_select($fval);\n }", "function getStatesOfCntryAgent($country_id,$agent_id=null){\t\t\r\n\t\t$this->db->select('id,title');\r\n\t\t$this->db->where(array('mst_countries_id'=>$country_id));\r\n\t\t$this->db->order_by('title','asc');\r\n\t\t$recordSet = $this->db->get(TBL_MST_STATES);\r\n\t\t$states=$recordSet->result();\r\n\t\t\r\n\t\tif($agent_id!=''){\r\n\t\t\t$this->db->select('mst_states_id');\r\n\t\t\t$this->db->where(array('id'=>$agent_id));\r\n\t\t\t$recordSet = $this->db->get(TBL_AGENTS);\r\n\t\t\t$data=$recordSet->result();\r\n\t\t\t$state_agent=$data[0]->mst_states_id;\r\n\t\t\tforeach($states as $row){\r\n\t\t\t\tif($state_agent==$row->id){\r\n\t\t\t\t\techo $xmlinner=\"<option value='$row->id' selected='selected'>$row->title</option>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\techo $xmlinner=\"<option value=''>Please Select State</option>\";\r\n\t\tforeach($states as $row){\r\n\t\t\techo $xmlinner=\"<option value='$row->id'>$row->title</option>\";\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "function build_dropdown ($name = false, $class=\"\", $default=0)\n {\n // Start building the tree from the top branch\n\n $options = $this->_dropdown_branch($default);\n\n // Return output\n if ($name)\n {\n \t$return = '<select name=\"'.$name . '\"';\n \t$return .= ( empty( $class ) ) ? '>' : ' class=\"' . $class . '\">';\n \t$return .= $options.'</select>';\n return $return;\n }\n else\n {\n return $options;\n } \n }", "public function getStates($id)\n {\n $result = $this->country->with(['states'])->find($id); \n $stateList = '<option value=\"\">Select State</option>';\n if(!empty($result->states)){\n foreach($result->states as $state){\n $stateList .= '<option value=\"'.$state->id.'\">'.$state->state_name.'</option>';\n }\n }\n return $stateList;\n //return response()->json($result);\n //echo \"<pre>\"; print_r($result->states); die;\n //return view('destination.index', ['data' => $result]);\n }", "public function dropdown()\n {\n $building_id = \\Request::get('building_id');\n return \\App\\Floor::where('building_id', $building_id)->lists('name','id');\n }", "function getstate_get(){\n\n $countryID = $this->uri->segment(4);\n\n $countryID = isset($countryID) ? $countryID : \"\";\n\n if ($countryID == FALSE) {\n $response = array(\n 'status' => FALSE,\n 'message' => 'Country id should not be empty.'\n );\n $this->response($response, REST_Controller::FIELD_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n \n $from = 'states';\n $where = array('country_id' => $countryID);\n $select = '*';\n $records = 2;\n\n $states = $this->base_model->getCommon($from, $where, $select, $records);\n\n if ($states) {\n \n $response = array(\n 'status' => TRUE,\n 'message' => 'States found successfully.',\n 'result' => $states);\n\n $this->set_response($response, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code \n }else{\n $response = array(\n 'status' => FALSE,\n 'message' => 'Country not found.');\n $this->response($response, REST_Controller::FIELD_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n }", "function make_regions_dropdown($search_name='',$cat_id=0){\n\t\t$locations\t\t\t\t=$this->get_locations();\n\t\t$home_location\t\t\t=$_SESSION['home_location'];\n\t\t$available_locations\t=array($home_location->location_id=>\"All \".$home_location->name);\n\t\t//---------------------------------------------------\n\t\tswitch($search_name){\n\t\t\tcase 'businesses':\n\t\t\tcase 'categories':\n\t\t\t\t$business=$this->cls('admin/class/business','external');\n\t\t\t\t$s=query(\"SELECT * FROM business_tbl WHERE failte <> -1\");\n\t\t\t\twhile($one=fetch_object($s)){\n\t\t\t\t\t$continue=true;\n\t\t\t\t\t$one->categories\t=$business->load_business_categories($one->business_id);\n\t\t\t\t\t$one->locations\t\t=$business->load_business_locations($one->business_id);\n\t\t\t\t\tif($cat_id){ //if category specified, then filter\n\t\t\t\t\t\tif(isset($one->categories[$cat_id])){\n\t\t\t\t\t\t\t$continue=true;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$continue=false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($continue){\n\t\t\t\t\t\tforeach($one->locations as $location_id=>$loc){\n\t\t\t\t\t\t\t$available_locations[$location_id]=$locations[$location_id];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t//$this->debug($search_name.\" = \".$cat_id);\n\t\t//$this->writelog();\n\t\t//---------------------------------------------------\n\t\t$form=$this->mod(\"form\")->form_style('block');\n\t\t$form->element(\"location_id\",array(\"db\"=>1,\"type\"=>\"SELECT\",\"label\"=>\"Location\",\"style\"=>\"width:230px;\",\"data\"=>$available_locations));\n\t\t$form->draw();\n\t\t$html=$form->elements[\"location_id\"]->elem;\n\t\t$html=str_replace(\"<br/>\",\"\",$html);\n\t\t//---------------------------------------------------\n\t\treturn $html;\n\t}", "function get_state_options_by_country($country) {\r\n\r\n /* $states = [\"India\" =>[ \"Tamil Nadu\",\"Kerala\", \"Andra Pradesh\" , \"Telungana\", \"Karnataka\"]];\r\n $options = $states[$country]; \r\n\treturn $options; */\r\n}", "function empty_city_dropdown_select()\n\t{\n\t\t$empty_select = '<select name=\"cityID\" class=\"chosen-select\" data-placeholder=\"Select City/Town\" style=\"width: 300px; display: none;\">';\n\t\t$empty_select_closed = '</select>';\n\t\t//GET THE ID OF THE LISTING USING URI\n\t\t$listingID = $this->uri->segment(4);\n\t\t\n\t\t//LOAD GCRUD AND GET THE STATE\n\t\t$crud = new grocery_CRUD();\n\t\t$state = $crud->getState();\n\t\t\n\t\t//CHECK FOR A URI VALUE AND MAKE SURE ITS ON THE EDIT STATE\n\t\tif(isset($listingID) && $state == \"edit\") {\n\t\t\t//GET THE STORED STATE ID\n\t\t\t$this->db->select('stateID, cityID')\n\t\t\t\t\t ->from('customers')\n\t\t\t\t\t ->where('customerNumber', $listingID);\n\t\t\t$db = $this->db->get();\n\t\t\t$row = $db->row(0);\n\t\t\t$stateID = $row->stateID;\n\t\t\t$cityID = $row->cityID;\n\t\t\t\n\t\t\t//GET THE CITIES PER STATE ID\n\t\t\t$this->db->select('*')\n\t\t\t\t\t ->from('city')\n\t\t\t\t\t ->where('stateID', $stateID);\n\t\t\t$db = $this->db->get();\n\t\t\t\n\t\t\t//APPEND THE OPTION FIELDS WITH VALUES FROM THE STATES PER THE COUNTRY ID\n\t\t\tforeach($db->result() as $row):\n\t\t\t\tif($row->city_id == $cityID) {\n\t\t\t\t\t$empty_select .= '<option value=\"'.$row->city_id.'\" selected=\"selected\">'.$row->city_title.'</option>';\n\t\t\t\t} else {\n\t\t\t\t\t$empty_select .= '<option value=\"'.$row->city_id.'\">'.$row->city_title.'</option>';\n\t\t\t\t}\n\t\t\tendforeach;\n\t\t\t\n\t\t\t//RETURN SELECTION COMBO\n\t\t\treturn $empty_select.$empty_select_closed;\n\t\t} else {\n\t\t\t//RETURN SELECTION COMBO\n\t\t\treturn $empty_select.$empty_select_closed;\t\n\t\t}\n\t}", "public function manage_state($operation = \"\", $id = \"\", $stateId = \"\") {\n $this->load->model('State_model');\n if ($operation == \"getAll\") {\n return $this->State_model->getAll();\n } else if ($operation == \"getByCountryId\") {\n $str = \"<option value='0'>Select State</option>\";\n foreach ($this->State_model->getStateByCountryId($id) as $value) {\n $selected = '';\n if ($stateId != \"\" && $value['id'] == $stateId) {\n $selected = 'selected=\"selected\"';\n }\n $str .= \"<option value='\" . $value['id'] . \"' \" . $selected . \">\" . $value['name'] . \"</option>\";\n }\n echo $str;\n return;\n }\n }", "function select_states($country_id = '', $value = '') \n {\n $locale_model = model('App\\Models\\LocaleModel', false);\n $locale = $locale_model->fetch_states(['country_id' => $country_id]); \n\n $options = '';\n \n foreach($locale AS $state) \n {\n if(mb_strtolower($value) == mb_strtolower($state['name'])) \n {\n $selected = ' selected=\"selected\"';\n } \n else \n {\n $selected = '';\n }\n\n $options .= '\n <option value=\"'.$state['name'].'\" id=\"'.$state['id'].'\"'.$selected.'>\n '.$state['name'].\n '</option>';\n }\n return $options; \n }", "function fetch_city($state_id){\n \n\t if(!empty($state_id)){\n\t\t $state_ids=explode(',',$state_id);\n\t }\n $this->db->where_in('state_id', $state_ids);\n\t\t$this->db->where('status','1');\n $this->db->order_by('city_name', 'ASC');\n $query = $this->db->get('cities');\n\t\t//echo $this->db->last_query();die;\n if($query->num_rows()>0){\n $output = '';\n\t\t$output .= '<option value=\"\">Select</option>';\n foreach($query->result() as $row){\n //pr($row);die;\n\t\t\t\n $output .= '<option value=\"'.$row->id.'\">'.$row->city_name.'</option>';\n }\n }else{\n\t\t\t$output .= '<option value=\"\">No city found</option>';\n\t\t}\n return $output;\n }", "public function select_city_country_id()\n {\n $country_id = $this->input->post('country_id',TRUE);\n $states = $this->Customers->select_city_country_id($country_id);\n\n $html = \"\";\n if ($states) {\n $html .= \"<select class=\\\"form-control select2 width_100p\\\" id=\\\"country\\\" name=\\\"country\\\">\n\t\t\t\t\t<option value=\\\"\\\">\" . display('select_one') . \"</option>\";\n foreach ($states as $state) {\n $html .= \"<option value='\" . $state->name . \"'>\" . $state->name . \"</option>\";\n }\n $html .= \"</select>\";\n }\n echo $html;\n }", "public function select_city_country_id()\n\t{\n\t\t$country_id = $this->input->post('country_id');\n\t\t$states = $this->Customers->select_city_country_id($country_id);\n\n\t\t$html =\"\";\n\t\tif ($states) {\n\t\t\t$html .=\"<select class=\\\"form-control select2\\\" id=\\\"country\\\" name=\\\"country\\\" style=\\\"width: 100%\\\">\n\t\t\t\t\t<option value=\\\"\\\">\".display('select_one').\"</option>\";\n\t\t\tforeach ($states as $state) {\n $html .=\"<option value='\".$state->name.\"'>\".$state->name.\"</option>\";\n\t\t\t}\n\t\t\t$html .=\"</select>\";\n\t\t}\n\t\techo $html;\n\t}", "function fsf_cms_getStatsPages_dropDown()\n {\n $fsfcms_api_options = array();\n $fsfcms_api_options['apiFile'] = \"fsf.cms.getStatsPages.php\";\n\n $fsfcms_stats_pages_json = fsf_cms_accessAPI($fsfcms_api_options);\n $fsfcms_stats_pages = json_decode($fsfcms_stats_pages_json,TRUE);\n \n if(array_pop($fsfcms_stats_pages) == 200)\n {\n $fsfcms_statsPages_select .= \"<select name=\\\"statsPages\\\" onchange=\\\"self.location.href=this.options[this.selectedIndex].value;\\\">\";\n $fsfcms_statsPages_select .= \"<option value=\\\"\\\">SELECT AN OPTION...</option>\";\n\n foreach($fsfcms_stats_pages as $fsfcms_page_name => $fsfcms_page_slug)\n {\n $fsfcms_statsPages_select .= \"<option value=\\\"/statistics/\" . $fsfcms_page_slug . \"\\\">\" . strtoupper($fsfcms_page_name) . \"</option>\"; \n }\n $fsfcms_statsPages_select .= \"</select>\";\n }\n \n return $fsfcms_statsPages_select; \n }", "function get_smash_dropdown($dbc, $selectedid) {\n\t#Create a query to get the character name and id from the smash table\n\t$query = 'SELECT character_name, id FROM smash ORDER BY id ASC' ;\n\n\t#Execute the query\n\t$results = mysqli_query($dbc, $query );\n\tcheck_results($results);\n\t\n\t#Show results\n\tif($results)\n\t{\n \t\t#For each row result, output a selection box choice\n \t\twhile ( $row = mysqli_fetch_array( $results , MYSQLI_ASSOC ) )\n \t\t{\n\t\t\tif($row['id']==$selectedid)\n\t\t\t\techo '<option value=\"'.$row['id'].'\" selected>'.$row['character_name'].'</option>';\n\t\t\telse\n\t\t\t\techo '<option value=\"'.$row['id'].'\">'.$row['character_name'].'</option>';\n \t\t}\n\n \t\t#Free up the results in memory\n \t\tmysqli_free_result( $results ) ;\n\t}\n}", "function getNationalityDropdownList($name, $initVal=\"\", $js=\"\") {\n $dList = \"<SELECT id=\\\"$name\\\" name=\\\"$name\\\" $js class=\\\"select\\\"><option value=\\\"\\\">Select from List</option>\";\n $dList.=\"<option value=\\\"British\\\">British</option>\";\n $nationalities = $this->getDBRecords(\"select label as name,value as id from nationality order by label\");\n for ($i = 0; $i < count($nationalities); $i++) {\n\n if (rtrim($initVal) == rtrim($nationalities[$i][\"id\"])) {\n $sel = \"selected\";\n }\n else\n $sel=null;\n $dList.= \"<option $sel value=\\\"\" . rtrim($nationalities[$i][\"id\"]) . \"\\\">\" . $nationalities[$i][\"name\"] . \"</option>\";\n }\n $dList.= \"</SELECT>\";\n\n return $dList;\n }", "function qa_load_state()\n{\n\tglobal $qa_state;\n\n\t$qa_state = qa_get('state');\n\tunset($_GET['state']); // to prevent being passed through on forms\n}", "function stateList(){\n\t$stateList = array( 'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', \n\t\t\t\t\t 'District Of Columbia', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', \n\t\t\t\t\t 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', \n\t\t\t\t\t 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', \n\t\t\t\t\t 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', \n\t\t\t\t\t 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', \n\t\t\t\t\t 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming' );\n\n\treturn $stateList;\n}", "public function state_list(){\n $country_id = $_REQUEST['country_id'];\n $state_list = $this->User_Model->get_list_by_id2('state_id, country_id, state_name','country_id',$country_id,'state');\n if($state_list){\n $response[\"status\"] = TRUE;\n $response[\"state_list\"] = $state_list;\n } else {\n $response[\"status\"] = FALSE;\n $response[\"state_list\"] = $state_list;\n }\n\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public static function get_states_select($ipaddress = null, $select = true, $allow_null = true)\n {\n\n $selected = ' selected=\"selected\"';\n $options = '';\n $hide_empty = false;\n $states_array = array();\n $sel_state = '';\n\n $args = array(\n 'type' => 'any',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => $hide_empty,\n 'hierarchical' => 1,\n 'exclude' => '',\n 'include' => '',\n 'number' => '',\n 'taxonomy' => 'custom_geo_us_state',\n 'pad_counts' => false\n\n );\n $states_category = get_categories($args);\n if (!empty($states_category)) {\n foreach ($states_category as $state_cat) {\n $states_array[$state_cat->slug] = $state_cat->name;\n }\n } else {\n $states_array = self::$us_states_array;\n }\n\n if ($select === true || empty($select)) {\n if (!isset($_SESSION['region_code'])) {\n $sel_state = self::get_instance()->region_code;\n } else {\n $sel_state = $_SESSION['region_code'];\n }\n } elseif (in_array($select, $states_array) || array_key_exists(strtolower($select), $states_array)) {\n $sel_state = $select;\n } elseif ($allow_null) {\n $options = '<option disabled=\"disabled\"' . $selected . '>-- By Location --</option>';\n } else {\n $sel_state = 'wa';\n $selected = \"\";\n }\n $options .= '<option value=\"all\">All locations</option>';\n foreach ($states_array as $abbr => $state) {\n $options .= '<option value=\"' . strtolower($abbr) . '\"' . ((strtolower($abbr) == strtolower($sel_state) || strtolower($state) == strtolower($sel_state)) ? $selected : '') . '>' . $state . '</option>';\n }\n return '<select name=\"location\">' . $options . '</select>';\n }", "public function state($province=null)\n {\n\n $tblProvince = new App_Model_Db_Table_State();\n $row = $tblProvince->fetchAll();\n\n $select_province = \"<select name=\\\"province\\\" id=\\\"province\\\">\\n\";\n if ($province) {\n $rowProvince = $tblProvince->find($province)->current();\n $select_province .= \"<option value='$rowProvince->pid' selected>$rowProvince->pname</option>\";\n $select_province .= \"<option value =''>Choose:</option>\";\n } else {\n $select_province .= \"<option value ='' selected>Choose:</option>\";\n }\n\n foreach ($row as $rowset) {\n if (($province) and ($rowset->pid == $rowProvince->pid)) {\n continue;\n } else {\n $select_province .= \"<option value='$rowset->pid'>$rowset->pname</option>\";\n }\n }\n\n $select_province .= \"</select>\\n\\n\";\n return $select_province;\n }", "public static function listStates($selected=\"TX\",$prefix=\"\")\n\t{\n\t\tif(strlen($prefix)){\n\t\t\t$prefix .= \"_\";\n\t\t}\n\t\t$states = array(\n\t\t\t\t\t\t\"AL\" => \"Alabama\",\n\t\t\t\t\t\t\"AK\" => \"Alaska\",\n\t\t\t\t\t\t\"AZ\" => \"Arizona\",\n\t\t\t\t\t\t\"AR\" => \"Arkansas\",\n\t\t\t\t\t\t\"CA\" => \"California\",\n\t\t\t\t\t\t\"CO\" => \"Colorado\",\n\t\t\t\t\t\t\"CT\" => \"Connecticut\",\n\t\t\t\t\t\t\"DE\" => \"Delaware\",\n\t\t\t\t\t\t\"DC\" => \"District of Columbia\",\n\t\t\t\t\t\t\"FL\" => \"Florida\",\n\t\t\t\t\t\t\"GA\" => \"Georgia\",\n\t\t\t\t\t\t\"HI\" => \"Hawaii\",\n\t\t\t\t\t\t\"ID\" => \"Idaho\",\n\t\t\t\t\t\t\"IL\" => \"Illinois\",\n\t\t\t\t\t\t\"IN\" => \"Indiana\",\n\t\t\t\t\t\t\"IA\" => \"Iowa\",\n\t\t\t\t\t\t\"KS\" => \"Kansas\",\n\t\t\t\t\t\t\"KY\" => \"Kentucky\",\n\t\t\t\t\t\t\"LA\" => \"Louisiana\",\n\t\t\t\t\t\t\"ME\" => \"Maine\",\n\t\t\t\t\t\t\"MD\" => \"Maryland\",\n\t\t\t\t\t\t\"MA\" => \"Massachusetts\",\n\t\t\t\t\t\t\"MI\" => \"Michigan\",\n\t\t\t\t\t\t\"MN\" => \"Minnesota\",\n\t\t\t\t\t\t\"MS\" => \"Mississippi\",\n\t\t\t\t\t\t\"MO\" => \"Missouri\",\n\t\t\t\t\t\t\"MT\" => \"Montana\",\n\t\t\t\t\t\t\"NE\" => \"Nebraska\",\n\t\t\t\t\t\t\"NV\" => \"Nevada\",\n\t\t\t\t\t\t\"NH\" => \"New Hampshire\",\n\t\t\t\t\t\t\"NJ\" => \"New Jersey\",\n\t\t\t\t\t\t\"NM\" => \"New Mexico\",\n\t\t\t\t\t\t\"NY\" => \"New York\",\n\t\t\t\t\t\t\"NC\" => \"North Carolina\",\n\t\t\t\t\t\t\"ND\" => \"North Dakota\",\n\t\t\t\t\t\t\"OH\" => \"Ohio\",\n\t\t\t\t\t\t\"OK\" => \"Oklahoma\",\n\t\t\t\t\t\t\"OR\" => \"Oregon\",\n\t\t\t\t\t\t\"PA\" => \"Pennsylvania\",\n\t\t\t\t\t\t\"PR\" => \"Puerto Rico\",\n\t\t\t\t\t\t\"RI\" => \"Rhode Island\",\n\t\t\t\t\t\t\"SC\" => \"South Carolina\",\n\t\t\t\t\t\t\"SD\" => \"South Dakota\",\n\t\t\t\t\t\t\"TN\" => \"Tennessee\",\n\t\t\t\t\t\t\"TX\" => \"Texas\",\n\t\t\t\t\t\t\"UT\" => \"Utah\",\n\t\t\t\t\t\t\"VT\" => \"Vermont\",\n\t\t\t\t\t\t\"VA\" => \"Virginia\",\n\t\t\t\t\t\t\"WA\" => \"Washington\",\n\t\t\t\t\t\t\"WV\" => \"West Virginia\",\n\t\t\t\t\t\t\"WI\" => \"Wisconsin\",\n\t\t\t\t\t\t\"WY\" => \"Wyoming\"\n\t\t);\n\n\t\tforeach($states as $value => $label){\n\t\t\t$values[] = $value;\n\t\t\t$labels[] = $label;\n\t\t}\n\t\treturn FormComponent::selectList($prefix.\"state\",$values,$labels,$selected,$prefix.\"state\");\n\t}", "function get_all_states()\n{\n\t\t$states = array(\n\t\t\t\"Alabama\" => \"Alabama\",\n\t\t\t\"Alaska\" => \"Alaska\",\n\t\t\t\"Arizona\" => \"Arizona\",\n\t\t\t\"Arkansas\" => \"Arkansas\",\n\t\t\t\"California\" => \"California\",\n\t\t\t\"Colorado\" => \"Colorado\",\n\t\t\t\"Connecticut\" => \"Connecticut\",\n\t\t\t\"Delaware\" => \"Delaware\",\n\t\t\t\"District of Columbia\" => \"District of Columbia\",\n\t\t\t\"Florida\" => \"Florida\",\n\t\t\t\"Georgia\" => \"Georgia\",\n\t\t\t\"Hawaii\" => \"Hawaii\",\n\t\t\t\"Idaho\" => \"Idaho\",\n\t\t\t\"Illinois\" => \"Illinois\",\n\t\t\t\"Indiana\" => \"Indiana\",\n\t\t\t\"Iowa\" => \"Iowa\",\n\t\t\t\"Kansas\" => \"Kansas\",\n\t\t\t\"Kentucky\" => \"Kentucky\",\n\t\t\t\"Louisiana\" => \"Louisiana\",\n\t\t\t\"Maine\" => \"Maine\",\n\t\t\t\"Maryland\" => \"Maryland\",\n\t\t\t\"Massachusetts\" => \"Massachusetts\",\n\t\t\t\"Michigan\" => \"Michigan\",\n\t\t\t\"Minnesota\" => \"Minnesota\",\n\t\t\t\"Mississippi\" => \"Mississippi\",\n\t\t\t\"Missouri\" => \"Missouri\",\n\t\t\t\"Montana\" => \"Montana\",\n\t\t\t\"Nebraska\" => \"Nebraska\",\n\t\t\t\"Nevada\" => \"Nevada\",\n\t\t\t\"New Hampshire\" => \"New Hampshire\",\n\t\t\t\"New Jersey\" => \"New Jersey\",\n\t\t\t\"New Mexico\" => \"New Mexico\",\n\t\t\t\"New York\" => \"New York\",\n\t\t\t\"North Carolina\" => \"North Carolina\",\n\t\t\t\"North Dakota\" => \"North Dakota\",\n\t\t\t\"Ohio\" => \"Ohio\",\n\t\t\t\"Oklahoma\" => \"Oklahoma\",\n\t\t\t\"Oregon\" => \"Oregon\",\n\t\t\t\"Pennsylvania\" => \"Pennsylvania\",\n\t\t\t\"Rhode island\" => \"Rhode island\",\n\t\t\t\"South Carolina\" => \"South Carolina\",\n\t\t\t\"South Dakota\" => \"South Dakota\",\n\t\t\t\"Tennessee\" => \"Tennessee\",\n\t\t\t\"Texas\" => \"Texas\",\n\t\t\t\"Utah\" => \"Utah\",\n\t\t\t\"Vermont\" => \"Vermont\",\n\t\t\t\"Virgin Islands\" => \"Virgin Islands\",\n\t\t\t\"Virginia\" => \"Virginia\",\n\t\t\t\"Washington\" => \"Washington\",\n\t\t\t\"West Virginia\" => \"West Virginia\",\n\t\t\t\"Wisconsin\" => \"Wisconsin\",\n\t\t\t\"Wyoming\" => \"Wyoming\",\n\t\t\t\"Alberta\" => \"Alberta\",\n\t\t\t\"Nova Scotia\" => \"Nova Scotia\",\n\t\t\t\"British Columbia\" => \"British Columbia\",\n\t\t\t\"Ontario\" => \"Ontario\",\n\t\t\t\"Manitoba\" => \"Manitoba\",\n\t\t\t\"Prince Edward Island\" => \"Prince Edward Island\",\n\t\t\t\"New Brunswick\" => \"New Brunswick\",\n\t\t\t\"Quebec\" => \"Quebec\",\n\t\t\t\"Newfoundland\" => \"Newfoundland\",\n\t\t\t\"Saskatchewan\" => \"Saskatchewan\",\n\t\t\t\"Northwest Territories\" => \"Northwest Territories\",\n\t\t\t\"Yukon Territory\" => \"Yukon Territory\",\n\t\t\t\"Nunavut\" => \"Nunavut\",\n\t\t\t\"American Samoa\" => \"American Samoa\",\n\t\t\t\"Guam\" => \"Guam\",\n\t\t\t\"Marshall Islands\" => \"Marshall Islands\",\n\t\t\t\"Micronesia (Federated States of)\" => \"Micronesia (Federated States of)\",\n\t\t\t\"Palau\" => \"Palau\",\n\t\t\t\"Puerto Rico\" => \"Puerto Rico\",\n\t\t\t\"U.S. Minor Outlying Islands\" => \"U.S. Minor Outlying Islands\",\n\t\t\t\"Northern Mariana Islands\" => \"Northern Mariana Islands\",\n\t\t\t\"Armed Forces Africa\" => \"Armed Forces Africa\",\n\t\t\t\"Armed Forces Americas AA (except Canada)\" => \"Armed Forces Americas AA (except Canada)\",\n\t\t\t\"Armed Forces Canada\" => \"Armed Forces Canada\",\n\t\t\t\"Armed Forces Europe AE\" => \"Armed Forces Europe AE\",\n\t\t\t\"Armed Forces Middle East AE\" => \"Armed Forces Middle East AE\",\n\t\t\t\"Armed Forces Pacific AP\" => \"Armed Forces Pacific AP\",\n\t\t\t\"Foreign\" => \"Foreign\",\n\t\t\t\"Others Not Listed above\" => \"Others Not Listed above\"\n\t\t);\n\treturn $states;\n}", "function\tdropdown_list($dbconn) {\n\t$sqlcom=\"select distinct spec_id,name from info;\";\n\t$dbres = pg_exec($dbconn, $sqlcom );\n\tif ( ! $dbres ) {echo \"Error : \" + pg_errormessage( $dbconn ); exit();} \n\t$row=0;\n\t$rowmax=pg_NumRows($dbres);\n\tprint \"<form method=\\\"post\\\" action=\\\"libSpec.php\\\"><select name=\\\"organism\\\" onchange=\\\"this.form.submit();\\\">\\n<option value=\\\"select\\\">Select an organism...</option>\\n\"; \n\twhile ($row<$rowmax) {\n\t $do = pg_Fetch_Object($dbres, $row);\n\t $name=$do->name;\n\t print \"<option value=\\\"$name\\\">$name</option>\\n\";\n\t $row++;\n\t}\n\tprint(\"</select></form>\\n\\n\");\n}", "function getStatesList()\n\t\t{\n\t\t\t$sSQL\t=\t\"select abbr , name from tbl_states\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\t\n\t\t\t$stateList = array();\n\t\t\t\n\t\t\twhile($row = $response->FetchRow())\n\t\t\t{\t\t\t\n\t\t\t\t$arr['abbr'] = $row['abbr'];\n\t\t\t\t$arr['name'] = $row['name'];\n\t\t\t\t$stateList[] = $arr;\n\t\t\t}\n\t\t\t\n\t\t\treturn $stateList;\t\t\t\n\t\t}", "function getIsoByState($state)\n{\n\tif (!empty($state) && is_string($state))\n\t{\n\t\t$tbl = _DB_PREFIX_.'state';\n\t\t$q = \"SELECT * from $tbl WHERE iso_code ='$state'\";\n\t\t$q = Db::getInstance()->ExecuteS($q);\n\t\tif (!empty($q))\n\t\t{\n\t\t\t$id = $q[0]['id_state'];\n\t\t\treturn ($id);\n\t\t}\n\t}\n\treturn '';\n}", "public function generate_order_states_html()\n {\n $this->log(' [Info] Entered generate_order_states_html()...');\n\n ob_start();\n\n $bp_statuses = array(\n 'new'=>'New Order',\n 'paid'=>'Paid',\n 'confirmed'=>'Confirmed',\n 'complete'=>'Complete',\n 'invalid'=>'Invalid',\n 'expired'=>'Expired',\n 'event_invoice_paidAfterExpiration'=>'Paid after expiration',\n 'event_invoice_expiredPaidPartial' => 'Expired with partial payment');\n $df_statuses = array(\n 'new'=>'wc-pending',\n 'paid'=>'wc-on-hold',\n 'confirmed'=>'wc-processing',\n 'complete'=>'wc-processing',\n 'invalid'=>'wc-failed',\n 'expired'=>'wc-cancelled',\n 'event_invoice_paidAfterExpiration' => 'wc-failed',\n 'event_invoice_expiredPaidPartial' => 'wc-failed');\n\n $wc_statuses = wc_get_order_statuses();\n $wc_statuses = array('BTCPAY_IGNORE' => '') + $wc_statuses;\n ?>\n <tr valign=\"top\">\n <th scope=\"row\" class=\"titledesc\">Order States:</th>\n <td class=\"forminp\" id=\"btcpay_order_states\">\n <table cellspacing=\"0\">\n <?php\n\n foreach ($bp_statuses as $bp_state => $bp_name) {\n ?>\n <tr>\n <th><?php echo $bp_name; ?></th>\n <td>\n <select name=\"woocommerce_btcpay_order_states[<?php echo $bp_state; ?>]\">\n <?php\n\n $order_states = get_option('woocommerce_btcpay_settings');\n $order_states = $order_states['order_states'];\n foreach ($wc_statuses as $wc_state => $wc_name) {\n $current_option = $order_states[$bp_state];\n\n if (true === empty($current_option)) {\n $current_option = $df_statuses[$bp_state];\n }\n\n if ($current_option === $wc_state) {\n echo \"<option value=\\\"$wc_state\\\" selected>$wc_name</option>\\n\";\n } else {\n echo \"<option value=\\\"$wc_state\\\">$wc_name</option>\\n\";\n }\n }\n\n ?>\n </select>\n </td>\n </tr>\n <?php\n }\n\n ?>\n </table>\n </td>\n </tr>\n <?php\n\n $this->log(' [Info] Leaving generate_order_states_html()...');\n\n return ob_get_clean();\n }", "function creditcard_country_pulldown($countryid, $slng = 'eng', $fieldname = 'form[countryid]')\n {\n global $ilance;\n $sql = $ilance->db->query(\"\n SELECT locationid, location_$slng AS location\n FROM \" . DB_PREFIX . \"locations\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n while ($res = $ilance->db->fetch_array($sql, DB_ASSOC))\n {\n\t\t\t\t$values[$res['locationid']] = ucwords(stripslashes($res['location']));\n }\n }\n return construct_pulldown($fieldname, $fieldname, $values, $countryid, 'style=\"font-family: Verdana\"');\n }", "static function getStateOptions()\n\t{\n\t\t// Build the filter options.\n\t\t$options = array();\n\t\t$options[] = JHtml::_('select.option', '0', JText::_('COM_REALTOR_ACTIVE'));\n\t\t$options[] = JHtml::_('select.option', '1', JText::_('COM_REALTOR_INACTIVE'));\n\n\t\treturn $options;\n\t}", "function GetStateByName($state)\n\t{\n\t\t$this->db->where('name_long', ucwords($state));\n\t\t$query = $this->db->get('states');\n\t\tif($query->num_rows() > 0) {\n\t\t\treturn $query->row()->name_short;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function list_status_select() {\r\n\tglobal $db_shared;\r\n\t\r\n\t$query \t\t= \"SELECT * FROM $db_shared.catalogue_status ORDER BY id\";\r\n\t$result \t= @mysql_query($query);\r\n\t$num_rows \t= mysql_num_rows($result);\t\t \r\n\t\r\n\t$BuildList = '';\t \r\n\tif(mysql_num_rows($result)) {\r\n\t\t$BuildList .= '<select name=\"new_status\" id=\"status\" onChange=\"checkeditbut();\">'; //onSelect=\"checkeditbut()\" \r\n\t\t$BuildList .= '<option value=\"\">Please Select</option>';\t\r\n\t\r\n\t\tfor($tmpcount = 0;$tmpcount < $num_rows;$tmpcount++) {\r\n\t\t\t$tmparray = mysql_fetch_array($result);\r\n\t\t\t$BuildList .= '<option value=\"'.$tmparray['id'].'\">'.get_statusname($tmparray['id']).'</option>';\t\t\t\r\n\t\t} \r\n\t\t$BuildList .= '</select>';\r\n\t\r\n\t} else {\r\n\t\t$BuildList .= '<p>Status list has not been created - contact support via the help page</p>';\r\n\t} \r\n\r\n\treturn $BuildList;\r\n}", "function bls_sf_selectForTypes() {\n\tbls_ut_backTrace(\"bls_sf_selectForTypes\");\n\tglobal $bls_sf_location;\n\n\techo \"<select name=\\\"s_pkg_srctype\\\">\";\n\tforeach ($bls_sf_location as $key => $val) {\n\t\techo \"<option value=\\\"$key\\\">$val</option>\";\n\t}\n\techo \"</select>\";\n}", "function get_post_states($post)\n {\n }", "public function get_all_state()\n\t {\n\t \t $data=(array)json_decode(file_get_contents(\"php://input\"));\n\t \t$id=$data['country_id'];\n\t \t$query=$this->ApiModel->get_all_state($id);\n\t \techo json_encode($query);\n\t }", "function tep_cfg_pull_down_country_list($country_id) {\n return tep_draw_pull_down_menu('configuration_value', tep_get_countries(), $country_id);\n}", "function GetStates () {\n\t\t$this->db->order_by('name_long','ASC');\n\t\t$result = $this->db->get('states');\n\n\t\t$states = array();\n\t\tforeach ($result->result_array() as $state) {\n\t\t\t$states[] = array(\n\t\t\t\t\t\t\t'code' => $state['name_short'],\n\t\t\t\t\t\t\t'name' => $state['name_long']\n\t\t\t\t\t\t);\n\t\t}\n\n\t\treturn $states;\n\t}", "function dropdown(array $attrib, array $options, $selected = null) {\n /* * * begin the select ** */\n\n $attrib_string = parseAttrib($attrib);\n\n $dropdown = \"<select {$attrib_string} >\" . \"\\n\";\n\n $selected = $selected;\n /* * * loop over the options ** */\n foreach ($options as $key => $option) {\n /* * * assign a selected value ** */\n $select = strtolower($selected) == strtolower($key) ? ' selected' : null;\n\n\n /* * * add each option to the dropdown ** */\n $dropdown .= '<option value=\"' . $key . '\"' . $select . '>' . $option . '</option>' . \"\\n\";\n }\n\n /* * * close the select ** */\n $dropdown .= '</select>' . \"\\n\";\n\n /* * * and return the completed dropdown ** */\n return $dropdown;\n}", "function particularstatelist($id)\n\t{\n\t\t$getParstates=\"SELECT * from states where id = $id\";\n\t\t$getParstatesdata = $this->get_results( $getParstates );\n\t\treturn $getParstatesdata;\n\t}", "static function html_select(array $input,$name,$sled=''){\n\t\t$ret='';\n\t\t\t$ret.='<select name=\"'.$name.'\">';\n\t\tforeach($input as $k=>$v){\n\t\t\t$tmp_def = $sled == $k ? 'selected=\"selected\"':'';\n\t\t\t$ret.='<option value=\"'.$k.'\" '.$tmp_def.'>'.$v.'</option>';\n\n\t\t}\n\t\t$ret.='</select>';\n\t\treturn $ret;\n\t}", "function select($name='',$class='',$optName='',$id='',$attrib='') {\n\t\t$n = '';\n\t\t$option = '';\n\t\t$fldname = str_replace(' ', '_', $name);\n\t\tif(isset($_SESSION[$fldname])) $n = $_SESSION[$fldname];\n\t\tif(isset($_POST[$fldname])) $n = $_POST[$fldname]; \n\t\tforeach($optName as $optVal){\n\t\t\t$cndtn = ($n == $optVal)? 'selected=\"selected\"' : '';\n\t\t\t$option .= '<option value=\"'.$optVal.'\" '.$cndtn.'>'.$optVal.'</option>';\t\t\n\t\t}\n\t\t$select = '<select name=\"'.$fldname.'\" class=\"'.$class.'\" id=\"'.$id.'\" '.$attrib.'>'.$option.'</select>';\n\t\techo $select;\n\t}", "function getCountries()\r\n {\r\n global $db;\r\n global $html;\r\n $sql = 'select ID, Name from Country order by Name ASC';\r\n $result = $db->query($sql);\r\n $countries = '';\r\n $n = $db->rowCount($result);\r\n for ($i = 0; $i < $n; $i++) {\r\n $row = $db->fetch($result);\r\n $selected = '';\r\n if(empty($_POST['country'])){$_POST['country'] = '412';}\r\n if($row['ID'] === $_POST['country']) {\r\n $selected = ' selected=\"selected\"';\r\n }\r\n $countries .= '<option'.$selected.' value=\"'.$row['ID'].'\">'.$html->text($row['Name']).'</option>';\r\n }\r\n }", "function dev_tickets_dropdown( $args = array(), $status = '' ) {\n\n\t$defaults = array(\n\t\t'name' => 'dev_tickets',\n\t\t'id' => '',\n\t\t'class' => '',\n\t\t'exclude' => array(),\n\t\t'selected' => '',\n\t\t'select2' => true,\n\t\t'please_select' => false\n\t);\n\n\t/* List all tickets */\n\t$tickets = dev_get_tickets( $status );\n\t$options = '';\n\n\tforeach ( $tickets as $ticket ) {\n\t\t$options .= \"<option value='$ticket->ID'>$ticket->post_title</option>\";\n\t}\n\n\techo dev_dropdown( wp_parse_args( $args, $defaults ), $options );\n\n}", "function display_product_dropdown ($varname = \"product_name\") {\n\n\t$products = &get_product_array($GLOBALS['dsn'], \"any\");\n\n\tprint \"<select name=\" . $varname . \">\n\t<option value=NONE>Please pick one</option>\\n\";\n\twhile ($product_name = current($products)) {\n\t\tprint \"<option value=\" . key($products) . \">\".key($products).\"</option>\\n\";\n\t\tnext($products);\n\t}\n\n\tprint \"</select>\";\n\n}", "function input_dropdown_ui($array = array()){\n\t\t$input = self::input_label($array['label']);\n\t\tif(isset($array['class'])){\n\t\t\t$class_addon = ' '.$array['class'];\n\t\t}\n\t\telse{\n\t\t\t$class_addon = '';\n\t\t}\t\t\n\t\t$input .= '<select class=\"form-control'.$class_addon.'\"';\n\t\tforeach ($array as $key => $value) {\n\t\t\tif($key != \"option\" && $key != \"label\" && $key != \"value\" && $key != \"readonly\"){\n\t\t\t\t$input .= ' '.$key.'=\"'.$value.'\"';\t\t\t\t\n\t\t\t}\n\t\t\tif($key == \"readonly\" && $value == true){\n\t\t\t\t$input .= ' '.$key.'';\n\t\t\t}\t\t\t\n\t\t}\n\t\t$input .= '>';\n\t\tforeach ($array['option'] as $key => $value) {\n\t\t\tif(isset($array['value']) && $array['value'] == $key){\n\t\t\t\t$selected = 'selected';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$selected ='';\n\t\t\t}\n\t\t\t$input .= '<option value=\"'.$key.'\" '.$selected.'>'.$value.'</option>';\n\t\t}\n\t\t$input .= '</select>';\n\t\treturn $input;\n\t}", "private function getWeeksDropdown($id=0) {\n $current_week = $this->current_week_no;\n $selected_week = (isset($_GET['week'])) ? $_GET['week'] : $current_week;\n\n $dropdown = \"&nbsp;<form action=\\\"timetable.php\\\" name=\\\"week_changer\\\" method=\\\"get\\\">\\n\";\n $dropdown .= \"<select name=\\\"week\\\" id=\\\"week_select\\\" onchange=\\\"javascript:this.form.submit();\\\">\\n\";\n\n // e.g. Starting date for this academic year = 02/08/2010, we can work out the rest by adding seven days onto this 52 times\n\t\t\t$timestamp = $this->ac_year_start_date;\n $day_counter = 0;\n\n // 52 weeks in an academic year\n for ($i=1; $i<=52; $i++) {\n\n $week_date = date('d M Y', strtotime('+'.$day_counter.' days', $timestamp));\n //$week_date .= ($current_week == $i) ? \" ($i) *\" : \" ($i)\";\n $week_date .= ($current_week == $i) ? \" *\" : \"\";\n\n if ($i == $selected_week) { \n $dropdown .= \"\\t<option value=\\\"$i\\\" selected=\\\"selected\\\">$week_date</option>\\n\"; \n } else {\n $dropdown .= \"\\t<option value=\\\"$i\\\">$week_date</option>\\n\"; \n }\n\n $day_counter += 7;\n }\n $dropdown .= \"</select>\\n</form>\\n\";\n return $dropdown;\n }", "public static function getZonesDropdownHtml($countries_id, $zone = null) {\n global $lC_Database, $lC_Language;\n\n $Qzones = $lC_Database->query('select zone_name from :table_zones where zone_country_id = :zone_country_id order by zone_name');\n $Qzones->bindTable(':table_zones', TABLE_ZONES);\n $Qzones->bindInt(':zone_country_id', $countries_id);\n $Qzones->execute();\n\n $result = array();\n if ($Qzones->numberOfRows() > 0) {\n $zones_array = array();\n while ($Qzones->next()) {\n $zones_array[] = array('id' => $Qzones->value('zone_name'), 'text' => $Qzones->value('zone_name'));\n }\n $zone_name = (isset($zone) && is_numeric($zone) && $zone != 0) ? lC_Address::getZoneName($zone) : NULL;\n $result['zonesHtml'] = lc_draw_label('', null, 'state') . lc_draw_pull_down_menu('state', $zones_array, $zone_name);\n $result['single'] = '0';\n\n } else { \n $result['zonesHtml'] = lc_draw_label('', null, 'state') . ' ' . lc_draw_input_field('state', (($zone != 'undefined') ? $zone : null), 'placeholder=\"' . $lC_Language->get('field_customer_state') . '\" onfocus=\"this.placeholder = \\'\\'\" onblur=\"this.placeholder = \\'' . $lC_Language->get('field_customer_state') . '\\'\" class=\"required\" style=\"width:103%;\"');\n $result['single'] = '1';\n }\n \n return $result;\n }", "public function status_filter() {\n\n\t\tglobal $typenow;\n\n\t\tif ( ('ticket' != $typenow ) || isset( $_GET['post_status'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this_sort = isset( $_GET['dev_status'] ) ? filter_input( INPUT_GET, 'dev_status', FILTER_SANITIZE_STRING ) : '';\n\t\t$all_selected = ( '' === $this_sort ) ? 'selected=\"selected\"' : '';\n\t\t$open_selected = ( ! isset( $_GET['dev_status'] ) && true === (bool) dev_get_option( 'hide_closed' ) || 'open' === $this_sort ) ? 'selected=\"selected\"' : '';\n\t\t$closed_selected = ( 'closed' === $this_sort ) ? 'selected=\"selected\"' : '';\n\t\t$dropdown = '<select id=\"dev_status\" name=\"dev_status\">';\n\t\t$dropdown .= \"<option value='' $all_selected>\" . __( 'Any Status', TEXTDOMAIN ) . \"</option>\";\n\t\t$dropdown .= \"<option value='open' $open_selected>\" . __( 'Open', TEXTDOMAIN ) . \"</option>\";\n\t\t$dropdown .= \"<option value='closed' $closed_selected>\" . __( 'Closed', TEXTDOMAIN ) . \"</option>\";\n\t\t$dropdown .= '</select>';\n\n\t\techo $dropdown;\n\n\t}", "function build_shop_list_html($selected,$selected_name)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$shop_list = \"<select name='business_id' class='forminput'>\";\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$shop_list .= \"<option value='$selected' selected='selected'>$selected_name</option>\";\n\t\t\t$shop_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$shop_list .= \"<option value=''>\".$lang['Select_A_Business'].\"</option>\";\n\t\t\t$shop_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\n\t\t$sql = \"SELECT id, title \n\t \t\tFROM \" . GARAGE_BUSINESS_TABLE . \" WHERE retail_shop = 1 OR web_shop = 1\n\t\t\tORDER BY title ASC\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query businesses', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $shop = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$shop_list .= \"<option value='\".$shop['id'].\"'>\".$shop['title'].\"</option>\";\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$shop_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'SHOP_LIST' => $shop_list)\n\t\t);\n\t\n\t\treturn ;\n\t}", "static function getStateOptions()\n\t{\n\t\t// Build the filter options.\n\t\t$options = array();\n\t\t$options[] = JHtml::_('select.option', '1', JText::_('JPUBLISHED'));\n\t\t$options[] = JHtml::_('select.option', '0', JText::_('JUNPUBLISHED'));\n\t\t$options[] = JHtml::_('select.option', '-2', JText::_('JTRASHED'));\n\t\treturn $options;\n\t}", "function GetProjectStateDetail($stateID=false,$languageID=false)\n\t{\n\t\t$qry=$this->db->query(\"select rp_state_details.stateName from rp_states,rp_state_details where rp_states.stateID='$stateID' and rp_states.stateStatus='Active' and rp_state_details.stateID='$stateID' and rp_state_details.languageID='$languageID'\");\n\t\treturn $qry->result();\n\t}", "function _addresses_province_ajax() {\n global $language;\n\n // ISO 3166-1 alpha-2 code of a country.\n $country = $_GET['country'];\n if (substr($country, 0, 4) == 'top_') {\n $country = substr($country, 4);\n }\n // HTML id attribute of select field.\n $field_id = $_GET['field_id'];\n // HTML name attribute of select field.\n $field_name = $_GET['field_name'];\n // HTML id attribute of province's wrapper.\n $passback = $_GET['passback'];\n // ISO-3166-2 code for the province or state to mark as selected.\n $province = $_GET['province'];\n\n // Check that required fields are supplied\n if (empty($field_id) || empty($field_name) || empty($passback)) {\n return drupal_json(array('error' => 'Invalid call'));\n }\n\n // $element is a form element we build below to get the needed HTML\n $element = array();\n // No need to use drupal_strtoupper() as ISO-3166-2 codes are latin based\n $element['#value'] = drupal_strtoupper($province);\n $element['#options'] = array();\n $provinces = array();\n $output = '';\n $hide = FALSE;\n\n if (!empty($country)) {\n module_load_include('inc', 'addresses');\n $provinces = _addresses_province_get($country);\n $element['#options'] = _addresses_province_get($country);\n }\n\n if (empty($provinces)) {\n $hide = TRUE;\n }\n\n // Generate province field HTML\n $output .= '<label for=\"'. $field_id .'\">'. t('State / Province: ') . '</label>';\n $output .= '<select id=\"'. $field_id .'\" name=\"'. $field_name\n .'\" class=\"addresses-province-field\">'\n . form_select_options($element) .'</select>';\n\n return drupal_json(array(\n 'field' => $output,\n 'passback' => $passback,\n 'hide' => $hide,\n ));\n}", "function get_states()\n\t{\n\t\t$countryID = $this->uri->segment(3);\n\t\t\n\t\t$this->db->select(\"*\")\n\t\t\t\t ->from('state')\n\t\t\t\t ->where('countryID', $countryID);\n\t\t$db = $this->db->get();\n\t\t\n\t\t$array = array();\n\t\tforeach($db->result() as $row):\n\t\t\t$array[] = array(\"value\" => $row->state_id, \"property\" => $row->state_title);\n\t\tendforeach;\n\t\t\n\t\techo json_encode($array);\n\t\texit;\n\t}", "function countryList($fieldname=\"country\", $classes=\"form-control\", $important=false, $country=\"\")\n\t{\n\t\tif($important)\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Country' required>\";\n\t\telse\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Country'>\";\n\t\t$con = dbConnect(\"localhost\", \"root\", \"\", \"jobPortal\");\n\t\tif($con)\n\t\t{\n\t\t\t$rsCountry = mysqli_query($con, \"SELECT * FROM countries\");\n\t\t\twhile($row = mysqli_fetch_array($rsCountry))\n\t\t\t{\n\t\t\t\tif($row[\"countries_name\"]==$country)\n\t\t\t\techo \"<option value='\".$row['countries_id'].\"' selected>\".$row['countries_name'].\"</option>\";\n\t\t\t\telse\n\t\t\t\techo \"<option value='\".$row['countries_id'].\"'>\".$row['countries_name'].\"</option>\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<option value='0'>Unable To Fetch.</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t}", "function get_selected()\n {\n }", "function creditcard_type_pulldown($selected = '', $fieldname = 'form[type]')\n {\n $html = '<select name=\"' . $fieldname . '\" style=\"font-family: Verdana\">';\n $html .= '<option value=\"visa\"';\n if ($selected == 'visa')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Visa</option>';\n $html .= '<option value=\"mc\"';\n if ($selected == 'mc')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Mastercard</option>';\n $html .= '<option value=\"amex\"';\n if ($selected == 'amex')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>American Express</option>';\n $html .= '<option value=\"disc\"';\n if ($selected == 'disc')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Discover</option>';\n $html .= '</select>';\n return $html;\n }", "function build_business_list_html($selected,$selected_name)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$business_list = \"<select name='id' class='forminput'>\";\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$business_list .= \"<option value='$selected' selected='selected'>$selected_name</option>\";\n\t\t\t$business_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$business_list .= \"<option value=''>\".$lang['Select_A_Business'].\"</option>\";\n\t\t\t$business_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\n\t\t$sql = \"SELECT id, title FROM \" . GARAGE_BUSINESS_TABLE . \" ORDER BY title ASC\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query businesses', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $business = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$business_list .= \"<option value='\".$business['id'].\"'>\".$business['title'].\"</option>\";\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$business_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'BUSINESS_LIST' => $business_list)\n\t\t);\n\t\n\t\treturn ;\n\t}", "public function actionGet_cities() {\n if (isset($_POST['state_id']) != 0) {\n $output = '';\n $state_id = $_POST['state_id'];\n $att_name = $_POST['att_name'];\n $all_cities = DvCities::find()->where(['state_id' => $state_id])->all();\n $allcities = ArrayHelper::map($all_cities, 'id', 'name');\n if ($att_name == 'DvRegistration[state]') {\n $output .= '<select id=\"dvusers-city\" class=\"form-control\" name=\"DvRegistration[city]\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select City\">';\n } else {\n $output .= '<select id=\"dvusers-city\" class=\"form-control\" name=\"usermeta[city]\" required=\"required\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select City\">';\n }\n $output .= '<option value=\"\">Select City</option>';\n foreach ($allcities as $id => $name) {\n $output .= '<option value=\"' . $id . '\">' . $name . '</option>';\n }\n $output .= '</select>';\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }", "function getstates() {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT abbreviation as state, name FROM states\");\n\t\t$sql->execute();\n\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function getAccess_DropDown() {\r\n $option_selected = '';\r\n if (!$this->access) {\r\n $option_selected = ' selected=\"selected\"';\r\n }\r\n \r\n // Get the categories\r\n $items = array('Registered', 'Admin');\r\n\r\n $html = array();\r\n \r\n $html[] = '<label for=\"access\">Choose Access</label><br />';\r\n $html[] = '<select name=\"access\" id=\"access\">';\r\n \r\n foreach ($items as $i=>$item) { \r\n // If the selected parameter equals the current category id then flag as selected\r\n if ($this->access == $item) {\r\n $option_selected = ' selected=\"selected\"';\r\n }\r\n // set up the option line\r\n $html[] = '<option value=\"' . $item . '\"' . $option_selected . '>' . $item . '</option>';\r\n // clear out the selected option flag\r\n $option_selected = '';\r\n }\r\n \r\n $html[] = '</select>';\r\n return implode(\"\\n\", $html); \r\n \r\n }", "function ninja_forms_list_field_type_dropdown( $selected ){\r\n\t$output = '<option value=\"\" disabled>' . __( 'List', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-dropdown' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-dropdown\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Dropdown (Select)', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-radio' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-radio\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Radio', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-checkbox' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-checkbox\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Checkboxes', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-multi' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-multi\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Multi-Select', 'ninja-forms-style' ) . '</option>';\r\n\r\n\treturn $output;\r\n}", "public function getStateAction()\n {\n\n $country_id = $this->getRequest()->getPost('country_id');\n\n $token = $this->getRequest()->getPost('token');\n\n if($this->tokenval() != $token)\n {\n $response['msg'] = 'You are not authorized to access this';\n $response['status'] = '1';\n echo json_encode($response);\n exit;\n }\n\n //$states = Mage::getModel('directory/country')->load($country_id)->getRegions();\n\n $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n $select = $connectionRead->select()\n ->from('citylist', array('*'))\n ->where('country_code=?',$country_id)\n ->group('region_name');\n\n $states = $connectionRead->fetchAll($select);\n\n //state names\n $response = array();\n\n $i=0;\n foreach ($states as $state) {\n $response[$i]['id'] = $state['id_citylist'];\n $response[$i]['country_code'] = $state['country_code'];\n $response[$i]['name'] = $state['region_name'];\n $i++;\n }\n\n echo json_encode($response);\n exit;\n }", "function getEstadoRp($fEstado, $opt){\r\nconnect();\r\n switch($opt){\r\n\tcase 0:\r\n\t $status[0] = 'PE'; $d_status[0] = 'Pendiente';\r\n\t\t $status[1] = 'PA'; $d_status[1] = 'Pagado';\r\n\t\t $cant = 2;\r\n\t\t for($i=0;$i<$cant;$i++){\r\n\t\t if($status[$i]==$fEstado) echo\"<option value='$status[$i]' selected>$d_status[$i]</option>\";\r\n\t\t\telse echo\"<option value='$status[$i]'> $d_status[$i]</option>\";\r\n\t\t }\r\n }\r\n}", "public function getstateid($state_name)\n\t{$sql = $this->db->select('stateid')\n\t\t->from('states')\n\t\t->where('state_name = ' .\"'\".$state_name.\"'\")\n\t\t->order_by(\"stateid ASC\");\n\t\t$return['rows'] = $sql->get()->result_array();\n\t\t$return = (json_encode($return));\n\t\tprint_r($return);\n\t\treturn $return;\n\t}", "static function getStateOptions()\n\t{\n\t\t// Build the filter options.\n\t\t$options = array();\n\t\t$options[] = Html::select('option', '1', Lang::txt('COM_MESSAGES_OPTION_READ'));\n\t\t$options[] = Html::select('option', '0', Lang::txt('COM_MESSAGES_OPTION_UNREAD'));\n\t\t$options[] = Html::select('option', '-2', Lang::txt('JTRASHED'));\n\n\t\treturn $options;\n\t}", "function getCountry($label)\n{\n $sql = \"SELECT * FROM countries ORDER BY name ASC\";\n $rows = fetchAll($sql);\n\n if (!empty($rows)) {\n $out = \" <select name=\\\"{$label}\\\" id=\\\"{$label}\\\" class=\\\"form-control\\\"\";\n $out .= \"<option value=\\\"\\\">Select One&hellip;</option>\";\n foreach ($rows as $row) {\n $out .= \"<option value=\\\"\" . $row['id'] . \"\\\"\";\n $out .= stickyDropdown($label, $row['id']);\n $out .= \">\" . $row['name'] . \"</option>\";\n }\n $out .= \"</select>\";\n }\n return isset($out) ? $out : null;\n}", "public function coconutComboBoxStart_long($name) {\necho \"<select name='$name' class='comboBox'>\";\n}", "public function getState()\n {\n return $this->getParameter('state');\n }", "public function getSelectedState()\r\n {\r\n if (!empty($this->View()->sUserData['additional']['stateShipping'])) {\r\n $this->session['sState'] = (int) $this->View()->sUserData['additional']['stateShipping']['id'];\r\n return $this->View()->sUserData['additional']['stateShipping'];\r\n }\r\n return array(\"id\" => $this->session['sState']);\r\n }", "function getCountryIdFromState($state_id=null,$return_field=\"hajj_mst_countries_id\"){\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('status'=>true));\r\n\t\tif($state_id!=null){\r\n\t\t\t$this->db->where(array('id'=>$state_id));\r\n\t\t}\r\n\t\t$recordSet = $this->db->get(TBL_HAJJ_MST_STATE);\r\n\t\t$data=$recordSet->result() ;\r\n\t\tif(count($data)>0){\r\n\t\t\treturn $data[0]->$return_field;\r\n\t\t}else{\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t}", "public function findbranch()\n\t{\n\t\t$post = $this->input->post();\n\t\t$data = $this->AjaxDB->findBranch(['course'=>$post['id']]);\n\t\t$d[] = 'Choose Branch';\n\t\tif (!empty($data)) {\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$d[$value->id] = $value->branch_name;\n\t\t\t}\n\t\t}\n\t\t$result = form_dropdown('branch',$d,'',['class'=>'form-control input-sm','id'=>'bid']);\n\t\techo $result;\n\t}", "public function dropDownCommentStatus($selected = \"\")\n{\n \t\n $name = 'comment_status';\n \t\n \t$comment_status = array('open' => 'Open', 'closed' => 'Closed');\n \t\n \tif ($selected != '') {\n \t $selected = $selected;\n \t}\n \t\n \treturn dropdown($name, $comment_status, $selected);\n \t\n}", "function country_select($selected_iso='', $default_iso='US', $select_name='iso', $class='' )\n\t{\n\t\t// First, grab the states from the config\n\t\t$countries = config_item('address.countries');\n\n\t\tif (!is_array($countries) OR empty($countries))\n\t\t{\n\t\t\treturn lang('us_no_countries');\n\t\t}\n\n\t\t$class = ( !empty($class) && $class[1] != '' ) ? ' class=\"' . $class . '\" ' : '';\n\n\t\t$output = '<select name=\"'. $select_name .'\" id=\"' . $select_name . '\" ' . $class . ' >';\n\t\t$output .= '<option value=\"\">&nbsp;</option>' . PHP_EOL;\n\t\tforeach ($countries as $country_iso => $country)\n\t\t{\n\t\t\t$output .= \"<option value='{$country_iso}'\";\n\t\t\t$output .= ($country_iso == $selected_iso) ? ' selected=\"selected\"' : '';\n\t\t\t$output .= empty($selected_iso) && ($default_iso == $country_iso) ? ' selected=\"selected\"' : '';\n\t\t\t$output .= \">{$country['printable']}</option>\\n\";\n\t\t}\n\t\t$output .= \"</select>\\n\";\n\n\t\treturn $output;\n\n\t}", "public function get_states_list(){\n //echo '<pre>'; print_r($_POST);exit;\n $id = $this->input->post('id');\n $data['states'] = $this->videos_model->get_states_list($id);\n if($data['states']){\n $data['status'] = 0;\n }else{\n $data['status'] = 1;\n }\n //echo '<pre>'; print_r($states);exit;\n echo json_encode($data);\n }", "function dropdown($array,$param=NULL) {\n\t\t$name = $param['name'];\n\t\tif (!$param['id']) $param['id'] = $name;\n\t\techo '<select name=\"' . $name . '\" id=\"' . $param['id'] . '\"' . '\" class=\"' . $param['class'] . '\"';\n\t\tif ($param['onchange']) echo ' onchange=\"' . $param['onchange'] . '\"';\n\t\tif ($param['class']) echo ' class=\"' . $param['class'] . '\"';\n\t\techo '>' . \"\\n\";\n\t\tif ( $param['null_option'] !== false ) echo \"\\t\" . '<option value=\"\">' . $param['null_option'] . '</option>';\n\t\tforeach ($array as $value => $option) {\n\t\t\techo \"\\t\" . '<option value=\"' . $value . '\"';\n\t\t\tif ($param['selected_value'] && $param['selected_value'] == $value) echo ' selected ';\n\t\t\techo '>' . $option . '</option>' . \"\\n\";\n\t\t}//foreach\n\t\techo \"</select>\\n\";\n\t\n\t}" ]
[ "0.7293122", "0.7240494", "0.70655537", "0.70473486", "0.700936", "0.69754803", "0.68531215", "0.68378717", "0.6834133", "0.67502487", "0.66942704", "0.66674036", "0.6652746", "0.66078544", "0.6571748", "0.64460546", "0.64176345", "0.6355785", "0.6351741", "0.6289966", "0.6238188", "0.62284255", "0.6150098", "0.61463404", "0.61463404", "0.6117686", "0.6077958", "0.5986132", "0.5954036", "0.5953064", "0.5935477", "0.5886566", "0.58833647", "0.58799374", "0.58723176", "0.5864945", "0.58582735", "0.5845443", "0.5839907", "0.58334506", "0.58290285", "0.58195597", "0.58009756", "0.57974595", "0.5766722", "0.5757589", "0.5751748", "0.57488686", "0.57451284", "0.57423913", "0.5739937", "0.57329035", "0.5729272", "0.57037514", "0.5679397", "0.567355", "0.5670433", "0.5647346", "0.5626", "0.56204766", "0.5616486", "0.56114596", "0.5609169", "0.56033283", "0.56012744", "0.5593882", "0.55879056", "0.55861104", "0.55824363", "0.55816317", "0.55750006", "0.55747825", "0.55701905", "0.55696", "0.5557329", "0.55548847", "0.55544376", "0.5552959", "0.5551407", "0.55504197", "0.55497366", "0.554889", "0.5545201", "0.55442137", "0.5540649", "0.5537667", "0.55261946", "0.5520362", "0.5514661", "0.55079025", "0.5506746", "0.5502117", "0.5500312", "0.5491873", "0.5486009", "0.5485457", "0.54805255", "0.5478333", "0.547049", "0.5466005" ]
0.8001649
0
Bit of a give away this one
function is_serialized($value, &$result = null) { if (!is_string($value)) { return false; } // Serialized false, return true. unserialize() returns false on an // invalid string or it could return false if the string is serialized // false, eliminate that possibility. if ($value === 'b:0;') { $result = false; return true; } $length = strlen($value); $end = ''; switch ($value[0]) { case 's': if ($value[$length - 2] !== '"') { return false; } case 'b': case 'i': case 'd': // This looks odd but it is quicker than isset()ing $end .= ';'; case 'a': case 'O': $end .= '}'; if ($value[1] !== ':') { return false; } switch ($value[2]) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: break; default: return false; } case 'N': $end .= ';'; if ($value[$length - 1] !== $end[0]) { return false; } break; default: return false; } if (($result = @unserialize($value)) === false) { $result = null; return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasAttack(){\r\n return $this->_has(8);\r\n }", "public function hasAttack(){\r\n return $this->_has(5);\r\n }", "public function hasFly(){\r\n return $this->_has(5);\r\n }", "public function hasIgnoredefense(){\r\n return $this->_has(34);\r\n }", "public function hasWholineme(){\n return $this->_has(2);\n }", "function yy_r128(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }", "public function benchThisWillBeSkipped()\n {\n }", "function yy_r147(){ $this->_retvalue = new Stmt\\Expr('not', $this->yystack[$this->yyidx + 0]->minor); }", "function giveDamage($target) :int {\n //si on ne ce tape pas nous meme\n if ($target->getId() !== $this->getId()) {\n return $target->receiveDamage($this->getAttack());\n } else {\n // TODO: return something?????\n }\n }", "public function hasIgnoredefense(){\r\n return $this->_has(31);\r\n }", "public function getDropGive()\n {\n return $this->get(self::_DROP_GIVE);\n }", "public function hasForce(){\n return $this->_has(2);\n }", "function policy_totally_frozen($dreamid) {\n #return in_array($dreamid, array(1049, 1053, 1050, 363, 826, 1051, 1052, 856, 811, 975, 996, 984, 1030,\n # 837, 1071, 1074, 1077, 1079, 1080));\n return false;\n}", "public function hasDamageaddper(){\r\n return $this->_has(33);\r\n }", "public function hasPrecost(){\n return $this->_has(25);\n }", "function yy_r74()\n {\n $this->_retvalue = '!(1 & ' . $this->yystack[$this->yyidx + - 1]->minor . ')';\n }", "public function hasFalseMutations(){\n return $this->_has(5);\n }", "private static function lowPass()\n {\n }", "public function negate(): self;", "public function getJustCollected()\n {\n return $this->just_collected;\n }", "public function hasPower(){\n return $this->_has(4);\n }", "public function hasDamageaddper(){\r\n return $this->_has(30);\r\n }", "public function tellNotEnoughMoneyInAccount()\n {\n }", "function goNoGoForLaunch($place){\n return $this->ship->hold->get($this->fuel()) >= $this->getFuelReqTo($place);\n }", "public function hasTutorreward(){\n return $this->_has(23);\n }", "public function disapprove()\n {\n return $this->approve(false);\n }", "public function hasPoisonAttack(){\r\n return $this->_has(15);\r\n }", "public function hasPoisonAttack(){\r\n return $this->_has(18);\r\n }", "public function holdingRight(){\n\t\treturn $this->_sendPacketToController(self::HOLDING_RIGHT);\n\t}", "function yy_r75()\n {\n $this->_retvalue = '(1 & ' . $this->yystack[$this->yyidx + - 1]->minor . ')';\n }", "public function hasMp(){\r\n return $this->_has(2);\r\n }", "public function hasMp(){\r\n return $this->_has(2);\r\n }", "public function hasFireAttack(){\r\n return $this->_has(20);\r\n }", "public function quash_unused() {\n\t\t// Don't put any code in here.\n\t}", "public function takeDamage()\n\t\t{\n\t\t\tif ($this->_illness)\n\t\t\t{\n\t\t\t\t$this->_health -= $this->_damage; \n\t\t\t}\n\t\t}", "public function constrainOnly($flag);", "public function hasSpeed(){\r\n return $this->_has(22);\r\n }", "abstract public function withholdTargets();", "public function hasIceAttack(){\r\n return $this->_has(16);\r\n }", "public function hasFireAttack(){\r\n return $this->_has(17);\r\n }", "public function hasRetreatdf(){\r\n return $this->_has(26);\r\n }", "public function hasY(){\n return $this->_has(2);\n }", "public function getGuarded();", "public function rebobinar() {\n\t\treturn $this->irA(0);\n\t}", "function negate() { # :: Num -> Num\n return -$this->value;\n }", "public function passes();", "public function isDeclined(): bool;", "function yy_r129(){$this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }", "public function hasFighting(){\r\n return $this->_has(22);\r\n }", "public function testNonsuppliedBitflagsAreLeftAlone()\n {\n $bit = new Formulaic\\Bitflag('superhero', [\n 'spidey' => 'Spiderman',\n 'hulk' => 'The Hulk',\n 'daredevil' => 'Daredevil',\n ]);\n $bit->setDefaultValue(['superman']);\n $bit->setValue(['hulk']);\n yield assert($bit->getValue()->hulk);\n yield assert(!isset($bit->getValue()->superman));\n }", "protected function fetchFlagsOther() {\n return null;\n }", "public function hasUnlock(){\n return $this->_has(3);\n }", "public function hasSitdown(){\r\n return $this->_has(4);\r\n }", "function cansigngb($uid, $who)\n{\n if(arebuds($uid, $who))\n {\n return true;\n }\n if($uid==$who)\n {\n return false; //imagine if someone signed his own gbook o.O\n }\n if(getplusses($uid)>=75)\n {\n return true;\n }\n return false;\n}", "public function getSparePower() {\r\n return $this->getMaxPower() - $this->getUsedPower();\r\n }", "public function testIncorrectCanBuyWithOneShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(99);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$c->buyStock(NULL, 0);\n\t\t\t$c->sellStock(NULL, 0);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "public function GetWasteBasket() {\n return false;\n }", "public function getCollectedAttribute()\n {\n // FIXME\n return 0;\n }", "public function hasRet(){\n return $this->_has(5);\n }", "public function getGuarantee(): Amount\n {\n return $this->guarantee;\n }", "public function unwant($planId)\n{\n $exist = $this->is_wanting($planId);\n \n\n\n if ($exist) {\n // stop following if following\n $this->wants()->detach($planId);\n return true;\n } else {\n // do nothing if not following\n return false;\n }\n}", "public function holdingForward(){\n\t\treturn $this->_sendPacketToController(self::HOLDING_FORWARD);\n\t}", "public function onlyTrashed();", "public function getFastPass()\n {\n return $this->get(self::_FAST_PASS);\n }", "public function temporality();", "function yy_r151(){ $this->_retvalue = new Stmt\\Expr(\"!=\", $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "function yy_r149(){$this->_retvalue = ' XOR '; }", "public function unsigned();", "function &act() {\n $dummy = $this->value;\n return $dummy;\n }", "public function hasLockarg(){\n return $this->_has(32);\n }", "public function popWake() {\n $wake = $this->wakeNext;\n $this->wakeNext = false;\n return $wake;\n }", "public function hasLastrewardtime(){\n return $this->_has(7);\n }", "public function expunge()\n {\n return $this->contra();\n }", "function yy_r119(){$this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; }", "public function hasSilencedf(){\r\n return $this->_has(30);\r\n }", "public function hasDefense(){\r\n return $this->_has(6);\r\n }", "public function hasPoisonDefense(){\r\n return $this->_has(16);\r\n }", "public function hasBepro1Time(){\n return $this->_has(3);\n }", "public function hasTrueMutations(){\n return $this->_has(4);\n }", "public function modif_boolbin() \r\n\t{\r\n\t\t$this->boolbin = abs($this->boolbin-1);\t\r\n\t}", "public function getFree()\n {\n return $this->free;\n }", "public function getFree()\n {\n return $this->_setFree;\n }", "function eth_check_burn($addr, $txid) {\n\n\treturn -1;\n}", "public function pop()\n {\n $bit = $this->get($this->size - 1);\n $this->size--;\n\n return $bit;\n }", "public function _getSkip()\n {\n if (isset($this->m_postvars['atkreturnbehaviour']) && $this->m_postvars['atkreturnbehaviour'] == self::ATK_ACTION_BACK) {\n return 2;\n }\n\n return 1;\n }", "function isFrozen() ;", "public function hasDefense(){\r\n return $this->_has(9);\r\n }", "public function hasAnger(){\r\n return $this->_has(4);\r\n }", "public function hasAnger(){\r\n return $this->_has(4);\r\n }", "static function false($X, $Alt) {\n\t\treturn $X ? $X : $Alt;\n\t}", "function yy_r130(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; }", "function isAcquired() ;", "protected function computeAllowed() {\n\t\tif($this->tees) {\n\t\t\t$this->exact_handicap = $this->player->handicap;\n\t\t\t$a = $this->player->allowed($this->tees);\n\t\t\t$this->handicap = array_sum($a); // playing handicap\n\t\t\t$this->save();\n\t\t\tif($this->hasDetails()) {\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($this->getScoreWithHoles()->each() as $score) {\n\t\t\t\t\t$score->allowed = $a[$i++];\n\t\t\t\t\t$score->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public function hasMaxHand(){\n return $this->_has(8);\n }", "public function hasDefhpper(){\r\n return $this->_has(32);\r\n }", "public function hasMp(){\r\n return $this->_has(3);\r\n }", "public function hasMp(){\r\n return $this->_has(3);\r\n }", "abstract public function sharpen($amount);", "public function getExhaustionExplanation ();", "function hitungDenda(){\n\n return 0;\n }", "protected function exclude_spare()\n {\n return $this->collection = $this->collection->where('is_spare', 'f');\n }" ]
[ "0.5369728", "0.5338726", "0.53350246", "0.52311015", "0.52161986", "0.5201477", "0.519185", "0.5164149", "0.51424617", "0.51116645", "0.510496", "0.5091257", "0.5072073", "0.5061036", "0.50449175", "0.5034209", "0.5007643", "0.49715218", "0.49494877", "0.49387044", "0.49324882", "0.49324718", "0.49279684", "0.49239475", "0.4923667", "0.4905214", "0.4898691", "0.4878627", "0.48648322", "0.48583022", "0.48581433", "0.48581433", "0.48534358", "0.48489058", "0.48416403", "0.48314163", "0.48263395", "0.48122826", "0.4806629", "0.4804888", "0.4803997", "0.47943395", "0.4785668", "0.4781684", "0.4769375", "0.47589868", "0.47567177", "0.47523844", "0.47365057", "0.47302583", "0.47301432", "0.47149393", "0.4707136", "0.46927813", "0.46854424", "0.46817443", "0.46792355", "0.4677243", "0.46746922", "0.4670068", "0.46699536", "0.46699095", "0.4668062", "0.4650435", "0.4648791", "0.4643258", "0.46427432", "0.46394372", "0.4635253", "0.46325976", "0.46294016", "0.46216848", "0.46204376", "0.46149564", "0.46094877", "0.46084777", "0.46018595", "0.4599498", "0.45840913", "0.4581769", "0.45736748", "0.45730764", "0.45632592", "0.4562984", "0.455976", "0.45572042", "0.45544308", "0.45461693", "0.45461693", "0.45459753", "0.45457566", "0.4545656", "0.45452076", "0.45448804", "0.45408592", "0.4539139", "0.4539139", "0.45343298", "0.453273", "0.45309153", "0.4528391" ]
0.0
-1
Description: function to validate fields has to first add their fields data to this function
function addFields($controler_name, $postVar, $authType, $error) { $index = $this->id++; $this->check_vars [$index] ['data'] = $postVar; //store control field data to be validated $this->check_vars [$index] ['authtype'] = $authType; //store type of validation required $this->check_vars [$index] ['error'] = $error; //store error message for in case of validation failed $this->check_vars [$index] ['controler_name'] = $controler_name; //store error message for in case of validation failed }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate_fields() {\n \n\t\t//...\n \n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "function validate_fields() {\n\t\treturn true;\n\t}", "abstract protected function fieldValidation($submittedData);", "protected function _validate() {\n\t}", "protected function prepareValidations() {}", "function validateData($fields, $vars) \n{ \n\t// array for storing error messages \n\tglobal $err_mess; \t\t\t\t\t\t// error message, make accessible outside function \n\t$err_msg = \"\"; \t\t\t\t\t\t\t// blank to begin with \n\t$fields_ok = true;\t\t\t\t\t\t// success/failure indicator - assume success \n\n\t// for each field name in validation information validate data \n\t// data according to rules for field \n\t// $fields[x] - attribute name \n\t// $fields[x+1] - validation code \n\t// $fields[x+2] - human name for error message \n\t// validation codes - correspond to array entry in function validateData \n\t// 1 - field required - primary key, \"new\" (new record) or numeric (existing record) \n\t// 2 - field required - foreign key, must be numeric, must be > 0 \n\t// 3 - field required - phone number, must be 10 digits long \n\t// 4 - field required - email address \n\t//\t 5 - field required - no validation required \n\t// code + 100 - field not required but same validation as code if field required \n\t\n\t// want to consider validation for all fields in record \n\tfor ($i=0; $i<count($fields); $i=$i+3) \n\t{\n\t\t// extract data value from $vars that corresponds \n\t\t// to field name in validation data \n\t\t$field_name = $fields[$i]; \t\t\t// field name \n\t\t$field_data = $vars[$field_name]; \t// data value from form \n\t\t$field_code = $fields[$i+1];\t\t// validation code \n\t\t$field_err = $fields[$i+2];\t\t\t// field name for error message \n\t\t\n\t\t// determine if validating primary key \n\t\tif ($field_code==1) { \n\t\t\t// primary key, required field, must be \"new\" or numeric \n\t\t\tif (strlen($field_data)==0) { \n\t\t\t\t// required field not entered \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// not blank so \n\t\t\t\t// check for \"new\" (new record) or numeric (update existing record) \n\t\t\t\tif ($field_data != \"new\") { \n\t\t\t\t\tif (is_numeric($field_data) == false) { \n\t\t\t\t\t\t// invalid primary key \n\t\t\t\t\t\t$err_mess .=$field_err .\" - invalid primary key \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \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\t// determine if validating foreign key \n\t\tif ($field_code==2 or $field_code==102) {\n\t\t\t// validation may be required on number \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==2 and is_numeric($field_data)==false) { \n\t\t\t\t// required foreign key and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not blank, must be number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// ensure value is > 0 \n\t\t\t\t\tif ($field_data <= 0) { \n\t\t\t\t\t\t// invalid foreign key \n\t\t\t\t\t\t$err_mess .=$field_err .\"-select \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// determine if validating phone number \n\t\tif ($field_code==3 or $field_code==103) { \n\t\t\t// validation may be required on phone number \n\t\t\tif ($field_code==3 and $field_data==\"\") { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\t// validate if not required field & data entered \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not a number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// check for correct length (must be 10 digits) \n\t\t\t\t\tif ($field_data!=\"\" and strlen($field_data)!=10) {\n\t\t\t\t\t\t// phone number length not 10 \n\t\t\t\t\t\t$err_mess .=$field_err .\"-must be 10 digits \"; \n\t\t\t\t\t\t$fields_ok = false; // indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} \n\t\t\n\t\t// determine if validating email address \n\t\tif ($field_code==4 or $field_code==104) { \n\t\t\t// validation may be required on email address \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==4 and (!isEmail($field_data))) { \n\t\t\t\t// required field and invalid email address \n\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\") { \n\t\t\t\t\t// validate email address \n\t\t\t\t\tif (!isEmail($field_data)) { \n\t\t\t\t\t\t// invalid email address \n\t\t\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}\n\t\t} \n\n\t\t// determine if no validation required (but could be required field) \n\t\tif ($field_code==5 or $field_code==105) { \n\t\t\t// considering field with no validation requirements \n\t\t\tif ($field_code==5 and strlen($field_data)==0) { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t}\n\t\t} \n\t} \n\n\t// all fields validated, return success/failure indicator \n\treturn $fields_ok; \t\n}", "public function validate_fields() {\n\n\t\t$this->validate_refund_address_field();\n\t}", "private function validatePaymentFields(){\n }", "function validate()\n\t\t{\n\t\t\tif(count($this->validateFields)==0 || !is_array($this->validateFields)){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t$error\t=\t0;\n\t\t\t\t$fieldPos=1;\n\t\t\t\t//First Validate For Empty on all fields //\n\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\n\t\t\t\t\tif(in_array(\"EMPTY\",$valids) && $checkedError==0){\n\t\t\t\t\t\tif($this->validateEmpty($key)){\n\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t$this->setError(\"Enter Mandatory Fields \");\n\t\t\t\t\t\t\t$checkedError\t=\t1;\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\t$fieldPos++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif($error==0){\n\t\t\t\t\t$fieldPos=1;\n\t\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"EMAIL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateEmail($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid email id in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"NUMBER\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateNumeric($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Enter Numeric in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(in_array(\"FILTER\",$valids)){\n\t\t\t\t\t\t\tif($this->validateSpecial($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Special chars not allowed in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"URL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateUrl($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid website address in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$fieldPos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\tif($error==0){\n\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public abstract function validation();", "abstract public function validateData();", "protected function preValidate() {}", "public function validation();", "function check_fields() {\r\n \r\n $fail = false;\r\n\t\t$empty = true;\r\n\t\t\r\n // if first name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputFirstName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputFirstName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['firstNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n // if last name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputLastName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputLastName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['lastNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n \r\n // if phone number contains any non-digit or - characters, exit\r\n\t\tif($_POST[\"InputPhone\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputPhone\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[0-9-]*$/\")))) {\r\n\t\t\t\t$GLOBALS['phoneNumberNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n if(!$fail && !$empty) {\r\n change_info();\r\n }\r\n }", "function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}", "public function validated();", "abstract public function validate();", "abstract public function validate();", "function validate(){\r\n\t\t$missing_fields = Array ();\r\n\t\tforeach ( $this->required_fields as $field ) {\r\n\t\t\t$true_field = $this->fields[$field]['name'];\r\n\t\t\tif ( $this->$true_field == \"\") {\r\n\t\t\t\t$missing_fields[] = $field;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( count($missing_fields) > 0){\r\n\t\t\t// TODO Create friendly equivelant names for missing fields notice in validation \r\n\t\t\t$this->errors[] = __ ( 'Missing fields: ' ) . implode ( \", \", $missing_fields ) . \". \";\r\n\t\t}\r\n\t\treturn apply_filters('em_event_validate', count($this->errors) == 0, $this );\r\n\t}", "protected function validate()\n {\n }", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "private function validateFormData() {\n\n $this->firstName = $this->generalFieldValidation($this->firstName, \"firstName\", \"First name\", 40, false);\n $this->lastName = $this->generalFieldValidation($this->lastName, \"lastName\", \"Last name\", 40, false);\n $this->email = $this->generalFieldValidation($this->email, \"email\", \"E-mail\", 60, false);\n $this->address = $this->generalFieldValidation($this->address, \"address\", \"Address\", 255);\n $this->city = $this->generalFieldValidation($this->city, \"city\", \"City\", 60);\n $this->state = $this->generalFieldValidation($this->state, \"state\", \"State\", 2);\n $this->zip = $this->generalFieldValidation($this->zip, \"zip\", \"Zip code\", 5);\n $this->phone = $this->generalFieldValidation($this->phone, \"phone\", \"Phone number\", 10, false);\n $this->notes = $this->generalFieldValidation($this->notes, \"notes\", \"Notes\", -1, false);\n if ($this->phone !== \"\") {\n if (!is_numeric($this->phone)) {\n $this->errorArray[\"phone\"] = \"Phone number may only contain digits.\";\n } else {\n if (strlen($this->phone) < 10) {\n $this->errorArray[\"phone\"] = \"Phone number must contain 10 digits.\";\n }\n }\n }\n if ($this->zip !== \"\") {\n if (!is_numeric($this->zip)) {\n $this->errorArray[\"zip\"] = \"Zip code may only contain digits.\";\n } else {\n if (strlen($this->zip) !== 5) {\n $this->errorArray[\"zip\"] = \"Five digit zip code required.\";\n }\n }\n }\n if ($this->email !== \"\") {\n if (!preg_match(\"/^\\S+@\\S+\\.\\S+$/\", $this->email)) {\n $this->errorArray[\"email\"] = \"E-mail address is not valid.\";\n }\n }\n if (count($this->errorArray) === 0) {\n $this->passedValidation = true;\n }\n }", "private function validateFields()\n {\n $errors = array();\n for ($x=0; $x < count($this->_fields); $x++)\n {\n $field = $this->_fields[$x];\n if ($field['type'] == WFT_CC_EXPIRATION)\n {\n // one or both fields left blank\n if (strlen(trim($this->getPostValue($field['id'] . 'Month'))) == 0 ||\n strlen(trim($this->getPostValue($field['id'] . 'Year'))) == 0)\n {\n if ($field['required'])\n $errors[] = 'You must select an card expiration month and year';\n $monthValue = $yearValue = -1;\n $value = '';\n }\n else\n {\n $monthValue = intval($this->getPostValue($field['id'] . 'Month'));\n $yearValue = intval($this->getPostValue($field['id'] . 'Year'));\n $curYear = intval(date('Y'));\n if ($yearValue < $curYear)\n $errors[] = 'The expiration year is in the past';\n if ($monthValue < 1 || $monthValue > 12)\n $errors[] = 'The expiration month is not valid';\n }\n }\n else if($field['required'] && !strlen(trim($this->getPostValue($field['id']))))\n {\n if (strlen($field['caption']) > 0)\n $errors[] = $field['caption'] . ' is a required field';\n else\n $errors[] = 'This field is required';\n $value = '';\n }\n else if($field['type'] == WFT_CURRENCY)\n {\n $value = trim($this->getPostValue($field['id']));\n $value = str_replace('$', '', $value);\n $cur = floatval($value);\n $value = strval($cur);\n }\n else if($field['type'] == WFT_ANTI_SPAM_IMAGE)\n {\n $antiSpamInput = $this->getPostValue($field['id']);\n $wordVerifyID = $this->getPostValue('wordVerifyID');\n $graphs = new Graphs();\n $wordVerifyText = $graphs->getVerificationImageText($wordVerifyID);\n if (strtoupper($antiSpamInput) != $wordVerifyText || $antiSpamInput == '')\n {\n $errors[] = 'The text you entered did not correspond with the text in the security image';\n $value = 0;\n }\n else\n {\n $value = 1;\n }\n $graphs->clearVerificationImageText($wordVerifyID);\n }\n else if($field['type'] == WFT_SELECT || $field['type'] == WFT_CC_TYPE || $field['type'] == WFT_BOOLEAN)\n {\n $value = $this->getPostValue($field['id']);\n if (!strcmp($value, 'noset'))\n {\n $errors[] = $field['caption'] . ': You must select an option';\n }\n }\n else if($field['type'] == WFT_CC_NUMBER)\n {\n $value = '';\n // Clean credit card number input\n $cardNumber = preg_replace('/[^0-9]/', '', $this->getPostValue($field['id']));\n\n if ($field['required'] == false && !strlen($cardNumber))\n {\n $value = '';\n }\n else\n {\n // Guess the card type by using a pregex pattern matching algorithm\n $cardType = $this->getCreditCardTypeByNumber($cardNumber);\n if ($cardType == -1)\n $errors[] = 'The credit card number you entered is not a recognized Visa, MasterCard, American Express '\n . 'or Discover card.';\n else if (!$this->isCardNumberValid($cardType, $cardNumber))\n $errors[] = 'The credit card number you entered has not been recognized and may be invalid.';\n else\n {\n // Valid card number, now change all card type fields to match\n // the autodetected card type (visa, mastercard, etc.)\n $value = $cardNumber;\n $cardTypeName = $this->getCreditCardName($cardType);\n\n for ($y=0; $y < count($this->_fields); $y++)\n {\n if ($this->_fields[$y]['type'] == WFT_CC_TYPE)\n {\n $this->_fields[$y]['validatedDataOverride'] = $cardTypeName;\n $this->_fields[$y]['validatedData'] = $cardTypeName;\n }\n }\n }\n }\n }\n else\n {\n $value = trim($this->getPostValue($field['id']));\n\n if (!($field['required'] == false && !strlen($value)))\n {\n if (strlen($field['regex_test']) > 0)\n {\n if (!preg_match($field['regex_test'], $value))\n {\n $errors[] = $field['regex_fail'];\n }\n }\n if (strlen($value) < $field['length'][0] || strlen($value) > $field['length'][1])\n {\n if ($field['length'][0] == $field['length'][1])\n {\n if (strlen(trim($field['caption'])) > 0)\n $errors[] = sprintf(\"%s must be %d characters in length\",\n $field['caption'], $field['length'][0]);\n else\n $errors[] = sprintf(\"This field must be %d characters in length\",\n $field['length'][0]);\n }\n else\n $errors[] = sprintf(\"%s must be between %s characters in length\",\n $field['caption'], implode(' and ', $field['length']));\n }\n }\n $value = str_replace(array(\"\\r\",\"\\n\",\"\\t\",\"\\f\"), '', strip_tags($value));\n }\n\n // Set the validated (form returned) data\n switch($field['type'])\n {\n case WFT_CC_EXPIRATION:\n if ($monthValue != -1 && $yearValue != -1)\n $this->_fields[$x]['validatedData'] = sprintf('%d/%d', $monthValue, $yearValue);\n else\n $this->_fields[$x]['validatedData'] = '';\n break;\n default:\n if (isset($this->_fields[$x]['validatedDataOverride']) && strlen($this->_fields[$x]['validatedDataOverride']))\n $this->_fields[$x]['validatedData'] = $this->_fields[$x]['validatedDataOverride'];\n else\n $this->_fields[$x]['validatedData'] = $value;\n break;\n }\n }\n return $errors;\n }", "protected function prepare_fields()\n {\n }", "function validateBizAddFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['businessCategory'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "abstract public function validate(array $data, array $fields);", "public function validate_customer_input_fields()\n {\n $passed_validation_tests = true;\n $check_name = has_presence($this->name);\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n if (!$check_name) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Customer name cannot be blank.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_telephone = has_presence($this->telephone);\n $check_telephone_numeric = has_number($this->telephone);\n $check_telephone_length = has_length($this->telephone, ['exact' => 10]);\n if (!$check_telephone or !$check_telephone_numeric or !$check_telephone_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Telephone: \";\n $msg .= h($this->telephone);\n $msg .= \" cannot be blank and must consists of 10 digits.\";\n $msg .= \"</li>\";\n }\n\n $check_barcode = has_presence($this->barcode);\n $check_barcode_numeric = has_number($this->barcode);\n $check_barcode_length = has_length($this->barcode, ['exact' => 6]);\n if (!$check_barcode or !$check_barcode_numeric or !$check_barcode_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Barcode: \";\n $msg .= h($this->barcode);\n $msg .= \" cannot be blank and must consists of 6 digits.\";\n $msg .= \"</li>\";\n }\n\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "protected function areFieldChangeFunctionsValid() {}", "protected function setupValidation()\n {\n }", "public static function input_fields()\n {\n }", "function validateBizEditFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['catID'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "protected function localValidation()\n\t\t{\n\t\t}", "public function validate() {\n\t\t$this->form_validation->set_rules('rfid', 'FRID', 'required');\t\t\n\t\t$this->form_validation->set_rules('person', \"Person\", 'required');\n\t\t$this->form_validation->set_rules('asset_id', \"Assets\", 'required'); \t\n\t\t$this->form_validation->set_rules('inform_mobile', \"Mobile No.\"); \t\n\t\t$this->form_validation->set_rules('inform_email', \"Email Id\"); \t\n\t\t$this->form_validation->set_rules('send_sms', \"Sms Alert\"); \t\n\t\t$this->form_validation->set_rules('send_email', \"Email Alert\"); \t\n\t\t$this->form_validation->set_rules('comments', \"Comments\"); \t\n\t\t$this->form_validation->set_rules('landmark_id', \"Landmark\"); \t\n\t\treturn parent::validate();\n\t}", "function validate() {\n//print \"Calling validate()\";\n\t\t// clear flags\n\t\t$this->fail_validate = 0;\n\t\t$this->fail_require = 0;\n\t\t\n\t\t$msgengine = new ooFormMessages;\n\t\t \n\t// for each of the fields by name, examine values\n\t// of params that exist for that name, if any\n\t\n\t// IMPORTANT change, what we really need to do now that we have a data structure representing the vlaues of form fields, is when a form is submitted, update the field values with the values from the CGI parameters.\n/*\n\nDEFAULTS --> form fields --> CGI PARAMS --> FIELD VALUES --> so that at this point, after submission, the params and field values are in sync, so that if you say $form->field() to the value, it is the same as the param just submitted.\n\nThis may be why FB uses two passes, one to redistribute the parameter values over the corresponding form fields. CGI PARAM -> FIELD VALUE\n\nThen it uses the field values to check against the regular expressions. I think I am still checking against the param and not updating the fields.\n\nWhere do I set the field value to the cgi value?\n\n*/\n\t\n\t// debug\n\t//print \"Fields to validate: \";\n\t//print_r( $this->fields_list );\n\t\n\t foreach ( $this->fields_list as $field_name ) {\n\t\t\n\t \t// debug\n\t\t//if( $this->debug == DEBUG_VERBOSE ) {\n\t\t//print '<pre style=\"border: 1px solid #ccc; background: #eee\">';\n\t\t//print \"Processing Field\\n\";\n\t\t//print \"Field: \" . $field_name .\"<BR>\";\n\t\t//print \"Value: \" . $this->value($field_name) .\"<BR><br>\";\n\t\t//print \"Fields<br>\";\n\t\t//print_r( $this->fields );\n \t\t//print \"</pre>\";\n\t\t//}\n\t\t\n\t\t/* My first way of thinking is to validate the values of CGI parameters. I'm thinking of a firewall, that I want to get the values first and check them. But ooForm is the firewall. So it would not make any difference if all parameters were redistributed to field values now that we keep a data structure of field properties, one of which is the value.\n\t\tThe regexes could be run against the field values instead of the cgi parameter values.\n\t\t*/\n\t\t\n\t\t// get the generic dynamic value for this field\n\t\t// which is either the default stored in props or from cgi\n\t\t//$val = $this->value($fieldname);\n\t\t// look down to validate section for where this really gets used\n\t\t\n\t\t//if( $val == '' ) {\n\t\t// Note, required validation fails unless you check against cgi params, can't use value function becuase it may be sticky or default value, for required, we must check params to see what is being submitted and what is not, because value may be giving us the default value or the cgi value depending on sticky status.\n\n/**\n * If this field is empty, test for required status,\n * otheriwse check for validity.\n *\n * FIXME: I think this should use empty()\n */\n\n\t\tif( $this->params_list[$field_name] == '' ) {\n//\t\tif( empty( $this->params_list[$field_name] ) ) {\n\t\t\n\t\t\t\t//if( $this->debug == DEBUG_VERBOSE ) {\n\t\t\t\t//print \"Param: \" . $field_name .\" is empty<BR>\";\n\t\t\t\t//}\n\t\t\t\t\n\t\t\t// we know the field is empty, check if required\n\t\t\tif(\tin_array($field_name, $this->required_list) ) {\n\t\t\t\n\t\t\t\n\t\t\t\t// set flag\n\t\t\t\t$this->fail_require = 1;\n\t\t\t\n\t\t\t\t// if empty and on required list, field is invalid\n\t\t\t\t$this->fields[$field_name][invalid] = 1;\n\t\t\t\n\t\t\t\t// IMPORTANT: if the intention is to render the form again with fields filled in for correction and error messages beside the fields, then we must store the required errors, not just stop at the first one.\n\t\t\t\t// to prepare for that I will try setting the invalid flag in the stored fields array for this field\n\n\t\t\t\t$this->fields[$field_name][required] = 1;\n\t\t\t\n\t\t\t\t// set the error message for this field\n\t\t\t\n\t\t\t\t// move to messages config\n\t\t\t\t//$temp = \"<span>Please enter a value for the '$field_name' field.</span>\";\n\t\t\t\t//$this->fields[$field_name][error] = $temp\n\n\t\t\t\t//print \"Setting Error Message:\";\n\t\t\t\t//print $msgengine->message('field_required', $this->fields[$field_name][label]);\n\t\t\t\t\n\t\t\t\t$this->fields[$field_name][error] = $msgengine->message('field_required', $this->fields[$field_name][label]);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t// moreover, I suppose you don't need to use this as a flag, you don't need to store failed required status, if you know the field is required, then after validation, you can then check that each required field has a value and compute the intersection with falied validate fields. No flag needs to be set, so what am I doing here?\n\n\t\t\t\t// debug\n\t\t\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\t\t\t\tprint \"Parameter \" . $field_name .\" failed required.<BR>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\n\t\t/*\n\t\t * Validate Fields\n\t\t *\n\t\t */\n\t\t \n\t\t // Note: if a field is empty, we don't check it for validity, we only check non-empty fields for validity, we check empty fields to see if they are required, once that check is done, we don't have to check if valid.\n\t\t\n\t\t/* LOOK HERE! This is where we get the value to validate from the PAREMETER LIST instead of from the field value. This is legacy practice. It should get it from the field value and field values all \"redistributed\" prior to validation.\n\n\t\tStill does not answer where the value is being set.\n\t\t*/\n\t\t\n\t\t// now we get value at top before conditional\n\t\t//$val = $this->params_list[$field_name];\n\t\t\n\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\tprint \"Validating \" . $field_name .\"<BR>\";\n\t\tprint \"With Value: \" . $this->value($field_name) .\"<BR>\";\n\t\t}\n\t\t\n\t\t// get regex\n\t\tif( array_key_exists($this->validate_list[$field_name], $this->rules_list) \n\t\t\t&& preg_match('/_[a-zA-Z]+$/', $this->validate_list[$field_name])\n\t\t\t) {\n\t\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\t\tprint \"Using rule\";\n\t\t\t}\n\t\t $regex = $this->rules_list[$this->validate_list[$field_name]];\n\t\t } else {\n\t\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\t\tprint \"Using user defined rule\";\n\t\t\t}\n\t\t $regex = $this->validate_list[$field_name];\n\t\t }\n\t\t\tif( $regex != '' && (! preg_match( $regex, $this->value($field_name))) )\n\t\t\t{\n\t\t\t// error validation\n\t\t\t$this->fail_validate = 1;\n\t\t\t\t\t\t\n\t\t\t// experimental code to set invalid flag for this field\n\t\t\t$this->fields[$field_name][invalid] = 1;\n\t\t\t// and error message\n\t\t\t//$this->fields[$field_name][error] = $this->messages_list[$field_name];\n// set through class\n\n/**\n * Validate message trumps required message.\n */\n \n// TEMP DISABLED\n$this->fields[$field_name][error] = $msgengine->message('field_invalid', $this->fields[$field_name][label]);\n\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t} // end foreach\n\t\n\t// debug\t\n\t//print \"Fail Validate: \". $this->fail_validate .\"<br>\";;\n\t//print \"Fail Require: \". $this->fail_require .\"<BR><br>\";;\n\t\t\n\t\t\n\tif( $this->fail_validate\n\t|| $this->fail_require ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n\t\n\t\n}", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "function validate()\n\t{\n\t}", "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}", "protected function restrict_fields()\n {\n }", "function validate_fields($part){\r\n\tif($part == 1){\r\n\t\t$error_msg = array();\r\n\t\t// check that name is not empty or larger than database can hold\r\n\t\tif (!isset($_POST['fullName'])){\r\n\t\t\t$error_msg[] = \"Name field is blank.\";\r\n\t\t} else if (isset($_POST['fullName'])){\r\n\t\t\t$name = trim($_POST['fullName']);\r\n\t\t\tif (empty($name)){\r\n\t\t\t\t$error_msg[] = \"Name field is blank.\";\r\n\t\t\t} else {\r\n\t\t\t\tif (strlen($name) > 128){\r\n\t\t\t\t\t$error_msg[] = \"First Name field cannot contain more than 128 characters.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check that age is set and numeric \r\n\t\tif (!isset($_POST['age'])){\r\n\t\t\t$error_msg[] = \"Age field is blank.\";\r\n\t\t} else if (isset($_POST['age'])){\r\n\t\t\tif (!is_numeric($_POST['age'])) {\r\n\t\t\t\t$error_msg[] = \"Age: Please enter numbers only\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check that dropdown option has been chosen \r\n\t\tif (!isset($_POST['student'])){\r\n\t\t\t$error_msg[] = \"Are you a student? Please choose one.\";\r\n\t\t} else if (isset($_POST['student'])){\r\n\t\t\t$age = $_POST['student'];\r\n\t\t\tif(!($age == \"F\" || $age == \"P\" || $age == \"N\")){\r\n\t\t\t\t$error_msg[] = \"Inappropriate answer given. Please select one from dropdown.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n\tif($part == 2){\r\n\t\t$error_msg = array();\r\n\t\t// check that purchase method is chosen \r\n\t\tif (!isset($_POST['howPurchased'])){\r\n\t\t\t$error_msg[] = \"Please select method of purchase.\";\r\n\t\t} else if (isset($_POST['howPurchased'])){\r\n\t\t\t$purchased = $_POST['howPurchased']; \r\n\t\t\tif(!($purchased == \"Online\" || $purchased == \"By Phone\" || $purchased == \"Mobile App\" || $purchased == \"In Store\")){\r\n\t\t\t\t$error_msg[] = \"Inappropriate value for method of purchase. Please select one. \".$purchased;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// check that one or more products has been chosen\r\n\t\tif (!isset($_POST['purchases'])){\r\n\t\t\t$error_msg[] = \"Please select at least one product.\";\r\n\t\t} else if (isset($_POST['purchases'])){\r\n\t\t\t$purchases = $_POST['purchases'];\r\n\t\t\tif(count($purchases) < 1){\r\n\t\t\t\t$error_msg[] = \"Please select at least one product.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n\tif($part == 3){\r\n\t\t$error_msg = array();\r\n\t\tfor($x = 0; $x < count($_SESSION['purchases']); $x++){\r\n\t\t\t// check that satisfaction is chosen \r\n\t\t\tif (!isset($_POST['satisfaction'.$x])){\r\n\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Please select level of satisfaction\";\r\n\t\t\t} else if (isset($_POST['satisfaction'.$x])){\r\n\t\t\t\t$sat = $_POST['satisfaction'.$x];\r\n\t\t\t\tif(!is_numeric($sat) || $sat < 1 || $sat > 5){\r\n\t\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Inappropriate value for satisfaction.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// check that recommendation has been chosen\r\n\t\t\tif (!isset($_POST['recommend'.$x])){\r\n\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Please choose recommendation option.\";\r\n\t\t\t} else if (isset($_POST['recommend'.$x])){\r\n\t\t\t\t$rec = $_POST['recommend'.$x];\r\n\t\t\t\tif(!($rec == \"Yes\" || $rec == \"Maybe\" || $rec == \"No\")){\r\n\t\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Inappropriate answer given. Please select one from dropdown.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n}", "function validateAll(){\n foreach($this->fields as $field){\n $val = $_POST[$field['id']];\n if($field['validate']){\n switch($field['type']){\n case \"email\":\n if(!filter_var($val, FILTER_VALIDATE_EMAIL)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n break;\n case \"number\":\n if(!is_numeric($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n if($this->fields[$field['id']]['min'] > $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n if($this->fields[$field['id']]['max'] < $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"password\":\n if($this->fields[$field['id']]['compare']){\n $compareWith = $this->fields[$field['id']]['compare'];\n if($val != $_POST[$compareWith]){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }else if(!$this->validatePassword($val) || !$this->validatePassword($_POST[$compareWith])){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }else{\n if(!$this->validatePassword($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n break;\n case \"date\":\n if(!$this->validateDate($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n $min = $this->fields[$field['id']]['min'];\n if($this->compareDates($min, $val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n $max = $this->fields[$field['id']]['max'];\n if($this->compareDates($val, $max)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"radio\":\n if(!$val){\n $this->fields[$field['id']]['error'] .= \" error\";\n }\n break;\n default:\n if(!$val){\n $this->fields[$field['id']]['class'] .= \" error\";\n }\n }\n }\n }\n return ($this->has_errors ? false : true);\n }", "public function validations() {\n $this->form_validation->set_rules('name', 'Name', 'trim|required|alpha');\n $this->form_validation->set_rules('age', 'Age', 'trim|required|is_natural_no_zero|max_length[2]');\n $this->form_validation->set_rules('dob', 'Date Of Birth', 'trim|required');\n $this->form_validation->set_rules('profession', 'Select Profession', 'trim|required');\n $this->form_validation->set_rules('locality', 'Locality', 'trim|required|alpha');\n $this->form_validation->set_rules('guests', 'No. of Guests', 'trim|required');\n $this->form_validation->set_rules('address', 'Address', 'trim|required');\n }", "function validateallFields(){\r\n\t$response = array();\r\n\t$valid = FALSE;\r\n\t//validate first name\r\n\t//first name should not be numeric\r\n\tif(is_numeric($_POST['fname'])){\r\n\t\t$response['message'] = \"First name should not be a number\";\r\n\t\t$response['valid'] = false;\r\n\t\treturn $response;\r\n\t}elseif(is_numeric($_POST['lname'])){\r\n\t\t$response['message'] = \"Last name should not be a number\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t}elseif(is_numeric($_POST['username'])){\r\n\t\t$response['message'] = \"Your username should not be numeric\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t}elseif(is_numeric($_POST['address'])){\r\n\t\t$response['message'] = \"address should be alphanumeric\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t}elseif(!is_numeric($_POST['contact'])){\r\n\t\t$response['message'] = \"Your contact should be numeric\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t\r\n\t}else{\r\n\t\t$response['valid'] = TRUE;\r\n\t\treturn $response;\r\n\t}\r\n\r\n}", "public static function validate() {}", "function tower_form_errors($data, $fields=[]) {\n $form_errors = [];\n foreach ($fields as $field) {\n $rules = explode('|', $field['rules']);\n $field_is_valid = true;\n $field_name = $field['name'];\n $value = trim(sanitize_text_field($data->get_param($field_name)));\n\n foreach ($rules as $rule) {\n if (! $field_is_valid) break;\n\n switch ($rule) {\n case 'email':\n if (! filter_var($value, FILTER_VALIDATE_EMAIL)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'Enter a valid email address';\n }\n break;\n\n case 'number':\n if (! is_numeric($value)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field needs to be numeric';\n }\n break;\n\n case 'required':\n if ($value == '') {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field is required';\n }\n break;\n\n case 'unique':\n // check DB for meta-value duplicate entry\n global $wpdb;\n $row_count = $wpdb->get_var(\"\n SELECT COUNT(`meta_id`)\n FROM {$wpdb->postmeta} \n WHERE `meta_key` = '{$field_name}' \n AND `meta_value` = '{$value}'\n \");\n if ($row_count > 0) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This value already exists. Please select another';\n }\n break;\n }\n }\n }\n return $form_errors;\n}", "public function validateForm(){\n foreach(self::$fields as $field){\n if(!array_key_exists($field, $this->data)){\n trigger_error(\"$field is not presented in data\");\n return;\n } \n }\n $this->validateUsername();\n $this->validatePassword();\n $this->validateEmail();\n $this->validateFullname();\n return $this->errors;\n }", "abstract protected function validate($data);", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "protected function prepareForValidation(): void\n {\n // $this->merge([\n // 'created_by' => Auth::user()->id\n // ]);\n // $this->merge([\n // 'updated_by' => Auth::user()->id\n // ]);\n\n // $this->merge([\n // 'status' => 'Active',\n // 'name' => $this->input('display_name'),\n // 'password' => ''\n // ]);\n\n\n // $this->merge([\n // 'slug' => str_slug($this->input('title'))\n // ]);\n // $this->merge([\n // 'posted_at' => Carbon::parse($this->input('posted_at'))\n // ]);\n }", "function HAA_parseFormData($form_data)\n{\n // Array containing parsed form parameters.\n $form_params = array();\n // List of valid column names.\n $column_whitelist = array(\n 'full_name',\n 'email'\n );\n\n // Name of corresponding fields.\n $fields = array(\n 'full_name' => 'Full Name',\n 'email' => 'Email',\n 'complaint_description' => 'Complaint Description'\n );\n\n // List of columns to be validated for email.\n $emails = array(\n 'email'\n );\n\n // List of columns to be validated for alphabets only.\n $names = array(\n 'full_name'\n );\n\n //Check that email and complaint are filled\n $error = false;\n if (! isset($form_data['complaint_description'])\n || empty($form_data['complaint_description'])\n ) {\n HAA_gotError(\n 'Complaint description was left blank.'\n );\n $error = true;\n }\n\n foreach ($form_data as $column => $value) {\n if (! empty($column) && in_array($column, $column_whitelist)) {\n if (in_array($column, $emails)) {\n if (! HAA_validateValue($value, 'email')) {\n HAA_inValidField($fields[$column]);\n } else {\n $form_params[':' . $column] = $value;\n }\n } elseif (in_array($column, $names)) {\n if (! HAA_validateValue($value, 'name')) {\n HAA_inValidField($fields[$column]);\n } else {\n $form_params[':' . $column] = $value;\n }\n } else {\n // Do nothing\n }\n\n // Remove matched element from white list.\n $column_whitelist = array_diff($column_whitelist, array($column));\n }\n }\n\n //If any error, exit\n if ($error==true) {\n return false;\n }\n\n $form_params[':complaint_description'] = $form_data['complaint_description'];\n\n // If faced any error.\n if (! empty($GLOBALS['error'])) {\n return false;\n }\n\n return $form_params;\n}", "public static function ValidateFields($fieldsRequired, $fieldsSize, $fieldsValidate, $dat, $die = true)\n {\n \tglobal $_error;\n\n\t$error = 0;\n foreach ($fieldsRequired as $field)\n {\n if (self::isEmpty($dat[$field]) AND (!is_numeric($dat[$field])))\n {\n \t$field_name = Core::FormatFieldName($field);\n $_error->AddError($field_name . ' is empty.');\n\t\t$error = 1;\n //return false;\n }\n }\n foreach ($fieldsSize as $field => $size)\n {\n if (isset($dat[$field]) AND self::strlen($this->{$field}) > $size)\n {\n /*\n if ($die) die (Tools::displayError().' ('.get_class($this).' -> '.$field.' length > '.$size.')');\n */\n\t\t$_error->AddError(\"Maximum size of \".$field_name.\" is \".$size);\n //return false;\n\t\t$error = 1;\n }\n }\n\n foreach ($fieldsValidate as $field => $method)\n {\n if (self::isEmpty($dat[$field]))\n {\n\t\t$error = 1;\n // return FALSE;\n }\n elseif (function_exists($method))\n {\n if(!$method($dat[$field]))\n {\n \t$field_name = Core::FormatFieldName($field);\n \t$_error->AddError('Provide Valid '.$field_name);\n\t\t\t$error = 1;\n \t//return FALSE;\n }\n }\n else\n {\n if (!self::$method($dat[$field]))\n {\n\t\t\t$error = 1;\n //return FALSE;\n }\n }\n }\n/*\n if (!method_exists($validate, $method))\n die (Tools::displayError('validation function not found').' '.$method);\n elseif (!Tools::isEmpty($this->{$field}) AND !call_user_func(array('Validate', $method), $this->{$field}))\n {\n if ($die) die (Tools::displayError().' ('.get_class($this).' -> '.$field.' = '.$this->{$field}.')');\n return false;\n }\n*/\tif($error == 1)\n\t\treturn false;\n\n return true;\n }", "public function & validate() {\n\t\t# INitialize\n\t\t$fields =& $this->getFields();\n\t\t$this->validated = true;\n\t\t# Validate fields\n\t\tforeach ($fields as $field) {\n\t\t\t# Any soingle invalid field would cause to return invalid\n\t\t\tif (!$field->validate() && $this->validated) {\n\t\t\t\t# Mark as invalie\n\t\t\t\t$this->validated = false;\n\t\t\t}\n\t\t}\n\t\t# Return vaidation state\n\t\treturn $this->validated;\n\t}", "function validate_field($field)\n {\n }", "function validate($data = false) {\n\t\tif ($data === false) {\n\t\t\tfix_POST_slashes();\n\t\t\t$data = $_POST;\n\t\t}\n\t\t$this->valid = true;\n\t\tforeach ($this->fields as $field) {\n\t\t\t# make sure the field is not missing\n\t\t\tif ($field->is_required() and (!isset($data[$field->get_var_name()]) or $data[$field->get_var_name()] === \"\")) {\n\t\t\t\t# field is missing\n\t\t\t\t$field->add_status(FH_Statuses::MISSING);\n\t\t\t\t$this->add_message(\"Missing field \" . $field->get_label(), $field);\n\t\t\t\t$this->valid = false;\n\t\t\t} else {\n\t\t\t\t$value = $data[$field->get_var_name()];\n\t\t\t\t# lets make sure the value is correct\n\t\t\t\t# some filters taken from\n\t\t\t\t# http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/\n\t\t\t\t\n\t\t\t\t# If this is a multiple value field then we need to test each value\n\t\t\t\tif ($field->get_multiple_values() and gettype($value) == \"array\") {\n\t\t\t\t\t# need to loop through the values\n\t\t\t\t\tfor ($i = 0; $i < sizeof($value); $i++) {\n\t\t\t\t\t\t$subvalue = $value[$i];\n\t\t\t\t\t\tif ($field->is_required() and $subvalue === \"\") {\n\t\t\t\t\t\t\t# field is missing\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::MISSING, $i);\n\t\t\t\t\t\t\t$this->add_message(\"Missing field \" . $field->get_label(), $field, $i);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($field->get_format() == FH_Formats::DATE) {\n\t\t\t\t\t\t\tif (preg_match(\"/^(\\d{1,2})[\\/\\.\\-](\\d{1,2})[\\/\\.\\-](\\d{2,4})$/\", $subvalue, $matches)) {\n\t\t\t\t\t\t\t\t$subvalue = $matches[1] . \"/\" . $matches[2] . \"/\" . $matches[3];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" needs to be in format m/d/yyyy\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::PRICE) {\n\t\t\t\t\t\t\t$subvalue = floatval(preg_replace(\"/[^\\-\\d\\.]/\",\"\", $subvalue));\n\t\t\t\t\t\t\t#$subvalue = number_format($subvalue, 2);\n\t\t\t\t\t\t\t# Having a value of 0 or less is not necessarily an invalid number, this should be checked by min max\n\t\t\t\t\t\t\tif (false and $value <= 0) {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then 0\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::CURRENCY) {\n\t\t\t\t\t\t\t$subvalue = floatval(preg_replace(\"/[^\\-\\d\\.]/\",\"\", $subvalue));\n\t\t\t\t\t\t\t$subvalue = money_format($subvalue,2);\n\t\t\t\t\t\t\t# Having a value of 0 or less is not necessarily an invalid number, this should be checked by min max\n\t\t\t\t\t\t\tif (false and $value <= 0) {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then 0\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::STATE) {\n\t\t\t\t\t\t\tif (preg_match(\"/^\\w\\w$/\", $subvalue, $matches)) {\n\t\t\t\t\t\t\t\t$subvalue = strtoupper($subvalue);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" 2 letters\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::ZIP) {\n\t\t\t\t\t\t\tif (preg_match(\"/^(\\d\\d\\d\\d\\d)/\", $subvalue, $matches)) {\n\t\t\t\t\t\t\t\t$subvalue = $matches[1];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" 5 digit zip code\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::EMAIL) {\n\t\t\t\t\t\t\t#if (eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $subvalue) {\n\t\t\t\t\t\t\tif (filter_var($subvalue, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t\t\t\t$subvalue = strtolower($subvalue);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$subvalue = strtolower(preg_replace(\"/[\\s]/\", \"\", $subvalue));\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a valid email\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::PHONE) {\n\t\t\t\t\t\t\t# OLD match string, need to have a better phone format function\n\t\t\t\t\t\t\t#if (preg_match('/\\(?\\d{3}\\)?[-\\s.]?\\d{3}[-\\s.]\\d{4}/x', $subvalue)) {\n\t\t\t\t\t\t\tif (preg_match('/\\d{3}-\\d{3}-\\d{4}/', $subvalue)) {\n\t\t\t\t\t\t\t\t$subvalue = strtolower($subvalue);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$tmpValue = strtolower(preg_replace(\"/[\\s\\D]/\", \"\", $subvalue));\n\t\t\t\t\t\t\t\tif (preg_match('/^(\\d{3})(\\d{3})(\\d{4})$/', $tmpValue, $match)) {\n\t\t\t\t\t\t\t\t\t$subvalue = $match[1] . \"-\" . $match[2] . \"-\" . $match[3];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a phone number in the form 999-999-9999\", $field, $i);\n\t\t\t\t\t\t\t\t\t$this->valid = false;\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\tif ($field->is_numeric()) {\n\t\t\t\t\t\t\t# we need to make sure that this is a number\n\t\t\t\t\t\t\tif (!is_numeric($subvalue)) {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a number\", $field, $i);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!is_null($field->get_min()) and $field->get_min() != '') { \n\t\t\t\t\t\t\t\tif ($field->get_value() < $field->get_min()) {\n\t\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then or equal to \" . $field->get_min(), $field, $i);\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 (!is_null($field->get_max()) and $field->get_min() != '') { \n\t\t\t\t\t\t\t\tif ($field->get_value() > $field->get_max() and $field->get_max() != '') {\n\t\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be less then or equal to \" . $field->get_max(), $field, $i);\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\t$value[$i] = $subvalue;\n\t\t\t\t\t}\n\t\t\t\t\t$field->set_value($value);\n\t\t\t\t} else {\n\t\t\t\t\tif ($field->get_format() == FH_Formats::DATE) {\n\t\t\t\t\t\tif (preg_match(\"/^(\\d{1,2})[\\/\\.\\-](\\d{1,2})[\\/\\.\\-](\\d{2,4})$/\", $value, $matches)) {\n\t\t\t\t\t\t\t$value = $matches[1] . \"/\" . $matches[2] . \"/\" . $matches[3];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" needs to be in format m/d/yyyy\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::PRICE) {\n\t\t\t\t\t\t$value = floatval(preg_replace(\"/[^\\-\\d\\.]/\",\"\", $value));\n\t\t\t\t\t\t#$value = number_format($value, 2);\n\t\t\t\t\t\t# Having a value of 0 or less is not necessarily an invalid number, this should be checked by min max\n\t\t\t\t\t\tif (false and $value <= 0) {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then 0\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::CURRENCY) {\n\t\t\t\t\t\t$value = floatval(preg_replace(\"/[^\\-\\d\\.]/\",\"\", $value));\n\t\t\t\t\t\t$value = money_format($value,2);\n\t\t\t\t\t\tif (false and $value <= 0) {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then 0\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::STATE) {\n\t\t\t\t\t\tif (preg_match(\"/^\\w\\w$/\", $value, $matches)) {\n\t\t\t\t\t\t\t$value = strtoupper($value);\n\t\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" 2 letters\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::ZIP) {\n\t\t\t\t\t\tif (preg_match(\"/^(\\d\\d\\d\\d\\d)/\", $value, $matches)) {\n\t\t\t\t\t\t\t$value = $matches[1];\n\t\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" 5 digit zip code\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::EMAIL) {\n\t\t\t\t\t\t#if (eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $value) {\n\t\t\t\t\t\tif (filter_var($value, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t\t\t$value = strtolower($value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$value = strtolower(preg_replace(\"/[\\s]/\", \"\", $value));\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a valid email\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::PHONE) {\n\t\t\t\t\t\t# OLD match string, need to have a better phone format function\n\t\t\t\t\t\t#if (preg_match('/\\(?\\d{3}\\)?[-\\s.]?\\d{3}[-\\s.]\\d{4}/x', $value)) {\n\t\t\t\t\t\tif (preg_match('/\\d{3}-\\d{3}-\\d{4}/', $value)) {\n\t\t\t\t\t\t\t$value = strtolower($value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$tmpValue = strtolower(preg_replace(\"/[\\s\\D]/\", \"\", $value));\n\t\t\t\t\t\t\tif (preg_match('/^(\\d{3})(\\d{3})(\\d{4})$/', $tmpValue, $match)) {\n\t\t\t\t\t\t\t\t$value = $match[1] . \"-\" . $match[2] . \"-\" . $match[3];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a phone number in the form 999-999-9999\", $field);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t}\n\t\t\t\t\tif ($field->is_numeric()) {\n\t\t\t\t\t\t# we need to make sure that this is a number\n\t\t\t\t\t\tif (!is_numeric($value)) {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a number\", $field);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_null($field->get_min()) and $field->get_min() != '') { \n\t\t\t\t\t\t\tif ($field->get_value() < $field->get_min()) {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then or equal to \" . $field->get_min(), $field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_null($field->get_max()) and $field->get_min() != '') { \n\t\t\t\t\t\t\tif ($field->get_value() > $field->get_max() and $field->get_max() != '') {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be less then or equal to \" . $field->get_max(), $field);\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 validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "private function validateData() {\r\n\r\n $requiredFields = array(\"v_code\" => \"Verification code not supplied\",\r\n \"psw1\" => \"Password field is empty\",\r\n \"psw2\" => \"Password field is empty\",);\r\n\r\n\r\n //0 means there is no error\r\n $error_status = \\VAL_NO_ERROR;\r\n\r\n /*\r\n Initialize error object that will be returned by this function\r\n */\r\n $error_obj = new stdClass();\r\n $error_obj->msg = \"\";\r\n $error_obj->field = \"\";\r\n $error_obj->code = 0;\r\n $error_obj->type = \\VAL_NO_ERROR;\r\n\r\n //check if required variables are defined\r\n foreach ($requiredFields as $key => $value) {\r\n $value = $this->request->request->get($key);\r\n if (empty( $value )) {\r\n $error_obj->field = $key;\r\n $error_obj->msg = $requiredFields[$key];\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n //return after each field that is found wrong\r\n return $error_obj;\r\n }\r\n }\r\n\r\n $pass_1 = $this->request->request->get('psw1');\r\n $pass_2 = $this->request->request->get('psw2');\r\n\r\n //Check if emails match\r\n if (strcmp($pass_1, $pass_2) != 0) {\r\n $error_obj->field = \"psw2\";\r\n $error_obj->msg = \"Passwords are different\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n /*\r\n Only check one password. If both passwords are thesame, we only need to check one of them.\r\n */\r\n if (!preg_match('/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}$/', $pass_1)) {\r\n $error_obj->field = \"psw1\";\r\n $error_obj->msg = \"Password must have a digit, lower and upper case charters. Min lenght is 6\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n return $error_obj;\r\n }", "function RegisterValidate() {\n\t\t\n\t\n\t\t$validate1 = array(\n\t\t\t'username'=> array(\n\t\t\t\t\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t\t\t\t'message'=> 'Please enter name')\n\t\t\t\t\t\t\t\t\t),\t\n\t\t\t'candidate_fname'=> array(\n\t\t\t\t\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t\t\t\t'message'=> 'Please enter first name')\n\t\t\t\t\t\t\t\t\t),\n\t\t\t'terms' => array(\n\t\t\t\t\t\t 'rule' => array('comparison', 'equal to', 1),\n\t\t\t\t\t\t 'required' => true,\n\t\t\t\t\t\t 'allowEmpty' => false,\n\t\t\t\t\t\t 'on' => 'index',\n\t\t\t\t\t\t 'message' => 'You have to agree terms & conditions'\n ),\n\t\t\t'candidate_lname'=> array(\n\t\t\t\t\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t\t\t\t'message'=> 'Please enter last name')\n\t\t\t\t\t\t\t\t\t),\t\t\n\t\t\t/*'candidate_title' => array(\n\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t'message' => 'Please enter title'\n\t\t\t\t),*/\n\t\t\t'candidate_phone' => array(\n\t\t\t\t\t'notEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter phone number',\n\t\t\t\t\t\t'last'=>true)\t\t\t\n\t\t\t\t),\n\t\t\t'candidate_city' => array(\n\t\t\t\t\t'rule' \t => 'notEmpty',\n\t\t\t\t\t'message' => 'Please enter city'\n\t\t\t\t),\n\t\t\t'candidate_address' => array(\n\t\t\t\t\t'rule' \t => 'notEmpty',\n\t\t\t\t\t'message' => 'Please enter address'\n\t\t\t\t),\n\t\t\t'candidate_zip'=> array(\n\t\t\t\t\t'notEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter zip Code',\n\t\t\t\t\t\t'last'=>true),\n\t\t\t\t\t'mustBeEmail'=> array(\n\t\t\t\t\t\t'rule' => 'numeric',\n\t\t\t\t\t\t'message' => 'Please enter valid zip Code',\n\t\t\t\t\t\t'last'=>true),\n\t\t\t\t\t'mustBeLonger' => array(\n\t\t\t\t\t\t'rule' => array('minLength', 5),\n\t\t\t\t\t\t'message' => 'Please enter valid zip Code'\n\t\t\t\t\t),\n\t\t\t\t\t'maxlength' => array(\n\t\t\t\t\t\t'rule' => array('maxLength', 5),\n\t\t\t\t\t\t'message' => 'Please enter valid zip Code'\n\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t'candidate_email'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter email',\n\t\t\t\t\t\t'last'=>true),\n\t\t\t\t\t'mustBeEmail'=> array(\n\t\t\t\t\t\t'rule' => array('email'),\n\t\t\t\t\t\t'message' => 'Please enter valid email',\n\t\t\t\t\t\t'last'=>true),\n\t\t\t\t\t'mustUnique'=>array(\n\t\t\t\t\t\t'rule' =>'isUnique',\n\t\t\t\t\t\t'message' =>'This email is already registered',\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t'candidate_secondary_email'=> array(\n\t\t\t\t\t'allowEmpty'=> array(\n\t\t\t\t\t\t'rule' => 'email',\n\t\t\t\t\t\t'allowEmpty' => true,\n\t\t\t\t\t\t'message' => 'Please enter valid email',\n\t\t\t\t\t\t'last'=>true)\n\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->validate=$validate1;\n\t\t\treturn $this->validates();\n\t}", "protected function _updatefields() {}", "public function validateFields($fieldRules)\n {\n global $errorFeedback;\n $errors = [];\n foreach($fieldRules as $field => $rules){\n $fieldErrors = [];\n $value = $_REQUEST[$field];\n\n $d = new Disinfect();\n $d->disinfect($value);\n\n foreach($rules as $rule){\n\n if($rule == 'required'){\n if(! isset($value) || trim($value) == '' ){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'its required'\n }\n }\n\n if($rule == 'number'){\n if($value != '' && ! preg_match('/^(\\d+)$/', $value)){\n $fieldErrors[] = $errorFeedback[$rule]; // 'its a number'\n }\n }\n\n if($rule == 'freeNickname'){\n $u = new UserModel();\n $nickexist = $u->getUsersByNickname($value);\n if (!$nickexist == false) {\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'nickname not free'\n }\n }\n\n if($rule == 'max15chars'){\n if($value != '' && strlen($value) > 15){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'max chars 15'\n }\n }\n\n if($rule == 'max35chars'){\n if($value != '' && strlen($value) > 35){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'max chars 35'\n }\n }\n\n if($rule == 'min5chars'){\n if($value != '' && strlen($value) < 5){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'min chars 5'\n }\n }\n\n if($rule == 'password'){ // not in use jet!\n\n if($value != '' && ! preg_match('/^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8,}$/', $value)){\n $fieldErrors[] = $this->errorFeedback[$rule];\n //'its a password with = 8 characters length oe more, 2 letters in Upper Case, 1 Special Character, 2 numerals, 3 letters in Lower Case'\n // TODO use the Password validation if you want you passwords really save (and annoy the users)\n }\n }\n }\n // Are there some errors?\n if(count($fieldErrors) != 0){\n $errors[$field] = $fieldErrors;\n }\n }\n return $errors;\n }", "function ValidateBeforeAdd(){\n $this->validator->ValidateForm($this->_data, true);\n }", "public function validate() {\n // loop through validators and run them\n foreach($this->form_fields as $field) {\n $field->valid = TRUE;\n // validate required items\n if ($field->required) {\n if ((strlen($field->value) == 0) || (empty($field->value)) || (is_null($field->value)) ) {\n $field->valid = FALSE; $this->form_errors++; \n if ((isset($field->default_error)) && (!empty($field->default_error))) {\n $field->error = $field->default_error;\n }\n else {\n $field->error = \"This field is required\";\n }\n }\n }\n // run validators for items that are not already failed\n if (($field->valid) && (!empty($field->validator)) && (is_array($field->validator))) {\n\n // skip empty fields\n if (empty($field->value)) { continue; }\n\n foreach($field->validator as $validator) {\n // run the function\n if (call_user_func($validator['func'],$field->value)) {\n $field->valid = TRUE;\n }\n else {\n $field->valid = FALSE; $this->form_errors++; \n if ((isset($validator['message'])) && (!empty($validator['message']))) {\n $field->error = $validator['message'];\n }\n else if ((isset($field->default_error)) && (!empty($field->default_error))) {\n $field->error = $field->default_error;\n }\n else {\n $field->error = \"This field contains an invalid value\";\n }\n // break out of the loop. No need to continue with validations if one has failed\n break;\n }\n }\n }\n $this->form_validated = TRUE;\n // run the post validate method to levy modifications against the validated input\n $this->postValidate();\n }\n return;\n }", "private function checkFields()\r\n {\r\n $vars = array('user', 'pass', 'numbers', 'message', 'date', 'ids', 'data_start', 'data_end',\r\n 'lido', 'status', 'entregue', 'data_confirmacao', 'return_format'\r\n );\r\n\r\n $final = array();\r\n foreach ($vars as $key => $value) {\r\n if ($this->$value !== '') {\r\n $final[$value] = $this->$value;\r\n }\r\n }\r\n return $final;\r\n }", "function validate_ref_no($formdata,$required_fields = array(),$correctformat=array())\n{\n\tprint_r($correctformat); exit();\n \t\n\t/*$empty_fields = array();\n\t$bool_result = TRUE;\n\tforeach($required_fields AS $required)\n\t{\n\t\t//compare fordata;\n\t\t//if($formdata)\n\n\t\t#array_push($empty_fields, $field_str[0]);\n\t} */\n}", "function validateInputs(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\tif(!matchRegex($nric,'/^[a-zA-Z0-9]*$/')) { return false; }\n\tif(!matchRegex($firstName,'/^[a-zA-Z0-9 ]*$/')) { return false; }\n\tif(!matchRegex($lastName,'/^[a-zA-Z0-9 ]*$/')) { return false; }\n\tif(!matchRegex($dob,'/^[0-9-]*$/')) { return false; }\n\tif(!matchRegex($address1,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\tif(!matchRegex($address2,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\tif(!matchRegex($poCode,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($homeNum,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($handphoneNum,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($email,'/^[a-zA-Z0-9@._-]*$/')) { return false; }\n\tif(!matchRegex($description,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\t\n\treturn true;\n}", "public function validate() {\n\n // Tell ourselves that the client has initiated validation.\n $this->hasRanValidation = true;\n\n // Sanitize and filter all of our field data.\n $this->filterFields();\n\n // Validate each field individually.\n foreach ($this->fields as $field) {\n\n // Skip fields with no rules.\n if (!$field->getGumpRules()) {\n continue;\n }\n\n // Validate this field.\n $fieldError = $field->validate();\n\n // Add any errors to our error log.\n if ($fieldError) {\n $this->addError($field, $fieldError);\n }\n }\n }", "abstract protected function fields();", "abstract protected function fields();", "protected function setupFields()\n {\n }", "function validate_user_field($field)\n {\n }", "public function validate()\n {\n // TODO implement this\n }", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "public function validate()\n {\n }", "public function validate()\n {\n }", "function _prepare_validation()\n\t{\n\t\t$this->load->library('form_validation');\t\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t//Setting Validation Rule\t\n\t\t$this->form_validation->set_rules('samity_id','Code','trim|required|xss_clean|max_length[100]');\n\t\t$this->form_validation->set_rules('cbo_samity_day','Samity Day','trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('txt_effective_date','Effective Date','trim|required|max_length[10]|is_date|xss_clean|callback_check_samity_effective_date');\t\n\t}", "protected function _readFormFields() {}", "function validate_fields( $array ) {\n\t\t$this->validate_list = $array;\n\t\t}", "public function validate() {\n }", "public function validate() {\n }", "protected function performValidation()\n {\n // no required arguments\n }", "function validate_user_form()\n {\n }", "public function validate($fields = false, $primary_key = false){\n\n\t\t$clean = parent::pre_validate($fields, $primary_key);\n\n\t\tif($clean->isEmpty('name')){\n\t\t\t$this->addError('name', text('db:error:groupname'));\n\t\t}\n\n\t\treturn $fields;\n\n\t}", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}", "function validateRequiredFields($requiredFields, $errorMsg=NULL,$errorLineBreak=false)\n{\n\t $errorOut =\"\";\n\t $errorArray =\tarray();\n\t\n\t foreach($requiredFields as $fieldName => $displayName)\n\t\t{\n\t\t\tif(!isset($_REQUEST[$fieldName]) || empty($_REQUEST[$fieldName]))\n\t\t\t{\n\t\t\t\tif(count($errorArray)> 0)\n\t\t\t\t\tarray_push($errorArray,\" \". $displayName);\n\t\t\t\telse\n\t\t\t\t\tarray_push($errorArray, $displayName);\n\t\t\t}\n\t\t}\n\t\t\n\t\n\n\t if(count($errorArray)> 0)\n\t\t {\n\t\t\t\n\t\t\tif($errorMsg!=NULL) // inserting the error message, if any at the first\n\t\t\t\t$errorArray=array_insert($errorArray, $errorMsg .\" \", 0);\n\t\t\t\n foreach($errorArray as $error)\n {\n if($errorLineBreak)\n $errorOut .= $error.'<br/>';\n \n else \n $errorOut .= $error;\n }\n \n \n \t\t\n }\n\t\t \t\t \n\t\n\treturn $errorOut;\n}", "public static function fields() {\n // check that something was provided.\n return array(\n\t 'email' => array(\n\t 'required' => TRUE,\n\t 'default' => '',\n\t ),\n\t 'name.first' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'name.last' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'address.address' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'address.city' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'address.state.code' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'address.country' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'address.postal-code' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'address.postal-code.type' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'partner.code' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'action.id' => array(\n\t 'required' => TRUE,\n\t 'default' => '',\n\t ),\n\t 'action.signature-type' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'action.message' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'action.opt-ins.display' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'action.opt-ins.newsletters' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n\t 'action.opt-ins.partner' => array(\n\t 'required' => FALSE,\n\t 'default' => '',\n\t ),\n );\n }", "public function validate() {\n // Validate each form field\n foreach ($this->fields as $field => $value) {\n \n // If the field value is empty\n if (empty($value)) {\n // If the field is set as required, throw error\n if (isset($this->rules[$field]['required'])) {\n $this->errors[$field][] = self::ERROR_REQUIRED;\n }\n }\n // Else, if the field has a value and is declared in Rules\n else if (isset($this->rules[$field])) {\n \n // Remove 'required' from list of callable functions.\n // We already did this check above.\n unset($this->rules[$field]['required']);\n \n foreach ($this->rules[$field] as $rule => $rule_value) {\n /**\n * For each rule specified for an element,\n * call a function with the same name, e.g. 'email()' when\n * checking whether a field value is a valid email address.\n * \n * This replaces the previous switch statement, and reduces\n * the need to iterate through each switch case for every\n * rule. \n */\n call_user_func_array(\n // Function is in this instance, named identical to rule\n array($this, $rule),\n // Pass the Field name, Field value, and Rule value\n array($field, $value, $rule_value)\n );\n }\n }\n }\n \n // Return validation result\n if (empty($this->errors)) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "abstract public function validateData($data);", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "public function validation()\n {\n\n }", "public function isDataValid() {\n if ($this->userExists())\n $this->_errors[] = 'username already taken';\n // username and password must match pattern\n else if (empty($this->_username) || !preg_match('/^[a-zA-Z0-9]{5,16}$/', $this->_username))\n $this->_errors[] = 'invalid username must be between 5 and 16 characters';\n else if (empty($this->_password) || !preg_match('/^[a-zA-Z0-9]{6,18}$/', $this->_password))\n $this->_errors[] = 'invalid password must be between 6 and 18 characters';\n\t\t else if (empty($this->_password) || $this->_password != $this->_password_confirm)\n $this->_errors[] = \"Password didn't match X\";\n // names must be between 2 and 22 characters\n else if (empty($this->_first_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_first_name))\n $this->_errors[] = 'invalid first name must be between 2 and 22 characters';\n else if (empty($this->_last_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_last_name))\n $this->_errors[] = 'invalid last name must be between 2 and 22 characters';\n //restricts day to 01-31, month to 01-12 and year to 1900-2099 (also allowing / - or . between the parts of the date) \n else if (empty($this->_dob) || !preg_match('/^(0?[1-9]|[12][0-9]|3[01])[\\/\\ ](0?[1-9]|1[0-2])[\\/\\ ](19|20)\\d{2}$/', $this->_dob))\n $this->_errors[] = 'invalid dod | must be DD/MM/YYYY format';\n else if (empty($this->_address))\n $this->_errors[] = 'invalid address';\n // checks if valid postal code\n else if (empty($this->_postcode) || !preg_match('/^(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})$/', $this->_postcode))\n $this->_errors[] = 'invalid postcode | must be AA11 9AA format';\n // checks is valid email using regular expression\n else if (empty($this->_email) || !preg_match('/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}$/', $this->_email))\n $this->_errors[] = 'invalid email';\n\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "function formValidation() {\n #Firstname Validation\n if (isset($_POST['firstname']) && $_POST['firstname']) {\n if (strlen($_POST['firstname']) < 2) {\n $this->formErrors[] = \"First name must be at least 2 characters long.\";\n }\n if (!valid_text($_POST['firstname'])) {\n $this->formErrors[] = \"First name contains invalid characters. Check for quotes.\";\n }\n } else {\n $this->formErrors[] = \"First name is a required field\";\n }\n #Lastname Validation\n if (isset($_POST['lastname']) && $_POST['lastname']) {\n if (strlen($_POST['lastname']) < 2) {\n $this->formErrors[] = \"Last name must be at least 2 characters long.\";\n }\n if (!valid_text($_POST['lastname'])) {\n $this->formErrors[] = \"Last name contains invalid characters. Check for quotes.\";\n }\n } else {\n $this->formErrors[] = \"Last name is a required field\";\n }\n #Address One Validation\n if (isset($_POST['addressOne']) && $_POST['addressOne']) {\n //Do nothing .. Not doing any AVS checks, so hopefully they give us a good address\n \n } else {\n $this->formErrors[] = \"Address Field One is required\";\n }\n #City Validation\n if (isset($_POST['city']) && $_POST['city']) {\n //Do nothing .. Not doing any AVS checks, so hopefully they give us a good city\n \n } else {\n $this->formErrors[] = \"City is required\";\n }\n #State Validation\n if (isset($_POST['state']) && $_POST['state']) {\n //Do nothing .. Not doing any AVS checks, so hopefully they give us a good state\n \n } else {\n $this->formErrors[] = \"State is required\";\n }\n #Postal Code Validation\n if (isset($_POST['postalCode']) && $_POST['postalCode']) {\n //Do nothing .. Not doing any AVS checks, so hopefully they give us a good zip\n \n } else {\n $this->formErrors[] = \"Zipcode is required\";\n }\n #Email Validation\n if (isset($_POST['email']) && $_POST['email']) {\n if (validate_email(format_trim($_POST['email']))) {\n //Do nothing .. its a valid email, i guess\n \n } else {\n $this->formErrors[] = \"Email is not valid.\";\n }\n }\n #Position Validation\n \n /** - This is no longer required because position is a radio button with a default value.\n if ((isset($_POST['goalie']) && $_POST['goalie'] == \"on\")\n || (isset($_POST['defense']) && $_POST['defense'] == \"on\")\n || (isset($_POST['center']) && $_POST['center'] == \"on\")\n || (isset($_POST['wing']) && $_POST['wing'] == \"on\")) {\n //Do nothing .. At least one position is checked\n } else {\n $this->formErrors[] = \"Must provide at least one position you would like to play. (Goalie, Defense, Center, Wing)\";\n }\n */\n #Jersey Information Validation\n #Jersey Choice 1 Validation\n //(isset($_POST['jerseyNumChoiceTwo']) && $_POST['jerseyNumChoiceTwo']) || $_POST['jerseyNumChoiceTwo'] == 0\n if ((isset($_POST['jerseyNumChoiceOne']) && $_POST['jerseyNumChoiceOne'] > - 1) || $_POST['jerseyNumChoiceOne'] == 0) {\n //if (is_numeric($_POST['jerseyNumChoiceOne']) && is_int(intval($_POST['jerseyNumChoiceOne']))) {\n if (strlen($_POST['jerseyNumChoiceOne']) == strlen(intval($_POST['jerseyNumChoiceOne']))) {\n if (intval($_POST['jerseyNumChoiceOne']) < 0 || intval($_POST['jerseyNumChoiceOne']) > 99) {\n $this->formErrors[] = \"Jersey Number Choice 1 must be between 0 - 99.\";\n }\n } else {\n $this->formErrors[] = \"Must provide a valid jersey number for Choice 1. (0 - 99)\";\n }\n } else {\n $this->formErrors[] = \"Must provide a valid jersey number for Choice 1. (0 - 99)\";\n }\n #Jersey Choice 2 Validation\n if ((isset($_POST['jerseyNumChoiceTwo']) && $_POST['jerseyNumChoiceTwo'] > - 1) || $_POST['jerseyNumChoiceTwo'] == 0) {\n if (strlen($_POST['jerseyNumChoiceTwo']) == strlen(intval($_POST['jerseyNumChoiceTwo']))) {\n if (intval($_POST['jerseyNumChoiceTwo']) < 0 || intval($_POST['jerseyNumChoiceTwo']) > 99) {\n $this->formErrors[] = \"Jersey Number Choice 2 must be between 0 - 99.\";\n }\n } else {\n $this->formErrors[] = \"Must provide a valid jersey number for Choice 2. (0 - 99)\";\n }\n } else {\n $this->formErrors[] = \"Must provide a valid jersey number for Choice 2. (0 - 99)\";\n }\n #Jersey Choice 3 Validation\n if ((isset($_POST['jerseyNumChoiceThree']) && $_POST['jerseyNumChoiceThree'] > - 1) || $_POST['jerseyNumChoiceThree'] == 0) {\n if (strlen($_POST['jerseyNumChoiceThree']) == strlen(intval($_POST['jerseyNumChoiceThree']))) {\n if (intval($_POST['jerseyNumChoiceThree']) < 0 || intval($_POST['jerseyNumChoiceThree']) > 99) {\n $this->formErrors[] = \"Jersey Number Choice 3 must be between 0 - 99.\";\n }\n } else {\n $this->formErrors[] = \"Must provide a valid jersey number for Choice 3. (0 - 99)\";\n }\n } else {\n $this->formErrors[] = \"Must provide a valid jersey number for Choice 3. (0 - 99)\";\n }\n #Will Sub? Validation\n if (isset($_POST['willSub']) && $_POST['willSub'] == \"Y\") {\n if ((isset($_POST['sunSub']) && $_POST['sunSub'] == \"on\") || (isset($_POST['monSub']) && $_POST['monSub'] == \"on\") || (isset($_POST['tueSub']) && $_POST['tueSub'] == \"on\") || (isset($_POST['wedSub']) && $_POST['wedSub'] == \"on\") || (isset($_POST['thuSub']) && $_POST['thuSub'] == \"on\") || (isset($_POST['friSub']) && $_POST['friSub'] == \"on\") || (isset($_POST['satSub']) && $_POST['satSub'] == \"on\")) {\n //Do nothing, they picked a day that they can sub\n \n } else {\n $this->formErrors[] = \"Since you answered yes to: Will you sub?, you must indicate at least one day you are willing to sub.\";\n }\n }\n return $this->get_formErrors();\n }" ]
[ "0.8654888", "0.864726", "0.79732895", "0.76296186", "0.7457367", "0.73698145", "0.7314247", "0.72714496", "0.7242398", "0.7234648", "0.7209101", "0.7200366", "0.71565455", "0.7155575", "0.71444637", "0.713251", "0.7044944", "0.70165616", "0.70165616", "0.7014293", "0.70098346", "0.7005039", "0.7005039", "0.7005039", "0.7005039", "0.7005039", "0.7005039", "0.7005039", "0.7005039", "0.7005039", "0.7005039", "0.7005039", "0.7005039", "0.6957672", "0.6943532", "0.6937438", "0.6908139", "0.69018406", "0.6899607", "0.68917847", "0.68872374", "0.6872448", "0.6871245", "0.6863427", "0.6861506", "0.68583107", "0.6858177", "0.6821204", "0.6793787", "0.6724606", "0.6722166", "0.67191505", "0.6718608", "0.6716027", "0.6713695", "0.6703748", "0.6681882", "0.6674426", "0.66570437", "0.6642962", "0.66357213", "0.66350114", "0.6628165", "0.66270053", "0.6614825", "0.6607218", "0.66057324", "0.6594536", "0.65815943", "0.65812355", "0.6575181", "0.6569401", "0.65677947", "0.65508455", "0.654639", "0.6543287", "0.6540613", "0.6540613", "0.6529674", "0.6529416", "0.65262485", "0.6525068", "0.6524903", "0.6524903", "0.652443", "0.65215945", "0.6509893", "0.6508834", "0.6508834", "0.6504504", "0.65009594", "0.6491866", "0.64873856", "0.64715886", "0.64613116", "0.64525497", "0.64505434", "0.6448308", "0.64464724", "0.6444829", "0.64297885" ]
0.0
-1
Description: function to validate fields common for all
function validate() { $errorMsg = array(); //variable store error messages $result = 1; for ($i = 0; $i < $this->id; $i++) { $errorMsg [$this->check_vars [$i] ['controler_name']] = ""; } for ($i = 0; $i < $this->id; $i++) { if (strlen($errorMsg [$this->check_vars [$i] ['controler_name']])) { continue; } $postVar = $this->check_vars [$i] ['data']; $authType = $this->check_vars [$i] ['authtype']; if ($this->check_vars [$i] ['error'] == "" || $this->check_vars [$i] ['error'] == " ") { $error = $lang->INVALID; } else { $error = $this->check_vars [$i] ['error']; } $pos = strpos($authType, '='); if ($pos !== false) { $authType = substr($this->check_vars [$i] ['authtype'], 0, $pos); $value = substr($this->check_vars [$i] ['authtype'], $pos + 1); } switch ($authType) { //check whether field is required or not case "required" : { if (is_array($postVar)) { $count = count($postVar); for ($j = 0; $j < $count; $j++) { $length = strlen(trim($postVar [$j])); if (!$length) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error . " :File " . ($j + 1); } } } elseif (isset($postVar) && empty($postVar)) { $length = strlen(trim($postVar)); if (!$length) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } } else { $length = strlen(trim($postVar)); if (!$length) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } } break; } //validate for name case "csvname": { $regexp = '/^[a-zA-Z ]+[a-zA-Z]*$/'; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validate field only contains alpha characters only case "alphabets" : { $regexp = '/^[A-za-z]*$/'; //echo trim ( $postVar );die; //echo "hello";die; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validate field only contains alphanumeric characters only case "alphanumeric" : { $regexp = '/^[A-za-z0-9]*$/'; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validate field only contains numeric characters only case "numeric" : { $regexp = '/^[0-9]*$/'; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validate field max character limit case "maxlength" : { $length = strlen(trim($postVar)); if ($length > $value) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; break; } //validate field min character limit case "minlength" : { $length = strlen(trim($postVar)); if ($length < $value && $length != 0) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; break; } //validate username field ...it can contain alphanumeric without any spaces case "username" : { $regexp1 = '/^[0-9]$/'; $regexp2 = '/^[a-zA-Z]+[a-zA-Z0-9\.\_]*[a-zA-Z0-9]+$/'; if (!preg_match($regexp1, trim($postVar)) && !preg_match($regexp2, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //checks for script tags case "script" : { $regexp1 = '/(<([^>]+)>)/i'; if (!preg_match($regexp1, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validates form address field case "address" : { $regexp = '/^[a-zA-Z0-9]+.*$/'; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validates for counting chrecters only, in string case "spaceCheck": { $foo = preg_replace('/\s+/', '', $postVar); if (strlen($foo) < $value) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validates for colorcodes case "colorCode": { $regexp = "/^#[abcdef 0-9]{6}/"; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validates phone field case "phone" : { if (isset($value)) { $found = strpos($value, ','); if ($found === false) { $options [0] = $value; } else { $options = explode(",", $value); } } $patternMatch = 0; foreach ($options as $opt) { $type = $this->availablePhoneType($opt); foreach ($type as $regexp) { if (preg_match($regexp, $postVar)) { $patternMatch = 1; } } if ($patternMatch) break; } if (!$patternMatch) { $length = strlen(trim($postVar)); if ($length) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } } break; } //validates mobile field case "mobile" : { $regexp1 = '/^[0-9]{10}$/'; // (+91)1111111111 $regexp2 = '/^[\(][\+][0-9]{2}[\)][0-9]{10}$/'; // +911111111111 $regexp3 = '/^[\+][0-9]{2}[0-9]{10}$/'; // 1-1111111111 $regexp4 = '/^[0-9]{2}[\-][0-9]{10}$/'; if (!preg_match($regexp1, trim($postVar)) && !preg_match($regexp2, trim($postVar)) && !preg_match($regexp3, trim($postVar)) && !preg_match($regexp4, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validates emial field case "email" : { $regexp = '/^[A-Za-z]+((\.|\_){1}[a-zA-Z0-9]+)*@([a-zA-Z0-9]+([\-]{1}[a-zA-Z0-9]+)*[\.]{1})+[a-zA-Z]{2,4}$/'; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } } break; } //validates url field case "url" : { $regexp = '|^http(s)?://[a-z0-9-]+(\.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i'; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } } break; } //validates date field case "date" : { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $this->validateDate(trim($postVar), $value, $error); break; } //validates password match case "match" : { $data = explode("#", $postVar); if (count($data) == 2) { if ($data[0] != $data[1]) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; break; } } } //validates datatype of field case "datatype" : { $limit = explode(',', $value); if ($limit[0] == "int") { $regexp = '/^[0-9]{' . $limit[1] . '}$/'; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } } } if ($limit[0] == "float") { $regexp = '/^[0-9]{' . $limit[1] . '}.[0-9]{' . $limit[2] . '}$/'; if (!preg_match($regexp, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } } } if ($limit[0] == "bool") { $result = is_bool($postVar); } if ($limit[0] == "null") { $result = is_null($postVar); } if (!$result) { $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } //validates filetype of field case "ftype": { $errorMsg .= $this->validateFileType($postVar, $value, $error); break; } //validates filesize case "fsize": { $errorMsg .= $this->validateFileSize($postVar, $value, $error); break; } case "custom" : { if (!preg_match($value, trim($postVar))) { $length = strlen(trim($postVar)); if ($length) $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error; } break; } default: { echo"you entered a wrong choice"; break; } } } return $errorMsg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate_fields() {\n \n\t\t//...\n \n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "function validate_fields() {\n\t\treturn true;\n\t}", "public abstract function validation();", "function validateAll(){\n foreach($this->fields as $field){\n $val = $_POST[$field['id']];\n if($field['validate']){\n switch($field['type']){\n case \"email\":\n if(!filter_var($val, FILTER_VALIDATE_EMAIL)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n break;\n case \"number\":\n if(!is_numeric($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n if($this->fields[$field['id']]['min'] > $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n if($this->fields[$field['id']]['max'] < $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"password\":\n if($this->fields[$field['id']]['compare']){\n $compareWith = $this->fields[$field['id']]['compare'];\n if($val != $_POST[$compareWith]){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }else if(!$this->validatePassword($val) || !$this->validatePassword($_POST[$compareWith])){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }else{\n if(!$this->validatePassword($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n break;\n case \"date\":\n if(!$this->validateDate($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n $min = $this->fields[$field['id']]['min'];\n if($this->compareDates($min, $val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n $max = $this->fields[$field['id']]['max'];\n if($this->compareDates($val, $max)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"radio\":\n if(!$val){\n $this->fields[$field['id']]['error'] .= \" error\";\n }\n break;\n default:\n if(!$val){\n $this->fields[$field['id']]['class'] .= \" error\";\n }\n }\n }\n }\n return ($this->has_errors ? false : true);\n }", "abstract public function validate();", "abstract public function validate();", "public function validate_fields() {\n\n\t\t$this->validate_refund_address_field();\n\t}", "function validate()\n\t\t{\n\t\t\tif(count($this->validateFields)==0 || !is_array($this->validateFields)){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t$error\t=\t0;\n\t\t\t\t$fieldPos=1;\n\t\t\t\t//First Validate For Empty on all fields //\n\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\n\t\t\t\t\tif(in_array(\"EMPTY\",$valids) && $checkedError==0){\n\t\t\t\t\t\tif($this->validateEmpty($key)){\n\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t$this->setError(\"Enter Mandatory Fields \");\n\t\t\t\t\t\t\t$checkedError\t=\t1;\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\t$fieldPos++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif($error==0){\n\t\t\t\t\t$fieldPos=1;\n\t\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"EMAIL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateEmail($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid email id in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"NUMBER\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateNumeric($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Enter Numeric in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(in_array(\"FILTER\",$valids)){\n\t\t\t\t\t\t\tif($this->validateSpecial($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Special chars not allowed in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"URL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateUrl($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid website address in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$fieldPos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\tif($error==0){\n\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "abstract public function validate(array $data, array $fields);", "abstract public function validateData();", "public function commonRules() {\n $this->sanitize();\n $rules = [\n 'first_name' => 'required|min:2|max:40|regex:/' . only_alpha_valid,\n 'last_name' => 'required|min:2|max:40|regex:/' . only_alpha_valid,\n 'date_of_birth' => 'required',\n 'telephone_no' => 'required|min:5|max:20|regex:/' . numeric_space_valid,\n 'address' => 'required|min:5|max:100',\n 'city' => 'required|min:2|max:40',\n 'postal_code' => 'required|min:4|max:7|regex:/'.alpha_numeric_valid,\n 'county' => 'required',\n 'country' => 'required',\n 'howfinds_id' => 'required',\n 'howfinds_other' => 'required',\n 'image' => 'image|max:' . img_maxsize\n ];\n if (!empty(Request::all())) {\n if (Request::get('howfinds_id') != '-1') {\n unset($rules['howfinds_other']);\n }\n }\n return $rules;\n }", "abstract protected function fieldValidation($submittedData);", "protected function _validate() {\n\t}", "public function generalValidation()\n {\n \t// Validamos que los dos campos esten llenos o estén vacios al mismo tiempo.\n \tif (is_null($this->error) ^ is_null($this->read_at)) {\n \t\treturn false;\n \t}\n\n \treturn true;\n }", "function validateBizEditFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['catID'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "function check_fields() {\r\n \r\n $fail = false;\r\n\t\t$empty = true;\r\n\t\t\r\n // if first name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputFirstName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputFirstName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['firstNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n // if last name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputLastName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputLastName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['lastNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n \r\n // if phone number contains any non-digit or - characters, exit\r\n\t\tif($_POST[\"InputPhone\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputPhone\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[0-9-]*$/\")))) {\r\n\t\t\t\t$GLOBALS['phoneNumberNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n if(!$fail && !$empty) {\r\n change_info();\r\n }\r\n }", "abstract function validator();", "protected function areFieldChangeFunctionsValid() {}", "public function validate(){\n\t\t// Loop through model's rules array.\n\t\tforeach($this->rules() as $field => $rules){\n\t\t\t// Take the value of field this rule is for.\n\t\t\t$value = $this->{$field};\n\t\t\t// Loop through all rules for this field.\n\t\t\tforeach($rules as $rule){\n\t\t\t\t$ruleType = $rule;\n\t\t\t\t// If the rule is an array, not string, read its type from first index.\n\t\t\t\tif(is_array($ruleType)){\n\t\t\t\t\t$ruleType = $ruleType[0];\n\t\t\t\t}\n\n\t\t\t\t// Rule: field is required.\n\t\t\t\tif($ruleType === 'required' && !$value){\n\t\t\t\t\t$this->addError($field, 'required', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: field value must validate as email.\n\t\t\t\telse if($ruleType === 'email' && !filter_var($value, FILTER_VALIDATE_EMAIL)){\n\t\t\t\t\t$this->addError($field, 'email', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: string length comparisons.\n\t\t\t\telse if($ruleType === 'length'){\n\t\t\t\t\t// String has rule for minimum length.\n\t\t\t\t\tif(array_key_exists('min', $rule) && $rule['min'] > strlen($value)){\n\t\t\t\t\t\t$this->addError($field, 'min', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// String has rule for maximum length.\n\t\t\t\t\tif(array_key_exists('max', $rule) && $rule['max'] < strlen($value)){\n\t\t\t\t\t\t$this->addError($field, 'max', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// String has rule for exact length.\n\t\t\t\t\tif(array_key_exists('equal', $rule) && $rule['equal'] != strlen ($value)){\n\t\t\t\t\t\t$this->addError($field, 'equal', $rule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Rule: field value must match comparison field's value.\n\t\t\t\telse if($ruleType === 'compare' && $value != $this->{$rule['field']}){\n\t\t\t\t\t$this->addError($field, 'compare', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: number comparisons.\n\t\t\t\telse if($ruleType === 'numeric'){\n\t\t\t\t\t// Value must validate to an integer number.\n\t\t\t\t\tif(array_key_exists('integer', $rule) && $rule['integer'] && filter_var($value, FILTER_VALIDATE_INT) === FALSE){\n\t\t\t\t\t\t$this->addError($field, 'integer', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value must validate to float number.\n\t\t\t\t\telse if((!array_key_exists('integer', $rule) || (array_key_exists('integer', $rule) && !$rule['integer'])) && filter_var($value, FILTER_VALIDATE_FLOAT) === FALSE){\n\t\t\t\t\t\t$this->addError($field, 'numeric', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value must be at least a minimum number.\n\t\t\t\t\tif(array_key_exists('min', $rule) && $rule['min'] > floatval($value)){\n\t\t\t\t\t\t$this->addError($field, 'numericmin', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value cannot be larger than a maximum number.\n\t\t\t\t\tif(array_key_exists('max', $rule) && $rule['max'] < floatval($value)){\n\t\t\t\t\t\t$this->addError($field, 'numericmax', $rule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Rule: unique database entry.\n\t\t\t\telse if($ruleType === 'unique'){\n\t\t\t\t\t// Check for match in database.\n\t\t\t\t\t$found = $this->findOne([\"$field\" => \"$value\"]);\n\t\t\t\t\tif($found){\n\t\t\t\t\t\t$this->addError($field, 'unique', $rule);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t// Rule: on action only.\n\t\t\t\telse if($ruleType === 'on'){\n\t\t\t\t\t// If field is used on create only and request is not for create, field is not used.\n\t\t\t\t\tif($rule['action'] === 'create' && !$this->isCreate()){\n\t\t\t\t\t\t$this->ignoreFields[] = $field;\n\t\t\t\t\t}\n\t\t\t\t\t// IF field is used on update only and request is not for update, field is not used.\n\t\t\t\t\telse if($rule['action'] === 'update' && !$this->isUpdate()){\n\t\t\t\t\t\t$this->ignoreFields[] = $field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn empty($this->errors);\n\t}", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "private function validatePaymentFields(){\n }", "static function validate($fields) {\n $validate = function ($x, $spec) use (&$validate) {\n if (!is_array($x)) {\n return false;\n }\n if (is_string($spec)) {\n return array_key_exists($spec, $x);\n } else {\n return _::reduce($spec, function ($acc, $v, $k) use ($x, &$validate) {\n $result = is_string($v) ? $validate($x, $v) : $validate(_::get($x, $k), $v);\n return $acc && $result;\n }, true);\n }\n };\n $ret = $validate($fields, [\n 'SC' => [\n 'NAME',\n 'DATA_ZAKL',\n 'ADRES',\n 'PHONE',\n ],\n 'VLADELEC' => [\n 'FIO',\n 'PHONE',\n 'ADRES',\n ],\n 'IZDEL' => [\n 'NAME',\n 'MODEL',\n 'TYPE',\n 'DATA_PROIZV',\n 'DATA_PRODAJI',\n 'KOMPLEKT',\n 'DATA_POSTUP',\n 'PRIZNAKI_NEISPR',\n 'SVEDINIYA',\n ],\n 'DAN' => array_merge([\n 'VIEV_DEFEKT',\n 'DEFEKT',\n ], _::get($fields, 'DAN.DEFEKT') == 64) ? ['DEFEKT3_DESCR'] : [],\n// 'PRICHINA', // not required\n 'ITEM_PLACE'\n ]);\n return $ret;\n }", "function validate_all($required, $data)\n{\n $result = array();\n $result['code'] = 1;\n $result['error'] = \"All OK!\";\n if (count(array_intersect_key($required, $data)) != count($required)) {\n $result['code'] = 0;\n $result['error'] = \"Fields Mismatch!\";\n return $result;\n }\n foreach ($required as $field => $rules) {\n $value = trim($data[$field]);\n $code = 0;\n $error = \"\";\n switch ($rules['type']) {\n case 'numeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!is_numeric($value)) {\n $error = $field . \" is not numeric.\";\n } else if (isset($rules['min'])) {\n if ($value < $rules['min']) {\n $error = $field . \" min error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else if (isset($rules['max'])) {\n if ($value > $rules['max']) {\n $error = $field . \" max error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9 ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'email':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'pattern':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'any':\n # code...\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n }\n $result['fields'][$field] = array('code' => $code, 'error' => $error, 'value' => $value, 'field' => $field);\n }\n foreach ($result['fields'] as $row) {\n if ($row[\"code\"] == 0) {\n $result['code'] = 0;\n $result['error'] = $row['error'];\n break;\n }\n }\n return $result;\n}", "public function validation();", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "private function commonRules()\n {\n return [\n 'address' => 'nullable|string|between:0,255',\n 'status' => 'required|integer',\n ];\n }", "function validate_all($required,$data){\n\n\t$result = array();\n\t$result['code'] = 1;\n\t$result['error'] = \"All OK!\";\n\n\tif(count(array_intersect_key($required, $data)) != count($required)){\n\t\t$result['code'] = 0;\n\t\t$result['error'] = \"Fields Mismatch!\";\n\t\treturn $result;\n\t}\n\n\t$field_count \t= count($required);\n\n\tforeach ($required as $field => $rules) {\n\t\t$value = $data[$field];\n\n\t\t$code = 0;\n\t\t$error = \"\";\n\n\t\tswitch ($rules['type']) {\n\t\t\tcase 'numeric':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!is_numeric($value)){\n\t\t\t\t\t$error = $field.\" is not numeric.\";\n\t\t\t\t}else if(isset($rules['min'])){\n\t\t\t\t\tif($value < $rules['min']){\n\t\t\t\t\t\t$error = $field.\" min error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else if(isset($rules['max'])){\n\t\t\t\t\tif($value > $rules['max']){\n\t\t\t\t\t\t$error = $field.\" max error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'alpha':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!preg_match($rules['pattern'], $value)){\n\t\t\t\t\t$error = $field.\" is invalid.\";\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$result['fields'][$field] = array('code' => $code, 'error' => $error, 'value'=>$value, 'field'=>$field );\n\t}\n\n\tforeach ($result['fields'] as $row) {\n\t\tif($row[\"code\"] == 0){\n\t\t\t$result['code'] = 0;\n\t\t\t$result['error'] = \"Invalid Fields!\";\n\t\t\tbreak;\n\t\t}\t\t\n\t}\n\n\treturn $result;\n\n}", "function validateFields($fields){\n\t\t$valid = [\n\t\t\t'isValid' => true,\n\t\t\t'invalidField' => ''\n\t\t];\n\t\t\n\t\tif(!isset($fields['articleName']) || empty($fields['articleName'])){\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleName';\n\t\t}\n\t\t\n\t\tif(!isset($fields['articleAuthor']) || empty($fields['articleAuthor'])){\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleAuthor';\n\t\t}\n\t\t\n\t\tif(!isset($fields['articleDate']) || empty($fields['articleDate'])){\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleDate';\n\t\t}\n\t\t\n\t\tif(!isset($fields['articleCategory']) || empty($fields['articleCategory'])){\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleCategory';\n\t\t}\n\t\tif(!isset($fields['articleContent']) || empty($fields['articleContent'])){\n\t\t\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleContent';\n\t\t}\n\t\t\n\t\treturn $valid;\n\t}", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "public function validate_customer_input_fields()\n {\n $passed_validation_tests = true;\n $check_name = has_presence($this->name);\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n if (!$check_name) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Customer name cannot be blank.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_telephone = has_presence($this->telephone);\n $check_telephone_numeric = has_number($this->telephone);\n $check_telephone_length = has_length($this->telephone, ['exact' => 10]);\n if (!$check_telephone or !$check_telephone_numeric or !$check_telephone_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Telephone: \";\n $msg .= h($this->telephone);\n $msg .= \" cannot be blank and must consists of 10 digits.\";\n $msg .= \"</li>\";\n }\n\n $check_barcode = has_presence($this->barcode);\n $check_barcode_numeric = has_number($this->barcode);\n $check_barcode_length = has_length($this->barcode, ['exact' => 6]);\n if (!$check_barcode or !$check_barcode_numeric or !$check_barcode_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Barcode: \";\n $msg .= h($this->barcode);\n $msg .= \" cannot be blank and must consists of 6 digits.\";\n $msg .= \"</li>\";\n }\n\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function commonRules()\n {\n Validator::extend('isvalidtimestamp', function ($attribute, $timestamp, $parameters, $validator) {\n \n return ((int) $timestamp === $timestamp)\n && ($timestamp <= PHP_INT_MAX)\n && ($timestamp >= ~PHP_INT_MAX);\n });\n \n Validator::extend('isvalidhash', function ($attribute, $hash, $parameters, $validator) {\n\n $temp_json = $validator->getData();\n // $temp_json = Input::json()->all();\n // echo \"<pre>\";print_r($temp_json);echo \"</pre>\";exit;\n unset($temp_json['hash']);\n if($hash == hash_hmac('SHA256', json_encode($temp_json), 'gramgoldlab888')){\n return TRUE;\n }\n else return FALSE;\n \n });\n\n return [\n 'hash' => 'required|isvalidhash',\n 'timestamp' => 'required|isvalidtimestamp',\n 'sessionId' => 'required|string|max:32',\n 'partnerPlayerId' => 'required|string',\n 'currency' => 'required|string',\n 'gameId' => 'required|string',\n 'token' => 'string',\n 'operatorName' => 'string',\n 'action' => 'required|string',\n 'playerIp' => 'required|ip'\n ];\n }", "abstract protected function validate($data);", "function commonValidation($data) {\n unset($this->validate['title']);\n unset($this->validate['category_id']);\n unset($this->validate['short_description']);\n\n if ($data['Offer']['basename'] != '') {\n unset($this->validate['file']['valid_upload']);\n }\n }", "public function validate() {\n // Validate each form field\n foreach ($this->fields as $field => $value) {\n \n // If the field value is empty\n if (empty($value)) {\n // If the field is set as required, throw error\n if (isset($this->rules[$field]['required'])) {\n $this->errors[$field][] = self::ERROR_REQUIRED;\n }\n }\n // Else, if the field has a value and is declared in Rules\n else if (isset($this->rules[$field])) {\n \n // Remove 'required' from list of callable functions.\n // We already did this check above.\n unset($this->rules[$field]['required']);\n \n foreach ($this->rules[$field] as $rule => $rule_value) {\n /**\n * For each rule specified for an element,\n * call a function with the same name, e.g. 'email()' when\n * checking whether a field value is a valid email address.\n * \n * This replaces the previous switch statement, and reduces\n * the need to iterate through each switch case for every\n * rule. \n */\n call_user_func_array(\n // Function is in this instance, named identical to rule\n array($this, $rule),\n // Pass the Field name, Field value, and Rule value\n array($field, $value, $rule_value)\n );\n }\n }\n }\n \n // Return validation result\n if (empty($this->errors)) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "public static function validate() {}", "function validateData($fields, $vars) \n{ \n\t// array for storing error messages \n\tglobal $err_mess; \t\t\t\t\t\t// error message, make accessible outside function \n\t$err_msg = \"\"; \t\t\t\t\t\t\t// blank to begin with \n\t$fields_ok = true;\t\t\t\t\t\t// success/failure indicator - assume success \n\n\t// for each field name in validation information validate data \n\t// data according to rules for field \n\t// $fields[x] - attribute name \n\t// $fields[x+1] - validation code \n\t// $fields[x+2] - human name for error message \n\t// validation codes - correspond to array entry in function validateData \n\t// 1 - field required - primary key, \"new\" (new record) or numeric (existing record) \n\t// 2 - field required - foreign key, must be numeric, must be > 0 \n\t// 3 - field required - phone number, must be 10 digits long \n\t// 4 - field required - email address \n\t//\t 5 - field required - no validation required \n\t// code + 100 - field not required but same validation as code if field required \n\t\n\t// want to consider validation for all fields in record \n\tfor ($i=0; $i<count($fields); $i=$i+3) \n\t{\n\t\t// extract data value from $vars that corresponds \n\t\t// to field name in validation data \n\t\t$field_name = $fields[$i]; \t\t\t// field name \n\t\t$field_data = $vars[$field_name]; \t// data value from form \n\t\t$field_code = $fields[$i+1];\t\t// validation code \n\t\t$field_err = $fields[$i+2];\t\t\t// field name for error message \n\t\t\n\t\t// determine if validating primary key \n\t\tif ($field_code==1) { \n\t\t\t// primary key, required field, must be \"new\" or numeric \n\t\t\tif (strlen($field_data)==0) { \n\t\t\t\t// required field not entered \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// not blank so \n\t\t\t\t// check for \"new\" (new record) or numeric (update existing record) \n\t\t\t\tif ($field_data != \"new\") { \n\t\t\t\t\tif (is_numeric($field_data) == false) { \n\t\t\t\t\t\t// invalid primary key \n\t\t\t\t\t\t$err_mess .=$field_err .\" - invalid primary key \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \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\t// determine if validating foreign key \n\t\tif ($field_code==2 or $field_code==102) {\n\t\t\t// validation may be required on number \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==2 and is_numeric($field_data)==false) { \n\t\t\t\t// required foreign key and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not blank, must be number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// ensure value is > 0 \n\t\t\t\t\tif ($field_data <= 0) { \n\t\t\t\t\t\t// invalid foreign key \n\t\t\t\t\t\t$err_mess .=$field_err .\"-select \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// determine if validating phone number \n\t\tif ($field_code==3 or $field_code==103) { \n\t\t\t// validation may be required on phone number \n\t\t\tif ($field_code==3 and $field_data==\"\") { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\t// validate if not required field & data entered \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not a number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// check for correct length (must be 10 digits) \n\t\t\t\t\tif ($field_data!=\"\" and strlen($field_data)!=10) {\n\t\t\t\t\t\t// phone number length not 10 \n\t\t\t\t\t\t$err_mess .=$field_err .\"-must be 10 digits \"; \n\t\t\t\t\t\t$fields_ok = false; // indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} \n\t\t\n\t\t// determine if validating email address \n\t\tif ($field_code==4 or $field_code==104) { \n\t\t\t// validation may be required on email address \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==4 and (!isEmail($field_data))) { \n\t\t\t\t// required field and invalid email address \n\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\") { \n\t\t\t\t\t// validate email address \n\t\t\t\t\tif (!isEmail($field_data)) { \n\t\t\t\t\t\t// invalid email address \n\t\t\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}\n\t\t} \n\n\t\t// determine if no validation required (but could be required field) \n\t\tif ($field_code==5 or $field_code==105) { \n\t\t\t// considering field with no validation requirements \n\t\t\tif ($field_code==5 and strlen($field_data)==0) { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t}\n\t\t} \n\t} \n\n\t// all fields validated, return success/failure indicator \n\treturn $fields_ok; \t\n}", "abstract function validate(): void;", "function validateallFields(){\r\n\t$response = array();\r\n\t$valid = FALSE;\r\n\t//validate first name\r\n\t//first name should not be numeric\r\n\tif(is_numeric($_POST['fname'])){\r\n\t\t$response['message'] = \"First name should not be a number\";\r\n\t\t$response['valid'] = false;\r\n\t\treturn $response;\r\n\t}elseif(is_numeric($_POST['lname'])){\r\n\t\t$response['message'] = \"Last name should not be a number\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t}elseif(is_numeric($_POST['username'])){\r\n\t\t$response['message'] = \"Your username should not be numeric\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t}elseif(is_numeric($_POST['address'])){\r\n\t\t$response['message'] = \"address should be alphanumeric\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t}elseif(!is_numeric($_POST['contact'])){\r\n\t\t$response['message'] = \"Your contact should be numeric\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t\r\n\t}else{\r\n\t\t$response['valid'] = TRUE;\r\n\t\treturn $response;\r\n\t}\r\n\r\n}", "function validateBizAddFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['businessCategory'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "public static function ValidateFields($fieldsRequired, $fieldsSize, $fieldsValidate, $dat, $die = true)\n {\n \tglobal $_error;\n\n\t$error = 0;\n foreach ($fieldsRequired as $field)\n {\n if (self::isEmpty($dat[$field]) AND (!is_numeric($dat[$field])))\n {\n \t$field_name = Core::FormatFieldName($field);\n $_error->AddError($field_name . ' is empty.');\n\t\t$error = 1;\n //return false;\n }\n }\n foreach ($fieldsSize as $field => $size)\n {\n if (isset($dat[$field]) AND self::strlen($this->{$field}) > $size)\n {\n /*\n if ($die) die (Tools::displayError().' ('.get_class($this).' -> '.$field.' length > '.$size.')');\n */\n\t\t$_error->AddError(\"Maximum size of \".$field_name.\" is \".$size);\n //return false;\n\t\t$error = 1;\n }\n }\n\n foreach ($fieldsValidate as $field => $method)\n {\n if (self::isEmpty($dat[$field]))\n {\n\t\t$error = 1;\n // return FALSE;\n }\n elseif (function_exists($method))\n {\n if(!$method($dat[$field]))\n {\n \t$field_name = Core::FormatFieldName($field);\n \t$_error->AddError('Provide Valid '.$field_name);\n\t\t\t$error = 1;\n \t//return FALSE;\n }\n }\n else\n {\n if (!self::$method($dat[$field]))\n {\n\t\t\t$error = 1;\n //return FALSE;\n }\n }\n }\n/*\n if (!method_exists($validate, $method))\n die (Tools::displayError('validation function not found').' '.$method);\n elseif (!Tools::isEmpty($this->{$field}) AND !call_user_func(array('Validate', $method), $this->{$field}))\n {\n if ($die) die (Tools::displayError().' ('.get_class($this).' -> '.$field.' = '.$this->{$field}.')');\n return false;\n }\n*/\tif($error == 1)\n\t\treturn false;\n\n return true;\n }", "function validateBizSearchFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['catID'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\t$f5 = $fields['postcode'];\r\r\n\t\t\t\t$f6 = $fields['phoneAreacode'];\r\r\n\t\t\t\t$f7 = $fields['phoneNumber'];\r\r\n\t\t\t\t$f8 = $fields['cellPhoneNumber'];\r\r\n\t\t\t\t$f9 = $fields['faxNumber'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '') && ($f5 == '') && ($f6 == '') && ($f7 == '') && ($f8 == '') && ($f9 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Atleast one field required for a search');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "public function validateFields($c) {\n\n\t\t$lang = \\Lib\\Registry::getInstance()->get('lang');\n\t\t$errorMessages = array();\n\n\t\tif ($this->contactdoa->contactExists($c)) {\n\t\t\t$GLOBALS['appLog']->log('Contact with this name already exists for the user', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$errorMessages['exists'] = $lang['CONTACTEXISTS'];\n\t\t}\n\n\t\tif( empty($c['firstname']) ) {\n\t\t\t$GLOBALS['appLog']->log('Empty First Name', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$errorMessages['firstname'] = $lang['FIRSTNAMEREQ'];\n\t\t}\n\n\t\tif( empty($c['lastname']) ) {\n\t\t\t$GLOBALS['appLog']->log('Empty Last Name', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$errorMessages['lastname'] = $lang['LASTNAMEREQ'];\n\t\t}\n\n\t\tif (!empty($c['phone1'])) {\n\t\t\tif (empty($c['phone1type'])) {\n\t\t\t\t$GLOBALS['appLog']->log('Phone number 1 requires a type', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t\t$errorMessages['phone1type'] = $lang['PHREQTYPE'];\n\t\t\t}\n\n\t\t\tif (!preg_match('/^\\(?[0-9]{3}\\)?|[0-9]{3}[-. ]? [0-9]{3}[-. ]?[0-9]{4}$/', $c['phone1'])) {\n\t\t\t\t$errorMessages['phone1'] = $lang['PHINVFORMAT'];\n\t\t\t\t$GLOBALS['appLog']->log('Phone 1 ' . $c['phone1'] . ' ' . $errorMessages['phone1'], \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($c['phone2'])) {\n\t\t\tif (empty($c['phone2type'])) {\n\t\t\t\t$GLOBALS['appLog']->log('Phone number 2 requires a type', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t\t$errorMessages['phone2type'] = $lang['PHREQTYPE'];\n\t\t\t}\n\n\t\t\tif (!preg_match('/^\\(?[0-9]{3}\\)?|[0-9]{3}[-. ]? [0-9]{3}[-. ]?[0-9]{4}$/', $c['phone2'])) {\n\t\t\t\t$errorMessages['phone2'] = $lang['PHINVFORMAT'];\n\t\t\t\t$GLOBALS['appLog']->log('Phone 2 ' . $c['phone2'] . ' ' . $errorMessages['phone2'], \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($c['phone3'])) {\n\t\t\tif (empty($c['phone3type'])) {\n\t\t\t\t$GLOBALS['appLog']->log('Phone number 3 requires a type', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t\t$errorMessages['phone3type'] = $lang['PHREQTYPE'];\n\t\t\t}\n\n\t\t\tif (!preg_match('/^\\(?[0-9]{3}\\)?|[0-9]{3}[-. ]? [0-9]{3}[-. ]?[0-9]{4}$/', $c['phone3'])) {\n\t\t\t\t$errorMessages['phone3'] = $lang['PHINVFORMAT'];\n\t\t\t\t$GLOBALS['appLog']->log('Phone 3 ' . $c['phone3'] . ' ' . $errorMessages['phone3'], \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($c['phone1type']) && empty($c['phone1'])) {\n\t\t\t$GLOBALS['appLog']->log('Phone type 1 requires a number', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$errorMessages['phone1'] = $lang['PHTYPEREQNUM'];\n\t\t}\n\n\t\tif (!empty($c['phone2type']) && empty($c['phone2']) ) {\n\t\t\t$GLOBALS['appLog']->log('Phone type 2 requires a number', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$errorMessages['phone2'] = $lang['PHTYPEREQNUM'];\n\t\t}\n\n\t\tif (!empty($c['phone3type']) && empty($c['phone3']) ) {\n\t\t\t$GLOBALS['appLog']->log('Phone type 3 requires a number', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$errorMessages['phone3'] = $lang['PHTYPEREQNUM'];\n\t\t}\n\n\t\t$GLOBALS['appLog']->log('$errorMessages : ' . print_r($errorMessages,1), \\Lib\\appLogger::INFO, __METHOD__);\n\t\treturn $errorMessages;\n\t}", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "private function checkFields()\r\n {\r\n $vars = array('user', 'pass', 'numbers', 'message', 'date', 'ids', 'data_start', 'data_end',\r\n 'lido', 'status', 'entregue', 'data_confirmacao', 'return_format'\r\n );\r\n\r\n $final = array();\r\n foreach ($vars as $key => $value) {\r\n if ($this->$value !== '') {\r\n $final[$value] = $this->$value;\r\n }\r\n }\r\n return $final;\r\n }", "private function validateFields()\n {\n $errors = array();\n for ($x=0; $x < count($this->_fields); $x++)\n {\n $field = $this->_fields[$x];\n if ($field['type'] == WFT_CC_EXPIRATION)\n {\n // one or both fields left blank\n if (strlen(trim($this->getPostValue($field['id'] . 'Month'))) == 0 ||\n strlen(trim($this->getPostValue($field['id'] . 'Year'))) == 0)\n {\n if ($field['required'])\n $errors[] = 'You must select an card expiration month and year';\n $monthValue = $yearValue = -1;\n $value = '';\n }\n else\n {\n $monthValue = intval($this->getPostValue($field['id'] . 'Month'));\n $yearValue = intval($this->getPostValue($field['id'] . 'Year'));\n $curYear = intval(date('Y'));\n if ($yearValue < $curYear)\n $errors[] = 'The expiration year is in the past';\n if ($monthValue < 1 || $monthValue > 12)\n $errors[] = 'The expiration month is not valid';\n }\n }\n else if($field['required'] && !strlen(trim($this->getPostValue($field['id']))))\n {\n if (strlen($field['caption']) > 0)\n $errors[] = $field['caption'] . ' is a required field';\n else\n $errors[] = 'This field is required';\n $value = '';\n }\n else if($field['type'] == WFT_CURRENCY)\n {\n $value = trim($this->getPostValue($field['id']));\n $value = str_replace('$', '', $value);\n $cur = floatval($value);\n $value = strval($cur);\n }\n else if($field['type'] == WFT_ANTI_SPAM_IMAGE)\n {\n $antiSpamInput = $this->getPostValue($field['id']);\n $wordVerifyID = $this->getPostValue('wordVerifyID');\n $graphs = new Graphs();\n $wordVerifyText = $graphs->getVerificationImageText($wordVerifyID);\n if (strtoupper($antiSpamInput) != $wordVerifyText || $antiSpamInput == '')\n {\n $errors[] = 'The text you entered did not correspond with the text in the security image';\n $value = 0;\n }\n else\n {\n $value = 1;\n }\n $graphs->clearVerificationImageText($wordVerifyID);\n }\n else if($field['type'] == WFT_SELECT || $field['type'] == WFT_CC_TYPE || $field['type'] == WFT_BOOLEAN)\n {\n $value = $this->getPostValue($field['id']);\n if (!strcmp($value, 'noset'))\n {\n $errors[] = $field['caption'] . ': You must select an option';\n }\n }\n else if($field['type'] == WFT_CC_NUMBER)\n {\n $value = '';\n // Clean credit card number input\n $cardNumber = preg_replace('/[^0-9]/', '', $this->getPostValue($field['id']));\n\n if ($field['required'] == false && !strlen($cardNumber))\n {\n $value = '';\n }\n else\n {\n // Guess the card type by using a pregex pattern matching algorithm\n $cardType = $this->getCreditCardTypeByNumber($cardNumber);\n if ($cardType == -1)\n $errors[] = 'The credit card number you entered is not a recognized Visa, MasterCard, American Express '\n . 'or Discover card.';\n else if (!$this->isCardNumberValid($cardType, $cardNumber))\n $errors[] = 'The credit card number you entered has not been recognized and may be invalid.';\n else\n {\n // Valid card number, now change all card type fields to match\n // the autodetected card type (visa, mastercard, etc.)\n $value = $cardNumber;\n $cardTypeName = $this->getCreditCardName($cardType);\n\n for ($y=0; $y < count($this->_fields); $y++)\n {\n if ($this->_fields[$y]['type'] == WFT_CC_TYPE)\n {\n $this->_fields[$y]['validatedDataOverride'] = $cardTypeName;\n $this->_fields[$y]['validatedData'] = $cardTypeName;\n }\n }\n }\n }\n }\n else\n {\n $value = trim($this->getPostValue($field['id']));\n\n if (!($field['required'] == false && !strlen($value)))\n {\n if (strlen($field['regex_test']) > 0)\n {\n if (!preg_match($field['regex_test'], $value))\n {\n $errors[] = $field['regex_fail'];\n }\n }\n if (strlen($value) < $field['length'][0] || strlen($value) > $field['length'][1])\n {\n if ($field['length'][0] == $field['length'][1])\n {\n if (strlen(trim($field['caption'])) > 0)\n $errors[] = sprintf(\"%s must be %d characters in length\",\n $field['caption'], $field['length'][0]);\n else\n $errors[] = sprintf(\"This field must be %d characters in length\",\n $field['length'][0]);\n }\n else\n $errors[] = sprintf(\"%s must be between %s characters in length\",\n $field['caption'], implode(' and ', $field['length']));\n }\n }\n $value = str_replace(array(\"\\r\",\"\\n\",\"\\t\",\"\\f\"), '', strip_tags($value));\n }\n\n // Set the validated (form returned) data\n switch($field['type'])\n {\n case WFT_CC_EXPIRATION:\n if ($monthValue != -1 && $yearValue != -1)\n $this->_fields[$x]['validatedData'] = sprintf('%d/%d', $monthValue, $yearValue);\n else\n $this->_fields[$x]['validatedData'] = '';\n break;\n default:\n if (isset($this->_fields[$x]['validatedDataOverride']) && strlen($this->_fields[$x]['validatedDataOverride']))\n $this->_fields[$x]['validatedData'] = $this->_fields[$x]['validatedDataOverride'];\n else\n $this->_fields[$x]['validatedData'] = $value;\n break;\n }\n }\n return $errors;\n }", "public function validateFields($fieldRules)\n {\n global $errorFeedback;\n $errors = [];\n foreach($fieldRules as $field => $rules){\n $fieldErrors = [];\n $value = $_REQUEST[$field];\n\n $d = new Disinfect();\n $d->disinfect($value);\n\n foreach($rules as $rule){\n\n if($rule == 'required'){\n if(! isset($value) || trim($value) == '' ){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'its required'\n }\n }\n\n if($rule == 'number'){\n if($value != '' && ! preg_match('/^(\\d+)$/', $value)){\n $fieldErrors[] = $errorFeedback[$rule]; // 'its a number'\n }\n }\n\n if($rule == 'freeNickname'){\n $u = new UserModel();\n $nickexist = $u->getUsersByNickname($value);\n if (!$nickexist == false) {\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'nickname not free'\n }\n }\n\n if($rule == 'max15chars'){\n if($value != '' && strlen($value) > 15){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'max chars 15'\n }\n }\n\n if($rule == 'max35chars'){\n if($value != '' && strlen($value) > 35){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'max chars 35'\n }\n }\n\n if($rule == 'min5chars'){\n if($value != '' && strlen($value) < 5){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'min chars 5'\n }\n }\n\n if($rule == 'password'){ // not in use jet!\n\n if($value != '' && ! preg_match('/^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8,}$/', $value)){\n $fieldErrors[] = $this->errorFeedback[$rule];\n //'its a password with = 8 characters length oe more, 2 letters in Upper Case, 1 Special Character, 2 numerals, 3 letters in Lower Case'\n // TODO use the Password validation if you want you passwords really save (and annoy the users)\n }\n }\n }\n // Are there some errors?\n if(count($fieldErrors) != 0){\n $errors[$field] = $fieldErrors;\n }\n }\n return $errors;\n }", "protected function validate()\n {\n }", "function validate(){\r\n\t\t$missing_fields = Array ();\r\n\t\tforeach ( $this->required_fields as $field ) {\r\n\t\t\t$true_field = $this->fields[$field]['name'];\r\n\t\t\tif ( $this->$true_field == \"\") {\r\n\t\t\t\t$missing_fields[] = $field;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( count($missing_fields) > 0){\r\n\t\t\t// TODO Create friendly equivelant names for missing fields notice in validation \r\n\t\t\t$this->errors[] = __ ( 'Missing fields: ' ) . implode ( \", \", $missing_fields ) . \". \";\r\n\t\t}\r\n\t\treturn apply_filters('em_event_validate', count($this->errors) == 0, $this );\r\n\t}", "public function check() {\n $field = null;\n $this->_errors = [];\n $fields = $this->_getField();\n\n foreach ($this->_constraints as $constraints) {\n foreach ($fields as $value) {\n switch ($constraints['type']) {\n case self::EQUAL:\n if ($value != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::DIFFERENT:\n if ($value == $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MORETHAN:\n if ($value <= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LESSTHAN:\n if ($value >= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::BETWEEN:\n if ($value < $constraints['value'][0] || $value > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IN:\n if (!in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTIN:\n if (in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTH:\n if (strlen($value) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMIN:\n if (strlen($value) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMAX:\n if (strlen($value) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHIN:\n if (!in_array(strlen($value), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHBETWEEN:\n if (strlen($value) < $constraints['value'][0] || strlen($value) > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::REGEX:\n if (!preg_match($constraints['value'], $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::URL:\n if (!filter_var($value, FILTER_VALIDATE_URL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MAIL:\n if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::INT:\n if (!filter_var($value, FILTER_VALIDATE_INT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::FLOAT:\n if (!filter_var($value, FILTER_VALIDATE_FLOAT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHA:\n if (!preg_match('#^([a-zA-Z]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHANUM:\n if (!preg_match('#^([a-zA-Z0-9]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHADASH:\n if (!preg_match('#^([a-zA-Z0-9_-]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IP:\n if (!filter_var($value, FILTER_VALIDATE_IP)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::SQL:\n /** @var $value \\Gcs\\Framework\\Core\\Orm\\Entity\\Entity */\n\n $sql = new Sql();\n $sql->query('query-form-validation', $constraints['value']['query']);\n $sql->vars('value', $value);\n\n if (count($constraints['value']['vars']) > 0) {\n $sql->vars($constraints['value']['vars']);\n }\n\n $data = $sql->fetch('query-form-validation', Sql::PARAM_FETCHCOLUMN);\n\n $querySuccess = true;\n\n switch ($constraints['value']['constraint']) {\n case '==':\n if ($data != $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '!=':\n if ($data == $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '>':\n if ($data <= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '<':\n if ($data >= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n }\n\n if (!$querySuccess) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::CUSTOM:\n /** @var object[] $constraints */\n if ($constraints['value']->filter() == false) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['value']->error()]);\n }\n break;\n }\n }\n\n switch ($constraints['type']) {\n case self::COUNT:\n if (count($fields) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMIN:\n if (count($fields) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMAX:\n if (count($fields) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTIN:\n /** @var array $constraints */\n if (!in_array(count($fields), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::EXIST:\n if (count($fields) == 1 && $fields[0] == null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTEXIST:\n if (count($fields) == 1 && $fields[0] != null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n }\n }\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "private function validateData() {\r\n\r\n $requiredFields = array(\"v_code\" => \"Verification code not supplied\",\r\n \"psw1\" => \"Password field is empty\",\r\n \"psw2\" => \"Password field is empty\",);\r\n\r\n\r\n //0 means there is no error\r\n $error_status = \\VAL_NO_ERROR;\r\n\r\n /*\r\n Initialize error object that will be returned by this function\r\n */\r\n $error_obj = new stdClass();\r\n $error_obj->msg = \"\";\r\n $error_obj->field = \"\";\r\n $error_obj->code = 0;\r\n $error_obj->type = \\VAL_NO_ERROR;\r\n\r\n //check if required variables are defined\r\n foreach ($requiredFields as $key => $value) {\r\n $value = $this->request->request->get($key);\r\n if (empty( $value )) {\r\n $error_obj->field = $key;\r\n $error_obj->msg = $requiredFields[$key];\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n //return after each field that is found wrong\r\n return $error_obj;\r\n }\r\n }\r\n\r\n $pass_1 = $this->request->request->get('psw1');\r\n $pass_2 = $this->request->request->get('psw2');\r\n\r\n //Check if emails match\r\n if (strcmp($pass_1, $pass_2) != 0) {\r\n $error_obj->field = \"psw2\";\r\n $error_obj->msg = \"Passwords are different\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n /*\r\n Only check one password. If both passwords are thesame, we only need to check one of them.\r\n */\r\n if (!preg_match('/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}$/', $pass_1)) {\r\n $error_obj->field = \"psw1\";\r\n $error_obj->msg = \"Password must have a digit, lower and upper case charters. Min lenght is 6\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n return $error_obj;\r\n }", "abstract public function validateData($data);", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function validate(){\r\n\t\tif(array_get($this->entity, array_get($this->validate, 'fieldName')) != $this->fieldValue){\r\n\t\t\tHmsException::occur($fieldName. '必须等于', $this->fieldValue);\r\n\t\t}\r\n\t}", "function validateInputs(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\tif(!matchRegex($nric,'/^[a-zA-Z0-9]*$/')) { return false; }\n\tif(!matchRegex($firstName,'/^[a-zA-Z0-9 ]*$/')) { return false; }\n\tif(!matchRegex($lastName,'/^[a-zA-Z0-9 ]*$/')) { return false; }\n\tif(!matchRegex($dob,'/^[0-9-]*$/')) { return false; }\n\tif(!matchRegex($address1,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\tif(!matchRegex($address2,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\tif(!matchRegex($poCode,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($homeNum,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($handphoneNum,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($email,'/^[a-zA-Z0-9@._-]*$/')) { return false; }\n\tif(!matchRegex($description,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\t\n\treturn true;\n}", "public function validateForm(){\n foreach(self::$fields as $field){\n if(!array_key_exists($field, $this->data)){\n trigger_error(\"$field is not presented in data\");\n return;\n } \n }\n $this->validateUsername();\n $this->validatePassword();\n $this->validateEmail();\n $this->validateFullname();\n return $this->errors;\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getCity())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getCountry())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_COUNTRY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDistrict())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DISTRICT] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getLine())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_LINE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPostalCode())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_POSTAL_CODE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getState())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_CITY])) {\n $v = $this->getCity();\n foreach($validationRules[self::FIELD_CITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_CITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CITY])) {\n $errs[self::FIELD_CITY] = [];\n }\n $errs[self::FIELD_CITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DISTRICT])) {\n $v = $this->getDistrict();\n foreach($validationRules[self::FIELD_DISTRICT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_DISTRICT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DISTRICT])) {\n $errs[self::FIELD_DISTRICT] = [];\n }\n $errs[self::FIELD_DISTRICT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LINE])) {\n $v = $this->getLine();\n foreach($validationRules[self::FIELD_LINE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_LINE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LINE])) {\n $errs[self::FIELD_LINE] = [];\n }\n $errs[self::FIELD_LINE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERIOD])) {\n $v = $this->getPeriod();\n foreach($validationRules[self::FIELD_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERIOD])) {\n $errs[self::FIELD_PERIOD] = [];\n }\n $errs[self::FIELD_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_POSTAL_CODE])) {\n $v = $this->getPostalCode();\n foreach($validationRules[self::FIELD_POSTAL_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_POSTAL_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_POSTAL_CODE])) {\n $errs[self::FIELD_POSTAL_CODE] = [];\n }\n $errs[self::FIELD_POSTAL_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATE])) {\n $v = $this->getState();\n foreach($validationRules[self::FIELD_STATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_STATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATE])) {\n $errs[self::FIELD_STATE] = [];\n }\n $errs[self::FIELD_STATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "function validate_field($field)\n {\n }", "function formErrorCheck( $fields ) {\n\t\n\t$array = get_option( 'resume_input_fields' );\n\n\tforeach ( $array as $item => $key) {\n\t\t\n\t\tswitch($item){\n\t\t\tcase 'fname':\n\t\t\t\t\t\tif ( !$fields['fname'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'lname':\n\t\t\t\t\t\tif ( !$fields['lname'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'address':\n\t\t\t\t\t\tif ( !$fields['address'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'address2':\n\t\t\t\t\t\tif ( !$fields['address2'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'city':\n\t\t\t\t\t\tif ( !$fields['city'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'state':\n\t\t\t\t\t\tif ( !$fields['state'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'zip':\n\t\t\t\t\t\tif ( !$fields['zip'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'pnumber':\n\t\t\t\t\t\tif ( ( !$fields['pnumber'] || !$fields['pnumbertype'] ) && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'snumber':\n\t\t\t\t\t\tif ( ( !$fields['snumber'] || !$fields['snumbertype'] ) && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\t\t\tif ( !$fields['email'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'attachment':\n\t\t\t\t\t\tif ( !$fields['attachment'][0]['name'][0] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'cover':\n\t\t\t\t\t\tif ( !$fields['cover'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'resume':\n\t\t\t\t\t\tif ( !$fields['resume'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n\t\n\treturn $error;\t\n}", "function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}", "abstract public function supported_fields();", "public function validate() {\n // loop through validators and run them\n foreach($this->form_fields as $field) {\n $field->valid = TRUE;\n // validate required items\n if ($field->required) {\n if ((strlen($field->value) == 0) || (empty($field->value)) || (is_null($field->value)) ) {\n $field->valid = FALSE; $this->form_errors++; \n if ((isset($field->default_error)) && (!empty($field->default_error))) {\n $field->error = $field->default_error;\n }\n else {\n $field->error = \"This field is required\";\n }\n }\n }\n // run validators for items that are not already failed\n if (($field->valid) && (!empty($field->validator)) && (is_array($field->validator))) {\n\n // skip empty fields\n if (empty($field->value)) { continue; }\n\n foreach($field->validator as $validator) {\n // run the function\n if (call_user_func($validator['func'],$field->value)) {\n $field->valid = TRUE;\n }\n else {\n $field->valid = FALSE; $this->form_errors++; \n if ((isset($validator['message'])) && (!empty($validator['message']))) {\n $field->error = $validator['message'];\n }\n else if ((isset($field->default_error)) && (!empty($field->default_error))) {\n $field->error = $field->default_error;\n }\n else {\n $field->error = \"This field contains an invalid value\";\n }\n // break out of the loop. No need to continue with validations if one has failed\n break;\n }\n }\n }\n $this->form_validated = TRUE;\n // run the post validate method to levy modifications against the validated input\n $this->postValidate();\n }\n return;\n }", "public function validation()\n {\n $this->validate(new PresenceOf(\n array(\n \"field\" => \"timestamp\",\n \"message\" => \"The field timestamp is required\"\n )\n ));\n\n $this->validate(new Regex(\n array(\n \"field\" => \"ip\",\n \"pattern\" => '/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\z/',\n \"message\" => \"The email must be unique\"\n )\n ));\n\n $this->validate(new Numericality(\n array(\n \"field\" => \"load_threshold\",\n \"message\" => \"The load threshold must be numeric\"\n )\n ));\n\n return $this->validationHasFailed() != true;\n }", "protected function validateFields($params) {\n\t\t$transactionType = $params['sg_TransType'];\n\t\t// Check for all required fields and formats\n\t\tforeach ($this->transactionFields as $field) {\n\t\t\t$isRequired = false;\n\n\t\t\t// Field is required for current transaction type\n\t\t\tif (is_array($field['required']) && in_array($transactionType, $field['required'])) {\n\t\t\t\t$isRequired = true;\n\t\t\t}\n\n\t\t\t// Field is required for all transaction types\n\t\t\telseif (is_bool($field['required']) && ($field['required'] === true)) {\n\t\t\t\t$isRequired = true;\n\t\t\t}\n\n\t\t\t// Check that all required parameters are present\n\t\t\tif (($isRequired) && (!in_array($field['name'], array_keys($params)))) {\n\t\t\t\tthrow new ValidationException(\"Parameter [\" . $field['name'] . \"] is required, but not specified\");\n\t\t\t}\n\n\t\t\t// Check that the format is more or less correct\n\t\t\tif (!empty($params[ $field['name'] ]) && strlen($params[ $field['name'] ]) > $field['size']) {\n\t\t\t\tthrow new ValidationException(sprintf(\"Value [%s] in field [%s] is over the size limit [%s]\", $params[ $field['name'] ], $field['name'], $field['size']));\n\t\t\t}\n\n\n\t\t\tif (!empty($params[ $field['name'] ])) {\n\t\t\t\t// Check the type of the value\n\t\t\t\t$correctType = false;\n\t\t\t\tswitch ($field['type']) {\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\t$correctType = is_string($params[ $field['name'] ]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'numeric':\n\t\t\t\t\t\t$correctType = is_numeric($params[ $field['name'] ]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'int':\n\t\t\t\t\t\t$correctType = is_int($params[ $field['name'] ]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!$correctType) {\n\t\t\t\t\tthrow new ValidationException(sprintf(\"Value [%s] in field [%s] is not of expected type [%s]\", $params[ $field['name'] ], $field['name'], $field['type']));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function isDataValid() {\n if ($this->userExists())\n $this->_errors[] = 'username already taken';\n // username and password must match pattern\n else if (empty($this->_username) || !preg_match('/^[a-zA-Z0-9]{5,16}$/', $this->_username))\n $this->_errors[] = 'invalid username must be between 5 and 16 characters';\n else if (empty($this->_password) || !preg_match('/^[a-zA-Z0-9]{6,18}$/', $this->_password))\n $this->_errors[] = 'invalid password must be between 6 and 18 characters';\n\t\t else if (empty($this->_password) || $this->_password != $this->_password_confirm)\n $this->_errors[] = \"Password didn't match X\";\n // names must be between 2 and 22 characters\n else if (empty($this->_first_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_first_name))\n $this->_errors[] = 'invalid first name must be between 2 and 22 characters';\n else if (empty($this->_last_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_last_name))\n $this->_errors[] = 'invalid last name must be between 2 and 22 characters';\n //restricts day to 01-31, month to 01-12 and year to 1900-2099 (also allowing / - or . between the parts of the date) \n else if (empty($this->_dob) || !preg_match('/^(0?[1-9]|[12][0-9]|3[01])[\\/\\ ](0?[1-9]|1[0-2])[\\/\\ ](19|20)\\d{2}$/', $this->_dob))\n $this->_errors[] = 'invalid dod | must be DD/MM/YYYY format';\n else if (empty($this->_address))\n $this->_errors[] = 'invalid address';\n // checks if valid postal code\n else if (empty($this->_postcode) || !preg_match('/^(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})$/', $this->_postcode))\n $this->_errors[] = 'invalid postcode | must be AA11 9AA format';\n // checks is valid email using regular expression\n else if (empty($this->_email) || !preg_match('/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}$/', $this->_email))\n $this->_errors[] = 'invalid email';\n\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "abstract protected function validate(): bool;", "abstract protected function getMandatoryModelsFields();", "public function validateFields()\n {\n $invalidFields = [];\n if (empty($_POST[\"activity\"])) {\n array_push($invalidFields, \"activity\");\n }\n if (empty($_POST[\"country\"])) {\n array_push($invalidFields, \"country\");\n }\n if (empty($_POST[\"done\"]) && empty($_POST[\"not done\"])) {\n array_push($invalidFields, \"done\");\n }\n return $invalidFields;\n }", "function tower_form_errors($data, $fields=[]) {\n $form_errors = [];\n foreach ($fields as $field) {\n $rules = explode('|', $field['rules']);\n $field_is_valid = true;\n $field_name = $field['name'];\n $value = trim(sanitize_text_field($data->get_param($field_name)));\n\n foreach ($rules as $rule) {\n if (! $field_is_valid) break;\n\n switch ($rule) {\n case 'email':\n if (! filter_var($value, FILTER_VALIDATE_EMAIL)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'Enter a valid email address';\n }\n break;\n\n case 'number':\n if (! is_numeric($value)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field needs to be numeric';\n }\n break;\n\n case 'required':\n if ($value == '') {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field is required';\n }\n break;\n\n case 'unique':\n // check DB for meta-value duplicate entry\n global $wpdb;\n $row_count = $wpdb->get_var(\"\n SELECT COUNT(`meta_id`)\n FROM {$wpdb->postmeta} \n WHERE `meta_key` = '{$field_name}' \n AND `meta_value` = '{$value}'\n \");\n if ($row_count > 0) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This value already exists. Please select another';\n }\n break;\n }\n }\n }\n return $form_errors;\n}", "public function rules()\n {\n return [\n 'country_id' => 'required|numeric',\n 'region_id' => 'required|numeric',\n 'city_id' => 'required|numeric', \n // 'rep_price_id' => 'required|numeric', \n ];\n }", "function Validation()\n {\n $validate1 = array(\n 'FIRST_NAME' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'First name could not be blank',\n 'last' => true)\n ),\n \n 'DOB' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Date Of Birth could not be blank',\n 'last' => true)\n ),\n 'FATHER_NAME' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Father Name could not be blank',\n 'last' => true)\n ),\n 'RELIGION' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Religion could not be blank',\n 'last' => true)\n ),\n 'CAST' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Cast could not be blank',\n 'last' => true)\n ),\n 'SUB_CAST' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Sub Cast could not be blank',\n 'last' => true)\n ),\n 'CAST_CAT_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Cast Category',\n 'last' => true)\n ),\n 'CLASS_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Class',\n 'last' => true)\n ),\n 'MEDIUM_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Medium',\n 'last' => true)\n ),\n 'PASSWORD' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Please enter password',\n 'allowEmpty' => true,\n 'on' => 'create',\n 'last' => true),\n 'between' => array(\n 'rule' => array('between', 6, 25),\n 'message' => 'Password between 6 and 25 chars',\n 'required' => false,\n 'allowEmpty' => true,\n ),\n ),\n 'CONFIRM_PASSWORD' => array(\n 'mustMatch' => array(\n 'rule' => array('verifies'),\n 'message' => 'Both passwords must match',\n 'last' => true),\n ),\n 'COUNTRY_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Country',\n 'last' => true)\n ),\n\t\t\t 'GROUP' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Group could not be blank',\n 'last' => true),\n\t\t\t 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Group',\n 'last' => true)\n \t\t ),\n \n \n \n );\n $this->validate = $validate1;\n return $this->validates();\n }", "function validation($data, $files) {\n global $DB;\n $errors = parent::validation($data, $files);\n\t\t\tif (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t$errors['email'] = \"Invalid email format\";\n\t\t\t} else{\n\t\t\t\t// Add field validation check for duplicate email,username.\n\t\t\t\tif($data['studentid'] == -1){\n\t\t\t\tif ($result = $DB->get_record('user', array('email' => $data['email']), 'id', IGNORE_MULTIPLE)) {\n\t\t\t\t\t//if (empty($data['studentid']) || $result->id != $data['studentid']) {\n\t\t\t\t\t\tif ($result) {\n\t\t\t\t\t\t\t$errors['email'] = \"Email already exists\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t}\n\t\t\tif($data['studentid'] > 0){\n\t\t\t\t\tif ($result = $DB->get_record('user', array('email' => $data['email']), 'id', IGNORE_MULTIPLE)) {\n\t\t\t\t\t\tif ($result && $result->id != $data['studentid']) {\n\t\t\t\t\t\tif ($result) {\n\t\t\t\t\t\t\t$errors['email'] = \"Email already exists\";\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(!check_only_characters($data['firstname']))\n\t\t{\n\t\t\t$errors['firstname'] = \"Use Only Characters\";\n\t\t}\n\t\tif(!check_only_characters($data['lastname']))\n\t\t{\n\t\t\t$errors['lastname'] = \"Use Only Characters\";\n\t\t}\n\t\tif(!empty($data['phone1'])){\n\t\t\tif(!check_is_number($data['phone1']))\n\t\t\t{\n\t\t\t\t$errors['phone1'] = \"Please Use only Numbers\";\n\t\t\t}\n\t\t\tif(!mobile_number_length($data['phone1']))\n\t\t\t{\n\t\t\t\t$errors['phone1'] = \"Please Give 10 Digit Mobile Number\";\n\t\t\t}\t\n\t\t}\n\t\treturn $errors;\n\t}", "public function validate($fields = false, $primary_key = false){\n\n\t\t$clean = parent::pre_validate($fields, $primary_key);\n\n\t\tif($clean->isEmpty('name')){\n\t\t\t$this->addError('name', text('db:error:groupname'));\n\t\t}\n\n\t\treturn $fields;\n\n\t}", "function fieldValidator() {\n\t\t$err = array();\n\t\t\n\t\tif(!$_POST['username'] || !$_POST['password']\n\t\t|| !$_POST['nickname'] || !$_POST['email'])\n\t\t\t$err[] = 'Все поля должны быть заполнены!';\n\t\telse\n\t\t{\n\t\t\tif(strlen($_POST['username'])<4 || strlen($_POST['username'])>32)\n\t\t\t\t$err[]='Логин должен содержать от 3 до 32 символов!';\n\t\t\t\n\t\t\tif(strlen($_POST['nickname'])<4 || strlen($_POST['nickname'])>16)\n\t\t\t\t$err[]='Ник-нейм должен содержать от 3 до 16 символов!';\n\t\t\t\n\t\t\tif(preg_match('/[^a-z0-9\\-\\_\\.]+/i',$_POST['username']))\n\t\t\t\t$err[]='Ваш логин содержит недопустимые символы!';\n\t\t\t\n\t\t\tif(preg_match('/[^a-z0-9\\-\\_\\.]+/i',$_POST['nickname']))\n\t\t\t\t$err[]='Ваш ник-нейм содержит недопустимые символы!';\n\t\t\t\n\t\t\tif(!checkEmail($_POST['email']))\n\t\t\t\t$err[]='Email неправильный!';\n\t\t\t\n\t\t\tif (strlen($_POST['password']) < 6 || strlen($_POST['password'])>32)\n\t\t\t\t$err[]='Пароль должен содержать от 6 до 32 символов!';\n\t\t\t\n\t\t\tif(preg_match('/[^a-z0-9\\-\\_\\.]+/i',$_POST['password']))\n\t\t\t\t$err[]='Ваш пароль содержит недопустимые символы!';\n\t\t\t\n\t\t\tif($_POST['repassword'] != $_POST['password'])\n\t\t\t\t$err[]='Пароли не совпадают!';\n\t\t}\n\t\treturn $err;\n\t}", "public function validate() {\n\t\t$this->form_validation->set_rules('rfid', 'FRID', 'required');\t\t\n\t\t$this->form_validation->set_rules('person', \"Person\", 'required');\n\t\t$this->form_validation->set_rules('asset_id', \"Assets\", 'required'); \t\n\t\t$this->form_validation->set_rules('inform_mobile', \"Mobile No.\"); \t\n\t\t$this->form_validation->set_rules('inform_email', \"Email Id\"); \t\n\t\t$this->form_validation->set_rules('send_sms', \"Sms Alert\"); \t\n\t\t$this->form_validation->set_rules('send_email', \"Email Alert\"); \t\n\t\t$this->form_validation->set_rules('comments', \"Comments\"); \t\n\t\t$this->form_validation->set_rules('landmark_id', \"Landmark\"); \t\n\t\treturn parent::validate();\n\t}", "public function validate()\n {\n $messages = array();\n\n // ID\n if (!Validator::validateField($this->id, 'intVal')) {\n $messages[] = 'ID is invalid.';\n }\n\n // Email\n if (!Validator::validateField($this->email, 'email', array('notEmpty' => array(), 'required' => true))) {\n $messages[] = 'Email address is invalid.';\n }\n\n // Password - no need to validate as it is validated on set and isn't required for an update\n\n // First name\n if (!Validator::validateField($this->first_name, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'First name is required.';\n }\n\n // Last name\n if (!Validator::validateField($this->last_name, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'Last name is required.';\n }\n\n // Role\n if (!Validator::validateField($this->role, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'Role is required.';\n }\n\n // Status\n if (!Validator::validateField($this->status, 'slug', array(\n 'notEmpty' => array(),\n 'length' => array(1, 20),\n 'required' => true\n ))) {\n $messages[] = 'Status is not valid.';\n }\n\n if (!empty($messages)) {\n throw new ValidationException($messages);\n }\n }", "protected function validate()\n {\n if ($this->primary_first_name == '') {\n $this->errors[] = 'First name is required';\n }\n if ($this->primary_last_name == '') {\n $this->errors[] = 'Last Name is required';\n }\n\n if ($this->email == '') {\n $this->errors[] = 'Email is required';\n }\n\n if ($this->phone_number == '') {\n $this->errors[] = 'Phone Number is required';\n }\n\n if ($this->city == '') {\n $this->errors[] = 'City is required';\n }\n\n if ($this->state == '') {\n $this->errors[] = 'State is required';\n }\n\n if ($this->zip_code == '') {\n $this->errors[] = 'Zip Code is required';\n }\n\n if ($this->application_date == '') {\n $this->errors[] = 'Application Date is required';\n }\n\n return empty($this->errors);\n}", "public static function __CheckFields($arFields)\n\t{\n\t\t$aMsg = array();\n\n\t\tif(is_set($arFields, \"NAME\") && trim($arFields[\"NAME\"])==\"\")\n\t\t\t$aMsg[] = array(\"id\"=>\"NAME\", \"text\"=>GetMessage(\"RR_GENERAL_ERR_NAME\"));\n\t\tif(is_set($arFields, \"ACTIVE\") && !($arFields[\"ACTIVE\"] == 'Y' || $arFields[\"ACTIVE\"] == 'N'))\n\t\t\t$aMsg[] = array(\"id\"=>\"ACTIVE\", \"text\"=>GetMessage(\"RR_GENERAL_ERR_ACTIVE\"));\n\t\tif(is_set($arFields, \"ENTITY_TYPE_ID\"))\n\t\t{\n\t\t\t$arObjects = CRatingRule::GetRatingRuleObjects();\n\t\t\tif(!in_array($arFields['ENTITY_TYPE_ID'], $arObjects))\n\t\t\t\t$aMsg[] = array(\"id\"=>\"ENTITY_TYPE_ID\", \"text\"=>GetMessage(\"RR_GENERAL_ERR_ENTITY_TYPE_ID\"));\n\t\t}\n\t\tif(is_set($arFields, \"CONDITION_NAME\") && trim($arFields[\"CONDITION_NAME\"])==\"\")\n\t\t\t$aMsg[] = array(\"id\"=>\"CONDITION_NAME\", \"text\"=>GetMessage(\"RR_GENERAL_ERR_CONDITION_NAME\"));\n\t\tif(is_set($arFields, \"ACTION_NAME\") && trim($arFields[\"ACTION_NAME\"])==\"\")\n\t\t\t$aMsg[] = array(\"id\"=>\"ACTION_NAME\", \"text\"=>GetMessage(\"RR_GENERAL_ERR_ACTION_NAME\"));\n\n\t\tif(!empty($aMsg))\n\t\t{\n\t\t\t$e = new CAdminException($aMsg);\n\t\t\t$GLOBALS[\"APPLICATION\"]->ThrowException($e);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function validate_user_field($field)\n {\n }", "protected function restrict_fields()\n {\n }", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "function validate( $values )\n {\n\n $this->errorCount = 0;\n $this->errors = array();\n\n foreach ( $this->rules as $rule ) {\n $key = $rule[\"key\"];\n\n switch( $rule['type']) {\n case \"required\":\n if (!$this->validRequired($values[$rule['key']])\n ) {\n $this->errors[] = \"Field $key is required\";\n $this->errorCount++;\n }\n break;\n case \"minlenght\":\n if (!$this->validMinLength($values[$rule['key']])\n ) {\n $this->errors[]\n = \"Field $key must have at least \" .\n $rule['arg'] . \" characters.\";\n $this->errorCount++;\n }\n break;\n case \"maxlenght\":\n if (!$this->validMaxLength($values[$rule['key']])\n ) {\n $this->errors[]\n = \"Field $key must have at most \" .\n $rule['arg'] . \" characters.\";\n $this->errorCount++;\n }\n break;\n case \"email\":\n if (!$this->validEmail($values[$rule['key']])\n ) {\n $this->errors[] = \"Field $key must be a valid email\";\n $this->errorCount++;\n }\n break;\n case \"url\":\n if (!$this->validUrl($values[$rule['key']])\n ) {\n $this->errors[] = \"Field $key must be a valid url\";\n $this->errorCount++;\n }\n break;\n case \"integer\":\n if (!$this->validInt($values[$rule['key']])\n ) {\n $this->errors[] = \"Field $key must be a valid integer\";\n $this->errorCount++;\n }\n break;\n case \"IP\":\n if (!$this->validIP($values[$rule['key']])\n ) {\n $this->errors[] = \"Field $key must be a valid IP address\";\n $this->errorCount++;\n }\n break;\n case \"regex\":\n if (!$this->validateRegEx($rule['arg'], $values[$rule['key']])\n ) {\n $this->errors[]\n = \"Field $key must be have the regular \" .\n \"expression pattern \" . $rule['arg'];\n $this->errorCount++;\n }\n break;\n } // end switch\n } // end foreach\n\n if ($this->errorCount > 0 ) {\n return false;\n } else {\n return true;\n }\n\n }", "function homeValidate() {\n\t\t$validate1 = array(\n\t\t\n\t\t/*'stock'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Stock Number')\n\t\t\t\t\t),\n\t\t\t\t\n\t\t 'name'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter name')\n\t\t\t\t\t),*/\n\t\t 'email'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Email')\n\t\t\t\t\t),\n\n\t\t 'contact'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Contact Number')\n\t\t\t\t\t),\n\t\t/*'make'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Make')\n\t\t\t\t\t),\n\t\t'model'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Model')\n\t\t\t\t\t),\n\t\t'part'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter part')\n\t\t\t\t\t),\n\t\t'year'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose year')\n\t\t\t\t\t),\n\t\t'country' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose country')\n\t\t\t\t\t),\n\t\t'comment' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter comment')\n\t\t\t\t\t),*/\n\t\t\n\t\t\t);\n\t\t$this->validate=$validate1;\n\t\treturn $this->validates();\n\t}", "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}", "private function validateFormData() {\n\n $this->firstName = $this->generalFieldValidation($this->firstName, \"firstName\", \"First name\", 40, false);\n $this->lastName = $this->generalFieldValidation($this->lastName, \"lastName\", \"Last name\", 40, false);\n $this->email = $this->generalFieldValidation($this->email, \"email\", \"E-mail\", 60, false);\n $this->address = $this->generalFieldValidation($this->address, \"address\", \"Address\", 255);\n $this->city = $this->generalFieldValidation($this->city, \"city\", \"City\", 60);\n $this->state = $this->generalFieldValidation($this->state, \"state\", \"State\", 2);\n $this->zip = $this->generalFieldValidation($this->zip, \"zip\", \"Zip code\", 5);\n $this->phone = $this->generalFieldValidation($this->phone, \"phone\", \"Phone number\", 10, false);\n $this->notes = $this->generalFieldValidation($this->notes, \"notes\", \"Notes\", -1, false);\n if ($this->phone !== \"\") {\n if (!is_numeric($this->phone)) {\n $this->errorArray[\"phone\"] = \"Phone number may only contain digits.\";\n } else {\n if (strlen($this->phone) < 10) {\n $this->errorArray[\"phone\"] = \"Phone number must contain 10 digits.\";\n }\n }\n }\n if ($this->zip !== \"\") {\n if (!is_numeric($this->zip)) {\n $this->errorArray[\"zip\"] = \"Zip code may only contain digits.\";\n } else {\n if (strlen($this->zip) !== 5) {\n $this->errorArray[\"zip\"] = \"Five digit zip code required.\";\n }\n }\n }\n if ($this->email !== \"\") {\n if (!preg_match(\"/^\\S+@\\S+\\.\\S+$/\", $this->email)) {\n $this->errorArray[\"email\"] = \"E-mail address is not valid.\";\n }\n }\n if (count($this->errorArray) === 0) {\n $this->passedValidation = true;\n }\n }", "function checkFields( $args )\r\n {\r\n\t\treturn true;\r\n }", "abstract public function validate(): bool;" ]
[ "0.8018763", "0.79772663", "0.73210245", "0.7242626", "0.7231924", "0.720395", "0.720395", "0.7117724", "0.701812", "0.697186", "0.69144034", "0.68603", "0.6858657", "0.6843471", "0.6818655", "0.67937076", "0.67817724", "0.67731434", "0.67485267", "0.67135525", "0.6705675", "0.67002636", "0.66959053", "0.6689028", "0.6661383", "0.66514415", "0.6646347", "0.66164863", "0.661635", "0.6592945", "0.6585684", "0.6585191", "0.6585191", "0.6585191", "0.6585191", "0.6585191", "0.6585191", "0.6585191", "0.6585191", "0.6585191", "0.6585191", "0.6585191", "0.6585191", "0.6558762", "0.6548833", "0.6543062", "0.6523919", "0.6523287", "0.6520294", "0.65089697", "0.6505673", "0.64918447", "0.64837915", "0.64806485", "0.64557636", "0.64442796", "0.64411277", "0.6435797", "0.64351946", "0.6429759", "0.64263064", "0.6391824", "0.6388127", "0.6363415", "0.63572496", "0.63559407", "0.63383967", "0.6333352", "0.6323211", "0.63170964", "0.6315995", "0.6306636", "0.6298634", "0.6280008", "0.6277815", "0.62579674", "0.6240305", "0.6231708", "0.62202775", "0.6218167", "0.6214042", "0.6212824", "0.62083197", "0.62043023", "0.61993307", "0.6193337", "0.6192401", "0.6190222", "0.6185362", "0.61815584", "0.61766493", "0.61676264", "0.6147856", "0.61339813", "0.6126565", "0.61148953", "0.6111406", "0.61023915", "0.60983795", "0.6096384", "0.6093047" ]
0.0
-1
Function to validate Date format
function validateDate($postVar, $value, $error) { $errorMsg = ""; $length = strlen(trim($postVar)); //checking if the length isset or not if ($length) { if (isset($value)) { $found = strpos($value, ','); if ($found === false) { $options [0] = $value; } else { $options = explode(",", $value); } } else { $options [0] = 'dd-mm-yyyy'; } $patternMatch = 0; foreach ($options as $opt) { $pos1 = strpos($opt, '-'); $pos2 = strpos($opt, '/'); $pos3 = strpos($opt, '.'); if ($pos1 !== false) { if ($pos1 == 2) { if (strlen($opt) == 8) $regexp = '/^[0-9]{2}[\-][0-9]{2}[\-][0-9]{2}$/'; else $regexp = '/^[0-9]{2}[\-][0-9]{2}[\-][0-9]{4}$/'; } if ($pos1 == 4) $regexp = '/^[0-9]{4}[\-][0-9]{2}[\-][0-9]{2}$/'; } if ($pos2 !== false) { if ($pos2 == 2) { if (strlen($opt) == 8) $regexp = '/^[0-9]{2}[\/][0-9]{2}[\/][0-9]{2}$/'; else $regexp = '/^[0-9]{2}[\/][0-9]{2}[\/][0-9]{4}$/'; } if ($pos2 == 4) $regexp = '/^[0-9]{4}[\/][0-9]{2}[\/][0-9]{2}$/'; } if ($pos3 !== false) { if ($pos3 == 2) { if (strlen($opt) == 8) $regexp = '/^[0-9]{2}[\.][0-9]{2}[\.][0-9]{2}$/'; else $regexp = '/^[0-9]{2}[\.][0-9]{2}[\.][0-9]{4}$/'; } if ($pos3 == 4) $regexp = '/^[0-9]{4}[\.][0-9]{2}[\.][0-9]{2}$/'; } if (preg_match($regexp, $postVar)) { $patternMatch = 1; if ((isset($pos1) && $pos1 == 2) || (isset($pos2) && $pos2 == 2) || (isset($pos3) && $pos3 == 2)) { $str1 = substr($opt, 0, 2); $str2 = substr($opt, 3, 2); if ($str1 == 'dd') { $DD = substr($postVar, 0, 2); $MM = substr($postVar, 3, 2); $YY = substr($postVar, 6); } if ($str1 == 'mm') { $MM = substr($postVar, 0, 2); $DD = substr($postVar, 3, 2); $YY = substr($postVar, 6); } if ($str1 == 'yy') { if ($str2 == 'mm') { $YY = substr($postVar, 0, 2); $MM = substr($postVar, 3, 2); $DD = substr($postVar, 6); } else { $MM = substr($postVar, 0, 2); $DD = substr($postVar, 3, 2); $YY = substr($postVar, 6); } } } if ((isset($pos1) && $pos1 == 4) || (isset($pos2) && $pos2 == 4) || (isset($pos3) && $pos3 == 4)) { $str = substr($opt, 5, 2); if ($str == 'dd') { $YY = substr($postVar, 0, 4); $DD = substr($postVar, 5, 2); $MM = substr($postVar, 8, 2); } if ($str == 'mm') { $YY = substr($postVar, 0, 4); $MM = substr($postVar, 5, 2); $DD = substr($postVar, 8, 2); } } if ($DD == 0 || $MM == 0 || $YY == 0) { $errorMsg .= "Invalid Date...<br>"; } if ($MM <= 12) { switch ($MM) { case 4 : case 6 : case 9 : case 11 : if ($DD > 30) { $errorMsg .= "Selected month has maximum 30 days.<br>"; } default : if ($DD > 31) { $errorMsg .= "Selected month has maximum 31 days.<br>"; } break; } } else { $errorMsg .= "Selected month more than 12 month.<br>"; } if (($YY % 4) == 0) { if (($MM == 2) && ($DD > 29)) { $errorMsg .= "Invalid days in February for leap year.<br>"; } } else { if (($MM == 2) && ($DD > 28)) { $errorMsg .= "Invalid days in February for non leap year.<br>"; } } } if ($patternMatch) break; } if (!$patternMatch) $errorMsg .= $error; } return $errorMsg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateDateFormat($date, $format);", "function str_validate_date($date_str, $date_format) {\r\n\r\n $date_str = trim($date_str);\r\n $date_format = trim($date_format);\r\n\r\n if ($date_format == 'YYYY-MM-DD')\r\n list($year, $month, $day) = explode('-', $date_str);\r\n if ($date_format == 'YYYY/MM/DD')\r\n list($year, $month, $day) = explode('/', $date_str);\r\n if ($date_format == 'YYYY.MM.DD')\r\n list($year, $month, $day) = explode('.', $date_str);\r\n\r\n if ($date_format == 'DD-MM-YYYY')\r\n list($day, $month, $year) = explode('-', $date_str);\r\n if ($date_format == 'DD/MM/YYYY')\r\n list($day, $month, $year) = explode('/', $date_str);\r\n if ($date_format == 'DD.MM.YYYY')\r\n list($day, $month, $year) = explode('.', $date_str);\r\n\r\n if ($date_format == 'MM-DD-YYYY')\r\n list($month, $day, $year) = explode('-', $date_str);\r\n if ($date_format == 'MM/DD/YYYY')\r\n list($month, $day, $year) = explode('/', $date_str);\r\n if ($date_format == 'MM.DD.YYYY')\r\n list($month, $day, $year) = explode('.', $date_str);\r\n\r\n if (is_numeric($year) && is_numeric($month) && is_numeric($day))\r\n return checkdate($month, $day, $year);\r\n return false;\r\n}", "function is_date_format_valid($date)\n{\n return preg_match(\"/(0[1-9]|[12][0-9]|3[01])[ \\.](0[1-9]|1[012])[ \\.](19|20)\\d\\d/\", $date) !== 0;\n}", "function checkDateFormat($date)\n{\n //match the format of the date\n if (preg_match (\"/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/\", $date, $parts))\n {\n //check weather the date is valid of not\n if(checkdate($parts[2],$parts[3],$parts[1]))\n return true;\n else\n return false;\n }\n else\n return false;\n}", "function isValidateDate($date, $format = 'd-m-Y')\r\n {\r\n switch ($format) {\r\n case 'd-m-Y':\r\n if (preg_match(\"/^([0-9]{2})-([0-9]{2})-([0-9]{4})$/\", $date, $parts)) {\r\n //check weather the date is valid of not\r\n if (checkdate($parts[2], $parts[1], $parts[3]))\r\n return true;\r\n else\r\n return false;\r\n } else\r\n return false;\r\n break;\r\n case 'Y-m-d':\r\n if (preg_match(\"/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/\", $date, $parts)) {\r\n //check weather the date is valid of not\r\n if (checkdate($parts[2], $parts[3], $parts[1]))\r\n return true;\r\n else\r\n return false;\r\n } else\r\n return false;\r\n break;\r\n case 'd/m/Y':\r\n if (preg_match(\"/^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})$/\", $date, $parts)) {\r\n //check weather the date is valid of not\r\n if (checkdate($parts[2], $parts[1], $parts[3]))\r\n return true;\r\n else\r\n return false;\r\n } else\r\n return false;\r\n break;\r\n }\r\n }", "function check_date($date_str)\r\n{\r\n\tif (strlen($date_str) != 10) return false;\r\n\t$pattern = \"/[0-9]{4}-[0-9]{2}-[0-9]{2}/\";\r\n\tif (!preg_match($pattern, $date_str)) return false;\r\n\t// correct format, now check ranges\r\n\treturn strtotime($date_str);\r\n}", "function validateDate($date,$format ='Y-m-d'){\n$d = dateTime::createFromFormat($format,$date);\n\nif($d && $d->format($format) == $date){\nreturn true;\n } else {\n return false;\n }\n}", "function validateDateFormat($date, $field)\n\t{\n\t\tif (preg_match (\"/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/\", $date, $parts))\n\t\t{\n\t\t //check weather the date is valid of not\n\t\t\t\t\tif(checkdate($parts[2],$parts[3],$parts[1]))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\telse\n\t\t\t\t\t return $this->setError(10011, \"error\", \"\", $field);\n\t\t}\n\t\telse\n\t\t\treturn $this->setError(10011, \"error\", \"\", $field);\n\t}", "function validateDate($date,$format = 'Y-m-d H:i:s') {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function validate_date() {\n # Check the date is in ISO date format\n if (ereg('(19|20)[0-9]{2}[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])', $this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for date ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank Date\n return \"0000-00-00\";\n }\n }", "function nrua_validateDate($date, $format = 'Y-m-d H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "public static function validateDate($input)\r\n\t{\r\n\t\treturn preg_match('/\\d{2}-\\d{2}-\\d{4}/', $input) && (strlen($input) == 10);\r\n\t}", "public function checkDateFormat($str) {\n\t\t\n\t\tif ($str != '') {\n\t\t\tlist($day, $month, $year)=explode(\"/\",$str);\n\t\n\t\t\tif (strpos($str,\".\") == true) {\n\t\t\t\t$result = \"Bad date: Point is not allowed.\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (is_numeric($day) == 1 && is_numeric($month) == 1 & is_numeric($year) == 1) {\n\t\t\t\t\tif(checkdate($month,$day,$year)) \n\t\t\t\t\t\t$result = \"good\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$result = \"Bad date\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$result = \"Bad date: Non numeric characters not allowed.\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse \n\t\t\t$result = 'The {field} is required';\n\n\t\tif ($result == 'good') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->form_validation->set_message('checkDateFormat', $result); \n\t\t\t\treturn false;\n\t\t\t}\n\t}", "function valid_date( $value = '', $format = 'Y-m-d H:i:s' )\n\t{\n\t\t$date = date_parse($value);\n\t\t$valid = ( $date['error_count'] == 0 && checkdate($date['month'], $date['day'], $date['year']) );\n\t\t\n\t\t/*\n\t\t// Create a date depending on PHP version\n\t\t$version = explode('.', phpversion());\n\t\tif (((int) $version[0] >= 5 && (int) $version[1] >= 2 && (int) $version[2] > 17))\n\t\t{\n\t\t\t$d = DateTime::createFromFormat($format, $date);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$d = new DateTime(date($format, strtotime($date)));\n\t\t}\n\t\t*/\n\t\t/*\n\t\t// Check valid date\n\t\t$format = 'Y-m-d H:i:s';\n\t\t$d = new DateTime(date($format, strtotime($date)));\n\t\t$valid_date = ( $d && $d->format($format) == $date );\n\t\t// or\n\t\t$date = date_parse($date);\n\t\t$valid_date = ( $date['error_count'] == 0 && checkdate($date['month'], $date['day'], $date['year']) );\n\t\tif ( ! $valid_date )\n\t\t{\n\t\t\t$valid = false;\n\t\t\t$return_message[] = 'The approved date is invalid.';\n\t\t}\n\t\t*/\n\t\t\n\t\tif ( ! $valid )\n\t\t{\n\t\t\t$this->set_message('valid_date', 'The %s field has in invalid date.');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function validateDate($date, $format = 'd/m/Y H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function validateDate($date, $format = 'Y-m-d') {\n \t $d = DateTime::createFromFormat($format, $date);\n \t return $d && $d->format($format) === $date;\n }", "function validateDate($date, $format = 'Y-m-d H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function validateDate($date, $format = 'Y-m-d H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function valid_date($str) \n\t{\n\t\t//if (ereg(\"([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})\", $str)) {\n\t\tif (preg_match(\"/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/\", $str)) \n\t\t{\n\t\t\t//$arr = split(\"-\", $str);\n\t\t\t$arr = preg_split(\"/-/\", $str);\n\t\t\t$yyyy = (int) $arr[0];\n\t\t\t$mm = (int) $arr[1];\n\t\t\t$dd = (int) $arr[2];\n\t\t\treturn checkdate($mm, $dd, $yyyy);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function validateDateFormat($date, $field, $format = 'd-m-Y')\r\n {\r\n switch ($format) {\r\n case 'd-m-Y':\r\n if (preg_match(\"/^([0-9]{2})-([0-9]{2})-([0-9]{4})$/\", $date, $parts)) {\r\n //check weather the date is valid of not\r\n if (checkdate($parts[2], $parts[1], $parts[3]))\r\n return true;\r\n else {\r\n $this->setError(10011, \"error\", \"\", $field);\r\n return false;\r\n }\r\n } else {\r\n $this->setError(10011, \"error\", \"\", $field);\r\n return false;\r\n }\r\n\r\n break;\r\n case 'Y-m-d':\r\n if (preg_match(\"/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/\", $date, $parts)) {\r\n //check weather the date is valid of not\r\n if (checkdate($parts[2], $parts[3], $parts[1]))\r\n return true;\r\n else {\r\n $this->setError(10011, \"error\", \"\", $field);\r\n return false;\r\n }\r\n\r\n } else {\r\n $this->setError(10011, \"error\", \"\", $field);\r\n return false;\r\n }\r\n\r\n break;\r\n }\r\n\r\n }", "protected function validateDate($value) {\n if (preg_match(\"/^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$/\", $value))\n return true;\n $this->setError(t(\"Invalid date (YYYY-MM-DD)\"));\n return false;\n }", "function _validateDate($date, $format = 'd/m/Y'){\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "function validate_date($date,$informat,$outformat){\n\n # if empty string then assume today\n #if ($date == \"\" ) { return '00:00:00' ; }\n if ($date == \"\" ) { return date(\"j/n/Y\") ; }\n\n // strtotime only understands us format dates so we need to rearrange it\n // Split date into d m Y parts\n if ( $informat == \"us\" ){\n $usdate = $date ;\n }\n // Assume Eu format\n elseif (preg_match(\"/\\d+[\\/-]\\d+[\\/-]\\d+/\", $date)) {\n preg_match_all(\"/\\d+/\", $date, $matches );\n $dateparts=$matches[0];\n $day = $dateparts[0];\n $month = $dateparts[1];\n $year = $dateparts[2];\n $usdate = \"$month/$day/$year\";\n }\n else {\n // otherwise assume it is some other format which will work in strtotime\n $usdate = $date;\n }\n\n if (( $outformat == \"eu\" ) && ( $formatted_date = date(\"j/n/Y\" , strtotime($usdate) ) ) ) {\n return $formatted_date ;\n }\n elseif (( $outformat == \"us\" ) && ( $formatted_date = date(\"n/j/Y\" , strtotime($usdate) ) ) ) {\n return $formatted_date ;\n } \n else { return false; }\n\n}", "function validateDate($date){\r\n $date = trim($date);\r\n $date_arr = explode(\"/\", $date);\r\n return checkdate ( $date_arr[0] , \"01\" , $date_arr[1] );\r\n\r\n}", "function dateValidation($value) {\n\t$reg = \"/^(((0?[1-9]|1[012])\\/(0?[1-9]|1\\d|2[0-8])|(0?[13456789]|1[012])\\/(29|30)|(0?[13578]|1[02])\\/31)\\/(19|[2-9]\\d)\\d{2}|0?2\\/29\\/((19|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00)))$/\";\n\treturn preg_match($reg,$value);\n}", "function verifyDate($date) {\r\n $date = trim($date);\r\n if (!is_numeric($date) || strlen($date) != 8) {\r\n return false;\r\n }\r\n $year = substr($date, 0, 4);\r\n $month = substr($date, 4, 2);\r\n $day = substr($date, 6);\r\n if (!checkdate($month, $day, $year)) {\r\n return false;\r\n } else {\r\n return \"$year-$month-$day\";\r\n }\r\n}", "function validateDate($Fecha, $Formato = 'Ymd')\n{\n $d = DateTime::createFromFormat($Formato, $Fecha);\n return $d && $d->format($Formato) == $Fecha;\n}", "function validateDate($date, $format = 'Y-m-d H:i:s')\n {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "function verifyDate($date, $date_format)\n {\n $datetime=DateTime::createFromFormat($date_format, $date);\n $errors=DateTime::getLastErrors();\n if (!$datetime || !empty($errors['warning_count'])) //date was invalid\n {\n $date_check_ok=false;\n }\n else //everything OK\n {\n $date_check_ok=true;\n }\n\n return $date_check_ok;\n }", "function ValidateDate($date)\n{\n // Cut date for some strings to check it.\n list($dd, $mm, $yyyy) = explode(\"-\", $date);\n \n // Check if date exist. \n if (is_numeric($dd) && is_numeric($mm) && is_numeric($yyyy))\n {\n if (!checkdate($mm, $dd, $yyyy)) \n {\n return false;\n }\n else \n {\n // Reverse date to mysql format.\n $date = sprintf(\"%d-%02d-%02d\", $yyyy,$mm,$dd);\n return $date; \n }\n }\n return false;\n}", "public function checkDate($date)\n\t{\n\t\tif (preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\",$date)){\n\t return true;\n\t }\n\t else{\n\t \t$this->form_validation->set_message('checkDate','date should be as yyyy-mm-dd');\n\t return false;\n\t }\n\t}", "function validateDate($date, $format = 'Y-m-d')\n {\n $d = DateTime::createFromFormat($format, $date);\n // The Y ( 4 digits year ) returns TRUE for any integer with any number of digits so changing the comparison from == to === fixes the issue.\n return $d && $d->format($format) === $date;\n }", "public static function validateDate($date) {\r\n if(preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\", $date)) // has to be YYYY-MM-DD\r\n {\r\n $dt = new DateTime($date);\r\n $d = $dt->format(self::dateDay);\r\n $m = $dt->format(self::dateMonth);\r\n $y = $dt->format(self::dateYear);\r\n if(!checkdate($m, $d, $y))\r\n {\r\n throw new Exception(\"Das Datum [\".$date.\"] entspricht keinem g&uuml;ltigen Format\");\r\n }\r\n else\r\n {\r\n return true; \r\n }\r\n }\r\n else\r\n {\r\n throw new Exception(\"Das Datum [\".$date.\"] entspricht nicht dem Format 'YYYY-MM-DD'\");\r\n }\r\n }", "public function check_date_format($date) {\n\t\t$matched = preg_match(\"/[0-12]{2}/[0-31]{2}/[0-9]{4}/\", $date);\n\n\t\tif ($matched) {\n\t\t\treturn checkdate(substr($date, 0, 2), substr($date, 3, 2), substr($date, 6, 4)); \n\t\t}\n\n\t\treturn $matched;\n\t}", "function validateDate($strdate) {\n//Must be 10 digits in MM/DD/YYYY format\n//Checks for a valid date (i.e days in a month etc..)\n//Returns an array\n//\t[0] - boolean 0 for good date, 1 for date error\n// [#] - error messasge\n\n \n\t$i = 0;\t\n\tif(((strlen($strdate)<10) OR (strlen($strdate)>10)) OR\n\t ((substr_count($strdate,\"/\"))<>2)) {\n\t\t$retarray[++$i] = \"Date not in 'MM/DD/YYYY' format\";\n\t} else {\n\t\t$month=(substr($strdate,0,2)); //Parse the string to be validated\n\t\t$day=(substr($strdate,3,2));\n\t\t$year=(substr($strdate,6,4));\t\n\t\t\t\n\t\t$result=ctype_digit($year);\n\t\tif(!($result)){\n\t\t\t$year=0;\n\t\t\t$isLeap=false;\n\t\t\t$retarray[++$i] = \"Year is not numeric\";\n\t\t} else {\n\t\t\t$isLeap = DateTime::createFromFormat('Y', $year)->format('L') === \"1\";\n\t\t}\t\n\t\t\t\n\t\t$result=ctype_digit($month);\n\t\tif(!($result)){\n\t\t\t$month=0; \n\t\t\t$retarray[++$i] = \"Month is not numeric\";\n\t\t} else {\n\t\t\tif(($month<=0)OR($month>12)){\n\t\t\t\t$retarray[++$i] = \"Month is not between 01 and 12\";\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$result=ctype_digit($day);\n\t\tif(!($result)){\n\t\t\t$day=0; \n\t\t\t$retarray[++$i] = \"Day is not numeric\";\n\t\t} else {\n\t\t\tif(($day<=0)OR($day>31)){\n\t\t\t\t$retarray[++$i] = \"Day is not between 01 and 31\";\n\t\t\t}\t\n\t\t\t\n\t\t\tif((($month==2) AND (((!$isLeap)AND($day>28))OR(($isLeap)AND($day>29)))) OR \n\t\t\t ((($month==4) OR ($month==6) OR ($month==9) OR ($month==11)) AND ($day>30))){\n\t\t\t\t$retarray[++$i] = \"Day is not valid for month/year\";\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\t\n\tif ($i > 0) {\n\t\t$retarray[0] = False;\n\t} else {\n\t\t$retarray[0] = True;\n\t}\t\n\t\n\treturn($retarray); \n}", "public function check_date_format($date) {\n $datepieces = explode('-', $date);\n $return = true;\n\n if (count($datepieces) != 3) {\n $return = false;\n } else {\n foreach ($datepieces as $piece => $datepiece) {\n if (!is_numeric($datepiece)) {\n $return = false;\n break;\n }\n switch ($piece) {\n // Year check.\n case 0:\n if ((strlen($datepiece) != 4) || ($datepiece <= 0)) {\n $return = false;\n break 2;\n }\n break;\n\n // Month check.\n case 1:\n if ((strlen($datepiece) != 2) || ((int)$datepiece < 1) || ((int)$datepiece > 12)) {\n $return = false;\n break 2;\n }\n break;\n\n // Day check.\n case 2:\n if ((strlen($datepiece) != 2) || ((int)$datepiece < 1) || ((int)$datepiece > 31)) {\n $return = false;\n break 2;\n }\n break;\n }\n }\n }\n return $return;\n }", "function isDateValid($date) {\r\n //$uy = $uyear->format(\"Y\");\r\n //$sy = date(\"Y\");\r\n \r\n if(preg_match('^(((0[1-9]|[12]\\d|3[01])\\/(0[13578]|1[02])\\/((19|[2-9]\\d)\\d{2}))|((0[1-9]|[12]\\d|30)\\/(0[13456789]|1[012])\\/((19|[2-9]\\d)\\d{2}))|((0[1-9]|1\\d|2[0-8])\\/02\\/((19|[2-9]\\d)\\d{2}))|(29\\/02\\/((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$^', $date))\r\n return false;\r\n else\r\n return true;\r\n \r\n}", "public function isdate($input){\n\n if (!preg_match(\"/^(0[1-9]|[1-2][0-9]|3[0-1])-(0[1-9]|1[0-2])-[0-9]{4}$/\",$input)){\n return false;\n }\n return true;\n }", "public static function check_date($value, $format='dd.mm.yyyy') {\n\t\tif (strlen($value) >= 6 && strlen($format) == 10) { \n\t // find separator. Remove all other characters from $format \n\t $separator_only = str_replace(array('m','d','y'),'', $format); \n\t $separator = $separator_only[0]; // separator is first character \n\t \n\t if ($separator && strlen($separator_only) == 2) { \n\t // make regex \n\t $regexp = str_replace('mm', '(0?[1-9]|1[0-2])', $format); \n\t $regexp = str_replace('dd', '(0?[1-9]|[1-2][0-9]|3[0-1])', $regexp); \n\t $regexp = str_replace('yyyy', '(19|20)?[0-9][0-9]', $regexp); \n\t $regexp = str_replace($separator, \"\\\\\" . $separator, $regexp); \n\t \n\t if ($regexp != $value && preg_match('/'.$regexp.'\\z/', $value)) { \n\t // check date \n\t $arr=explode($separator,$value); \n\t $day=$arr[0]; \n\t $month=$arr[1]; \n\t $year=$arr[2]; \n\t \n\t if (@checkdate($month, $day, $year)) {\n\t return true; \n\t }\n\t } \n\t } \n\t } \n\t return false; \n\t}", "function is_date_valid($date)\n{\n $is_date_valid = false;\n\n if (strtotime($date)) {\n list($day, $month, $year) = explode('.', $date);\n $is_date_valid = checkdate($month, $day, $year);\n }\n\n return $is_date_valid;\n}", "function validated_date($date_strg)\n{\n\t$new_date_strg = '';\n\n // joomla will correctly interpret us dates with slashes (mm/dd/yy\n // or mm/dd/yyyy) but interprets dates as intl if they have dashes\n // (dd-mm-yy or dd-mm-yyyy)\n $us_dash_pat = \"/^([0-9]{1,2})-([0-9]{1,2})-([0-9]{2,4})$/\";\n if (preg_match($us_dash_pat, trim($date_strg))) {\n $date_strg = str_replace(\"-\",\"/\",$date_strg);\n }\n\n\tif (empty($date_strg)) {\n\t}\n\telse if (is_numeric($date_strg)) {\n\t\t// don't allow unix timestamps here\n\t\techo '<br> Bad format for Active Date <br>';\n\t}\n\telse if (date_create($date_strg)) {\n\t\t$new_date_strg = \\JFactory::getDate($date_strg);\n\t\t$new_date_strg = $new_date_strg->format('m/d/Y');\n\t}\n\telse {\n\t\techo '<br> Bad format for Active Date <br>';\n\t}\n\treturn $new_date_strg;\n}", "function isValidShortDate ($var) {\n //Returns error message for an invalid date\n \n //Check for unsafe characters\n $msg = isSantizeString($var);\n if ($msg != \"\") {\n return $msg;\n }\n // Format mm/dd/yy or mm/dd/yyyy\n $tmpDate = explode(\"/\",$var);\n\n //if the date can't be split into 3 parts, then a \"/\" was missing\n if (count($tmpDate) != 3) {\n return \"Invalid Date\"; \n }\n \n // isValidInt does not validate numbers with leading zeros. Strip off the leading zeros.\n $tmpDate[0] = ltrim($tmpDate[0], \"0\"); \n $tmpDate[1] = ltrim($tmpDate[1], \"0\"); \n $tmpDate[2] = ltrim($tmpDate[2], \"0\");\n \n //Make sure all of the parts are valid numbers\n if (isValidInt($tmpDate[0]) == \"\" && isValidInt($tmpDate[1]) == \"\" && isValidInt($tmpDate[2]) == \"\") {\n \n // Use checkdate to validate the date\n if (checkdate($tmpDate[0], $tmpDate[1], $tmpDate[2])) { //checkdate(month, day, year)\n return \"\";\n } else {\n return \"Invalid Date\";\n }\n } else {\n return \"Invalid Date\";\n }\n}", "function mycheck_isodate($str)\n{\n if (preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $str)) {\n return TRUE;\n } else {\n return FALSE;\n }\n}", "function isDateValid($dateInput){\n\t\t$d = DateTime::createFromFormat('Y-m-d', $dateInput);\n\t\treturn $d && $d->format('Y-m-d') === $dateInput;\n\t}", "protected function dateValidation( $datetime_str ){\n\n list($date, $time) = explode('T', $datetime_str);\n\n $date = trim($date);\n $extended_year = (strpos($date,'y') === 0 ? true : false);\n if($extended_year && $this->getSetting('strict_dates')){\n return \"Extended years (5.2.4.) are not supported with the 'strict dates' option enabled.\";\n }\n // Uncertainty characters on the end are valid Level 1 features (5.2.1.),\n // pull them off to make checking the rest easier.\n $date = rtrim($date, '?~');\n\n // Negative year? That is fine, but remove it\n // and the extended year indicator before exploding the date\n $date = ltrim($date, 'y-');\n\n //Now to check the parts\n list($year, $month, $day) = explode('-',$date,3);\n\n // Year\n if(!preg_match('/^\\d\\d(\\d\\d|\\du|uu)$/', $year) && !$extended_year){\n return \"The year '$year' is invalid. Please enter a four-digit year.\";\n } elseif($extended_year && !preg_match('/^\\d{5,}$/', $year)){\n return \"Invalid extended year. Please enter at least a four-digit year.\";\n }\n $strict_pattern = 'Y';\n\n // Month\n if(!empty($month) && !preg_match('/^(\\d\\d|\\du|uu)$/',$month)){\n return \"The month '$month' is invalid. Please enter a two-digit month.\";\n }\n if(!empty($month)){\n if(strpos($year, 'u') !== false && strpos($month, 'u') === false){\n return \"The month must either be blank or unspecified when the year is unspecified.\";\n }\n $strict_pattern = 'Y-m';\n }\n\n // Day\n if(!empty($day) && !preg_match('/^(\\d\\d|\\du|uu)$/',$day)){\n return \"The day '$day' is invalid. Please enter a two-digit day.\";\n }\n if(!empty($day)){\n if(strpos($month, 'u') !== false && strpos($day, 'u') === false){\n return \"The day must either be blank or unspecified when the month is unspecified.\";\n }\n $strict_pattern = 'Y-m-d';\n }\n\n // Time\n if(strpos($datetime_str, 'T') !== false && empty($time)){\n return \"Time not provided with time seperator (T).\";\n }\n\n if($time){\n if(!preg_match('/^-?(\\d{4})(-\\d{2}){2}T\\d{2}(:\\d{2}){2}(Z|(\\+|-)\\d{2}:\\d{2})?$/',$datetime_str,$matches)){\n return \"The date/time '$datetime_str' is invalid. See EDTF 1.0, 5.1.2.\";\n }\n drupal_set_message(print_r($matches, TRUE));\n $strict_pattern = 'Y-m-d\\TH:i:s';\n if(count($matches) > 4){\n if($matches[4] === 'Z'){\n $strict_pattern .= '\\Z';\n } else {\n $strict_pattern .= 'P';\n }\n }\n }\n\n if($this->getSetting('strict_dates')){\n //Clean the date/time string to ensure it parses correctly.\n $cleaned_datetime = str_replace('u','1', $datetime_str);\n $datetime_obj = DateTime::createFromFormat('!'.$strict_pattern, $cleaned_datetime);\n $errors = DateTime::getLastErrors();\n if( !$datetime_obj ||\n !empty($errors['warning_count']) ||\n // DateTime will create valid dates from Y-m without warning,\n // so validate we still have what it was given.\n !($cleaned_datetime === $datetime_obj->format($strict_pattern))\n ) {\n return \"Strictly speaking, the date (and/or time) '$datetime_str' is invalid.\";\n }\n\n }\n\n return false;\n }", "public function isValidDate() {\n\t\t// TODO\n\t\treturn TRUE;\n\t}", "function __validFecha2($fecha){\n $test_arr = explode('-', $fecha);\n if (count($test_arr) == 3) {\n if (checkdate($test_arr[1], $test_arr[2], $test_arr[0])) {//YEAR / MES / DIA\n return true;\n }\n return false;\n }\n return false;\n }", "function validateDate($value) {\n\tif(ereg(\"^(([1-9])|(0[1-9])|(1[0-2]))\\/(([0-9])|([0-2][0-9])|(3[0-1]))\\/(([0-9][0-9])|([1-2][0,9][0-9][0-9]))$\", $value, $regs)) {\n\t\techo \"true\";\n\t} else {\n\t\techo \"false\";\n\t}\n}", "function isValidDate($date) {\n $d = DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') == $date;\n}", "public function testDate()\n {\n $this->assertTrue(BrValidation::date('01/01/2020'));\n $this->assertTrue(BrValidation::date('12/11/2019'));\n $this->assertTrue(BrValidation::date('21/04/1940'));\n $this->assertTrue(BrValidation::date('1/3/20'));\n\n $this->assertFalse(BrValidation::date('25-12-2000'), 'BR date accept only slash as separator');\n $this->assertFalse(BrValidation::date('04/21/1980'), 'BR date accept only day/month/year sequence');\n $this->assertFalse(BrValidation::date('2000-12-25'));\n $this->assertFalse(BrValidation::date('2019/11/12'));\n $this->assertFalse(BrValidation::date('2040/25/12'));\n }", "function valid_date($date){\r\n\t$day = date_day($date);\r\n\t$month = date_month($date);\r\n\t$year = date_year($date);\r\n\tif(!is_numeric($day) || !is_numeric($month) || !is_numeric($year)){\r\n\t\treturn FALSE;\r\n\t}elseif($month < 1 || $month > 12){\r\n\t\treturn FALSE;\r\n\t}elseif(($day < 1) || ($day > 30 && ($month == 4 || $month == 6 || $month == 9 || $month == 11 )) || ($day > 31)){\r\n\t\treturn FALSE;\r\n\t}elseif($month == 2 && ($day > 29 || ($day > 28 && (floor($year / 4) != $year / 4)))){\r\n\t\treturn FALSE;\r\n\t}else{\r\n\t\treturn TRUE;\r\n\t}\r\n}", "protected function validateDate($value){\n\t\tif ($value instanceof DateTime) return true;\n\n\t\tif (strtotime($value) === false) return false;\n\n\t\t$date = date_parse($value);\n\n\t\treturn checkdate($date['month'], $date['day'], $date['year']);\n\t}", "function _fourD_analysis_validate_date( $d ) {\n $ymd = explode('-', $d );\n \n if( sizeof($ymd) != 3 || strlen($ymd[0]) != 4 || ((int)$ymd[1]) < 1 || ((int)$ymd[2]) < 1 ){\n return false;\n }\n else{\n $ymd[1] = str_replace('0', '', $ymd[1]);\n $ymd[2] = str_replace('0', '', $ymd[2]);\n if($ymd[1] < 10) $ymd[1] = \"0\" . $ymd[1]; // pad month with leading 0\n if($ymd[2] < 10) $ymd[2] = \"0\" . $ymd[2]; // pad day with leading 0\n $ymd[3] = $ymd[0].'-'.$ymd[1].'-'.$ymd[2];\n $epoch = strtotime( $ymd[3] );\n // fourD_analysis_debug('form_parts_validate; $ymd[3]: '. $ymd[3].'; epoch: '.$epoch );\n \n //if( !$time || $time <= time() ){ // Allow past dates? What about editing an old project?\n // $err = 'Date must be in the future.';\n if( $epoch > 1 ){\n return $epoch;\n }\n }\n return false;\n}", "function checkMyDate($date) {\n if (trim($date)==\"\") return false;\n $arr = explode(\"-\",$date);\nreturn checkdate($arr[1],$arr[2],$arr[0]);\n}", "function validateDate($date)\n\t\t{\n\t\t\t$d = DateTime::createFromFormat('Y-m-d', $date);\n\t\t\treturn $d && $d->format('Y-m-d') == $date;\n\t\t}", "function validateDate($date)\n\t\t{\n\t\t\t$d = DateTime::createFromFormat('Y-m-d', $date);\n\t\t\treturn $d && $d->format('Y-m-d') == $date;\n\t\t}", "public static function validate_date( $date )\n {\n return preg_match(\n '/^(19|20)\\d\\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/',\n $date );\n }", "function validate_date($date) {\n $d = \\DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') === $date;\n }", "function _valid_date($field)\r\n\t{\r\n\t\t// Ignore if empty\r\n\t\tif (empty($this->{$field}))\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\r\n\t\t$date = date_parse($this->{$field});\r\n\r\n\t\treturn checkdate($date['month'], $date['day'],$date['year']);\r\n\t}", "public function checkDateFormat($data) {\n foreach ($this->_date_format as $field => $value) {\n if (!empty($data[$field])) {\n $dt = \\DateTime::createFromFormat($value, $data[$field]);\n if (!($dt !== false && !array_sum($dt->getLastErrors()))) {\n $this->_addError(self::ERROR_CODE_FIELD_FORMAT_DATE, $field, $data[$field]);\n $this->_invalid_parameter = $field;\n return false;\n }\n }\n }\n\n return true;\n }", "function fechaInvalida($fecha){\n $valores = explode('-', $fecha);\n if(count($valores) == 3 && checkdate($valores[1], $valores[2], $valores[0])){\n return false;\n }\n return true;\n }", "protected function checkDate($date)\r\n\t{\r\n\t\tif(!$date)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tif(!preg_match('/^([1-3][0-9]{3,3})-(0?[1-9]|1[0-2])-(0?[1-9]|[1-2][1-9]|3[0-1])$/', $date)) {\r\n\t\t\t\tthrow new Exception ( 'checkDate() expects a SQL formatted date like 2009-12-24.' );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function valid_date($str)\n\t{\n\t\treturn ( ! ereg(\"^[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}$\", $str)) ? FALSE : TRUE;\n\t}", "function isValidISODate ($var) {\n //Returns error message for an invalid date\n\n //Check for unsafe characters\n $msg = isSantizeString($var);\n if ($msg != \"\") {\n return $msg;\n }\n // Format yyyy-mm-dd or yy-mm-dd\n $tmpDate = explode(\"-\",$var);\n //if the date can't be split into 3 parts, then a \"-\" was missing\n if (count($tmpDate) != 3) {\n return \"Invalid Date\"; \n }\n\n // isValidInt does not validate numbers with leading zeros. Strip off the leading zeros.\n $tmpDate[0] = ltrim($tmpDate[0], \"0\"); \n $tmpDate[1] = ltrim($tmpDate[1], \"0\"); \n $tmpDate[2] = ltrim($tmpDate[2], \"0\"); \n\n //Make sure all of the parts are valid numbers\n if (isValidInt($tmpDate[0]) == \"\" && isValidInt($tmpDate[1]) == \"\" && isValidInt($tmpDate[2]) == \"\") {\n\n // Use checkdate to validate the date\n if (checkdate($tmpDate[1], $tmpDate[2], $tmpDate[0])) { //checkdate(month, day, year)\n return \"\";\n } else {\n return \"Invalid Date\";\n }\n } else {\n return \"Invalid Date\";\n }\n}", "private function isValidDateFormat($date)\n {\n if(!is_array($date)){\n return false;\n }\n if(sizeof($date) != 3){\n return false;\n }\n foreach($date as $elem){\n if(!is_numeric($elem)){\n return false;\n }\n }\n // There are only 12 months!\n if($date[0] > 12 || $date[0] < 1){\n return false;\n }\n // I don't want to type in special check for months like February so..\n if($date[1] > 31 || $date[1] < 1){\n return false;\n }\n // No crazy years\n if(strlen($date[2]) > 4 || strlen($date[2]) < 4){\n return false;\n }\n return true;\n }", "public function validateDate($data)\n {\n\n if($data =='now' || (strlen($data)>=8 && strlen($data)<=10)) {\n try {\n $value_time = new DateTime($data);\n return true;\n } catch (Exception $e) {\n // Is not a valida Date\n }\n }\n return false;\n }", "function __validFecha($fecha){\n $test_arr = explode('/', $fecha);\n if (count($test_arr) == 3) {\n if (checkdate($test_arr[1], $test_arr[0], $test_arr[2])) {//MES / DIA / YEAR\n return true;\n }\n return false;\n }\n return false;\n }", "public function validMysqlDate($date) {\n\t\t$error = 'The %s is not valid. YYYY-MM-DD is the correct form of dates.';\n\t\t// check if there are hyphens\n\t\tif(!strstr($date, '-')) {\n\t\t\t$this->form_validation->set_message('validMysqlDate', $error);\n\t\t\treturn false;\n\t\t}\n\t\t// split apart the date by hyphen\n\t\t$parts = explode('-', $date);\n\t\t// check that there is two hyphens\n\t\tif(count($parts) != 3) {\n\t\t\t$this->form_validation->set_message('validMysqlDate', $error);\n\t\t\treturn false;\n\t\t}\n\t\t// check that each part is numeric\n\t\tforeach($parts as $val) {\n\t\t\tif(!is_numeric($val)) {\n\t\t\t\t$this->form_validation->set_message('validMysqlDate', $error);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// make it here, the date is fine\n\t\treturn true;\n\t}", "protected function _checkDateValidity($format='d/m/Y') {\n $parts = explode('/', $this->data['Profile']['birth_date']);\n if (count($parts) != 3)\n return false;\n\n return checkdate($parts[1], $parts[0], $parts[2]);\n }", "public function valid_date($date, $format){\n\t\tif(!$format){\n\t\t\t$format = 'Y-m-d H:i:s';\n\t\t}\n\n\t\t$this->set_message('valid_date', 'The %s field is not a valid date according to the format: ' . $format);\n\t\t$date_object = DateTime::createFromFormat($format, $date);\n\t\treturn $date_object && $date_object->format($format) == $date;\n\n\t}", "function is_date($date) {\n\tif (preg_match('/^((1|2)[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $date) || preg_match('/^(0[1-9]|[1-2][0-9]|3[0-1])-(0[1-9]|1[0-2])-((1|2)[0-9]{3})$/', $date)){\n\t\t$date = explode('-', $date);\n\t\tif (checkdate($date[1], $date[2], $date[0]) || checkdate($date[1], $date[0], $date[2])) {\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}", "function validDate($input_data) \r\n{\r\n $date = DateTime::createFromFormat($input_data, readline(\"Masukkan tanggal/bulan/tahun dengan angka! : \"));\r\n echo $date->format('l d-M-Y');\r\n}", "function validateDate($date_joined) {\n if((preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $date_joined))) {\n list( $y, $m, $d ) = preg_split( '/[-\\.\\/ ]/', $date_joined );\n return (checkdate( $m, $d, $y ) && ($y >= date('Y') - 2) && ($y <= date('Y')));\n } else {\n // wrong format, convert to correct format\n $date_joined = date('Y-m-d', strtotime(str_replace('-', '/', $date_joined)));\n list( $y, $m, $d ) = preg_split( '/[-\\.\\/ ]/', $date_joined );\n return (checkdate( $m, $d, $y ) && ($y >= date('Y') - 2) && ($y <= date('Y')));\n }\n }", "private static function sanitizeDate($date){\r\n if (isset($date) && strlen(''.$date)==10 && preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\",$date)){\r\n return TRUE;\r\n } else {\r\n return FALSE;\r\n }\r\n }", "public function checkDateWithStrtotimeValuesDataProvider() {}", "function checkIsValidDate($date, $format = 'Y-m-d H:i:s')\n {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) === $date;\n }", "function valida_dates($enter_date, $obsolescense_date)\n{\n $day1 = substr($enter_date, 0, 2);\n $month1 = substr($enter_date, 3, 2);\n $year1 = substr($enter_date, 6, 4);\n $day2 = substr($obsolescense_date, 0, 2);\n $month2 = substr($obsolescense_date, 3, 2);\n $year2 = substr($obsolescense_date, 6, 4);\n\n if ($enter_date <= $obsolescense_date) {\n return true;\n }\n\n return false;\n}", "public function validate () {\n\t\tlist($valid, $value) = parent::validate();\n\t\tif (!$valid) {\n\t\t\t$error_message = $this->get('error_invalid', 'Invalid date: %s');\n\t\t\t$this->error($value = sprintf($error_message, $this->getRawValue()));\n\t\t} else {\n\t\t\t$value = FString::date($value, $this->get('format', FString::DATE_MYSQL));\n\t\t}\n\t\treturn array($valid, $value);\n\t}", "function fecha_valida($fecha){\n if(ereg( \"([0-9]{2})/([0-9]{2})/([0-9]{4})\",$fecha)){\n ereg( \"([0-9]{2})/([0-9]{2})/([0-9]{4})\", $fecha, $mifecha);\n $ok = checkdate($mifecha[2],$mifecha[1],$mifecha[3]);\n if($ok){\n $actual = date(\"Y-m-d\");\n $older = \"1900-01-01\";\n $dtime = strtotime(fecha_mysql($fecha));\n $dtime_ac = strtotime($actual);\n $dtime_ol = strtotime($older);\n if($dtime>$dtime_ac || $dtime<$dtime_ol){\n return false;\n }else{\n return true;\n }\n }else{\n // fecha fuera del calendario\n return false;\n } \n }else{\n // formato no valido\n return false;\n }\n}", "public function checkDateWithInvalidDateValuesDataProvider() {}", "private function isValidDate($date)\n\t{\n\t\t$date = str_replace('/', '-', $date);\n\t\treturn (date_create($date)) ? JFactory::getDate($date)->format(\"Y-m-d\") : null;\n\t}", "function dayFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_DAY_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "public function validate( $value )\n\t{\n\t\t$value = (string) $value;\n\t\t\n\t\tif( strlen( $value ) != 13 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$first_letter = substr( $value, 0, 1 );\n\t\t\n\t\tlist( $year, $month, $day ) = str_split( substr( $value, 1, 7 ), 2 );\n\t\tswitch( $first_letter )\n\t\t{\n\t\t\tcase '1':\n\t\t\t\t$year = '19' . $year;\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t$year = '19' . $year;\n\t\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t\t$year = '20' . $year;\n\t\t\t\tbreak;\n\t\t\tcase '6':\n\t\t\t\t$year = '20' . $year;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif( ! RPC_Date::validDate( $year . '-' . $month . '-' . $day ) ||\n\t\t RPC_Date::getTimestamp( $year . '-' . $month . '-' . $day ) >= RPC_Date::getTimestamp( date( 'Y-m-d' ) ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private function validateDate($date, $format = 'Y-m-d H:i:s'){\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "private function validatePassportIssuedDate() {\n $issued_date = DateTime::createFromFormat( 'd.m.Y', $this->passport_issued_date );\n\n if ( $issued_date < DateTime::createFromFormat( 'd.m.Y', '01.10.1997' ) ) {\n $this->errors[] = [ 'Паспорт должен быть выдан не позднее 1 октября 1997 года' ];\n }\n\n if ( $issued_date > new DateTime( 'tomorrow' ) ) {\n $this->errors[] = [ 'Паспорт не может быть выдан в будущем' ];\n }\n }", "function validateDate(&$errors, $field_list, $field_day, $field_month, $field_year)\n{\n\t//check if a field has been missed\n\t//$errors[$field_day] = \"$field_list[$field_day] $field_list[$field_month] $field_list[$field_year]\";\n\tif ((!isset($field_list[$field_day])|| empty($field_list[$field_day])) || (!isset($field_list[$field_month])|| empty($field_list[$field_month])) || (!isset($field_list[$field_year])|| empty($field_list[$field_year])))\n\t\t$errors[$field_day] = ' Required';\n\n\t//check February dates\n\telse if (($field_list[$field_month] == 2) && ($field_list[$field_day] == 29) && (date(\"L\", mktime(0, 0, 0, 2, 29, $field_list[$field_year])) == 0))\n\t\t\t$errors[$field_day] = ' Invalid Date: no 29th in '.$field_list[$field_year];\t\n\telse if (($field_list[$field_month] == 2) && ($field_list[$field_day] >= 30)) \n\t\t\t$errors[$field_day] = ' Invalid Date: day not in February';\n\t//check 30 Day months i.e September, April, etc\n\telse if (($field_list[$field_day] == 31) && (($field_list[$field_month] == 9) || ($field_list[$field_month] == 4) || ($field_list[$field_month] == 6) || ($field_list[$field_month] == 11)))\n\t\t$errors[$field_day] = ' Invalid Date: no 31st in'.$field_list[$field_year];\n}", "public static function isDateFormat($may_date) {\n \n $dt = DateTime::createFromFormat(\"Y-m-d\", $may_date);\n \n if ($dt !== false && !array_sum($dt->getLastErrors())) {\n //echo $dt->format('Y-m-d');\n return true;\n }\n return false;\n \n }", "private function isValidDate($date) {\n $date = str_replace('/', '-', $date);\n return (date_create($date)) ? JFactory::getDate($date)->format(\"Y-m-d\") : null;\n }", "private function isValidDate($date)\n\t\t{\n\t\t\t$date = str_replace('/', '-', $date);\n\t\t\treturn (date_create($date)) ? Factory::getDate($date)->format(\"Y-m-d\") : null;\n\t\t}", "private static function validateDate(string $date): bool\n {\n $date = \\DateTime::createFromFormat('Y-m-d', $date);\n\n if (!$date) {\n return false;\n }\n\n return true;\n }", "public function date_valid_func($date) {\n\t\t\n\t\t$date_value = null;\n\t\t// Checking date has value or not\n\t\tif (isset($date) && !empty($date) && strlen($date) == 10) {\n\t\t\t$date_explode = explode(\"/\",$date);\n\t\t\tif (count($date_explode) == 3) {\n\t\t\t\t$date_value+=strlen($date_explode[0]);\n\t\t\t\t$date_value+=strlen($date_explode[1]);\n\t\t\t\t$date_value+=strlen($date_explode[2]);\n\t\t\t\tif ($date_value === 8) {\n\t\t\t\t\t $date_value = 'date';\n\t\t\t\t} else {\n\t\t\t\t\t$date_value = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $date_value;\n\t\t}\n\t}", "public function validateDate($date, $format) {\r\n $d = DateTime::createFromFormat ( $format, $date );\r\n return $d && $d->format ( $format ) == $date;\r\n }", "function evalDate($value) {\n\t\tif (!$value) {\n\t\t\treturn false;\n\t\t}\n\t\t$checkValue = trim($value);\n\t\tif (strlen($checkValue) == 8) {\n\t\t\t$checkValue = substr($checkValue,0,2).'.'.substr($checkValue,2,2)\n\t\t\t\t.'.'.substr($checkValue,4,4) ;\n\t\t}\n\t\tlist($day,$month,$year) = split('\\.', $checkValue, 3);\n\t\tif(is_numeric($year) && is_numeric($month) && is_numeric($day)) {\n\t\t\treturn checkdate($month, $day, $year);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function validate($date, $type, $format = self::DATE_FORMAT)\n {\n $d = \\DateTime::createFromFormat($format, $date);\n $valid = $d && $d->format($format) === $date;\n if (!$valid) {\n throw new \\Exception(\" The date format for filter type: $type must be in the format \".self::DATE_FORMAT);\n }\n }", "function fecha($str)\n\t{\n\t\t$this->CI->form_validation->set_message('fecha', \"El campo %s debe contener una fecha en formato dd/mm/aaaa.\");\n\t\treturn (bool) preg_match(\"/(^([0]?[1-9]|[1|2][0-9]|[3][0|1])(\\/)([0]?[1-9]|[1][0-2])(\\/)([0-9]{4}|[0-9]{2})$)|^$/\", $str);\n\t}", "public static function isValidDate($date){\n return (DateTime::createFromFormat('d/m/Y', $date)) ? true : false;\n }", "public function testIsInvalidIncorrectlyFormattedMatchDate() {\n\t\t$this->assertFalse($this->match->validate(array('match_date' => 'qwerty')), 'Expected invalid match date to cause validation failure');\n\t\t$this->assertTrue($this->match->errors()->has('match_date'));\n\t\t$failures = $this->match->failures();\n\t\t$this->assertArrayHasKey('Date', $failures['match_date']);\n\n\t\t$this->assertFalse($this->match->validate(array('match_date' => '30 February 2014')), 'Expected 30 February date in match_dte to cause validation failure');\n\t\t$this->assertTrue($this->match->errors()->has('match_date'));\n\t\t$failures = $this->match->failures();\n\t\t$this->assertArrayHasKey('Date', $failures['match_date']);\n\t}", "public function validarFecha($texto){\n $valores = explode('-', $texto);\n if(count($valores) == 3 && checkdate($valores[1], $valores[2], $valores[0])){\n return true;\n }\n return false;\n }", "protected function checkFormat($Value,$Format){\n\t\tif (parent::checkFormat($Value,$Format)){\t\t\t\n\t\t\tif ($Format=='dd-mm-yyyy'){\t\t\t\t\t\t\t\n\t\t\t\t$RegExp='^(0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[012])-(19|20)\\d\\d$^';\n\t\t\t\tif (preg_match($RegExp,$Value)==false) return false;\n\t\t\t\telse return true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isDate();" ]
[ "0.85788125", "0.8089153", "0.8053855", "0.800916", "0.79160124", "0.7802426", "0.77569455", "0.7721865", "0.7719596", "0.765753", "0.7655146", "0.7648553", "0.7639155", "0.7630302", "0.762221", "0.759448", "0.7587629", "0.7587629", "0.75789297", "0.75556386", "0.75311893", "0.75295955", "0.7497312", "0.7455755", "0.7449991", "0.74410665", "0.7418627", "0.7377108", "0.7365573", "0.7321624", "0.73194", "0.73111373", "0.73050386", "0.73040015", "0.7294345", "0.7290032", "0.7289148", "0.72880805", "0.72845775", "0.72741723", "0.7261719", "0.723839", "0.7228269", "0.7212241", "0.717658", "0.7167475", "0.7160969", "0.714632", "0.7130906", "0.71273386", "0.71192384", "0.71175766", "0.7112573", "0.71047735", "0.7103146", "0.7103146", "0.7092066", "0.70903444", "0.70813185", "0.7078748", "0.7069381", "0.7033501", "0.7017432", "0.70151544", "0.7012763", "0.7008222", "0.692613", "0.69235957", "0.6905812", "0.68942714", "0.68845636", "0.6875268", "0.6873701", "0.68727535", "0.6858973", "0.6840098", "0.6836367", "0.68196756", "0.6818269", "0.6815025", "0.6813977", "0.67868173", "0.6784527", "0.6776201", "0.6771622", "0.6754359", "0.67485654", "0.6744365", "0.6733771", "0.6730819", "0.67263234", "0.66989887", "0.6695453", "0.66872483", "0.66669035", "0.66471857", "0.6641522", "0.6639411", "0.66357034", "0.66029865" ]
0.73421854
29
Function to validate File Type
function validateFileType($postVar, $value, $error) { $errorMsg = ""; //checking if the $value variable is isset or not if (isset($value)) { $found = strpos($value, ','); if ($found === false) { $options[0] = $value; } else { $options = explode(",", $value); } } //checking if the $postVar['name'] value in an array or not if (is_array($postVar['name'])) { $totalFiles = count($postVar['name']); for ($i = 0; $i < $totalFiles; $i++) { if ($postVar['name'][$i]) { $fileTypeMatch = 0; foreach ($options as $id => $type) { $typeArray = $this->availableFileTypes($type); if (in_array($postVar['type'][$i], $typeArray)) { $fileTypeMatch = 1; } if ($fileTypeMatch) break; } if (!$fileTypeMatch) { $errorMsg .= $error . " (" . $postVar['name'][$i] . ")<br>"; } } } //if not array then go here } else { if ($postVar['name']) { $fileTypeMatch = 0; foreach ($options as $id => $type) { $typeArray = $this->availableFileTypes($type); if (in_array($postVar['type'], $typeArray)) { $fileTypeMatch = 1; } if ($fileTypeMatch) break; } if (!$fileTypeMatch) { $errorMsg .= $error . " (" . $postVar['name'] . ")<br>"; } } } return $errorMsg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "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}", "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 function mimeTypeValid()\n\t{\n\t\tif (!in_array($this->files['type'], $this->mime_types)) {\n\t\t\tthrow new Exception(\"Invalid file Extension\",6);\n\t\t}\n\t}", "private function checkMimeType()\n {\n $allowedTypes = $this->getSetting('allowed_upload_types', true);\n if (is_string($allowedTypes) && strlen($allowedTypes)) {\n $allowedTypes = str_replace(' ', '', $allowedTypes);\n $allowedTypes = explode(',', $allowedTypes);\n }\n if (is_array($allowedTypes)) {\n if (!in_array($this->file->getMimeType(), $allowedTypes)) {\n throw new FileException('File type is not allowed');\n }\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 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 }", "function check_upload($file) {\n if (preg_match(\":^application/vnd.bdoc-:\", $file[\"type\"])) {\n $file[\"format\"] = \"bdoc\";\n } else if ($file[\"type\"] === \"application/x-ddoc\") {\n $file[\"format\"] = \"ddoc\";\n } else {\n return FALSE;\n }\n\n return is_uploaded_file($file[\"tmp_name\"]);\n}", "function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}", "function __checkType($type = null) {\n\t\t$valid = false;\n \tforeach($this->allowedTypes as $allowedType) {\n \t\tif(strtolower($type) == strtolower($allowedType)){\n \t\t$valid = true;\n \t\t}\n \t}\n\t\tif(!$valid) {\n\t\t\t$this->Session->setFlash('You tried to upload an invalid type! Please upload your pictures in jpeg, gif, or png format!');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t}", "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 check_mime_type($source)\n{\n $mime_types = array(\n // images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n // adobe\n 'pdf' => 'application/pdf',\n // ms office\n 'doc' => 'application/msword',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'ppt' => 'application/vnd.ms-powerpoint',\n // open office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n $arrext = explode('.', $source['name']);\n $jml = count($arrext) - 1;\n $ext = $arrext[$jml];\n $ext = strtolower($ext);\n //$ext = strtolower(array_pop(explode(\".\", $source['name'])));\n if (array_key_exists($ext, $mime_types)) {\n return $mime_types[$ext];\n } elseif (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimetype = finfo_file($finfo, $source['tmp_name']);\n finfo_close($finfo);\n return $mimetype;\n } else {\n return false;\n }\n}", "function file_tester($file){\n if (htmlentities($file['filename']['type']) == 'text/plain')\n return true;\n else {\n echo \"Please submit correct file type (.txt)\";\n return false;\n }\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 }", "private function checkSupportedFile($file_type) {\n return true;\n\n\n }", "function validateFileMime(&$model, $fieldData, $fieldName, $allowedMimes = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $availableMimes = assetMimes();\n \n foreach (!empty($allowedMimes) ? $allowedMimes : array() as $type) {\n if ($type == '*') return true;\n \n # check fileinfo first\n $fileinfo = assetMimeType($fieldData[$fieldName]['tmp_name']);\n if ((!$fileinfo) && (in_array($fileinfo, $availableMimes[$type]))) return true; \n \n # check browser provided mime-type second\n if (in_array($fieldData[$fieldName]['type'], $availableMimes[$type])) return true;\n }\n \n return false;\n }", "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}", "abstract protected function validateFile() : object;", "function validateFile($fieldname)\n{\n $error = '';\n if (!empty($_FILES[$fieldname]['error'])) {\n switch ($_FILES[$fieldname]['error']) {\n case '1':\n $error = 'Upload maximum file is 4 MB.';\n break;\n case '2':\n $error = 'File is too big, please upload with smaller size.';\n break;\n case '3':\n $error = 'File uploaded, but only halef of file.';\n break;\n case '4':\n $error = 'There is no File to upload';\n break;\n case '6':\n $error = 'Temporary folder not exists, Please try again.';\n break;\n case '7':\n $error = 'Failed to record File into disk.';\n break;\n case '8':\n $error = 'Upload file has been stop by extension.';\n break;\n case '999':\n default:\n $error = 'No error code avaiable';\n }\n } elseif (empty($_FILES[$fieldname]['tmp_name']) || $_FILES[$fieldname]['tmp_name'] == 'none') {\n $error = 'There is no File to upload.';\n } elseif ($_FILES[$fieldname]['size'] > FILE_UPLOAD_MAX_SIZE) {\n $error = 'Upload maximum file is '.number_format(FILE_UPLOAD_MAX_SIZE/1024,2).' MB.';\n } else {\n //$get_ext = substr($_FILES[$fieldname]['name'],strlen($_FILES[$fieldname]['name'])-3,3);\t\n $cekfileformat = check_file_type($_FILES[$fieldname]);\n if (!$cekfileformat) {\n $error = 'Upload File only allow (jpg, gif, png, pdf, doc, xls, xlsx, docx)';\n }\n }\n\n return $error;\n}", "function checkFileType($imageFileType)\n{\n\n if ($imageFileType == \"c\"||$imageFileType==\"C\"){\n echo \"C file detected!\";\n return 1;\n }\n if ($imageFileType ==\"py\"||$imageFileType==\"PY\"){\n echo \"Python file detected!\";\n return 2;\n\n }\n else{\n echo \"File is not allowed\";\n return 0;\n\n }\n}", "public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }", "function wp_check_filetype($filename, $mimes = null) {\n\t$mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array(\n\t\t'jpg|jpeg|jpe' => 'image/jpeg',\n\t\t'gif' => 'image/gif',\n\t\t'png' => 'image/png',\n\t\t'bmp' => 'image/bmp',\n\t\t'tif|tiff' => 'image/tiff',\n\t\t'ico' => 'image/x-icon',\n\t\t'asf|asx|wax|wmv|wmx' => 'video/asf',\n\t\t'avi' => 'video/avi',\n\t\t'mov|qt' => 'video/quicktime',\n\t\t'mpeg|mpg|mpe' => 'video/mpeg',\n\t\t'txt|c|cc|h' => 'text/plain',\n\t\t'rtx' => 'text/richtext',\n\t\t'css' => 'text/css',\n\t\t'htm|html' => 'text/html',\n\t\t'php|php3|' => 'application/php',\n\t\t'mp3|mp4' => 'audio/mpeg',\n\t\t'ra|ram' => 'audio/x-realaudio',\n\t\t'wav' => 'audio/wav',\n\t\t'ogg' => 'audio/ogg',\n\t\t'mid|midi' => 'audio/midi',\n\t\t'wma' => 'audio/wma',\n\t\t'rtf' => 'application/rtf',\n\t\t'js' => 'application/javascript',\n\t\t'pdf' => 'application/pdf',\n\t\t'doc' => 'application/msword',\n\t\t'pot|pps|ppt' => 'application/vnd.ms-powerpoint',\n\t\t'wri' => 'application/vnd.ms-write',\n\t\t'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',\n\t\t'mdb' => 'application/vnd.ms-access',\n\t\t'mpp' => 'application/vnd.ms-project',\n\t\t'swf' => 'application/x-shockwave-flash',\n\t\t'class' => 'application/java',\n\t\t'tar' => 'application/x-tar',\n\t\t'zip' => 'application/zip',\n\t\t'gz|gzip' => 'application/x-gzip',\n\t\t'exe' => 'application/x-msdownload',\n\t\t// openoffice formats\n\t\t'odt' => 'application/vnd.oasis.opendocument.text',\n\t\t'odp' => 'application/vnd.oasis.opendocument.presentation',\n\t\t'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n\t\t'odg' => 'application/vnd.oasis.opendocument.graphics',\n\t\t'odc' => 'application/vnd.oasis.opendocument.chart',\n\t\t'odb' => 'application/vnd.oasis.opendocument.database',\n\t\t'odf' => 'application/vnd.oasis.opendocument.formula',\n\n\t));\n\n\t$type = false;\n\t$ext = false;\n\n\tforeach ($mimes as $ext_preg => $mime_match) {\n\t\t$ext_preg = '!\\.(' . $ext_preg . ')$!i';\n\t\tif (preg_match($ext_preg, $filename, $ext_matches)) {\n\t\t\t$type = $mime_match;\n\t\t\t$ext = $ext_matches[1];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn compact('ext', 'type');\n}", "function isFileType($files) {\n $allowedExts = array(\"jpg\", \"jpeg\", \"gif\", \"png\", \"doc\", \"docx\", \"txt\", \"rtf\", \"pdf\", \"xls\", \"xlsx\", \"ppt\", \"pptx\");\n $temp = explode(\".\", $files);\n $extension = end($temp);\n if (in_array($extension, $allowedExts))\n return true;\n else\n return false;\n}", "public function checkFileValidation($string) {\n $file_mimes = array('text/x-comma-separated-values',\n 'text/comma-separated-values',\n 'application/octet-stream',\n 'application/vnd.ms-excel',\n 'application/x-csv',\n 'text/x-csv',\n 'text/csv',\n 'application/csv',\n 'application/excel',\n 'application/vnd.msexcel',\n 'text/plain',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n );\n if (isset($_FILES['fileURL']['name'])) {\n $arr_file = explode('.', $_FILES['fileURL']['name']);\n $extension = end($arr_file);\n if (($extension == 'xlsx' || $extension == 'xls' || $extension == 'csv') && in_array($_FILES['fileURL']['type'], $file_mimes)) {\n return true;\n } else {\n $this->form_validation->set_message('checkFileValidation', 'Please choose correct file.');\n return false;\n }\n } else {\n $this->form_validation->set_message('checkFileValidation', 'Please choose a file.');\n return false;\n }\n }", "function testFileTypes()\n {\n $bulletproof = $this->bulletproof->uploadDir('/tmp');\n $image = array('name' => $this->testingImage,\n 'type' => 'image/jpeg',\n 'size' => 542,\n 'tmp_name' => $this->testingImage,\n 'error' => 0\n );\n\n /* should not accept gif*/\n $bulletproof->fileTypes(array('gif'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( gif ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n\n /* should not accept png*/\n $bulletproof->fileTypes(array('png'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( png ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n /* shouldn't accept this file */\n $bulletproof->fileTypes(array('exe'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( exe ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n /* example file is actually jpeg, not jpg */\n $bulletproof->fileTypes(array('png', 'jpeg'));\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n $this->assertEquals('uploads/bulletproof_test_image.jpeg',$upload);\n }", "function testFileTypes()\r\n {\r\n $nautilus = $this->nautilus->uploadDir('/tmp');\r\n $image = array('name' => $this->testingImage,\r\n 'type' => 'image/jpeg',\r\n 'size' => 542,\r\n 'tmp_name' => $this->testingImage,\r\n 'error' => 0\r\n );\r\n\r\n /* should not accept gif*/\r\n $nautilus->fileTypes(array('gif'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( gif ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n\r\n /* should not accept png*/\r\n $nautilus->fileTypes(array('png'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( png ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n /* shouldn't accept this file */\r\n $nautilus->fileTypes(array('exe'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( exe ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n /* example file is actually jpeg, not jpg */\r\n $nautilus->fileTypes(array('png', 'jpeg'));\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n $this->assertEquals('uploads/nautilus_test_image.jpeg',$upload);\r\n }", "function isFileId($type) {\n\tif (strlen($type) >= 7) {\n\t\tif (substr($type, -7) === \"file_id\") {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "public function typeOfFile($path);", "public function extensionValid() \n\t{\n\t\tif (!in_array($this->extension_of_file, $this->file_types)) //{\n\t\t\tthrow new Exception(\"Invalid file Extension\",5);\n\t\t//}\n\t}", "function checkMimeType($params = array(), $options = array()) {\n\t\tif ($this->isUploadedFile($params)) {\n\t\t\t// Only validate mime type if a file was uploaded at all\n\t\t\t$val = array_shift($params);\n\t\t\tforeach ($options['allowed_mime_types'] as $extensions) {\n\t\t\t\tif ((!is_array($extensions) && $extensions == '*') ||\n\t\t\t\t\t(is_array($extensions) && in_array($val['type'], $extensions))) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isValid($file_key)\n\t{\n\t\treturn App_File_Utils::check_type($this->_type, $_FILES[$file_key]['tmp_name']);\n\t}", "public function isValidType( $ext=null ){\n global $VALID_FILES;\n if (!$ext)\n $ext = $this->ext; \n return (in_array( $ext, $VALID_FILES )); \n }", "function file_is_valid_image($path)\n {\n }", "function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}", "function validate_file($file, $allowed_files = array())\n {\n }", "public function file_check($str){\n \t$allowed_mime_type_arr = array('application/pdf');\n \tif(isset($_FILES['file']['name']) && $_FILES['file']['name']!=\"\"){\n \t\t$mime = get_mime_by_extension($_FILES['file']['name']);\n \t\tif(in_array($mime, $allowed_mime_type_arr)){\n \t\t\treturn true;\n \t\t}else{\n \t\t\t$this->form_validation->set_message('file_check', 'Extension File Hanya Boleh PDF');\n \t\t\treturn false;\n \t\t}\n \t}else{\n \t\t// $this->form_validation->set_message('file_check', 'Silahkan Pilih File PDF nya.');\n \t\t// return false;\n \t\treturn true;\n \t}\n }", "public function wrongTypeFile()\n {\n return 'This type of file is not allowed';\n }", "function validate ($type, $value)\n {\n \n if($type == \"link\") {\n return filter_var($value, FILTER_VALIDATE_URL);\n }\n if($type == \"picture\") {\n $ext = substr($value, strlen($value) - 4, 4);\n if($ext != \".png\" && $ext != \".jpg\" && $ext != \".gif\") return false;\n else return true;\n }\n if($type == \"int\") {\n return is_numeric($value);\n }\n if($type == \"string\") {\n return true;\n }\n if($type == \"date\") {\n if($value instanceof DateTime) return true;\n else return false;\n }\n }", "private function isValidImageType(string $file)\r\n {\r\n return in_array(pathinfo($file, PATHINFO_EXTENSION), $this->supported);\r\n }", "public function file_check($str)\n {\n $allowed_mime_types = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain');\n if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != \"\") {\n $mime = get_mime_by_extension($_FILES['file']['name']);\n $fileAr = explode('.', $_FILES['file']['name']);\n $ext = end($fileAr);\n if (($ext == 'csv') && in_array($mime, $allowed_mime_types)) {\n return true;\n } else {\n $this->form_validation->set_message('file_check', 'Please select only CSV file to upload.');\n return false;\n }\n } else {\n $this->form_validation->set_message('file_check', 'Please select a CSV file to upload.');\n return false;\n }\n }", "function availableFileTypes($ext) {\n //checking file type extension\n switch ($ext) {\n //checking txt extention\n case \"txt\":\n $type[0] = \"text/plain\";\n break;\n\n //checking xml extention\n case \"xml\":\n $type[0] = \"text/xml\";\n $type[1] = \"application/xml\";\n break;\n\n //checking csv extention\n case \"csv\":\n $type[0] = \"text/x-comma-separated-values\";\n $type[1] = \"application/octet-stream\";\n $type[2] = \"text/plain\";\n break;\n\n //checking zip extention\n case \"zip\":\n $type[0] = \"application/zip\";\n break;\n\n //checking tar extention\n case \"tar\":\n $type[0] = \"application/x-gzip\";\n break;\n\n //checking ctar extention\n case \"ctar\":\n $type[0] = \"application/x-compressed-tar\";\n break;\n\n //checking pdf extention\n case \"pdf\":\n $type[0] = \"application/pdf\";\n break;\n\n //checking doc extention\n case \"doc\":\n $type[0] = \"application/msword\";\n $type[1] = \"application/octet-stream\";\n break;\n\n //checking xls extention\n case \"xls\":\n $type[0] = \"application/vnd.ms-excel\";\n $type[1] = \"application/vnd.oasis.opendocument.spreadsheet\";\n break;\n\n //checking ppt extention\n case \"ppt\":\n $type[0] = \"application/vnd.ms-powerpoint\";\n break;\n\n //checking jpg extention\n case \"jpg\":\n $type[0] = \"image/jpg\";\n $type[1] = \"image/jpeg\";\n $type[2] = \"image/pjpeg\";\n break;\n\n //checking gif extention\n case \"gif\":\n $type[0] = \"image/gif\";\n break;\n\n //checking png extention\n case \"png\":\n $type[0] = \"image/png\";\n break;\n\n //checking bmp extention\n case \"bmp\":\n $type[0] = \"image/bmp\";\n break;\n\n //checking icon extention\n case \"icon\":\n $type[0] = \"image/x-ico\";\n break;\n\n //checking tfontt extention\n case \"font\":\n $type[0] = \"application/x-font-ttf\";\n break;\n }\n\n return $type;\n }", "private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\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}", "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 validateFileTypes($inputType, $outputType)\n {\n try{\n if(! in_array($inputType, $this->allowedInputTypes))\n {\n throw new \\Exception($inputType.' is not a valid Input file type');\n }\n\n if(! in_array($outputType, $this->allowedOutputTypes))\n {\n throw new \\Exception($outputType.' is not a valid Output file type');\n }\n\n return true;\n\n }catch(\\Exception $e){\n echo \"ERROR: \".$e->getMessage();\n return false;\n }\n }", "public function isFile();", "function checkFileType( $file_types, $currentFileType )\n{\n $aFiles = explode( ',', $file_types ) ; # create aFiles file type array:\n for ( $x=0; $x<count($aFiles); $x++ )\n {\n if ( $aFiles[$x] == $currentFileType ) { return TRUE ; }\n }\n return FALSE ; # no match found, return false!\n}", "function validateCompile($file, $type, $folder, $require_type){\n\tif($type=='application/sql' && $require_type==$type){\n\t\tif(!is_array($file) || !$folder){\n\t\t\treturn false;\n\t\t}\t\n\t}elseif($type=='application/zip' && $require_type==$type){\n\t\tif(!is_array($file) || !$folder){\n\t\t\treturn false;\n\t\t}\t\n\t}else{\n\t\treturn false;\n\t}\t\n\treturn true;\n}", "public function testGetMimeType()\n {\n $validator = new File\\MimeType('image/gif');\n $this->assertEquals('image/gif', $validator->getMimeType());\n\n $validator = new File\\MimeType(['image/gif', 'video', 'text/test']);\n $this->assertEquals('image/gif,video,text/test', $validator->getMimeType());\n\n $validator = new File\\MimeType(['image/gif', 'video', 'text/test']);\n $this->assertEquals(['image/gif', 'video', 'text/test'], $validator->getMimeType(true));\n }", "function isValidFile($fileArray)\n{\n\t# Creating image type array\n\t$imgTypeArr = array('jpg','gif','png','jpeg');\n\t\n\t# image size variable\n\t$fileSize\t= $fileArray['file']['size']; \n\t\n\t# image type variable\n\t$fileType\t= $fileArray['file']['name']; \n\t\n\t# Creating Image extension variable and converting to lowercase\n\t\t$imageExt\t= strtolower(substr($fileType, strrpos($fileType, '.') + 1));\n\t\n\t# Checking weather file type is image and size is less then OR equal to 2 MB\n\tif(in_array($imageExt,$imgTypeArr) && $fileSize <= '2090000'){\n\t\treturn TRUE;\n\t}else{\n\t\treturn FALSE;\n\t}\n}", "public function file_check($str)\n {\n\n\n\n echo \"sadasd : \";\n print_r($str);\n print_r($_FILES);\n\n die();\n\n $allowed_mime_type_arr = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'svg');\n $mime = get_mime_by_extension($_FILES['file']['name']);\n if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != \"\") {\n if (in_array($mime, $allowed_mime_type_arr)) {\n return true;\n } else {\n $this->form_validation->set_message('file_check', 'por favor selecciona solamente gif/jpg/png file.');\n return false;\n }\n } else {\n $this->form_validation->set_message('file_check', 'Selecciona un archivo.');\n return false;\n }\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 }", "public function isFile() : bool;", "function check_upload_mimes($mimes)\n {\n }", "protected function isFile() {}", "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 validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }", "function check_file_is_audio( $tmp ) \n{\n $allowed = array(\n 'audio/mpeg', 'audio/x-mpeg', 'audio/mpeg3', 'audio/x-mpeg-3', 'audio/aiff', \n 'audio/mid', 'audio/x-aiff', 'audio/x-mpequrl','audio/midi', 'audio/x-mid', \n 'audio/x-midi','audio/wav','audio/x-wav','audio/xm','audio/x-aac','audio/basic',\n 'audio/flac','audio/mp4','audio/x-matroska','audio/ogg','audio/s3m','audio/x-ms-wax',\n 'audio/xm'\n );\n \n // check REAL MIME type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $tmp );\n finfo_close($finfo);\n \n // check to see if REAL MIME type is inside $allowed array\n if( in_array($type, $allowed) ) {\n return $type;\n } else {\n return false;\n }\n}", "function verifyMimeType( $pFile ) {\n\t\t$mime = NULL;\n\t\tif( file_exists( $pFile ) ) {\n\t\t\tif( function_exists( 'finfo_open' ) ) {\n\t\t\t\tif( is_windows() && defined( 'PHP_MAGIC_PATH' ) && is_readable( PHP_MAGIC_PATH )) {\n\t\t\t\t\t$finfo = finfo_open( FILEINFO_MIME, PHP_MAGIC_PATH );\n\t\t\t\t} else {\n\t\t\t\t\t$finfo = finfo_open( FILEINFO_MIME );\n\t\t\t\t}\n\t\t\t\t$mime = finfo_file( $finfo, $pFile );\n\t\t\t\tfinfo_close( $finfo );\n\t\t\t} else {\n\t\t\t\tif( function_enabled( \"escapeshellarg\" ) && function_enabled( \"exec\" )) {\n\t\t\t\t\t$mime = exec( trim( 'file -bi ' . escapeshellarg( $pFile )));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( empty( $mime ) ) {\n\t\t\t\t$mime = $this->lookupMimeType( substr( $pFile, strrpos( $pFile, '.' ) + 1 ) );\n\t\t\t}\n\t\t\tif( $len = strpos( $mime, ';' )) {\n\t\t\t\t$mime = substr( $mime, 0, $len );\n\t\t\t}\n\t\t}\n\t\treturn $mime;\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 }", "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}", "public static function validate_mime_type($y_type) {\n\t//--\n\t$y_type = (string) strtolower(trim((string)$y_type));\n\t//--\n\tif((string)$y_type == '') {\n\t\treturn '';\n\t} //end if\n\t//--\n\tif(preg_match('/^[[:graph:]]+$/', $y_type)) { // mime types are only ISO-8859-1\n\t\t$type = $y_type;\n\t} else {\n\t\t$type = '';\n\t} //end if\n\t//--\n\treturn (string) $type;\n\t//--\n}", "public function MimeType();", "function sanitize_mime_type($mime_type)\n {\n }", "function validate_expense_file() {\n return validate_post_file($this->input->post(\"file_name\"));\n }", "protected function validateType($type) {\n switch (strtolower($type)) {\n case 'string':\n return 'string';\n break;\n\n case 'url':\n return 'url';\n break;\n\n case 'file':\n return 'file';\n break;\n\n default:\n return FALSE;\n break;\n }\n }", "public function checkIsFile($path);", "function accouk_is_valid_text_file($path) {\n\n // Use finfo to detect mime type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime = finfo_file($finfo, $path);\n finfo_close($finfo);\n if($mime !== \"text/plain\") return false;\n\n // Check file extension\n $filename_length = strlen($path);\n if(substr($path, $filename_length-4, $filename_length) !== \".txt\") return false;\n\n return true;\n}", "function isOfType($data, $types) {\r\n\t\t// Multiple types\r\n\t\tif (!is_array($types)) $types = array($types);\r\n\r\n\t\t// Fails if not in the list of allowed extensions\r\n\t\tif (!in_array($data['ext'], $types)) {\r\n\t\t\t$this->uploadValidationError = sprintf(__d('caracole_documents', 'This file extension, %1$s, is not allowed.', true), $data['ext']);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}", "static function validFile($name,$size,$arrayFileType){\n \n $valid = true;\n \n// //extraer el ultimo componente de la ruta(se busca el nombre del archivo)\n// $file = $dir . basename($_FILES[$name]['name']);\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n// $valFileType = strtolower(pathinfo($file,PATHINFO_EXTENSION));\n //Extraer el tamaño del archivo\n// $valsize = getimagesize($_FILES[$name][\"tmp_name\"]);\n \n // Extenciones permitidas\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n $valFileType = strtolower(pathinfo($_FILES[$name]['name'],PATHINFO_EXTENSION)); \n $true=0;\n// var_dump(count($arrayFileType));\n for($i=0; $i<=count($arrayFileType)-1; $i++){\n \n if($valFileType==$arrayFileType[$i]){\n $true=$true+1;\n } \n $stringFileType .=$arrayFileType[$i].\" \";\n \n }\n \n if($true==0){\n $valid = false;\n $msg.=\"Solo se permiten extensiones \".$stringFileType.\". \"; \n }\n \n //tamaño permitido\n if ($_FILES[$name][\"size\"] > $size) {\n $valid = false;\n $msg.=\"Operacion fallida, este archivo no puede ser mayor a \".($size/100000).\"MB. \"; \n } \n \n \n if($msg!=\"\"){\n// $msg = \"Debe darse un valor al campo: \".$msg ;\n utilities::alert($msg); \n }\n \n \n \n return ($valid); \n }", "function mimetype($filedata) {\r\n\t\t$filepath = $filedata['tmp_name'];\r\n\t\t// Check only existing files\r\n\t\tif (!file_exists($filepath) || !is_readable($filepath)) return false;\r\n\r\n\t\t// Trying to run file from the filesystem\r\n\t\tif (function_exists('exec')) {\r\n\t\t\t$mimeType = exec(\"/usr/bin/file -i -b $filepath\");\r\n\t\t\tif (!empty($mimeType)) return $mimeType;\r\n\t\t}\r\n\r\n\t\t// Trying to get mimetype from images\r\n\t\t$imageData = @getimagesize($filepath);\r\n\t\tif (!empty($imageData['mime'])) {\r\n\t\t\treturn $imageData['mime'];\r\n\t\t}\r\n\r\n\t\t// Reverting to guessing the mimetype from a known list\r\n\t\t // Thanks to MilesJ Uploader plugin : http://milesj.me/resources/logs/uploader-plugin\r\n\t\tstatic $mimeTypes = array(\r\n\t\t\t// Images\r\n\t\t\t'bmp'\t=> 'image/bmp',\r\n\t\t\t'gif'\t=> 'image/gif',\r\n\t\t\t'jpe'\t=> 'image/jpeg',\r\n\t\t\t'jpg'\t=> 'image/jpeg',\r\n\t\t\t'jpeg'\t=> 'image/jpeg',\r\n\t\t\t'pjpeg'\t=> 'image/pjpeg',\r\n\t\t\t'svg'\t=> 'image/svg+xml',\r\n\t\t\t'svgz'\t=> 'image/svg+xml',\r\n\t\t\t'tif'\t=> 'image/tiff',\r\n\t\t\t'tiff'\t=> 'image/tiff',\r\n\t\t\t'ico'\t=> 'image/vnd.microsoft.icon',\r\n\t\t\t'png'\t=> 'image/png',\r\n\t\t\t'xpng'\t=> 'image/x-png',\r\n\t\t\t// Text\r\n\t\t\t'txt' \t=> 'text/plain',\r\n\t\t\t'asc' \t=> 'text/plain',\r\n\t\t\t'css' \t=> 'text/css',\r\n\t\t\t'csv'\t=> 'text/csv',\r\n\t\t\t'htm' \t=> 'text/html',\r\n\t\t\t'html' \t=> 'text/html',\r\n\t\t\t'stm' \t=> 'text/html',\r\n\t\t\t'rtf' \t=> 'text/rtf',\r\n\t\t\t'rtx' \t=> 'text/richtext',\r\n\t\t\t'sgm' \t=> 'text/sgml',\r\n\t\t\t'sgml' \t=> 'text/sgml',\r\n\t\t\t'tsv' \t=> 'text/tab-separated-values',\r\n\t\t\t'tpl' \t=> 'text/template',\r\n\t\t\t'xml' \t=> 'text/xml',\r\n\t\t\t'js'\t=> 'text/javascript',\r\n\t\t\t'xhtml'\t=> 'application/xhtml+xml',\r\n\t\t\t'xht'\t=> 'application/xhtml+xml',\r\n\t\t\t'json'\t=> 'application/json',\r\n\t\t\t// Archive\r\n\t\t\t'gz'\t=> 'application/x-gzip',\r\n\t\t\t'gtar'\t=> 'application/x-gtar',\r\n\t\t\t'z'\t\t=> 'application/x-compress',\r\n\t\t\t'tgz'\t=> 'application/x-compressed',\r\n\t\t\t'zip'\t=> 'application/zip',\r\n\t\t\t'rar'\t=> 'application/x-rar-compressed',\r\n\t\t\t'rev'\t=> 'application/x-rar-compressed',\r\n\t\t\t'tar'\t=> 'application/x-tar',\r\n\t\t\t// Audio\r\n\t\t\t'aif' \t=> 'audio/x-aiff',\r\n\t\t\t'aifc' \t=> 'audio/x-aiff',\r\n\t\t\t'aiff' \t=> 'audio/x-aiff',\r\n\t\t\t'au' \t=> 'audio/basic',\r\n\t\t\t'kar' \t=> 'audio/midi',\r\n\t\t\t'mid' \t=> 'audio/midi',\r\n\t\t\t'midi' \t=> 'audio/midi',\r\n\t\t\t'mp2' \t=> 'audio/mpeg',\r\n\t\t\t'mp3' \t=> 'audio/mpeg',\r\n\t\t\t'mpga' \t=> 'audio/mpeg',\r\n\t\t\t'ra' \t=> 'audio/x-realaudio',\r\n\t\t\t'ram' \t=> 'audio/x-pn-realaudio',\r\n\t\t\t'rm' \t=> 'audio/x-pn-realaudio',\r\n\t\t\t'rpm' \t=> 'audio/x-pn-realaudio-plugin',\r\n\t\t\t'snd' \t=> 'audio/basic',\r\n\t\t\t'tsi' \t=> 'audio/TSP-audio',\r\n\t\t\t'wav' \t=> 'audio/x-wav',\r\n\t\t\t'wma'\t=> 'audio/x-ms-wma',\r\n\t\t\t// Video\r\n\t\t\t'flv' \t=> 'video/x-flv',\r\n\t\t\t'fli' \t=> 'video/x-fli',\r\n\t\t\t'avi' \t=> 'video/x-msvideo',\r\n\t\t\t'qt' \t=> 'video/quicktime',\r\n\t\t\t'mov' \t=> 'video/quicktime',\r\n\t\t\t'movie' => 'video/x-sgi-movie',\r\n\t\t\t'mp2' \t=> 'video/mpeg',\r\n\t\t\t'mpa' \t=> 'video/mpeg',\r\n\t\t\t'mpv2' \t=> 'video/mpeg',\r\n\t\t\t'mpe' \t=> 'video/mpeg',\r\n\t\t\t'mpeg' \t=> 'video/mpeg',\r\n\t\t\t'mpg' \t=> 'video/mpeg',\r\n\t\t\t'mp4'\t=> 'video/mp4',\r\n\t\t\t'viv' \t=> 'video/vnd.vivo',\r\n\t\t\t'vivo' \t=> 'video/vnd.vivo',\r\n\t\t\t'wmv'\t=> 'video/x-ms-wmv',\r\n\t\t\t// Applications\r\n\t\t\t'js'\t=> 'application/x-javascript',\r\n\t\t\t'xlc' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xll' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xlm' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xls' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xlw' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'doc'\t=> 'application/msword',\r\n\t\t\t'dot'\t=> 'application/msword',\r\n\t\t\t'pdf' \t=> 'application/pdf',\r\n\t\t\t'psd' \t=> 'image/vnd.adobe.photoshop',\r\n\t\t\t'ai' \t=> 'application/postscript',\r\n\t\t\t'eps' \t=> 'application/postscript',\r\n\t\t\t'ps' \t=> 'application/postscript'\r\n\t\t);\r\n\t\t$ext = $this->ext($filedata);\r\n\t\treturn array_key_exists($ext, $mimeTypes) ? $mimeTypes[$ext] : false;\r\n\t}", "protected function validateMimetype($mime) {\n if (preg_match('#^[-\\w]+/[-\\w\\.+]+$#', $mime)) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "private function get_mime_type($fn) {\r\n \r\n $mime_types = array(\r\n \r\n 'txt' => 'text/plain',\r\n 'htm' => 'text/html',\r\n 'html' => 'text/html',\r\n 'php' => 'text/html',\r\n 'css' => 'text/css',\r\n 'js' => 'application/javascript',\r\n 'json' => 'application/json',\r\n 'xml' => 'application/xml',\r\n 'swf' => 'application/x-shockwave-flash',\r\n 'flv' => 'video/x-flv',\r\n \r\n // images\r\n 'png' => 'image/png',\r\n 'jpe' => 'image/jpeg',\r\n 'jpeg' => 'image/jpeg',\r\n 'jpg' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'bmp' => 'image/bmp',\r\n 'ico' => 'image/vnd.microsoft.icon',\r\n 'tiff' => 'image/tiff',\r\n 'tif' => 'image/tiff',\r\n 'svg' => 'image/svg+xml',\r\n 'svgz' => 'image/svg+xml',\r\n \r\n // archives\r\n 'zip' => 'application/zip',\r\n 'rar' => 'application/x-rar-compressed',\r\n 'exe' => 'application/x-msdownload',\r\n 'msi' => 'application/x-msdownload',\r\n 'cab' => 'application/vnd.ms-cab-compressed',\r\n \r\n // audio/video\r\n 'mp3' => 'audio/mpeg',\r\n 'qt' => 'video/quicktime',\r\n 'mov' => 'video/quicktime',\r\n \r\n // adobe\r\n 'pdf' => 'application/pdf',\r\n 'psd' => 'image/vnd.adobe.photoshop',\r\n 'ai' => 'application/postscript',\r\n 'eps' => 'application/postscript',\r\n 'ps' => 'application/postscript',\r\n \r\n // ms office\r\n 'doc' => 'application/msword',\r\n 'rtf' => 'application/rtf',\r\n 'xls' => 'application/vnd.ms-excel',\r\n 'ppt' => 'application/vnd.ms-powerpoint',\r\n \r\n // open office\r\n 'odt' => 'application/vnd.oasis.opendocument.text',\r\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\r\n );\r\n \r\n $ext = strtolower(array_pop(explode('.',$fn)));\r\n if (array_key_exists($ext, $mime_types)) {\r\n return $mime_types[$ext];\r\n }\r\n elseif (function_exists('finfo_open')) {\r\n $finfo = finfo_open(FILEINFO_MIME);\r\n $mimetype = finfo_file($finfo, $fn);\r\n finfo_close($finfo);\r\n return $mimetype;\r\n }\r\n else {\r\n return 'application/octet-stream';\r\n }\r\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('file', 'required'),\n\t\t\tarray('file','file','types'=>'jpg png'),\n\t\t);\n\t}", "function isKnownMimeType($filename, $filetype)\n\t{\n\t $filetype = MimeTypeHandler::filename2ObjType($format, $filename);\n\t if ($format == '') {\n\t return false;\n\t }\n\t else {\n\t return $format;\n\t }\n\t}", "function checkFilePhoto(string $name)\n{\n if (!($_FILES[$name]['type'] == 'image/png') && !($_FILES[$name]['type'] == 'image/jpeg') && !($_FILES[$name]['type'] == 'image/gif')) {\n return 'Некорректный формат фото';\n }\n}", "function get_file_type($file_mimetype)\n{\n // Get mimetype from file\n $mimetype = explode('/', $file_mimetype);\n\n switch ($mimetype[0]) {\n case 'image':\n return 'image';\n break;\n case 'video':\n return 'video';\n break;\n case 'audio':\n return 'audio';\n break;\n default:\n return 'file';\n }\n}", "public function isFile(): bool;", "protected function checkType($file) {\n if (in_array($file['type'], $this->_permitted)) {\n return true;\n } else {\n if (!empty($file['type'])) {\n $this->_messages[] = '4' . $file['name'] . ' is not a permitted file type.';\n }\n return false;\n }\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 Photo_Uploaded_Mime_Type()\n{\n // On assume ici que la photo est valide\n\n $imageFileType = pathinfo(basename($_FILES['un_fichier']['name']), PATHINFO_EXTENSION);\n switch ($imageFileType) {\n case 'jpg':\n case 'JPG':\n return 'image/jpeg';\n\n case 'gif':\n case 'GIF':\n return 'image/gif';\n\n case 'png':\n case 'PNG':\n return 'image/png';\n }\n\n return 'ERROR';\n}", "function fn_get_file_type($filename, $not_available_result = 'application/octet-stream')\n{\n $file_type = $not_available_result;\n\n $types = fn_get_ext_mime_types('ext');\n\n $ext = fn_strtolower(fn_get_file_ext($filename));\n\n if (!empty($types[$ext])) {\n $file_type = $types[$ext];\n }\n\n return $file_type;\n}", "public function testAddMimeType()\n {\n $validator = new File\\MimeType('image/gif');\n $validator->addMimeType('text');\n $this->assertEquals('image/gif,text', $validator->getMimeType());\n $this->assertEquals(['image/gif', 'text'], $validator->getMimeType(true));\n\n $validator->addMimeType('jpg, to');\n $this->assertEquals('image/gif,text,jpg,to', $validator->getMimeType());\n $this->assertEquals(['image/gif', 'text', 'jpg', 'to'], $validator->getMimeType(true));\n\n $validator->addMimeType(['zip', 'ti']);\n $this->assertEquals('image/gif,text,jpg,to,zip,ti', $validator->getMimeType());\n $this->assertEquals(['image/gif', 'text', 'jpg', 'to', 'zip', 'ti'], $validator->getMimeType(true));\n\n $validator->addMimeType('');\n $this->assertEquals('image/gif,text,jpg,to,zip,ti', $validator->getMimeType());\n $this->assertEquals(['image/gif', 'text', 'jpg', 'to', 'zip', 'ti'], $validator->getMimeType(true));\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}", "function validateFileExtension(&$model, $fieldData, $fieldName, $allowedExts = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $extension = strtolower(pathinfo($fieldData[$fieldName]['name'], PATHINFO_EXTENSION));\n \n if (!is_array($allowedExts) || (!in_array('*', $allowedExts) && !in_array($extension, $allowedExts))) return false;\n \n return true;\n }", "function _file_get_type($file) {\n $ext = file_ext($file);\n if (preg_match(\"/$ext/i\", get_setting(\"image_ext\")))\n return IMAGE;\n if (preg_match(\"/$ext/i\", get_setting(\"audio_ext\")))\n return AUDIO;\n if (preg_match(\"/$ext/i\", get_setting(\"video_ext\")))\n return VIDEO;\n if (preg_match(\"/$ext/i\", get_setting(\"document_ext\")))\n return DOCUMENT;\n if (preg_match(\"/$ext/i\", get_setting(\"archive_ext\")))\n return ARCHIVE;\n }", "function isValidDocument($docFormat, $document){\n $name = $document['name'];\n $ext = explode('.', $name);\n $ext = '.' . $ext[1];\n\n if($ext == $docFormat){\n if($document['error'] === 0){\n return true;\n }\n else{\n echo \"error uploading document\";\n return false;\n }\n }\n else{\n echo \"doc type does not match documents true extension\";\n }\n }", "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 typeoffile($file){ //list( $mutes, $date, $type, $ext) = explode( '.', $file );\n $type= explode( '.', $file )[2];\n return $type;\n}", "public function isAllowedType()\n {\n $extension = $this->getFile()->guessExtension();\n if (in_array($extension, $this->allowedTypes)) {\n return true;\n } else {\n return false;\n }\n }", "function _mime_content_type($filename) {\n if (!file_exists($filename) || !is_readable($filename)) return false;\n if(class_exists('finfo')){\n $result = new finfo();\n if (is_resource($result) === true) {\n return $result->file($filename, FILEINFO_MIME_TYPE);\n }\n }\n \n // Trying finfo\n if (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimeType = finfo_file($finfo, $filename);\n finfo_close($finfo);\n // Mimetype can come in text/plain; charset=us-ascii form\n if (strpos($mimeType, ';')) list($mimeType,) = explode(';', $mimeType);\n return $mimeType;\n }\n \n // Trying mime_content_type\n if (function_exists('mime_content_type')) {\n return mime_content_type($filename);\n }\n \n\n // Trying to get mimetype from images\n $imageData = getimagesize($filename);\n if (!empty($imageData['mime'])) {\n return $imageData['mime'];\n }\n // Trying exec\n if (function_exists('exec')) {\n $mimeType = exec(\"/usr/bin/file -i -b $filename\");\n if(strpos($mimeType,';')){\n $mimeTypes = explode(';',$mimeType);\n return $mimeTypes[0];\n }\n if (!empty($mimeType)) return $mimeType;\n }\n return false;\n }", "public function type() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$type = null;\n\n\t\t\t// We can't use the file command on windows\n\t\t\tif (!defined('PHP_WINDOWS_VERSION_MAJOR')) {\n\t\t\t\t$type = shell_exec(sprintf(\"file -b --mime %s\", escapeshellarg($file->path())));\n\n\t\t\t\tif ($type && strpos($type, ';') !== false) {\n\t\t\t\t\t$type = strstr($type, ';', true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fallback because of fileinfo bug: https://bugs.php.net/bug.php?id=53035\n\t\t\tif (!$type) {\n\t\t\t\t$info = finfo_open(FILEINFO_MIME_TYPE);\n\t\t\t\t$type = finfo_file($info, $file->path());\n\t\t\t\tfinfo_close($info);\n\t\t\t}\n\n\t\t\t// Check the mimetype against the extension or $_FILES type\n\t\t\t// If they are different, use the upload type since fileinfo returns invalid mimetypes\n\t\t\t// This could be problematic in the future, but unknown better alternative\n\t\t\t$extType = $file->data('type') ?: MimeType::getTypeFromExt($file->ext());\n\n\t\t\tif ($type !== $extType) {\n\t\t\t\t$type = $extType;\n\t\t\t}\n\n\t\t\treturn $type;\n\t\t});\n\t}", "public function checkMineType(array $file_data) {\n if (null != $this->_filterType) { //defined filter by Type\n $ext = explode(',', $this->_filterType);\n $mime = array();\n $mime = array();\n for ($i = 0; $i < sizeof($ext); ++$i) {\n $ext[$i] = strtolower(ltrim(trim($ext[$i]), '.'));\n $mime[$ext[$i]] = $this->_allowedMimeType[$ext[$i]];\n }\n } else {\n $mime = $this->_allowedMimeType;\n }\n $ext = $this->getExtension($file_data['name'], false);\n $expectMimeType = $this->getMimeTypeByExtension($ext, $mime);\n\n $fileMimeType = $this->_getUploadedFileMimeType($file_data);\n\n if (is_array($expectMimeType)) {\n if (!in_array($fileMimeType, $expectMimeType)) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n } elseif (is_string($expectMimeType)) {\n if ($expectMimeType != $fileMimeType) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n } elseif (false == $expectMimeType) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n\n return true;\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 }", "private function getFileTypes()\r\n {\r\n $filename = __DIR__ . '/mime-types.php';\r\n if (!is_readable($filename)) {\r\n throw new \\DomainException('Mime types file (`' . $filename . '`) does not exist or is not readable.');\r\n }\r\n\r\n return $filename;\r\n }", "private function validate($value,$type) {\n\t\tswitch($type) {\n\t\t\tcase \"varchar\":\n\t\t\t\treturn self::is_alphanum($value);\n\t\t\t\tbreak;\n\t\t\tcase \"int\":\n\t\t\t\treturn self::is_num($value);\n\t\t\t\tbreak;\n\t\t\tcase \"binary\":\n\t\t\t\treturn self::is_binary($value);\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tcase \"signed\":\n\t\t\t\treturn self::is_signed($value);\n\t\t\t\tbreak;\n\t\t\tcase \"file\":\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function testSetMimeType()\n {\n $validator = new File\\MimeType('image/gif');\n $validator->setMimeType('image/jpeg');\n $this->assertEquals('image/jpeg', $validator->getMimeType());\n $this->assertEquals(['image/jpeg'], $validator->getMimeType(true));\n\n $validator->setMimeType('image/gif, text/test');\n $this->assertEquals('image/gif,text/test', $validator->getMimeType());\n $this->assertEquals(['image/gif', 'text/test'], $validator->getMimeType(true));\n\n $validator->setMimeType(['video/mpeg', 'gif']);\n $this->assertEquals('video/mpeg,gif', $validator->getMimeType());\n $this->assertEquals(['video/mpeg', 'gif'], $validator->getMimeType(true));\n }", "function get_file_format($file) {\n if(function_exists('finfo_open')) {\n $file_info = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($file_info, $file);\n finfo_close($file_info);\n if($mime_type) {\n return $mime_type;\n }\n }\n\n if(function_exists('mime_content_type')) {\n if($mime_type = @mime_content_type($file)) {\n return $mime_type;\n }\n }\n\n if($extension = get_file_extension($file)) {\n switch($extension) {\n case 'js' :\n return 'application/x-javascript';\n case 'json' :\n return 'application/json';\n case 'jpg' :\n case 'jpeg' :\n case 'jpe' :\n return 'image/jpg';\n case 'png' :\n case 'gif' :\n case 'bmp' :\n case 'tiff' :\n return 'image/'.$extension;\n case 'css' :\n return 'text/css';\n case 'xml' :\n return 'application/xml';\n case 'doc' :\n case 'docx' :\n return 'application/msword';\n case 'xls' :\n case 'xlt' :\n case 'xlm' :\n case 'xld' :\n case 'xla' :\n case 'xlc' :\n case 'xlw' :\n case 'xll' :\n return 'application/vnd.ms-excel';\n case 'ppt' :\n case 'pps' :\n return 'application/vnd.ms-powerpoint';\n case 'rtf' :\n return 'application/rtf';\n case 'pdf' :\n return 'application/pdf';\n case 'html' :\n case 'htm' :\n case 'php' :\n return 'text/html';\n case 'txt' :\n return 'text/plain';\n case 'mpeg' :\n case 'mpg' :\n case 'mpe' :\n return 'video/mpeg';\n case 'mp3' :\n return 'audio/mpeg3';\n case 'wav' :\n return 'audio/wav';\n case 'aiff' :\n case 'aif' :\n return 'audio/aiff';\n case 'avi' :\n return 'video/msvideo';\n case 'wmv' :\n return 'video/x-ms-wmv';\n case 'mov' :\n return 'video/quicktime';\n case 'zip' :\n return 'application/zip';\n case 'tar' :\n return 'application/x-tar';\n case 'swf' :\n return 'application/x-shockwave-flash';\n default:\n return 'unknown/'.trim($extension,'.');\n }\n }\n return false;\n}", "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}", "function hook_file_type_alter(&$types, $file) {\n // Choose a specific, non-first, file type.\n $types = array($types[4]);\n}" ]
[ "0.81652874", "0.782444", "0.77502763", "0.7667408", "0.7528905", "0.7508876", "0.74393773", "0.71285474", "0.7068329", "0.70600194", "0.70563906", "0.70517707", "0.70246696", "0.7012814", "0.6931212", "0.69166875", "0.6908667", "0.68369347", "0.6835543", "0.6815674", "0.68090796", "0.6802259", "0.67994076", "0.67234373", "0.6719211", "0.6702903", "0.6694496", "0.6685685", "0.66714233", "0.6651245", "0.6646456", "0.6619311", "0.6618804", "0.66103816", "0.66057914", "0.65957624", "0.6586364", "0.6586017", "0.65849215", "0.6578416", "0.65720814", "0.6568567", "0.65616614", "0.6555139", "0.6538643", "0.6538055", "0.6536742", "0.6524067", "0.6512483", "0.65117407", "0.6511161", "0.65015936", "0.6499443", "0.64976764", "0.6495642", "0.64816386", "0.6466428", "0.6450933", "0.6447842", "0.6444662", "0.6429882", "0.64066726", "0.6397167", "0.63902366", "0.63780546", "0.6376555", "0.635836", "0.6356861", "0.6347923", "0.63429284", "0.6335838", "0.6329228", "0.6324353", "0.63243383", "0.6323092", "0.6321468", "0.6311022", "0.6293576", "0.6291845", "0.62838084", "0.6283402", "0.628072", "0.6264811", "0.6257372", "0.6249002", "0.6238043", "0.6235796", "0.6228545", "0.62281615", "0.6204104", "0.6201656", "0.61850834", "0.61789995", "0.6170536", "0.61664116", "0.6152775", "0.615232", "0.6143599", "0.61434805", "0.61405015" ]
0.6532533
47
Function is used to manage available file type that are valid
function availableFileTypes($ext) { //checking file type extension switch ($ext) { //checking txt extention case "txt": $type[0] = "text/plain"; break; //checking xml extention case "xml": $type[0] = "text/xml"; $type[1] = "application/xml"; break; //checking csv extention case "csv": $type[0] = "text/x-comma-separated-values"; $type[1] = "application/octet-stream"; $type[2] = "text/plain"; break; //checking zip extention case "zip": $type[0] = "application/zip"; break; //checking tar extention case "tar": $type[0] = "application/x-gzip"; break; //checking ctar extention case "ctar": $type[0] = "application/x-compressed-tar"; break; //checking pdf extention case "pdf": $type[0] = "application/pdf"; break; //checking doc extention case "doc": $type[0] = "application/msword"; $type[1] = "application/octet-stream"; break; //checking xls extention case "xls": $type[0] = "application/vnd.ms-excel"; $type[1] = "application/vnd.oasis.opendocument.spreadsheet"; break; //checking ppt extention case "ppt": $type[0] = "application/vnd.ms-powerpoint"; break; //checking jpg extention case "jpg": $type[0] = "image/jpg"; $type[1] = "image/jpeg"; $type[2] = "image/pjpeg"; break; //checking gif extention case "gif": $type[0] = "image/gif"; break; //checking png extention case "png": $type[0] = "image/png"; break; //checking bmp extention case "bmp": $type[0] = "image/bmp"; break; //checking icon extention case "icon": $type[0] = "image/x-ico"; break; //checking tfontt extention case "font": $type[0] = "application/x-font-ttf"; break; } return $type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "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}", "private function checkMimeType()\n {\n $allowedTypes = $this->getSetting('allowed_upload_types', true);\n if (is_string($allowedTypes) && strlen($allowedTypes)) {\n $allowedTypes = str_replace(' ', '', $allowedTypes);\n $allowedTypes = explode(',', $allowedTypes);\n }\n if (is_array($allowedTypes)) {\n if (!in_array($this->file->getMimeType(), $allowedTypes)) {\n throw new FileException('File type is not allowed');\n }\n }\n }", "function check_mime_type($source)\n{\n $mime_types = array(\n // images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n // adobe\n 'pdf' => 'application/pdf',\n // ms office\n 'doc' => 'application/msword',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'ppt' => 'application/vnd.ms-powerpoint',\n // open office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n $arrext = explode('.', $source['name']);\n $jml = count($arrext) - 1;\n $ext = $arrext[$jml];\n $ext = strtolower($ext);\n //$ext = strtolower(array_pop(explode(\".\", $source['name'])));\n if (array_key_exists($ext, $mime_types)) {\n return $mime_types[$ext];\n } elseif (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimetype = finfo_file($finfo, $source['tmp_name']);\n finfo_close($finfo);\n return $mimetype;\n } else {\n return false;\n }\n}", "function testFileTypes()\r\n {\r\n $nautilus = $this->nautilus->uploadDir('/tmp');\r\n $image = array('name' => $this->testingImage,\r\n 'type' => 'image/jpeg',\r\n 'size' => 542,\r\n 'tmp_name' => $this->testingImage,\r\n 'error' => 0\r\n );\r\n\r\n /* should not accept gif*/\r\n $nautilus->fileTypes(array('gif'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( gif ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n\r\n /* should not accept png*/\r\n $nautilus->fileTypes(array('png'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( png ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n /* shouldn't accept this file */\r\n $nautilus->fileTypes(array('exe'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( exe ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n /* example file is actually jpeg, not jpg */\r\n $nautilus->fileTypes(array('png', 'jpeg'));\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n $this->assertEquals('uploads/nautilus_test_image.jpeg',$upload);\r\n }", "public function mimeTypeValid()\n\t{\n\t\tif (!in_array($this->files['type'], $this->mime_types)) {\n\t\t\tthrow new Exception(\"Invalid file Extension\",6);\n\t\t}\n\t}", "function hook_file_type_alter(&$types, $file) {\n // Choose a specific, non-first, file type.\n $types = array($types[4]);\n}", "private function checkSupportedFile($file_type) {\n return true;\n\n\n }", "function getFileTypeRestrictions() ;", "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}", "function wp_check_filetype($filename, $mimes = null) {\n\t$mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array(\n\t\t'jpg|jpeg|jpe' => 'image/jpeg',\n\t\t'gif' => 'image/gif',\n\t\t'png' => 'image/png',\n\t\t'bmp' => 'image/bmp',\n\t\t'tif|tiff' => 'image/tiff',\n\t\t'ico' => 'image/x-icon',\n\t\t'asf|asx|wax|wmv|wmx' => 'video/asf',\n\t\t'avi' => 'video/avi',\n\t\t'mov|qt' => 'video/quicktime',\n\t\t'mpeg|mpg|mpe' => 'video/mpeg',\n\t\t'txt|c|cc|h' => 'text/plain',\n\t\t'rtx' => 'text/richtext',\n\t\t'css' => 'text/css',\n\t\t'htm|html' => 'text/html',\n\t\t'php|php3|' => 'application/php',\n\t\t'mp3|mp4' => 'audio/mpeg',\n\t\t'ra|ram' => 'audio/x-realaudio',\n\t\t'wav' => 'audio/wav',\n\t\t'ogg' => 'audio/ogg',\n\t\t'mid|midi' => 'audio/midi',\n\t\t'wma' => 'audio/wma',\n\t\t'rtf' => 'application/rtf',\n\t\t'js' => 'application/javascript',\n\t\t'pdf' => 'application/pdf',\n\t\t'doc' => 'application/msword',\n\t\t'pot|pps|ppt' => 'application/vnd.ms-powerpoint',\n\t\t'wri' => 'application/vnd.ms-write',\n\t\t'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',\n\t\t'mdb' => 'application/vnd.ms-access',\n\t\t'mpp' => 'application/vnd.ms-project',\n\t\t'swf' => 'application/x-shockwave-flash',\n\t\t'class' => 'application/java',\n\t\t'tar' => 'application/x-tar',\n\t\t'zip' => 'application/zip',\n\t\t'gz|gzip' => 'application/x-gzip',\n\t\t'exe' => 'application/x-msdownload',\n\t\t// openoffice formats\n\t\t'odt' => 'application/vnd.oasis.opendocument.text',\n\t\t'odp' => 'application/vnd.oasis.opendocument.presentation',\n\t\t'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n\t\t'odg' => 'application/vnd.oasis.opendocument.graphics',\n\t\t'odc' => 'application/vnd.oasis.opendocument.chart',\n\t\t'odb' => 'application/vnd.oasis.opendocument.database',\n\t\t'odf' => 'application/vnd.oasis.opendocument.formula',\n\n\t));\n\n\t$type = false;\n\t$ext = false;\n\n\tforeach ($mimes as $ext_preg => $mime_match) {\n\t\t$ext_preg = '!\\.(' . $ext_preg . ')$!i';\n\t\tif (preg_match($ext_preg, $filename, $ext_matches)) {\n\t\t\t$type = $mime_match;\n\t\t\t$ext = $ext_matches[1];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn compact('ext', 'type');\n}", "function __checkType($type = null) {\n\t\t$valid = false;\n \tforeach($this->allowedTypes as $allowedType) {\n \t\tif(strtolower($type) == strtolower($allowedType)){\n \t\t$valid = true;\n \t\t}\n \t}\n\t\tif(!$valid) {\n\t\t\t$this->Session->setFlash('You tried to upload an invalid type! Please upload your pictures in jpeg, gif, or png format!');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t}", "function testFileTypes()\n {\n $bulletproof = $this->bulletproof->uploadDir('/tmp');\n $image = array('name' => $this->testingImage,\n 'type' => 'image/jpeg',\n 'size' => 542,\n 'tmp_name' => $this->testingImage,\n 'error' => 0\n );\n\n /* should not accept gif*/\n $bulletproof->fileTypes(array('gif'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( gif ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n\n /* should not accept png*/\n $bulletproof->fileTypes(array('png'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( png ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n /* shouldn't accept this file */\n $bulletproof->fileTypes(array('exe'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( exe ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n /* example file is actually jpeg, not jpg */\n $bulletproof->fileTypes(array('png', 'jpeg'));\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n $this->assertEquals('uploads/bulletproof_test_image.jpeg',$upload);\n }", "public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }", "function _file_get_type($file) {\n $ext = file_ext($file);\n if (preg_match(\"/$ext/i\", get_setting(\"image_ext\")))\n return IMAGE;\n if (preg_match(\"/$ext/i\", get_setting(\"audio_ext\")))\n return AUDIO;\n if (preg_match(\"/$ext/i\", get_setting(\"video_ext\")))\n return VIDEO;\n if (preg_match(\"/$ext/i\", get_setting(\"document_ext\")))\n return DOCUMENT;\n if (preg_match(\"/$ext/i\", get_setting(\"archive_ext\")))\n return ARCHIVE;\n }", "function check_upload($file) {\n if (preg_match(\":^application/vnd.bdoc-:\", $file[\"type\"])) {\n $file[\"format\"] = \"bdoc\";\n } else if ($file[\"type\"] === \"application/x-ddoc\") {\n $file[\"format\"] = \"ddoc\";\n } else {\n return FALSE;\n }\n\n return is_uploaded_file($file[\"tmp_name\"]);\n}", "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 }", "function checkFileType($imageFileType)\n{\n\n if ($imageFileType == \"c\"||$imageFileType==\"C\"){\n echo \"C file detected!\";\n return 1;\n }\n if ($imageFileType ==\"py\"||$imageFileType==\"PY\"){\n echo \"Python file detected!\";\n return 2;\n\n }\n else{\n echo \"File is not allowed\";\n return 0;\n\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 provider_mime_type() {\n\t\treturn array(\n\t\t\tarray( 'not-found.txt', false ),\n\t\t\tarray( 'empty.txt', version_compare( PHP_VERSION, '7.4', '>=' ) ? 'application/x-empty' : 'inode/x-empty' ),\n\t\t\tarray( 'file.aac', 'audio/aac' ),\n\t\t\tarray( 'file.css', 'text/css' ),\n\t\t\tarray( 'file.csv', 'text/plain' ),\n\t\t\tarray( 'file.flac', 'audio/flac' ),\n\t\t\tarray( 'file.gif', 'image/gif' ),\n\t\t\tarray( 'file.htm', 'text/html' ),\n\t\t\tarray( 'file.html', 'text/html' ),\n\t\t\tarray( 'file.jpe', 'image/jpeg' ),\n\t\t\tarray( 'file.jpeg', 'image/jpeg' ),\n\t\t\tarray( 'file.jpg', 'image/jpeg' ),\n\t\t\tarray( 'file.js', 'application/javascript' ),\n\t\t\tarray( 'file.m4a', 'audio/m4a' ),\n\t\t\tarray( 'file.mp3', 'audio/mpeg' ),\n\t\t\tarray( 'file.png', 'image/png' ),\n\t\t\tarray( 'file.svg', 'image/svg+xml' ),\n\t\t\tarray( 'file.txt', 'text/plain' ),\n\t\t\tarray( 'file.wav', 'audio/wav' ),\n\t\t\tarray( 'file.xml', 'application/xml' ),\n\t\t\tarray( 'no-extension-text', 'text/plain' ),\n\t\t\tarray( 'no-extension-media', 'application/octet-stream' ),\n\t\t\tarray( 'upper-case.JPG', 'image/jpeg' ),\n\t\t);\n\t}", "private function get_mime_type($fn) {\r\n \r\n $mime_types = array(\r\n \r\n 'txt' => 'text/plain',\r\n 'htm' => 'text/html',\r\n 'html' => 'text/html',\r\n 'php' => 'text/html',\r\n 'css' => 'text/css',\r\n 'js' => 'application/javascript',\r\n 'json' => 'application/json',\r\n 'xml' => 'application/xml',\r\n 'swf' => 'application/x-shockwave-flash',\r\n 'flv' => 'video/x-flv',\r\n \r\n // images\r\n 'png' => 'image/png',\r\n 'jpe' => 'image/jpeg',\r\n 'jpeg' => 'image/jpeg',\r\n 'jpg' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'bmp' => 'image/bmp',\r\n 'ico' => 'image/vnd.microsoft.icon',\r\n 'tiff' => 'image/tiff',\r\n 'tif' => 'image/tiff',\r\n 'svg' => 'image/svg+xml',\r\n 'svgz' => 'image/svg+xml',\r\n \r\n // archives\r\n 'zip' => 'application/zip',\r\n 'rar' => 'application/x-rar-compressed',\r\n 'exe' => 'application/x-msdownload',\r\n 'msi' => 'application/x-msdownload',\r\n 'cab' => 'application/vnd.ms-cab-compressed',\r\n \r\n // audio/video\r\n 'mp3' => 'audio/mpeg',\r\n 'qt' => 'video/quicktime',\r\n 'mov' => 'video/quicktime',\r\n \r\n // adobe\r\n 'pdf' => 'application/pdf',\r\n 'psd' => 'image/vnd.adobe.photoshop',\r\n 'ai' => 'application/postscript',\r\n 'eps' => 'application/postscript',\r\n 'ps' => 'application/postscript',\r\n \r\n // ms office\r\n 'doc' => 'application/msword',\r\n 'rtf' => 'application/rtf',\r\n 'xls' => 'application/vnd.ms-excel',\r\n 'ppt' => 'application/vnd.ms-powerpoint',\r\n \r\n // open office\r\n 'odt' => 'application/vnd.oasis.opendocument.text',\r\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\r\n );\r\n \r\n $ext = strtolower(array_pop(explode('.',$fn)));\r\n if (array_key_exists($ext, $mime_types)) {\r\n return $mime_types[$ext];\r\n }\r\n elseif (function_exists('finfo_open')) {\r\n $finfo = finfo_open(FILEINFO_MIME);\r\n $mimetype = finfo_file($finfo, $fn);\r\n finfo_close($finfo);\r\n return $mimetype;\r\n }\r\n else {\r\n return 'application/octet-stream';\r\n }\r\n }", "function fileTypes($extension){\r\n $fileTypes['pdf'] = 'application/pdf';\r\n \r\n $fileTypes['zip'] = 'application/zip';\r\n $fileTypes['doc'] = 'application/msword';\r\n $fileTypes['rar'] = 'application/rar';\r\n\r\n \r\n return $fileTypes[$extention];\r\n }", "public function test_listUnsupportedFileTypes() {\n\n }", "function checkFileType( $file_types, $currentFileType )\n{\n $aFiles = explode( ',', $file_types ) ; # create aFiles file type array:\n for ( $x=0; $x<count($aFiles); $x++ )\n {\n if ( $aFiles[$x] == $currentFileType ) { return TRUE ; }\n }\n return FALSE ; # no match found, return false!\n}", "public function getFileTypeRestrictions() {}", "public function wrongTypeFile()\n {\n return 'This type of file is not allowed';\n }", "function typeoffile($file){ //list( $mutes, $date, $type, $ext) = explode( '.', $file );\n $type= explode( '.', $file )[2];\n return $type;\n}", "function get_file_format($file) {\n if(function_exists('finfo_open')) {\n $file_info = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($file_info, $file);\n finfo_close($file_info);\n if($mime_type) {\n return $mime_type;\n }\n }\n\n if(function_exists('mime_content_type')) {\n if($mime_type = @mime_content_type($file)) {\n return $mime_type;\n }\n }\n\n if($extension = get_file_extension($file)) {\n switch($extension) {\n case 'js' :\n return 'application/x-javascript';\n case 'json' :\n return 'application/json';\n case 'jpg' :\n case 'jpeg' :\n case 'jpe' :\n return 'image/jpg';\n case 'png' :\n case 'gif' :\n case 'bmp' :\n case 'tiff' :\n return 'image/'.$extension;\n case 'css' :\n return 'text/css';\n case 'xml' :\n return 'application/xml';\n case 'doc' :\n case 'docx' :\n return 'application/msword';\n case 'xls' :\n case 'xlt' :\n case 'xlm' :\n case 'xld' :\n case 'xla' :\n case 'xlc' :\n case 'xlw' :\n case 'xll' :\n return 'application/vnd.ms-excel';\n case 'ppt' :\n case 'pps' :\n return 'application/vnd.ms-powerpoint';\n case 'rtf' :\n return 'application/rtf';\n case 'pdf' :\n return 'application/pdf';\n case 'html' :\n case 'htm' :\n case 'php' :\n return 'text/html';\n case 'txt' :\n return 'text/plain';\n case 'mpeg' :\n case 'mpg' :\n case 'mpe' :\n return 'video/mpeg';\n case 'mp3' :\n return 'audio/mpeg3';\n case 'wav' :\n return 'audio/wav';\n case 'aiff' :\n case 'aif' :\n return 'audio/aiff';\n case 'avi' :\n return 'video/msvideo';\n case 'wmv' :\n return 'video/x-ms-wmv';\n case 'mov' :\n return 'video/quicktime';\n case 'zip' :\n return 'application/zip';\n case 'tar' :\n return 'application/x-tar';\n case 'swf' :\n return 'application/x-shockwave-flash';\n default:\n return 'unknown/'.trim($extension,'.');\n }\n }\n return false;\n}", "function hook_file_type($file) {\n // Assign all files uploaded by anonymous users to a special file type.\n if (user_is_anonymous()) {\n return array('untrusted_files');\n }\n}", "function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}", "public function supported_filetypes() {\n return '*';\n }", "function validateFileMime(&$model, $fieldData, $fieldName, $allowedMimes = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $availableMimes = assetMimes();\n \n foreach (!empty($allowedMimes) ? $allowedMimes : array() as $type) {\n if ($type == '*') return true;\n \n # check fileinfo first\n $fileinfo = assetMimeType($fieldData[$fieldName]['tmp_name']);\n if ((!$fileinfo) && (in_array($fileinfo, $availableMimes[$type]))) return true; \n \n # check browser provided mime-type second\n if (in_array($fieldData[$fieldName]['type'], $availableMimes[$type])) return true;\n }\n \n return false;\n }", "private function getAllowedFileTypes()\n {\n return str_replace('.', '', config('media.allowed', ''));\n }", "function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}", "public function getSupportedFileTypes(){\n\t\t$_url = $this->constants['SERVICE_ENTRY_POINT'].$this->constants['SERVICE_VERSION'].'/'.$this->constants['MISC_PATH'].'/supported-file-types';\n\t\t$response = $this->getRequests($_url)['response'];\n\t\treturn $response;\n\t}", "function sanitize_mime_type($mime_type)\n {\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}", "function isFileType($files) {\n $allowedExts = array(\"jpg\", \"jpeg\", \"gif\", \"png\", \"doc\", \"docx\", \"txt\", \"rtf\", \"pdf\", \"xls\", \"xlsx\", \"ppt\", \"pptx\");\n $temp = explode(\".\", $files);\n $extension = end($temp);\n if (in_array($extension, $allowedExts))\n return true;\n else\n return false;\n}", "function changer_formats($type)\n{\n $format = \"\";\n \n switch ($type)\n {\n case 'image/png':\n $format = '.png';\n break;\n case 'image/jpeg':\n $format = '.jpg';\n break;\n case 'image/gif':\n $format = '.gif';\n break;\n case 'image/bmp':\n $format = '.bmp';\n break;\n case 'image/vnd.microsoft.icon':\n $format = '.ico';\n break;\n case 'image/tiff':\n $format = '.tif';\n break;\n case 'image/svg+xml':\n $format = '.svg';\n break;\n }\n \n return $format;\n}", "function validateFileType($postVar, $value, $error) {\n $errorMsg = \"\";\n //checking if the $value variable is isset or not\n if (isset($value)) {\n $found = strpos($value, ',');\n if ($found === false) {\n $options[0] = $value;\n } else {\n $options = explode(\",\", $value);\n }\n }\n\n //checking if the $postVar['name'] value in an array or not\n if (is_array($postVar['name'])) {\n $totalFiles = count($postVar['name']);\n\n for ($i = 0; $i < $totalFiles; $i++) {\n if ($postVar['name'][$i]) {\n $fileTypeMatch = 0;\n foreach ($options as $id => $type) {\n $typeArray = $this->availableFileTypes($type);\n if (in_array($postVar['type'][$i], $typeArray)) {\n $fileTypeMatch = 1;\n }\n if ($fileTypeMatch)\n break;\n }\n\n if (!$fileTypeMatch) {\n $errorMsg .= $error . \" (\" . $postVar['name'][$i] . \")<br>\";\n }\n }\n }\n //if not array then go here\n } else {\n if ($postVar['name']) {\n $fileTypeMatch = 0;\n foreach ($options as $id => $type) {\n $typeArray = $this->availableFileTypes($type);\n if (in_array($postVar['type'], $typeArray)) {\n $fileTypeMatch = 1;\n }\n if ($fileTypeMatch)\n break;\n }\n\n if (!$fileTypeMatch) {\n $errorMsg .= $error . \" (\" . $postVar['name'] . \")<br>\";\n }\n }\n }\n\n return $errorMsg;\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 extensionValid() \n\t{\n\t\tif (!in_array($this->extension_of_file, $this->file_types)) //{\n\t\t\tthrow new Exception(\"Invalid file Extension\",5);\n\t\t//}\n\t}", "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 file_tester($file){\n if (htmlentities($file['filename']['type']) == 'text/plain')\n return true;\n else {\n echo \"Please submit correct file type (.txt)\";\n return false;\n }\n}", "function Photo_Uploaded_Mime_Type()\n{\n // On assume ici que la photo est valide\n\n $imageFileType = pathinfo(basename($_FILES['un_fichier']['name']), PATHINFO_EXTENSION);\n switch ($imageFileType) {\n case 'jpg':\n case 'JPG':\n return 'image/jpeg';\n\n case 'gif':\n case 'GIF':\n return 'image/gif';\n\n case 'png':\n case 'PNG':\n return 'image/png';\n }\n\n return 'ERROR';\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}", "function fn_get_file_type($filename, $not_available_result = 'application/octet-stream')\n{\n $file_type = $not_available_result;\n\n $types = fn_get_ext_mime_types('ext');\n\n $ext = fn_strtolower(fn_get_file_ext($filename));\n\n if (!empty($types[$ext])) {\n $file_type = $types[$ext];\n }\n\n return $file_type;\n}", "static function get_mime_type($file) {\n $mime_types = array(\n \"pdf\" => \"application/pdf\"\n , \"exe\" => \"application/octet-stream\"\n , \"zip\" => \"application/zip\"\n // ,\"docx\"=>\"application/msword\"\n , \"docx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n , \"doc\" => \"application/msword\"\n , \"rtf\" => \"text/rtf\"\n , \"txt\" => \"text/plain\"\n , \"xls\" => \"application/vnd.ms-excel\"\n , \"ppt\" => \"application/vnd.ms-powerpoint\"\n , \"pptx\" => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n , \"gif\" => \"image/gif\"\n , \"png\" => \"image/png\"\n , \"jpeg\" => \"image/jpg\"\n , \"jpg\" => \"image/jpg\"\n , \"mp3\" => \"audio/mpeg\"\n , \"wav\" => \"audio/x-wav\"\n , \"mpeg\" => \"video/mpeg\"\n , \"mpg\" => \"video/mpeg\"\n , \"mpe\" => \"video/mpeg\"\n , \"mov\" => \"video/quicktime\"\n , \"avi\" => \"video/x-msvideo\"\n , \"3gp\" => \"video/3gpp\"\n , \"css\" => \"text/css\"\n , \"jsc\" => \"application/javascript\"\n , \"js\" => \"application/javascript\"\n , \"php\" => \"text/html\"\n , \"htm\" => \"text/html\"\n , \"html\" => \"text/html\"\n , \"xlsx\" => \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n , \"xltx\" => \"application/vnd.openxmlformats-officedocument.spreadsheetml.template\"\n , \"potx\" => \"application/vnd.openxmlformats-officedocument.presentationml.template\"\n , \"ppsx\" => \"application/vnd.openxmlformats-officedocument.presentationml.slideshow\"\n , \"pptx\" => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n , \"sldx\" => \"application/vnd.openxmlformats-officedocument.presentationml.slide\"\n , \"docx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n , \"dotx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.template\"\n , \"xlam\" => \"application/vnd.ms-excel.addin.macroEnabled.12\"\n , \"xlsb\" => \"application/vnd.ms-excel.sheet.binary.macroEnabled.12\"\n );\n $extention = explode('.', $file);\n $extension = end($extention);\n $extension = strtolower($extension);\n return $mime_types[$extension];\n }", "function _webform_edit_file_filtering_validate($form_element, &$form_state) {\r\n // Predefined types.\r\n $extensions = array();\r\n foreach (element_children($form_element['types']) as $category) {\r\n foreach (array_keys($form_element['types'][$category]['#value']) as $extension) {\r\n if ($form_element['types'][$category][$extension]['#value']) {\r\n $extensions[] = $extension;\r\n }\r\n }\r\n }\r\n\r\n // Additional types.\r\n $additional_extensions = explode(',', $form_element['addextensions']['#value']);\r\n foreach ($additional_extensions as $extension) {\r\n $clean_extension = drupal_strtolower(trim($extension));\r\n if (!empty($clean_extension) && !in_array($clean_extension, $extensions)) {\r\n $extensions[] = $clean_extension;\r\n }\r\n }\r\n\r\n form_set_value($form_element['types'], $extensions, $form_state);\r\n}", "public static function _mime_types($ext = '')\n {\n }", "static function getValidContentTypes() {\n return array(\n 'image/',\n 'text/',\n 'application/pdf',\n );\n }", "public function file_check($str){\n \t$allowed_mime_type_arr = array('application/pdf');\n \tif(isset($_FILES['file']['name']) && $_FILES['file']['name']!=\"\"){\n \t\t$mime = get_mime_by_extension($_FILES['file']['name']);\n \t\tif(in_array($mime, $allowed_mime_type_arr)){\n \t\t\treturn true;\n \t\t}else{\n \t\t\t$this->form_validation->set_message('file_check', 'Extension File Hanya Boleh PDF');\n \t\t\treturn false;\n \t\t}\n \t}else{\n \t\t// $this->form_validation->set_message('file_check', 'Silahkan Pilih File PDF nya.');\n \t\t// return false;\n \t\treturn true;\n \t}\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}", "public function file_check($str)\n {\n\n\n\n echo \"sadasd : \";\n print_r($str);\n print_r($_FILES);\n\n die();\n\n $allowed_mime_type_arr = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'svg');\n $mime = get_mime_by_extension($_FILES['file']['name']);\n if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != \"\") {\n if (in_array($mime, $allowed_mime_type_arr)) {\n return true;\n } else {\n $this->form_validation->set_message('file_check', 'por favor selecciona solamente gif/jpg/png file.');\n return false;\n }\n } else {\n $this->form_validation->set_message('file_check', 'Selecciona un archivo.');\n return false;\n }\n }", "function extension2fileType( $extension )\n{\n $file_types = '' ; # initialize\n switch ( strtolower( $extension ) )\n {\n case '.jpg':\n case '.jpeg':\n $file_types = 'image/pjpeg,image/jpeg' ;\n break ;\n case '.gif':\n $file_types = 'image/gif' ;\n break ;\n case '.png':\n $file_types = 'image/x-png' ;\n break ;\n case '.doc':\n $file_types = 'application/msword' ;\n break ;\n case '.zip':\n $file_types = 'application/x-zip-compressed' ;\n break ;\n case '.pdf':\n $file_types = 'application/pdf' ;\n break ;\n case '.xls':\n $file_types = 'application/vnd.ms-excel' ;\n break ;\n case '.mp3':\n $file_types = 'audio/mpeg' ;\n break ;\n case '.txt':\n $file_types = 'text/plain' ;\n break ;\n case '.htm':\n case '.html':\n $file_types = 'text/html' ;\n break ;\n case '.wma':\n $file_types = 'audio/x-ms-wma' ;\n break ;\n default:\n $file_types = 'image/pjpeg,image/jpeg' ; # default to .jpg\n }\n return $file_types ; # return matching file type!\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 }", "private function getMimeTypes()\n {\n return apply_filters('wplms_assignments_upload_mimes_array',array(\n 'JPG' => array(\n 'image/jpeg',\n 'image/jpg',\n 'image/jp_',\n 'application/jpg',\n 'application/x-jpg',\n 'image/pjpeg',\n 'image/pipeg',\n 'image/vnd.swiftview-jpeg',\n 'image/x-xbitmap'),\n 'GIF' => array(\n 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_'),\n 'PNG' => array(\n 'image/png',\n 'application/png',\n 'application/x-png'),\n 'DOCX'=> 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'RAR'=> 'application/x-rar',\n 'ZIP' => array(\n 'application/zip',\n 'application/x-zip',\n 'application/x-zip-compressed',\n 'application/x-compress',\n 'application/x-compressed',\n 'multipart/x-zip'),\n 'DOC' => array(\n 'application/msword',\n 'application/doc',\n 'application/text',\n 'application/vnd.msword',\n 'application/vnd.ms-word',\n 'application/winword',\n 'application/word',\n 'application/x-msw6',\n 'application/x-msword'),\n 'PDF' => array(\n 'application/pdf',\n 'application/x-pdf',\n 'application/acrobat',\n 'applications/vnd.pdf',\n 'text/pdf',\n 'text/x-pdf'),\n 'PPT' => array(\n 'application/vnd.ms-powerpoint',\n 'application/mspowerpoint',\n 'application/ms-powerpoint',\n 'application/mspowerpnt',\n 'application/vnd-mspowerpoint',\n 'application/powerpoint',\n 'application/x-powerpoint',\n 'application/x-m'),\n 'PPTX'=> 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'PPS' => 'application/vnd.ms-powerpoint',\n 'PPSX'=> 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'PSD' => array('application/octet-stream',\n 'image/vnd.adobe.photoshop'\n ),\n 'ODT' => array(\n 'application/vnd.oasis.opendocument.text',\n 'application/x-vnd.oasis.opendocument.text'),\n 'XLS' => array(\n 'application/vnd.ms-excel',\n 'application/msexcel',\n 'application/x-msexcel',\n 'application/x-ms-excel',\n 'application/vnd.ms-excel',\n 'application/x-excel',\n 'application/x-dos_ms_excel',\n 'application/xls'),\n 'XLSX'=> array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel'),\n 'MP3' => array(\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'audio/mp3',\n 'audio/x-mp3',\n 'audio/mpeg3',\n 'audio/x-mpeg3',\n 'audio/mpg',\n 'audio/x-mpg',\n 'audio/x-mpegaudio'),\n 'M4A' => array(\n 'audio/mp4a-latm',\n 'audio/m4a',\n 'audio/mp4'),\n 'OGG' => array(\n 'audio/ogg',\n 'application/ogg'),\n 'WAV' => array(\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n 'audio/x-pn-wav'),\n 'WMA' => 'audio/x-ms-wma',\n 'MP4' => array(\n 'video/mp4v-es',\n 'audio/mp4',\n 'video/mp4'),\n 'M4V' => array(\n 'video/mp4',\n 'video/x-m4v'),\n 'MOV' => array(\n 'video/quicktime',\n 'video/x-quicktime',\n 'image/mov',\n 'audio/aiff',\n 'audio/x-midi',\n 'audio/x-wav',\n 'video/avi'),\n 'WMV' => 'video/x-ms-wmv',\n 'AVI' => array(\n 'video/avi',\n 'video/msvideo',\n 'video/x-msvideo',\n 'image/avi',\n 'video/xmpg2',\n 'application/x-troff-msvideo',\n 'audio/aiff',\n 'audio/avi'),\n 'MPG' => array(\n 'video/avi',\n 'video/mpeg',\n 'video/mpg',\n 'video/x-mpg',\n 'video/mpeg2',\n 'application/x-pn-mpg',\n 'video/x-mpeg',\n 'video/x-mpeg2a',\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'image/mpg'),\n 'OGV' => 'video/ogg',\n '3GP' => array(\n 'audio/3gpp',\n 'video/3gpp'),\n '3G2' => array(\n 'video/3gpp2',\n 'audio/3gpp2'),\n 'FLV' => 'video/x-flv',\n 'WEBM'=> 'video/webm',\n 'APK' => 'application/vnd.android.package-archive',\n ));\n }", "function get_file_type($file_mimetype)\n{\n // Get mimetype from file\n $mimetype = explode('/', $file_mimetype);\n\n switch ($mimetype[0]) {\n case 'image':\n return 'image';\n break;\n case 'video':\n return 'video';\n break;\n case 'audio':\n return 'audio';\n break;\n default:\n return 'file';\n }\n}", "function get_displayable_file_types() {\n return array( \n 'ada',\n 'adb',\n 'adp',\n 'ads',\n 'ans',\n 'as',\n 'asc',\n 'asm',\n 'asp',\n 'aspx',\n 'atom',\n 'au3',\n 'bas',\n 'bat',\n 'bmax',\n 'bml',\n 'c',\n 'cbl',\n 'cc',\n 'cfm',\n 'cgi',\n 'cls',\n 'cmd',\n 'cob',\n 'cpp',\n 'cs',\n 'css',\n 'csv',\n 'cxx',\n 'd',\n 'dif',\n 'dist',\n 'dtd',\n 'e',\n 'efs',\n 'egg',\n 'egt',\n 'f',\n 'f77',\n 'for',\n 'frm',\n 'frx',\n 'ftn',\n 'ged',\n 'gitattributes',\n 'gitignore',\n 'gm6',\n 'gmd',\n 'gml',\n 'h',\n 'hpp',\n 'hs',\n 'hta',\n 'htaccess',\n 'htm',\n 'html',\n 'hxx',\n 'ici',\n 'ictl',\n 'ihtml',\n 'inc',\n 'inf',\n 'info',\n 'ini',\n 'install',\n 'java',\n 'js',\n 'jsfl',\n 'json',\n 'l',\n 'las',\n 'lasso',\n 'lassoapp',\n 'less',\n 'log',\n 'lua',\n 'm',\n 'm4',\n 'makefile',\n 'manifest',\n 'md',\n 'met',\n 'metalink',\n 'ml',\n 'module',\n 'mrc',\n 'n',\n 'ncf',\n 'nfo',\n 'nut',\n 'p',\n 'pas',\n 'php',\n 'php3',\n 'php4',\n 'php5',\n 'phps',\n 'phtml',\n 'piv',\n 'pl',\n 'pm',\n 'pp',\n 'properties',\n 'ps1',\n 'ps1xml',\n 'psc1',\n 'psd1',\n 'psm1',\n 'py',\n 'pyc',\n 'pyi',\n 'rb',\n 'rdf',\n 'resx',\n 'rss',\n 's',\n 'scm',\n 'scpt',\n 'sh',\n 'shtml',\n 'spin',\n 'sql',\n 'ss',\n 'stk',\n 'svg',\n 'tab',\n 'tcl',\n 'tpl',\n 'txt',\n 'vb',\n 'vbp',\n 'vbs',\n 'xht',\n 'xhtml',\n 'xml',\n 'xsl',\n 'xslt',\n 'xul',\n 'y',\n 'yml'\n );\n }", "function check_file_is_audio( $tmp ) \n{\n $allowed = array(\n 'audio/mpeg', 'audio/x-mpeg', 'audio/mpeg3', 'audio/x-mpeg-3', 'audio/aiff', \n 'audio/mid', 'audio/x-aiff', 'audio/x-mpequrl','audio/midi', 'audio/x-mid', \n 'audio/x-midi','audio/wav','audio/x-wav','audio/xm','audio/x-aac','audio/basic',\n 'audio/flac','audio/mp4','audio/x-matroska','audio/ogg','audio/s3m','audio/x-ms-wax',\n 'audio/xm'\n );\n \n // check REAL MIME type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $tmp );\n finfo_close($finfo);\n \n // check to see if REAL MIME type is inside $allowed array\n if( in_array($type, $allowed) ) {\n return $type;\n } else {\n return false;\n }\n}", "function mimetype($filedata) {\r\n\t\t$filepath = $filedata['tmp_name'];\r\n\t\t// Check only existing files\r\n\t\tif (!file_exists($filepath) || !is_readable($filepath)) return false;\r\n\r\n\t\t// Trying to run file from the filesystem\r\n\t\tif (function_exists('exec')) {\r\n\t\t\t$mimeType = exec(\"/usr/bin/file -i -b $filepath\");\r\n\t\t\tif (!empty($mimeType)) return $mimeType;\r\n\t\t}\r\n\r\n\t\t// Trying to get mimetype from images\r\n\t\t$imageData = @getimagesize($filepath);\r\n\t\tif (!empty($imageData['mime'])) {\r\n\t\t\treturn $imageData['mime'];\r\n\t\t}\r\n\r\n\t\t// Reverting to guessing the mimetype from a known list\r\n\t\t // Thanks to MilesJ Uploader plugin : http://milesj.me/resources/logs/uploader-plugin\r\n\t\tstatic $mimeTypes = array(\r\n\t\t\t// Images\r\n\t\t\t'bmp'\t=> 'image/bmp',\r\n\t\t\t'gif'\t=> 'image/gif',\r\n\t\t\t'jpe'\t=> 'image/jpeg',\r\n\t\t\t'jpg'\t=> 'image/jpeg',\r\n\t\t\t'jpeg'\t=> 'image/jpeg',\r\n\t\t\t'pjpeg'\t=> 'image/pjpeg',\r\n\t\t\t'svg'\t=> 'image/svg+xml',\r\n\t\t\t'svgz'\t=> 'image/svg+xml',\r\n\t\t\t'tif'\t=> 'image/tiff',\r\n\t\t\t'tiff'\t=> 'image/tiff',\r\n\t\t\t'ico'\t=> 'image/vnd.microsoft.icon',\r\n\t\t\t'png'\t=> 'image/png',\r\n\t\t\t'xpng'\t=> 'image/x-png',\r\n\t\t\t// Text\r\n\t\t\t'txt' \t=> 'text/plain',\r\n\t\t\t'asc' \t=> 'text/plain',\r\n\t\t\t'css' \t=> 'text/css',\r\n\t\t\t'csv'\t=> 'text/csv',\r\n\t\t\t'htm' \t=> 'text/html',\r\n\t\t\t'html' \t=> 'text/html',\r\n\t\t\t'stm' \t=> 'text/html',\r\n\t\t\t'rtf' \t=> 'text/rtf',\r\n\t\t\t'rtx' \t=> 'text/richtext',\r\n\t\t\t'sgm' \t=> 'text/sgml',\r\n\t\t\t'sgml' \t=> 'text/sgml',\r\n\t\t\t'tsv' \t=> 'text/tab-separated-values',\r\n\t\t\t'tpl' \t=> 'text/template',\r\n\t\t\t'xml' \t=> 'text/xml',\r\n\t\t\t'js'\t=> 'text/javascript',\r\n\t\t\t'xhtml'\t=> 'application/xhtml+xml',\r\n\t\t\t'xht'\t=> 'application/xhtml+xml',\r\n\t\t\t'json'\t=> 'application/json',\r\n\t\t\t// Archive\r\n\t\t\t'gz'\t=> 'application/x-gzip',\r\n\t\t\t'gtar'\t=> 'application/x-gtar',\r\n\t\t\t'z'\t\t=> 'application/x-compress',\r\n\t\t\t'tgz'\t=> 'application/x-compressed',\r\n\t\t\t'zip'\t=> 'application/zip',\r\n\t\t\t'rar'\t=> 'application/x-rar-compressed',\r\n\t\t\t'rev'\t=> 'application/x-rar-compressed',\r\n\t\t\t'tar'\t=> 'application/x-tar',\r\n\t\t\t// Audio\r\n\t\t\t'aif' \t=> 'audio/x-aiff',\r\n\t\t\t'aifc' \t=> 'audio/x-aiff',\r\n\t\t\t'aiff' \t=> 'audio/x-aiff',\r\n\t\t\t'au' \t=> 'audio/basic',\r\n\t\t\t'kar' \t=> 'audio/midi',\r\n\t\t\t'mid' \t=> 'audio/midi',\r\n\t\t\t'midi' \t=> 'audio/midi',\r\n\t\t\t'mp2' \t=> 'audio/mpeg',\r\n\t\t\t'mp3' \t=> 'audio/mpeg',\r\n\t\t\t'mpga' \t=> 'audio/mpeg',\r\n\t\t\t'ra' \t=> 'audio/x-realaudio',\r\n\t\t\t'ram' \t=> 'audio/x-pn-realaudio',\r\n\t\t\t'rm' \t=> 'audio/x-pn-realaudio',\r\n\t\t\t'rpm' \t=> 'audio/x-pn-realaudio-plugin',\r\n\t\t\t'snd' \t=> 'audio/basic',\r\n\t\t\t'tsi' \t=> 'audio/TSP-audio',\r\n\t\t\t'wav' \t=> 'audio/x-wav',\r\n\t\t\t'wma'\t=> 'audio/x-ms-wma',\r\n\t\t\t// Video\r\n\t\t\t'flv' \t=> 'video/x-flv',\r\n\t\t\t'fli' \t=> 'video/x-fli',\r\n\t\t\t'avi' \t=> 'video/x-msvideo',\r\n\t\t\t'qt' \t=> 'video/quicktime',\r\n\t\t\t'mov' \t=> 'video/quicktime',\r\n\t\t\t'movie' => 'video/x-sgi-movie',\r\n\t\t\t'mp2' \t=> 'video/mpeg',\r\n\t\t\t'mpa' \t=> 'video/mpeg',\r\n\t\t\t'mpv2' \t=> 'video/mpeg',\r\n\t\t\t'mpe' \t=> 'video/mpeg',\r\n\t\t\t'mpeg' \t=> 'video/mpeg',\r\n\t\t\t'mpg' \t=> 'video/mpeg',\r\n\t\t\t'mp4'\t=> 'video/mp4',\r\n\t\t\t'viv' \t=> 'video/vnd.vivo',\r\n\t\t\t'vivo' \t=> 'video/vnd.vivo',\r\n\t\t\t'wmv'\t=> 'video/x-ms-wmv',\r\n\t\t\t// Applications\r\n\t\t\t'js'\t=> 'application/x-javascript',\r\n\t\t\t'xlc' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xll' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xlm' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xls' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xlw' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'doc'\t=> 'application/msword',\r\n\t\t\t'dot'\t=> 'application/msword',\r\n\t\t\t'pdf' \t=> 'application/pdf',\r\n\t\t\t'psd' \t=> 'image/vnd.adobe.photoshop',\r\n\t\t\t'ai' \t=> 'application/postscript',\r\n\t\t\t'eps' \t=> 'application/postscript',\r\n\t\t\t'ps' \t=> 'application/postscript'\r\n\t\t);\r\n\t\t$ext = $this->ext($filedata);\r\n\t\treturn array_key_exists($ext, $mimeTypes) ? $mimeTypes[$ext] : false;\r\n\t}", "function get_allowed_mime_types($user = \\null)\n {\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 check_upload_mimes($mimes)\n {\n }", "public static function mimeTypeExtensions ()\r\n\t{\r\n\t\t# Define the MIME Types; list taken from www.mimetype.org\r\n\t\t$mimeTypes = '\r\n\t\tapplication/SLA\tstl\r\n\t\tapplication/STEP\tstep\r\n\t\tapplication/STEP\tstp\r\n\t\tapplication/acad\tdwg\r\n\t\tapplication/andrew-inset\tez\r\n\t\tapplication/clariscad\tccad\r\n\t\tapplication/drafting\tdrw\r\n\t\tapplication/dsptype\ttsp\r\n\t\tapplication/dxf\tdxf\r\n\t\tapplication/excel\txls\r\n\t\tapplication/i-deas\tunv\r\n\t\tapplication/java-archive\tjar\r\n\t\tapplication/mac-binhex40\thqx\r\n\t\tapplication/mac-compactpro\tcpt\r\n\t\tapplication/vnd.ms-powerpoint\tpot\r\n\t\tapplication/vnd.ms-powerpoint\tpps\r\n\t\tapplication/vnd.ms-powerpoint\tppt\r\n\t\tapplication/vnd.ms-powerpoint\tppz\r\n\t\tapplication/msword\tdoc\r\n\t\tapplication/octet-stream\tbin\r\n\t\tapplication/octet-stream\tclass\r\n\t\tapplication/octet-stream\tdms\r\n\t\tapplication/octet-stream\texe\r\n\t\tapplication/octet-stream\tlha\r\n\t\tapplication/octet-stream\tlzh\r\n\t\tapplication/oda\toda\r\n\t\tapplication/ogg\togg\r\n\t\tapplication/ogg\togm\r\n\t\tapplication/pdf\tpdf\r\n\t\tapplication/pgp\tpgp\r\n\t\tapplication/postscript\tai\r\n\t\tapplication/postscript\teps\r\n\t\tapplication/postscript\tps\r\n\t\tapplication/pro_eng\tprt\r\n\t\tapplication/rtf\trtf\r\n\t\tapplication/set\tset\r\n\t\tapplication/smil\tsmi\r\n\t\tapplication/smil\tsmil\r\n\t\tapplication/solids\tsol\r\n\t\tapplication/vda\tvda\r\n\t\tapplication/vnd.mif\tmif\r\n\t\tapplication/vnd.ms-excel\txlc\r\n\t\tapplication/vnd.ms-excel\txll\r\n\t\tapplication/vnd.ms-excel\txlm\r\n\t\tapplication/vnd.ms-excel\txls\r\n\t\tapplication/vnd.ms-excel\txlw\r\n\t\tapplication/vnd.rim.cod\tcod\r\n\t\tapplication/x-arj-compressed\tarj\r\n\t\tapplication/x-bcpio\tbcpio\r\n\t\tapplication/x-cdlink\tvcd\r\n\t\tapplication/x-chess-pgn\tpgn\r\n\t\tapplication/x-cpio\tcpio\r\n\t\tapplication/x-csh\tcsh\r\n\t\tapplication/x-debian-package\tdeb\r\n\t\tapplication/x-director\tdcr\r\n\t\tapplication/x-director\tdir\r\n\t\tapplication/x-director\tdxr\r\n\t\tapplication/x-dvi\tdvi\r\n\t\tapplication/x-freelance\tpre\r\n\t\tapplication/x-futuresplash\tspl\r\n\t\tapplication/x-gtar\tgtar\r\n\t\tapplication/x-gunzip\tgz\r\n\t\tapplication/x-gzip\tgz\r\n\t\tapplication/x-hdf\thdf\r\n\t\tapplication/x-ipix\tipx\r\n\t\tapplication/x-ipscript\tips\r\n\t\tapplication/x-javascript\tjs\r\n\t\tapplication/x-koan\tskd\r\n\t\tapplication/x-koan\tskm\r\n\t\tapplication/x-koan\tskp\r\n\t\tapplication/x-koan\tskt\r\n\t\tapplication/x-latex\tlatex\r\n\t\tapplication/x-lisp\tlsp\r\n\t\tapplication/x-lotusscreencam\tscm\r\n\t\tapplication/x-mif\tmif\r\n\t\tapplication/x-msdos-program\tbat\r\n\t\tapplication/x-msdos-program\tcom\r\n\t\tapplication/x-msdos-program\texe\r\n\t\tapplication/x-netcdf\tcdf\r\n\t\tapplication/x-netcdf\tnc\r\n\t\tapplication/x-perl\tpl\r\n\t\tapplication/x-perl\tpm\r\n\t\tapplication/x-rar-compressed\trar\r\n\t\tapplication/x-sh\tsh\r\n\t\tapplication/x-shar\tshar\r\n\t\tapplication/x-shockwave-flash\tswf\r\n\t\tapplication/x-stuffit\tsit\r\n\t\tapplication/x-sv4cpio\tsv4cpio\r\n\t\tapplication/x-sv4crc\tsv4crc\r\n\t\tapplication/x-tar-gz\ttar.gz\r\n\t\tapplication/x-tar-gz\ttgz\r\n\t\tapplication/x-tar\ttar\r\n\t\tapplication/x-tcl\ttcl\r\n\t\tapplication/x-tex\ttex\r\n\t\tapplication/x-texinfo\ttexi\r\n\t\tapplication/x-texinfo\ttexinfo\r\n\t\tapplication/x-troff-man\tman\r\n\t\tapplication/x-troff-me\tme\r\n\t\tapplication/x-troff-ms\tms\r\n\t\tapplication/x-troff\troff\r\n\t\tapplication/x-troff\tt\r\n\t\tapplication/x-troff\ttr\r\n\t\tapplication/x-ustar\tustar\r\n\t\tapplication/x-wais-source\tsrc\r\n\t\tapplication/x-zip-compressed\tzip\r\n\t\tapplication/zip\tzip\r\n\t\taudio/TSP-audio\ttsi\r\n\t\taudio/basic\tau\r\n\t\taudio/basic\tsnd\r\n\t\taudio/midi\tkar\r\n\t\taudio/midi\tmid\r\n\t\taudio/midi\tmidi\r\n\t\taudio/mpeg\tmp2\r\n\t\taudio/mpeg\tmp3\r\n\t\taudio/mpeg\tmpga\r\n\t\taudio/ulaw\tau\r\n\t\taudio/x-aiff\taif\r\n\t\taudio/x-aiff\taifc\r\n\t\taudio/x-aiff\taiff\r\n\t\taudio/x-mpegurl\tm3u\r\n\t\taudio/x-ms-wax\twax\r\n\t\taudio/x-ms-wma\twma\r\n\t\taudio/x-pn-realaudio-plugin\trpm\r\n\t\taudio/x-pn-realaudio\tram\r\n\t\taudio/x-pn-realaudio\trm\r\n\t\taudio/x-realaudio\tra\r\n\t\taudio/x-wav\twav\r\n\t\tchemical/x-pdb\tpdb\r\n\t\tchemical/x-pdb\txyz\r\n\t\timage/cmu-raster\tras\r\n\t\timage/gif\tgif\r\n\t\timage/ief\tief\r\n\t\timage/jpeg\tjpe\r\n\t\timage/jpeg\tjpeg\r\n\t\timage/jpeg\tjpg\r\n\t\timage/png\tpng\r\n\t\timage/tiff\ttif tiff\r\n\t\timage/tiff\ttif\r\n\t\timage/tiff\ttiff\r\n\t\timage/x-cmu-raster\tras\r\n\t\timage/x-portable-anymap\tpnm\r\n\t\timage/x-portable-bitmap\tpbm\r\n\t\timage/x-portable-graymap\tpgm\r\n\t\timage/x-portable-pixmap\tppm\r\n\t\timage/x-rgb\trgb\r\n\t\timage/x-xbitmap\txbm\r\n\t\timage/x-xpixmap\txpm\r\n\t\timage/x-xwindowdump\txwd\r\n\t\tmodel/iges\tiges\r\n\t\tmodel/iges\tigs\r\n\t\tmodel/mesh\tmesh\r\n\t\tmodel/mesh\tmsh\r\n\t\tmodel/mesh\tsilo\r\n\t\tmodel/vrml\tvrml\r\n\t\tmodel/vrml\twrl\r\n\t\ttext/css\tcss\r\n\t\ttext/html\thtm\r\n\t\ttext/html\thtml htm\r\n\t\ttext/html\thtml\r\n\t\ttext/plain\tasc txt\r\n\t\ttext/plain\tasc\r\n\t\ttext/plain\tc\r\n\t\ttext/plain\tcc\r\n\t\ttext/plain\tf90\r\n\t\ttext/plain\tf\r\n\t\ttext/plain\th\r\n\t\ttext/plain\thh\r\n\t\ttext/plain\tm\r\n\t\ttext/plain\ttxt\r\n\t\ttext/richtext\trtx\r\n\t\ttext/rtf\trtf\r\n\t\ttext/sgml\tsgm\r\n\t\ttext/sgml\tsgml\r\n\t\ttext/tab-separated-values\ttsv\r\n\t\ttext/vnd.sun.j2me.app-descriptor\tjad\r\n\t\ttext/x-setext\tetx\r\n\t\ttext/xml\txml// This is disabled because XML has several different MIME Types\r\n\t\tvideo/dl\tdl\r\n\t\tvideo/fli\tfli\r\n\t\tvideo/flv\tflv\r\n\t\tvideo/gl\tgl\r\n\t\tvideo/mpeg\tmp2\r\n\t\tvideo/mpeg\tmpe\r\n\t\tvideo/mpeg\tmpeg\r\n\t\tvideo/mpeg\tmpg\r\n\t\tvideo/quicktime\tmov\r\n\t\tvideo/quicktime\tqt\r\n\t\tvideo/vnd.vivo\tviv\r\n\t\tvideo/vnd.vivo\tvivo\r\n\t\tvideo/x-fli\tfli\r\n\t\tvideo/x-ms-asf\tasf\r\n\t\tvideo/x-ms-asx\tasx\r\n\t\tvideo/x-ms-wmv\twmv\r\n\t\tvideo/x-ms-wmx\twmx\r\n\t\tvideo/x-ms-wvx\twvx\r\n\t\tvideo/x-msvideo\tavi\r\n\t\tvideo/x-sgi-movie\tmovie\r\n\t\twww/mime\tmime\r\n\t\tx-conference/x-cooltalk\tice\r\n\t\tx-world/x-vrml\tvrm\r\n\t\tx-world/x-vrml\tvrml';\r\n\t\t\r\n\t\t# Parse the list as array ($extension => $mimeType, ... )\r\n\t\t$list = array ();\r\n\t\t$mimeTypes = explode (\"\\n\", trim ($mimeTypes));\r\n\t\tforeach ($mimeTypes as $index => $line) {\r\n\t\t\tlist ($mimeType, $extension) = explode (\"\\t\", trim ($line), 2);\r\n\t\t\tif (substr_count ($extension, ' ')) {continue;}\t// Limit of 2 for some extensions in the source listing have two listed, e.g. \"asc txt\"\r\n\t\t\t$list[$extension] = $mimeType;\r\n\t\t}\r\n\t\t\r\n\t\t# Return the list\r\n\t\treturn $list;\r\n\t}", "Function getFileType(){\n\t\t$it = $this->info['origSize'][2];\n\t\tswitch($it){\n\t\t\tcase IMAGETYPE_GIF: $r = \"gif\"; break;\n\t\t\tcase IMAGETYPE_JPEG: $r = \"jpg\"; break;\n\t\t\tcase IMAGETYPE_PNG: $r = \"png\"; break;\n\t\t\tcase IMAGETYPE_BMP: $r = \"bmp\"; break;\n\t\t\tcase IMAGETYPE_WBMP: $r = \"wbmp\"; break;\n\t\t\tcase IMAGETYPE_WEBP: $r = \"webp\"; break;\n\t\t\tdefault:\n\t\t\t\t$r = false;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $r;\n\t}", "function get_file_type($file)\n {\n global $image_types, $movie_types;\n \n $pos = strrpos($file, \".\");\n if ($pos === false) {\n return \"Unknown File\";\n }\n \n $ext = rtrim(substr($file, $pos + 1), \"~\");\n if (in_array($ext, $image_types)) {\n $type = \"Image File\";\n \n } elseif (in_array($ext, $movie_types)) {\n $type = \"Video File\";\n \n } elseif (in_array($ext, $archive_types)) {\n $type = \"Compressed Archive\";\n \n } elseif (in_array($ext, $document_types)) {\n $type = \"Type Document\";\n \n } elseif (in_array($ext, $font_types)) {\n $type = \"Type Font\";\n \n } else {\n $type = \"File\";\n }\n \n return (strtoupper($ext) . \" \" . $type);\n }", "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}", "function loadMimeTypes() {\n\t\tif( empty( $this->mMimeTypes )) {\n\t\t\t// use bitweavers mime.types file to ensure everyone has our set unless user forces his own.\n\t\t\tif( defined( 'MIME_TYPES' ) && is_file( MIME_TYPES )) {\n\t\t\t\t$mimeFile = MIME_TYPES;\n\t\t\t} else {\n\t\t\t\t$mimeFile = KERNEL_PKG_PATH.'admin/mime.types';\n\t\t\t}\n\n\t\t\t$this->mMimeTypes = array();\n\t\t\tif( $fp = fopen( $mimeFile,\"r\" ) ) {\n\t\t\t\twhile( FALSE != ( $line = fgets( $fp, 4096 ) ) ) {\n\t\t\t\t\tif( !preg_match( \"/^\\s*(?!#)\\s*(\\S+)\\s+(?=\\S)(.+)/\", $line, $match ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = preg_split( \"/\\s/\",trim( $match[2] ) );\n\t\t\t\t\tforeach( $tmp as $type ) {\n\t\t\t\t\t\t$this->mMimeTypes[strtolower( $type )] = $match[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose( $fp );\n\t\t\t}\n\t\t}\n\t}", "function validateFile($fieldname)\n{\n $error = '';\n if (!empty($_FILES[$fieldname]['error'])) {\n switch ($_FILES[$fieldname]['error']) {\n case '1':\n $error = 'Upload maximum file is 4 MB.';\n break;\n case '2':\n $error = 'File is too big, please upload with smaller size.';\n break;\n case '3':\n $error = 'File uploaded, but only halef of file.';\n break;\n case '4':\n $error = 'There is no File to upload';\n break;\n case '6':\n $error = 'Temporary folder not exists, Please try again.';\n break;\n case '7':\n $error = 'Failed to record File into disk.';\n break;\n case '8':\n $error = 'Upload file has been stop by extension.';\n break;\n case '999':\n default:\n $error = 'No error code avaiable';\n }\n } elseif (empty($_FILES[$fieldname]['tmp_name']) || $_FILES[$fieldname]['tmp_name'] == 'none') {\n $error = 'There is no File to upload.';\n } elseif ($_FILES[$fieldname]['size'] > FILE_UPLOAD_MAX_SIZE) {\n $error = 'Upload maximum file is '.number_format(FILE_UPLOAD_MAX_SIZE/1024,2).' MB.';\n } else {\n //$get_ext = substr($_FILES[$fieldname]['name'],strlen($_FILES[$fieldname]['name'])-3,3);\t\n $cekfileformat = check_file_type($_FILES[$fieldname]);\n if (!$cekfileformat) {\n $error = 'Upload File only allow (jpg, gif, png, pdf, doc, xls, xlsx, docx)';\n }\n }\n\n return $error;\n}", "public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }", "private function loadMimeTypes ()\n\t\t{\n\t\t\tif ($this->mimeTypes === null)\n\t\t\t{\n\t\t\t\t$this->mimeTypes = [];\n\n\t\t\t\t$lines = file($this->mimeFile);\n\t\t\t\tforeach($lines as $line) {\n\t\t\t\t\t// skip comments\n\t\t\t\t\t$line = preg_replace('/#.*$/', '', $line);\n\t\t\t\t\t$line = trim($line);\n\t\t\t\t\tif($line === '') continue;\n\n\t\t\t\t\t$exts = preg_split('/\\s+/', $line);\n\t\t\t\t\t$mime = array_shift($exts);\n\t\t\t\t\tif(!$exts) continue;\n\t\t\t\t\tforeach($exts as $ext) {\n\t\t\t\t\t\tif(empty($ext)) continue;\n\t\t\t\t\t\tif(strlen($ext) > 4) continue; // we only handle 4 chars or less\n\t\t\t\t\t\t$this->mimeTypes[$ext] = $mime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private function get_mime_type(string $file_path) {\n //MIME Types\n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-unic',\n 'flv' => 'video/x-flv',\n\n //Images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n\n //Archives\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n\n //Audio/Video\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n\n //Adobe\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n\n //MS Office\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'docx' => 'application/msword',\n 'xlsx' => 'application/vnd.ms-excel',\n 'pptx' => 'application/vnd.ms-powerpoint',\n\n //Open Office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n\n $ext_array = explode('.', $file_path);\n $extension = strtolower(end($ext_array));\n if(isset($mime_types[$extension])) {\n return $mime_types[$extension];\n } else {\n return mime_content_type($file_path);\n }\n }", "protected function isFile() {}", "public function getFileType()\n\t{\n\t\tif (is_dir($this->getFullPath()))\n\t\t{\n\t\t\treturn 'directory';\n\t\t}\n\t\tif (is_link($this->getFullPath()))\n\t\t{\n\t\t\treturn 'link';\n\t\t}\n\t\tif (is_file($this->getFullPath()))\n\t\t{\n\t\t\treturn 'file';\n\t\t}\n\t\treturn 'unknown';\n\n\t}", "private function _getFileType($fileName)\n {\n $safeFileName = escapeshellarg($fileName);\n return trim(exec(\"file -b $safeFileName\"));\n\n//return $this->getFileType2($fileName);\n }", "public function testGetMimeType()\n {\n $validator = new File\\MimeType('image/gif');\n $this->assertEquals('image/gif', $validator->getMimeType());\n\n $validator = new File\\MimeType(['image/gif', 'video', 'text/test']);\n $this->assertEquals('image/gif,video,text/test', $validator->getMimeType());\n\n $validator = new File\\MimeType(['image/gif', 'video', 'text/test']);\n $this->assertEquals(['image/gif', 'video', 'text/test'], $validator->getMimeType(true));\n }", "public function ImageType($file_type){\r\n $this->file_type=$file_type;\r\n }", "function custom_mime_types($existing_mimes = array()) {\n\n //For example, the following line allows PDF uploads\n //$existing_mimes['pdf'] = 'application/pdf';\n \n return $existing_mimes;\n}", "public function file_extensions_for_case_studies(){\n\t\t$filetype_arr = array();\n\t\t$filetype_arr['ppt'] = \"PowerPoint\";\n\t\t$filetype_arr['pptx'] = \"PowerPoint\";\n\t\t$filetype_arr['pdf'] = \"PDF file\";\n\t\treturn $filetype_arr;\n\t}", "public function isFileNameType() {\r\n return $this->config['filenametype'];\r\n }", "public function get_allowed_content_object_types()\n {\n return array(File::class);\n }", "private function isValidStaticTypeFile(): bool\n {\n return $this->oHttpRequest->getExists('t') &&\n in_array($this->oHttpRequest->get('t'), self::ASSET_FILES_ACCEPTED, true);\n }", "static function validFile($name,$size,$arrayFileType){\n \n $valid = true;\n \n// //extraer el ultimo componente de la ruta(se busca el nombre del archivo)\n// $file = $dir . basename($_FILES[$name]['name']);\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n// $valFileType = strtolower(pathinfo($file,PATHINFO_EXTENSION));\n //Extraer el tamaño del archivo\n// $valsize = getimagesize($_FILES[$name][\"tmp_name\"]);\n \n // Extenciones permitidas\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n $valFileType = strtolower(pathinfo($_FILES[$name]['name'],PATHINFO_EXTENSION)); \n $true=0;\n// var_dump(count($arrayFileType));\n for($i=0; $i<=count($arrayFileType)-1; $i++){\n \n if($valFileType==$arrayFileType[$i]){\n $true=$true+1;\n } \n $stringFileType .=$arrayFileType[$i].\" \";\n \n }\n \n if($true==0){\n $valid = false;\n $msg.=\"Solo se permiten extensiones \".$stringFileType.\". \"; \n }\n \n //tamaño permitido\n if ($_FILES[$name][\"size\"] > $size) {\n $valid = false;\n $msg.=\"Operacion fallida, este archivo no puede ser mayor a \".($size/100000).\"MB. \"; \n } \n \n \n if($msg!=\"\"){\n// $msg = \"Debe darse un valor al campo: \".$msg ;\n utilities::alert($msg); \n }\n \n \n \n return ($valid); \n }", "public static function _mime_types($ext = '')\n {\n $mimes = array(\n 'xl' => 'application/excel',\n 'js' => 'application/javascript',\n 'hqx' => 'application/mac-binhex40',\n 'cpt' => 'application/mac-compactpro',\n 'bin' => 'application/macbinary',\n 'doc' => 'application/msword',\n 'word' => 'application/msword',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',\n 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',\n 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n 'class' => 'application/octet-stream',\n 'dll' => 'application/octet-stream',\n 'dms' => 'application/octet-stream',\n 'exe' => 'application/octet-stream',\n 'lha' => 'application/octet-stream',\n 'lzh' => 'application/octet-stream',\n 'psd' => 'application/octet-stream',\n 'sea' => 'application/octet-stream',\n 'so' => 'application/octet-stream',\n 'oda' => 'application/oda',\n 'pdf' => 'application/pdf',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'smi' => 'application/smil',\n 'smil' => 'application/smil',\n 'mif' => 'application/vnd.mif',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'wbxml' => 'application/vnd.wap.wbxml',\n 'wmlc' => 'application/vnd.wap.wmlc',\n 'dcr' => 'application/x-director',\n 'dir' => 'application/x-director',\n 'dxr' => 'application/x-director',\n 'dvi' => 'application/x-dvi',\n 'gtar' => 'application/x-gtar',\n 'php3' => 'application/x-httpd-php',\n 'php4' => 'application/x-httpd-php',\n 'php' => 'application/x-httpd-php',\n 'phtml' => 'application/x-httpd-php',\n 'phps' => 'application/x-httpd-php-source',\n 'swf' => 'application/x-shockwave-flash',\n 'sit' => 'application/x-stuffit',\n 'tar' => 'application/x-tar',\n 'tgz' => 'application/x-tar',\n 'xht' => 'application/xhtml+xml',\n 'xhtml' => 'application/xhtml+xml',\n 'zip' => 'application/zip',\n 'mid' => 'audio/midi',\n 'midi' => 'audio/midi',\n 'mp2' => 'audio/mpeg',\n 'mp3' => 'audio/mpeg',\n 'mpga' => 'audio/mpeg',\n 'aif' => 'audio/x-aiff',\n 'aifc' => 'audio/x-aiff',\n 'aiff' => 'audio/x-aiff',\n 'ram' => 'audio/x-pn-realaudio',\n 'rm' => 'audio/x-pn-realaudio',\n 'rpm' => 'audio/x-pn-realaudio-plugin',\n 'ra' => 'audio/x-realaudio',\n 'wav' => 'audio/x-wav',\n 'bmp' => 'image/bmp',\n 'gif' => 'image/gif',\n 'jpeg' => 'image/jpeg',\n 'jpe' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'png' => 'image/png',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'eml' => 'message/rfc822',\n 'css' => 'text/css',\n 'html' => 'text/html',\n 'htm' => 'text/html',\n 'shtml' => 'text/html',\n 'log' => 'text/plain',\n 'text' => 'text/plain',\n 'txt' => 'text/plain',\n 'rtx' => 'text/richtext',\n 'rtf' => 'text/rtf',\n 'vcf' => 'text/vcard',\n 'vcard' => 'text/vcard',\n 'xml' => 'text/xml',\n 'xsl' => 'text/xml',\n 'mpeg' => 'video/mpeg',\n 'mpe' => 'video/mpeg',\n 'mpg' => 'video/mpeg',\n 'mov' => 'video/quicktime',\n 'qt' => 'video/quicktime',\n 'rv' => 'video/vnd.rn-realvideo',\n 'avi' => 'video/x-msvideo',\n 'movie' => 'video/x-sgi-movie'\n );\n if (array_key_exists(strtolower($ext), $mimes)) {\n return $mimes[strtolower($ext)];\n }\n return 'application/octet-stream';\n }", "function atkGetMimeTypeFromFileExtension($filename)\n {\n $ext = strtolower(end(explode('.',$filename )));\n\n $mimetypes = array(\n 'ai' =>'application/postscript',\n 'aif' =>'audio/x-aiff',\n 'aifc' =>'audio/x-aiff',\n 'aiff' =>'audio/x-aiff',\n 'asc' =>'text/plain',\n 'atom' =>'application/atom+xml',\n 'avi' =>'video/x-msvideo',\n 'bcpio' =>'application/x-bcpio',\n 'bmp' =>'image/bmp',\n 'cdf' =>'application/x-netcdf',\n 'cgm' =>'image/cgm',\n 'cpio' =>'application/x-cpio',\n 'cpt' =>'application/mac-compactpro',\n 'crl' =>'application/x-pkcs7-crl',\n 'crt' =>'application/x-x509-ca-cert',\n 'csh' =>'application/x-csh',\n 'css' =>'text/css',\n 'dcr' =>'application/x-director',\n 'dir' =>'application/x-director',\n 'djv' =>'image/vnd.djvu',\n 'djvu' =>'image/vnd.djvu',\n 'doc' =>'application/msword',\n 'dtd' =>'application/xml-dtd',\n 'dvi' =>'application/x-dvi',\n 'dxr' =>'application/x-director',\n 'eps' =>'application/postscript',\n 'etx' =>'text/x-setext',\n 'ez' =>'application/andrew-inset',\n 'gif' =>'image/gif',\n 'gram' =>'application/srgs',\n 'grxml' =>'application/srgs+xml',\n 'gtar' =>'application/x-gtar',\n 'hdf' =>'application/x-hdf',\n 'hqx' =>'application/mac-binhex40',\n 'html' =>'text/html',\n 'html' =>'text/html',\n 'ice' =>'x-conference/x-cooltalk',\n 'ico' =>'image/x-icon',\n 'ics' =>'text/calendar',\n 'ief' =>'image/ief',\n 'ifb' =>'text/calendar',\n 'iges' =>'model/iges',\n 'igs' =>'model/iges',\n 'jpe' =>'image/jpeg',\n 'jpeg' =>'image/jpeg',\n 'jpg' =>'image/jpeg',\n 'js' =>'application/x-javascript',\n 'kar' =>'audio/midi',\n 'latex' =>'application/x-latex',\n 'm3u' =>'audio/x-mpegurl',\n 'man' =>'application/x-troff-man',\n 'mathml' =>'application/mathml+xml',\n 'me' =>'application/x-troff-me',\n 'mesh' =>'model/mesh',\n 'mid' =>'audio/midi',\n 'midi' =>'audio/midi',\n 'mif' =>'application/vnd.mif',\n 'mov' =>'video/quicktime',\n 'movie' =>'video/x-sgi-movie',\n 'mp2' =>'audio/mpeg',\n 'mp3' =>'audio/mpeg',\n 'mpe' =>'video/mpeg',\n 'mpeg' =>'video/mpeg',\n 'mpg' =>'video/mpeg',\n 'mpga' =>'audio/mpeg',\n 'ms' =>'application/x-troff-ms',\n 'msh' =>'model/mesh',\n 'mxu m4u' =>'video/vnd.mpegurl',\n 'nc' =>'application/x-netcdf',\n 'oda' =>'application/oda',\n 'ogg' =>'application/ogg',\n 'pbm' =>'image/x-portable-bitmap',\n 'pdb' =>'chemical/x-pdb',\n 'pdf' =>'application/pdf',\n 'pgm' =>'image/x-portable-graymap',\n 'pgn' =>'application/x-chess-pgn',\n 'php' =>'application/x-httpd-php',\n 'php4' =>'application/x-httpd-php',\n 'php3' =>'application/x-httpd-php',\n 'phtml' =>'application/x-httpd-php',\n 'phps' =>'application/x-httpd-php-source',\n 'png' =>'image/png',\n 'pnm' =>'image/x-portable-anymap',\n 'ppm' =>'image/x-portable-pixmap',\n 'ppt' =>'application/vnd.ms-powerpoint',\n 'ps' =>'application/postscript',\n 'qt' =>'video/quicktime',\n 'ra' =>'audio/x-pn-realaudio',\n 'ram' =>'audio/x-pn-realaudio',\n 'ras' =>'image/x-cmu-raster',\n 'rdf' =>'application/rdf+xml',\n 'rgb' =>'image/x-rgb',\n 'rm' =>'application/vnd.rn-realmedia',\n 'roff' =>'application/x-troff',\n 'rtf' =>'text/rtf',\n 'rtx' =>'text/richtext',\n 'sgm' =>'text/sgml',\n 'sgml' =>'text/sgml',\n 'sh' =>'application/x-sh',\n 'shar' =>'application/x-shar',\n 'shtml' =>'text/html',\n 'silo' =>'model/mesh',\n 'sit' =>'application/x-stuffit',\n 'skd' =>'application/x-koan',\n 'skm' =>'application/x-koan',\n 'skp' =>'application/x-koan',\n 'skt' =>'application/x-koan',\n 'smi' =>'application/smil',\n 'smil' =>'application/smil',\n 'snd' =>'audio/basic',\n 'spl' =>'application/x-futuresplash',\n 'src' =>'application/x-wais-source',\n 'sv4cpio' =>'application/x-sv4cpio',\n 'sv4crc' =>'application/x-sv4crc',\n 'svg' =>'image/svg+xml',\n 'swf' =>'application/x-shockwave-flash',\n 't' =>'application/x-troff',\n 'tar' =>'application/x-tar',\n 'tcl' =>'application/x-tcl',\n 'tex' =>'application/x-tex',\n 'texi' =>'application/x-texinfo',\n 'texinfo' =>'application/x-texinfo',\n 'tgz' =>'application/x-tar',\n 'tif' =>'image/tiff',\n 'tiff' =>'image/tiff',\n 'tr' =>'application/x-troff',\n 'tsv' =>'text/tab-separated-values',\n 'txt' =>'text/plain',\n 'ustar' =>'application/x-ustar',\n 'vcd' =>'application/x-cdlink',\n 'vrml' =>'model/vrml',\n 'vxml' =>'application/voicexml+xml',\n 'wav' =>'audio/x-wav',\n 'wbmp' =>'image/vnd.wap.wbmp',\n 'wbxml' =>'application/vnd.wap.wbxml',\n 'wml' =>'text/vnd.wap.wml',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmls' =>'text/vnd.wap.wmlscript',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wrl' =>'model/vrml',\n 'xbm' =>'image/x-xbitmap',\n 'xht' =>'application/xhtml+xml',\n 'xhtml' =>'application/xhtml+xml',\n 'xls' =>'application/vnd.ms-excel',\n 'xml xsl' =>'application/xml',\n 'xpm' =>'image/x-xpixmap',\n 'xslt' =>'application/xslt+xml',\n 'xul' =>'application/vnd.mozilla.xul+xml',\n 'xwd' =>'image/x-xwindowdump',\n 'xyz' =>'chemical/x-xyz',\n 'zip' =>'application/zip'\n );\n\n $ext = trim(strtolower($ext));\n if (array_key_exists($ext,$mimetypes))\n {\n atkdebug(\"Filetype for $filename is {$mimetypes[$ext]}\");\n return $mimetypes[$ext];\n }\n else\n {\n atkdebug(\"Filetype for $filename could not be found. Returning application/octet-stream.\");\n return \"application/octet-stream\";\n }\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 testSetAllowedMimeTypesIllegal() {\n // list is only checked against during upload, so expect success here.\n $mytype = array('application/x-perl' => 'pl');\n $this->up->setAllowedMimeTypes($mytype);\n $this->assertEquals($mytype, $this->up->getAllowedMimeTypes());\n }", "function get_available_post_mime_types($type = 'attachment')\n {\n }", "function fn_get_ext_mime_types($key = 'ext')\n{\n $types = array (\n 'zip' => 'application/zip',\n 'tgz' => 'application/tgz',\n 'rar' => 'application/rar',\n\n 'exe' => 'application/exe',\n 'com' => 'application/com',\n 'bat' => 'application/bat',\n\n 'png' => 'image/png',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/x-icon',\n 'swf' => 'application/x-shockwave-flash',\n\n 'csv' => 'text/csv',\n 'txt' => 'text/plain',\n 'xml' => 'application/xml',\n 'doc' => 'application/msword',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'pdf' => 'application/pdf',\n\n 'css' => 'text/css',\n 'js' => 'text/javascript'\n );\n\n if ($key == 'mime') {\n $types = array_flip($types);\n }\n\n return $types;\n}", "private function readTypes() {\n $files = $this->path->read();\n\n foreach ($files as $file) {\n if ($file->isDirectory()) {\n continue;\n }\n\n $this->readType($file->getName());\n }\n }", "public function checkInlineFileTypeAccessForFieldFiletypesSetRecordTypeInListReturnsTrue() {}", "function choose_image($file_name)\n{\n static $type, $image;\n\n /* TABLES INITIALISATION */\n if (!$type || !$image) {\n $type['word'] = array(\n 'doc',\n 'dot',\n 'rtf',\n 'mcw',\n 'wps',\n 'psw',\n 'docm',\n 'docx',\n 'dotm',\n 'dotx',\n );\n $type['web'] = array(\n 'htm',\n 'html',\n 'htx',\n 'xml',\n 'xsl',\n 'php',\n 'xhtml',\n );\n $type['image'] = array(\n 'gif',\n 'jpg',\n 'png',\n 'bmp',\n 'jpeg',\n 'tif',\n 'tiff',\n );\n $type['image_vect'] = array('svg', 'svgz');\n $type['audio'] = array(\n 'wav',\n 'mid',\n 'mp2',\n 'mp3',\n 'midi',\n 'sib',\n 'amr',\n 'kar',\n 'oga',\n 'au',\n 'wma',\n );\n $type['video'] = array(\n 'mp4',\n 'mov',\n 'rm',\n 'pls',\n 'mpg',\n 'mpeg',\n 'm2v',\n 'm4v',\n 'flv',\n 'f4v',\n 'avi',\n 'wmv',\n 'asf',\n '3gp',\n 'ogv',\n 'ogg',\n 'ogx',\n 'webm',\n );\n $type['excel'] = array(\n 'xls',\n 'xlt',\n 'xls',\n 'xlt',\n 'pxl',\n 'xlsx',\n 'xlsm',\n 'xlam',\n 'xlsb',\n 'xltm',\n 'xltx',\n );\n $type['compressed'] = array('zip', 'tar', 'rar', 'gz');\n $type['code'] = array(\n 'js',\n 'cpp',\n 'c',\n 'java',\n 'phps',\n 'jsp',\n 'asp',\n 'aspx',\n 'cfm',\n );\n $type['acrobat'] = array('pdf');\n $type['powerpoint'] = array(\n 'ppt',\n 'pps',\n 'pptm',\n 'pptx',\n 'potm',\n 'potx',\n 'ppam',\n 'ppsm',\n 'ppsx',\n );\n $type['flash'] = array('fla', 'swf');\n $type['text'] = array('txt', 'log');\n $type['oo_writer'] = array('odt', 'ott', 'sxw', 'stw');\n $type['oo_calc'] = array('ods', 'ots', 'sxc', 'stc');\n $type['oo_impress'] = array('odp', 'otp', 'sxi', 'sti');\n $type['oo_draw'] = array('odg', 'otg', 'sxd', 'std');\n $type['epub'] = array('epub');\n $type['java'] = array('class', 'jar');\n $type['freemind'] = array('mm');\n\n $image['word'] = 'word.gif';\n $image['web'] = 'file_html.gif';\n $image['image'] = 'file_image.gif';\n $image['image_vect'] = 'file_svg.png';\n $image['audio'] = 'file_sound.gif';\n $image['video'] = 'film.gif';\n $image['excel'] = 'excel.gif';\n $image['compressed'] = 'file_zip.gif';\n $image['code'] = 'icons/22/mime_code.png';\n $image['acrobat'] = 'file_pdf.gif';\n $image['powerpoint'] = 'powerpoint.gif';\n $image['flash'] = 'file_flash.gif';\n $image['text'] = 'icons/22/mime_text.png';\n $image['oo_writer'] = 'file_oo_writer.gif';\n $image['oo_calc'] = 'file_oo_calc.gif';\n $image['oo_impress'] = 'file_oo_impress.gif';\n $image['oo_draw'] = 'file_oo_draw.gif';\n $image['epub'] = 'file_epub.gif';\n $image['java'] = 'file_java.png';\n $image['freemind'] = 'file_freemind.png';\n }\n\n $extension = array();\n if (!is_array($file_name)) {\n if (preg_match('/\\.([[:alnum:]]+)(\\?|$)/', $file_name, $extension)) {\n $extension[1] = strtolower($extension[1]);\n\n foreach ($type as $generic_type => $extension_list) {\n if (in_array($extension[1], $extension_list)) {\n return $image[$generic_type];\n }\n }\n }\n }\n\n return 'defaut.gif';\n}", "public function testIgnoreCheckMimeType() {\n // the check can be disabled\n $up2 = new upload();\n $up2->setIgnoreMimeCheck(true);\n $this->assertTrue($up2->checkMimeType());\n }", "abstract protected function getFileExtension();", "function quota_upload_filetypes($types) {\n\tif (zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS) || (getoption('quota_allowZIP'))) {\n\t\treturn $types;\n\t}\n\t$key = array_search('ZIP', $types);\n\tif ($key !== false) unset($types[$key]);\n\treturn $types;\n}", "function add_upload_types( $existing_mimes ) {\n\t\t$existing_mimes['ico'] = 'image/vnd.microsoft.icon';\n\t\t$existing_mimes['eot'] = 'application/vnd.ms-fontobject';\n\t\t$existing_mimes['woff2'] = 'application/x-woff';\n\t\t$existing_mimes['woff'] = 'application/x-woff';\n\t\t$existing_mimes['ttf'] = 'application/octet-stream';\n\t\t$existing_mimes['svg'] = 'image/svg+xml';\n\t\t$existing_mimes['mp4'] = 'video/mp4';\n\t\t$existing_mimes['ogv'] = 'video/ogg';\n\t\t$existing_mimes['webm'] = 'video/webm';\n\t\treturn $existing_mimes;\n\t}", "function getMIMEType( $sFileName = \"\" ) { \r\n $sFileName = strtolower( trim( $sFileName ) ); \r\n if( ! strlen( $sFileName ) ) return \"\"; \r\n \r\n $aMimeType = array( \r\n \"txt\" => \"text/plain\" , \r\n \"pdf\" => \"application/pdf\" , \r\n \"zip\" => \"application/x-compressed\" , \r\n \r\n \"html\" => \"text/html\" , \r\n \"htm\" => \"text/html\" , \r\n \r\n \"avi\" => \"video/avi\" , \r\n \"mpg\" => \"video/mpeg \" , \r\n \"wav\" => \"audio/wav\" , \r\n \r\n \"jpg\" => \"image/jpeg \" , \r\n \"gif\" => \"image/gif\" , \r\n \"tif\" => \"image/tiff \" , \r\n \"png\" => \"image/x-png\" , \r\n \"bmp\" => \"image/bmp\" \r\n ); \r\n $aFile = split( \"\\.\", basename( $sFileName ) ) ; \r\n $nDiminson = count( $aFile ) ; \r\n $sExt = $aFile[ $nDiminson - 1 ] ; // get last part: like \".tar.zip\", return \"zip\" \r\n \r\n return ( $nDiminson > 1 ) ? $aMimeType[ $sExt ] : \"\"; \r\n}", "function getMimeType() ;", "public function MimeType();" ]
[ "0.7637471", "0.71792746", "0.70807767", "0.70572215", "0.7029141", "0.6989566", "0.69383556", "0.6920997", "0.6912857", "0.6905421", "0.69052345", "0.68998796", "0.6875097", "0.68642384", "0.68600273", "0.68121755", "0.6781184", "0.67681396", "0.6765715", "0.67581457", "0.67291707", "0.66928", "0.666676", "0.665321", "0.66510135", "0.6640005", "0.65749544", "0.65641916", "0.6562047", "0.6544666", "0.653357", "0.65253437", "0.65006584", "0.64475703", "0.64394176", "0.6428718", "0.6426062", "0.64222074", "0.64146477", "0.64045066", "0.6391835", "0.63865244", "0.63661224", "0.63399184", "0.632574", "0.63085693", "0.63080096", "0.6305291", "0.6296817", "0.6290315", "0.6279399", "0.62785083", "0.62735623", "0.627062", "0.62675464", "0.6264826", "0.6229263", "0.6226478", "0.622387", "0.62227464", "0.62224084", "0.62201464", "0.6218304", "0.6199779", "0.6178933", "0.61760306", "0.6164237", "0.6156923", "0.615676", "0.6155746", "0.6148428", "0.6137811", "0.613565", "0.613505", "0.61273926", "0.6114404", "0.6103581", "0.6097707", "0.6079505", "0.60765296", "0.6073798", "0.6061218", "0.6060914", "0.60586596", "0.60533977", "0.6049166", "0.603657", "0.6026021", "0.60247916", "0.6024505", "0.60176015", "0.60155207", "0.6014267", "0.60112953", "0.60102993", "0.6000571", "0.60000354", "0.59950936", "0.5992676", "0.59877086" ]
0.74488544
1
Function is used to check size of file
function validateFileSize($postVar, $value, $error) { $errorMsg = ""; //checking if the $postVar['name'] value in an array or not if (is_array($postVar['name'])) { $totalFiles = count($postVar['name']); for ($i = 0; $i < $totalFiles; $i++) { if ($postVar['name'][$i]) { if ($postVar['size'][$i] > $value) { $errorMsg .= $error . " (" . $postVar['name'][$i] . ")<br>"; } } } //if not an arry then start from else part } else { if ($postVar['size'] > $value) { $errorMsg .= $error . " (" . $postVar['name'] . ")<br>"; } } return $errorMsg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_size($file)\n {\n return true;\n }", "function checkSize(){\n global $postpath;\n return (filesize($postpath) / 1000000) < 1;\n }", "function check_size($file)\n {\n $ret = false;\n if (!$this->_file_init($file)) return true;\n if ($this->_init_header())\n {\n\t$buf = fread($this->fd, 24);\n\t$tmp = unpack('H32id/Vlen/H8unused', $buf);\n\tif ($tmp['id'] == '3626b2758e66cf11a6d900aa0062ce6c')\n\t {\n\t $stat = fstat($this->fd);\n\t $ret = ($stat['size'] == ($this->head['len'] + $tmp['len']));\n\t }\n }\n $this->_file_deinit();\n return $ret;\n }", "function c_filesize($filename) {\r\n\r\n $serach_name=e_file_exists($filename);\r\n return filesize($serach_name);\r\n}", "function check_size($data)\n {\n try {\n $file_name = $data[\"file\"][\"name\"];\n if (!empty ($file_name)) {\n $size = $data[\"file\"][\"size\"];\n if ($size <= 1048576) { //1MB\n return true;\n }\n return false;\n }\n return true;\n } catch (Exception $exception) {\n echo $exception->getMessage();\n }\n }", "public function sizeFile(){\n if ($_FILES[\"fileToUpload\"][\"size\"] > 8300000) {\n echo \"Sorry, your file is too large.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }", "public function isValidSize( $size ){ return $size <= MAX_FILE_SIZE;}", "public function getSize() {\n\t\t$stat = fstat($this->handle);\n\t\treturn isset($stat['size']) ? $stat['size'] : false;\n\t}", "public function getSize($file);", "public function getSize(){\n $path = $this->aParams['path'] . $this->aParams['name'];\n if(\n is_null($this->aParams['size']) &&\n mb_strlen($this->aParams['path']) &&\n mb_strlen($this->aParams['name']) &&\n file_exists($path)\n\n ){\n $this->aParams['size'] = filesize($path);\n }\n return\n $this->aParams['size'] !== FALSE && $this->aParams['size'] !== null\n ? sprintf('%u', $this->aParams['size'])\n : NULL;\n }", "public function getSize()\n\t{\n\t\tif(!$this->__isFile())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn filesize($this->_path);\n\t}", "function filesize($filedata) {\r\n\t\treturn file_exists($filedata['tmp_name']) ? filesize($filedata['tmp_name']) : false;\r\n\t}", "public function checkSize()\r\n\t{\r\n\t\treturn ((abs(@filesize($this->targetFile) - @filesize($this->referenceFile))) < $this->sizeTol);\r\n\t}", "function checkFilesize($params = array(), $options = array()) {\n\t\t$val = array_shift($params);\n\t\tif ($val['size'] > $options['max_size']) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function check_file_size($file_size) {\nif ($file_size < 1000000) {\nreturn true;\n}else {\necho \"The file is too large to upload, please choose a file less than 500 mega byte\";\n}\n}", "public function getSize()\r\n {\r\n return filesize($this->filename);\r\n }", "public function validSize() {\n\t\tif($this->file['size'] <= $this->max_bytes) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function checkSize($file) {\n\n if ($file['size'] <= 2048000 && $file['size'] > 0) {\n\n return true;\n }\n\n return false;\n }", "public function testSizeOutputsSize()\n {\n $size = file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n\n $this->assertTrue($size === (int) Storage::size(self::$temp.DS.'foo.txt'));\n }", "public function getSize($path);", "public function size()\n {\n if ($this->exists()) {\n return filesize($this->path);\n }\n\n return false;\n }", "public static function getSize($path) {\n \n }", "static function size($file){\r\n\t\t$file = new File\\Instance($file);\r\n\t\treturn $file->Size();\r\n\t}", "function size($path)\t{\n\t\tif ($file = $this->file($path)) {\n\t\t\treturn filesize($file);\n\t\t}\n\t}", "public function getSize($path)\n {\n }", "function checkFileSize()\r\n\t{\r\n\t\tif ($this->file_size_max >= 0)\r\n\t\t{\r\n\t\t\t$post \t\t= $_FILES[$this->post_name];\r\n\t\t\t$size \t\t= ( !$this->isArrayPostName ) ? $post['size'] : $post['size'][$this->arrayPostName];\r\n\t\t\tif ($size > $this->file_size_max) return false;\r\n\t\t\telse return true;\r\n\t\t}else return true;\r\n\t}", "function ppom_get_filesize_in_kb( $file_name ) {\n\t\t\n\t$base_dir = ppom_get_dir_path();\n\t$file_path = $base_dir . 'confirmed/' . $file_name;\n\t\n\tif (file_exists($file_path)) {\n\t\t$size = filesize ( $file_path );\n\t\treturn round ( $size / 1024, 2 ) . ' KB';\n\t}elseif(file_exists( $base_dir . '/' . $file_name ) ){\n\t\t$size = filesize ( $base_dir . '/' . $file_name );\n\t\treturn round ( $size / 1024, 2 ) . ' KB';\n\t}\n\t\n}", "public function getSize() {\n\t\treturn filesize($this->getPath());\n\t}", "public function getSize()\n\t{\n\t\treturn filesize($this->tmp_name);\n\t}", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function checkSize($fileSize){\n \t\tif ($fileSize < 102400){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}", "public function size($file)\n {\n }", "public function size() {\n\t\treturn filesize($this->_path);\n\t}", "public function getSize()\n {\n return $this->file->getSize();\n }", "public function getSize()\n {\n return $this->file['size'];\n }", "public function getFilesize()\n {\n return $this->filesize;\n }", "public function getSize()\n {\n return $this->fileStructure->size;\n }", "public function filesizeValid()\n\t{\n\t\tif ($this->files['size'] > $this->max_filesize) {\n\t\t\tthrow new Exception(\"File is too big\",7);\n\t\t}\n\n\t\t//Check that the file is not too less\n\t\tif ($this->files['size'] < $this->min_filesize) {\n\t\t throw new Exception(\"File is too less than\",8);\n\t\t}\n\t\n\t}", "public static function size($_path)\r\n {\r\n return filesize($_path);\r\n }", "public function getSize() {\r\n\t\treturn $this->app->filesystem->formatFilesize($this->get('size', 0));\r\n\t}", "public function size()\n {\n return $this->getPackage('FileStation')->size($this->path);\n }", "public function getSize()\n {\n return filesize($this->file) ?: null;\n }", "function upload_is_file_too_big($upload)\n {\n }", "function size($file) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\t$res = @ftp_size($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpSizeException($file);\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}", "function size($pathname)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\t$response = ftp_size($this->_socket);\r\n \t} else {\r\n \t$this->putcmd(\"SIZE\", $pathname);\r\n \t$response = $this->getresp();\r\n \t}\r\n \tif (!$response) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif (ereg(\"^[123]\", $response)) {\r\n \t\treturn ereg_replace(\"^[0-9]{3} ([0-9]+)\\r\\n\", \"\\\\1\", $response);\r\n \t} else {\r\n \t\treturn -1;\r\n \t}\r\n }", "public static function size (string $path, bool $format = true, bool $space_between = true): string|int|false {\n if (filter_var($path, FILTER_VALIDATE_URL)) {\n $ch = curl_init($path);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, true);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_exec($ch);\n $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);\n curl_close($ch);\n }\n else {\n $path = realpath($path);\n $size = file_exists($path) ? filesize($path) : false;\n }\n if (isset($size) && is_numeric($size)) {\n return $format ? tools::byteFormat($size, space_between: $space_between) : $size;\n }\n return false;\n }", "function get_file_size($filename) {\n\t$domain = $_SERVER['HTTP_HOST'];\n\t$script = $_SERVER['SCRIPT_NAME'];\n\t$currentfile = basename($script);\n\t$fullurl = \"http://$domain\".str_replace($currentfile, '', $script).$filename;\n\t\n\t// Context for file_get_contents HEAD request\n\t$context = stream_context_create(array('http'=>array('method'=>'HEAD')));\n\t\n\t// file_get_contents HEAD request\n\t$request = file_get_contents($fullurl, false, $context);\n\t\n\t// Go through each response header and search for Content-Length\n\tforeach($http_response_header as $hrh) {\n\t\tif(strpos($hrh, 'Content-Length') !== false) {\n\t\t\t$size = str_replace('Content-Length:', '', $hrh);\n\t\t\t$size = trim($size);\n\t\t}\n\t}\n\treturn $size;\n}", "public static function size($path)\n\t{\n\t\treturn filesize($path);\n\t}", "public static function size($path)\n\t{\n\t\treturn filesize($path);\n\t}", "function wp_filesize($path)\n {\n }", "public function size($key) {\n\t\t$result = 0;\n\t\t$proxyStatus = \\OC_FileProxy::$enabled;\n\t\t\\OC_FileProxy::$enabled = false;\n\t\tif ($this->hasKey($key)) {\n\t\t\t$storage = $this->getStorage();\n\t\t\t$result = $storage->filesize($key);\n\t\t}\n\t\t\\OC_FileProxy::$enabled = $proxyStatus;\n\t\treturn $result;\n\t}", "public function check_file_sizes($filename){\n\t\t\t$error['error_exists'] = false; \n\t\t\t$error['error_message'] = false; \n\n\t\t\tif (filesize($filename) == null){\n\t\t\t\t$error['error_exists'] = true; \n\t\t\t\t$error['error_message'] = $this->file_uploading_settings['file_not_exist']; \n\n\t\t\t}\n\t\t\telse if (filesize($filename) > $this->file_uploading_settings['max_size']){\n\t\t\t\t$error['error_exists'] = true; \n\t\t\t\t$error['error_message'] = $this->file_uploading_settings['file_too_big'];\n\t\t\t}\n\n\t\t\treturn $error;\n\t\t}", "public function getSize() {\n return $_FILES['uploadfile']['size'];\n }", "public function getFile_size() {\n return $this->_file_size ? (int) $this->_file_size : null;\n }", "public function getSize() : int\n {\n if (null === $this->size) {\n if (!file_exists($this)) {\n throw new Exception(sprintf('target file \\'%s\\' doesn\\'t exist', $this->getFilename()));\n }\n $this->size = filesize($this);\n }\n return $this->size;\n }", "function check_file_size($str, $max_size = 0)\n{\n if (!$max_size) {\n $max_size = IMG_UPLOAD_MAX_SIZE;\n }\n $file_size = $str['size'];\n if ($file_size > $max_size)\n return false;\n else\n return true;\n}", "public function getSize()\n {\n return $this->fileInfo['size'];\n }", "public function length() {\r\n return filesize($this->fullName());\r\n }", "public function supportsFileSize()\n\t{\n\t\treturn $this->supportsFileSize;\n\t}", "public function getSize()\n {\n return $this->fstat()[\"size\"];\n }", "private function checkSize()\n {\n $allowedSize = intval($this->getSetting('allowed_upload_size', true));\n if ($allowedSize) {\n if ($this->file->getSize() > $allowedSize) {\n throw new FileException(\"File cannot be bigger than $allowedSize bytes\");\n }\n }\n }", "function getSize() ;", "function acf_get_filesize($size = 1)\n{\n}", "public function getSize()\n {\n $size = null;\n\n if ($this->stream) {\n $stats = fstat($this->stream);\n $size = $stats['size'];\n }\n\n return $size;\n }", "private function find_filesize($file){\n\n if(substr(PHP_OS, 0, 3) == \"WIN\"){\n\n exec('for %I in (\"'.$file.'\") do @echo %~zI', $output);\n $return = $output[0];\n\n }else{\n\n $return = filesize($file);\n\n // SOURCE :: https://www.php.net/manual/en/function.filesize.php\n // AUTHOR :: https://www.php.net/manual/en/function.filesize.php#121437\n //$fsobj = new COM(\"Scripting.FileSystemObject\");\n //$f = $fsobj->GetFile($file);\n //$return = $f->Size;\n\n }\n\n return $return;\n\n }", "public function getSize($path)\n {\n if ($metaData = $this->getMetadata($path)) {\n return $this->normalizeResponse([\n 'size' => $metaData['content-length'],\n ], $path);\n }\n\n return false;\n }", "public function getSavedSize(){\n\t\t$savedFile=$this->getSavePath().$this->getNameWithExtension();\n\t\tif(is_file($savedFile) && file_exists($savedFile)) {\n\t\t\treturn filesize($savedFile);\n\t\t}\n\t\treturn false;\n\t}", "public function getLength()\n {\n return filesize($this->fullPath);\n }", "public static function getSizeOfRemoteFile($url)\r\n\t{\r\n\t\t$headers = @get_headers($url, 1);\r\n\t\tif ($headers !== false && is_array($headers) && isset($headers['Content-Length'])) {\r\n\t\t\treturn $headers['Content-Length'];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function getFileSize() {\n\t\treturn filesize($this->filename);\n\t}", "public function get_size_image($img){\n if ($this->get_path_pic($img)){\n return filesize($this->get_path_pic($img)); \n }else{\n return false;\n }\n \n }", "function getSize() {\n\t\treturn $this->data_array['filesize'];\n\t}", "public function get_file_size()\n\t{\n if (!$this->file_size) {\n if ($this->local_file) {\n $this->file_size = filesize($this->local_file);\n } else {\n $object = upload_aws2::$client->listObjects(array(\n 'Bucket' => $this->bucket,\n 'Prefix' => $this->location\n ));\n $this->file_size = $object['Contents'][0]['Size'];\n }\n }\n return $this->file_size;\n\t}", "function tdc_get_filesize($filenode){\n $file_path = tdc_get_filepath($filenode);\n $file_name = tdc_get_filename($filenode);\n $full_path = TDC_DOC_ROOT . $file_path . \"/\" .$file_name;\n $size = filesize($full_path);\n return human_filesize($size);\n}", "public function getSize($path)\n {\n $meta = $this->getMetadata($path);\n return isset($meta['size'])\n ? ['size' => $meta['size']] : false;\n }", "public function filesize()\n {\n $size =\n round(\n (filesize('/var/www/html/web'.$this->getSrc()) / 1000),\n 2\n );\n\n // Clear cache\n clearstatcache();\n // Return result\n return $size . ' Kb';\n }", "function validSize($size)\n {\n return $size > 1;\n }", "public function read_image_file_size($url){\n\t\t\n if (strpos($url, 'http') !== false){\n\t\t\t\n\t\t try{\n\n\t\t // $time_ini_check_url_size = microtime(1);\n\t\t \n\t\t if (isset($this->stored_url_files_sizes[$url])){\n\n\t\t // sl_debbug('# time_check_size_url stored: '.(microtime(1) - $time_ini_check_url_size).' seconds.', 'timer');\n\t\t return $this->stored_url_files_sizes[$url];\n\n\t\t }else{\n\t\t \n\t\t $image_url_info = pathinfo($url);\n\t\t $filename_encoded = $image_url_info['basename'];\t \n\t\t $filename_encoded = rawurlencode(rawurldecode($filename_encoded));\n\t\t $image_url_encoded = $image_url_info['dirname'].'/'.$filename_encoded;\n\n\t\t $headers = get_headers($image_url_encoded, TRUE);\n\t\t // sl_debbug('# time_check_size_url: '.(microtime(1) - $time_ini_check_url_size).' seconds.', 'timer');\n\n\t\t }\n\n\t\t }catch(\\Exception $e){\n\n\t\t sl_debbug(\"## Error. Remote image with URL \".$url.\" couldn't been synchronized: \".$e->getMessage());\n\t\t return false;\n\n\t\t }\n\n\t\t if (isset($headers['Content-Length'])){\n\t\t \n\t\t $this->stored_url_files_sizes[$url] = $headers['Content-Length'];\n\t\t return $headers['Content-Length'];\n\t\t \n\t\t }else if (isset($headers['content-length'])){\n\t\t \n\t\t $this->stored_url_files_sizes[$url] = $headers['content-length'];\n\t\t return $headers['content-length'];\n\t\t \n\t\t }\n\t\t\n\t\t return false;\n\n\t\t}else{\n\t\t\t\n\t\t try{\n\n\t\t // $time_ini_check_local_size = microtime(1);\n\t\t $url_filesize = filesize($url);\n\t\t clearstatcache();\n\t\t // sl_debbug('# time_check_size_local: '.(microtime(1) - $time_ini_check_local_size).' seconds.', 'timer');\n\t\t return $url_filesize; \n\n\t\t }catch(\\Exception $e){\n\n\t\t sl_debbug(\"## Notice. Could not read local image with URL \".$url.\" : \".$e->getMessage());\n\n\t\t }\n\t\t \n\t\t return false;\n\n\t\t}\n\t\t\n\t}", "function file_size($size)\r\n\r\n{\r\n\r\n\t$units = array('b', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb');\r\n\r\n\r\n\r\n\tfor ($i = 0; $size > 1024; $i++)\r\n\r\n\t\t$size /= 1024;\r\n\r\n\r\n\r\n\treturn round($size, 2).' '.$units[$i];\r\n\r\n}", "function fm_get_size($path, $rawbytes = 0) {\r\n\tif (!is_dir($path)) {\r\n\t\treturn fm_readable_filesize(@filesize($path));\r\n\t}\r\n\t$dir = opendir($path);\r\n\t$size = 0;\r\n\twhile ($file = readdir($dir)) {\r\n\t\tif (is_dir($path.\"/\".$file) && $file != \".\" && $file != \"..\") {\r\n\t\t\t$size += fm_get_size($path.\"/\".$file, 1);\r\n\t\t} else {\r\n\t\t\t$size += @filesize($path.\"/\".$file);\r\n\t\t}\r\n\t}\r\n\tif ($rawbytes == 1) {\r\n\t\treturn $size;\r\n\t}\r\n\tif ($size == 0) {\r\n\t\treturn \"0 Bytes\";\r\n\t} else {\r\n\t\treturn fm_readable_filesize($size);\r\n\t}\r\n}", "public function getSize()\n {\n $curl_options = array (\n CURLOPT_HEADER => 1,\n CURLOPT_NOBODY => 1,\n CURLOPT_RETURNTRANSFER => 1,\n );\n\n $headers = $this->curl_query($curl_options);\n\n if (!$headers) return false;\n\n /* grep Content-Length from response */\n preg_match('/(Content-Length: \\d{1,})/', $headers, $content_length);\n preg_match('/\\d{1,}/', $content_length[0], $size);\n\n return intval($size[0]);\n }", "public function isAllowedFileSize()\n {\n if (empty($this->max_upload_size)) {\n $this->max_upload_size = ini_get('upload_max_filesize');\n }\n\n if ($this->_file_info['size'] > $this->max_upload_size) {\n NUCLEUS_Exceptions::catcher(UPLOAD_FILESIZE_DENIED);\n return false;\n }\n\n return true;\n }", "function has_image_size($name)\n {\n }", "protected function getResourceLength(): int\n {\n if (null === $this->fileName) {\n return parent::getResourceLength();\n }\n\n if (substr($this->fileName, 0, 16) === 'compress.zlib://') {\n return filesize(substr($this->fileName, 16));\n } elseif (substr($this->fileName, 0, 17) === 'compress.bzip2://') {\n return filesize(substr($this->fileName, 17));\n }\n\n return parent::getResourceLength();\n }", "public function getSize()\n {\n $this->size = 0;\n\n if (count($this->temp_files) > 0) {\n\n foreach ($this->temp_files as $file) {\n $this->size = $this->size + (int)$file->size;\n }\n }\n\n return;\n }", "public function size($remoteFilename) {\n if (false !== $this->connection) {\n return ftp_size($this->connection, $remoteFilename);\n }\n return false;\n }", "public static function size($path)\r\n {\r\n $path = Akt_Filesystem_Path::clean($path);\r\n\r\n if (!is_file($path)) {\r\n throw new Exception(\"File '{$path}' not found\");\r\n }\r\n\r\n $filesize = @filesize($path);\r\n\r\n if ($filesize === false) {\r\n throw new Exception(\"Couldn't get file size\");\r\n }\r\n\r\n return sprintf(\"%u\", $filesize);\r\n }", "public function hasSize() {\n return $this->_has(2);\n }", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "function getDestinationSize()\n {\n return filesize($this->destinationFilePath);;\n }" ]
[ "0.87704587", "0.8042931", "0.8042358", "0.795538", "0.7830275", "0.7794612", "0.7789529", "0.77887976", "0.77471703", "0.7677621", "0.7613836", "0.7583823", "0.7565024", "0.75421304", "0.74471027", "0.7414658", "0.73953784", "0.7358625", "0.730078", "0.72914296", "0.72663337", "0.72084963", "0.7192524", "0.7176804", "0.7154948", "0.71154416", "0.7097526", "0.7088242", "0.7082339", "0.706663", "0.706663", "0.706663", "0.70663774", "0.70657176", "0.70649695", "0.7062354", "0.70515585", "0.704833", "0.7045845", "0.7043583", "0.7039627", "0.7029179", "0.70155746", "0.69842654", "0.69700456", "0.6940967", "0.6930415", "0.68827045", "0.6863255", "0.68516916", "0.6847998", "0.6847998", "0.6831843", "0.68314976", "0.68284357", "0.68100786", "0.6798083", "0.679221", "0.6784676", "0.67826176", "0.6753545", "0.67496514", "0.67487425", "0.6747829", "0.6732015", "0.6727579", "0.67166656", "0.6710725", "0.670434", "0.66985404", "0.6698131", "0.6695002", "0.6693194", "0.6685375", "0.6677457", "0.66757846", "0.66262376", "0.66173494", "0.66172045", "0.66147566", "0.6585905", "0.65855116", "0.6566314", "0.65629685", "0.655372", "0.65527683", "0.65485156", "0.65428483", "0.65276444", "0.6521431", "0.65191424", "0.6510411", "0.6510411", "0.6510411", "0.6510411", "0.6510411", "0.6510411", "0.6510411", "0.6510411", "0.6510411", "0.6504738" ]
0.0
-1
Function is used to check availble phone type
function availablePhoneType($country) { //checking country name extension switch ($country) { case "in": # India $type[0] = '/^[0-9]{6,10}$/'; # (+91)[022]111111 $type[1] = '/^[\(][\+][0-9]{2}[\)][\[][0-9]{3,5}[\]][0-9]{6,10}$/'; # +91022111111 $type[2] = '/^[\+][0-9]{2}[0-9]{3,5}[0-9]{6,10}$/'; # 91-111111 $type[3] = '/^[0-9]{2}[\-][0-9]{6,10}$/'; break; case "br": # Brazil $type[0] = '/^([0-9]{2})?(\([0-9]{2})\)([0-9]{3}|[0-9]{4})-[0-9]{4}$/'; break; case "fr": # France $type[0] = '/^([0-9]{2})?(\([0-9]{2})\)([0-9]{3}|[0-9]{4})-[0-9]{4}$/'; break; case "us": # US $type[0] = '/^[\(][0-9]{3}[\)][0-9]{3}[\-][0-9]{4}$/'; break; case "sw": # Swedish $type[0] = '/^(([+][0-9]{2}[ ][1-9][0-9]{0,2}[ ])|([0][0-9]{1,3}[-]))(([0-9]{2}([ ][0-9]{2}){2})|([0-9]{3}([ ][0-9]{3})*([ ][0-9]{2})+))$/'; break; } return $type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasTelephoneExtension(): bool;", "public function hasTelephone(): bool;", "public function typePhone($number)\n {\n try {\n // Initialize CURL:\n $ch = curl_init('http://apilayer.net/api/validate?access_key='.$this->tokenPhone.'&number='.$number.'');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // Store the data:\n $json = curl_exec($ch);\n curl_close($ch);\n\n // Decode JSON response:\n $validationResult = json_decode($json, true);\n\n if($validationResult['valid']){\n return $validationResult['line_type'];\n }\n return false;\n } catch (\\Exception $e){\n return false;\n }\n }", "public function hasVerifiedPhone();", "function is_phone_available($phone) {\n\t\t// Load Models\n\t\t$this->ci->load->model('dx_auth/users', 'users');\n\t\t//$this->ci->load->model('dx_auth/user_temp', 'user_temp');\n\n\t\t$users = $this->ci->users->check_phone($phone);\n\t\t//$temp = $this->ci->user_temp->check_phone($phone);\n\t\t\n\t\t//return $users->num_rows() + $temp->num_rows() == 0;\n\t\treturn $users->num_rows() == 0;\n\t}", "function is_phone_stored($phoneNumber){\n $data = array(\"phone\"=>$phoneNumber);\n $status = CallAPI(\"ussd.myfarmnow.com/api/verifyphone\", $data);\n if($status == 1){\n return true;\n }elseif($status == 0){\n return false;\n }\n}", "function checkPhoneNumber($telefono): bool {\n return is_string($telefono) and preg_match(\"/^([+][0-9]{1,3})?[0-9]{4,13}$/\", $telefono);\n}", "function read_extension_phone_number_detect_sms_feature(){\n global $platform;\n $endpoint = \"/restapi/v1.0/account/~/extension/~/phone-number\";\n $resp = $platform->get($endpoint);\n $jsonObj = $resp->json();\n foreach ($resp->json()->records as $record){\n foreach ($record->features as $feature){\n if ($feature == \"SmsSender\"){\n // If a user has multiple phone numbers, check and decide which number\n // to be used for sending SMS message.\n return send_sms($record->phoneNumber);\n }\n }\n }\n if (count($jsonObj->records) == 0){\n exit(\"This user does not own a phone number!\");\n }else{\n exit(\"None of this user's phone number(s) has the SMS capability!\");\n }\n}", "function validPhone($phone)\r\n {\r\n return strlen((string)$phone) == 10 && is_numeric($phone);\r\n }", "static function is_phone($phone) {\n $stripped=preg_replace(\"(\\(|\\)|\\-|\\.|\\+|[ ]+)\",\"\",$phone);\n return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>16)))?false:true;\n }", "public function isMobilePhone () : bool {\n\t}", "function validate_phone($phone)\n{\n $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n // Check the lenght of number\n // This can be customized if you want phone number from a specific country\n if (strlen($filtered_phone_number) != 12) {\n return false;\n } else {\n return true;\n }\n}", "function check_authcode_phone($phone,$code_type,$user_id=\"\")\n {\n\t\tif($phone)\n\t\t{\n\t\t\tif($this->_redis)\n\t\t\t{\n\n\t\t\t\t$errorcode=$this->check_auth('phone',sha1($phone));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->select(\"id\");\n\t\t\t\t$this->db->from($this->_table);\n\t\t\t\t$this->db->where(\"phone\",sha1($phone));//需要通过服务获得加密后的电话号码\n\t\t\t\t$this->db->where(\"code_type\",$code_type);\n\t\t\t\t$this->db->where(\"has_verified\",0);\n\t\t\t\t$this->db->where(\"generate_time >\",date(\"Y-m-d H:i:s\",strtotime(date(\"Y-m-d H:i:s\").\" - \".Constant::SEND_AUTHCODE_INTERVAL_PHONE)));\n\t\t\t\t$query=$this->db->get();\n\t\t\t\t$total=$query->num_rows();\n\t\t\t\tif($total>0) $errorcode=true;\n\t\t\t\telse $errorcode=false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errorcode=true;\n\t\t}\n\t\treturn array(\"errorcode\"=>$errorcode);\t\n }", "public function isPhoneType($type)\n {\n // Legacy support.\n $type = ($type == 'LANDLINE' ? 'FIXED_LINE' : $type);\n\n return defined('\\libphonenumber\\PhoneNumberType::' . strtoupper($type));\n }", "function validPhone($phone)\r\n {\r\n\r\n return !empty($phone) && ctype_digit($phone);\r\n\r\n }", "function isPhone($strCol){\n\t\t$strCol = trim($strCol);\n\t\tif($strCol != '' and (stripos(strtolower($strCol), 'phone')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'phone')!== false and stripos(strtolower($strCol), 'number')!== false ) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'phone')!== false and stripos(strtolower($strCol), 'no')!== false ) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'phone_number')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'phone-number')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'phone')!== false and stripos(strtolower($strCol), '#')!== false ) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'phone_#')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'phone-#')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'telephone')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'telephone')!== false and stripos(strtolower($strCol), 'number')!== false ) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'telephone')!== false and stripos(strtolower($strCol), '#')!== false ) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'Telephone_Number')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'Telephone-Number')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'tel')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'tel.')!== false) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'contact')!== false and stripos(strtolower($strCol), 'number')!== false ) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'contact')!== false and stripos(strtolower($strCol), 'no')!== false ) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'cell')!== false and stripos(strtolower($strCol), 'number')!== false ) ){\n\t\t\treturn true;\n\t\t}else if($strCol != '' and (stripos(strtolower($strCol), 'mobile')!== false and stripos(strtolower($strCol), 'number')!== false ) ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function valid_mobile() {\n return (strlen($this->mobile) == 10 && is_numeric($this->mobile));\n }", "public function hasPhone() {\n return $this->_has(5);\n }", "function isValidPhoneNumber($phone_number) {\n \t\t\n\t$phone_number_status = false; \n\t\n\t$phone_number = trim($phone_number);\n\t\n\tif (strlen($phone_number) == 12) \n\t{\n\t\t$pattern = \"/^2547(\\d{8})$/\";\n\t\tif (preg_match($pattern, $phone_number)) {\n\t\t\t$phone_number_status = true;\n\t\t}\n\t}\n\t\n\tif (strlen($phone_number) == 13) \n\t{\n\t\t$pattern = \"/^\\+2547(\\d{8})$/\";\n\t\tif (preg_match($pattern, $phone_number)) {\n\t\t\t$phone_number_status = true;\n\t\t}\n\t}\n\t\n\tif (strlen($phone_number) == 10) \n\t{\n\t\t$pattern = \"/^07(\\d{8})$/\";\n\t\tif (preg_match($pattern, $phone_number)) {\n\t\t\t$phone_number_status = true;\n\t\t}\n\t}\n\n\tif (strlen($phone_number) == 9) \n\t{\n\t\t$pattern = \"/^7(\\d{8})$/\";\n\t\tif (preg_match($pattern, $phone_number)) {\n\t\t\t$phone_number_status = true;\n\t\t}\n\t}\n\n return $phone_number_status;\n\t\n}", "private function _verifyPhoneType($type)\n {\n if (!array_key_exists($type, $this->_phoneTypes)) {\n throw new \\Exception('Phone type must be mobile, work, or home');\n }\n }", "function isValidPhone($phone) {\n return preg_match(\"/^((0|([\\+][4][4-8]))((7\\d{8}?)|([^7]\\d{6,8})))$/\", $phone);\n}", "function db_type_name_exists()\r\n {\r\n $toReturn = false;\r\n $dbmgr = new DB_Mgr(\"sites\");\r\n $stmt = \"SELECT count(*) FROM SI_PHONE_TYPE WHERE name = '\" . $this->name . \"'\";\r\n $dbmgr->query($stmt);\r\n $row = $dbmgr->get_a_row();\r\n $num = $row[0];\r\n return($num);\r\n }", "function validate_phone_num($nr)\n{\n $tel = preg_replace('/\\D+/', '', $nr);\n if (substr($tel, 0, 1) !== '0') {\n $int = substr_replace($tel, \"0\", 0, 0);\n }\n $tel = substr_replace($tel, \" 0 \", 0, 1);\n $tel = wordwrap($tel, 3, ' ', true);\n if (strlen($tel) != 13) {\n $status['sta'] = \"has-warning\";\n $status['err'] = 1;\n $_SESSION['message'] = \"Atentie! Numarul de telefon trebuie sa aiba exact 10 cifre\";\n $_SESSION['status'] = \"warning\";\n $_SESSION['icon'] = \"glyphicon-phone-alt\";\n } else {\n $status['sta'] = \"has-success\";\n $status['err'] = null;\n }\n $status['tel'] = $tel;\n return $status;\n}", "private function isTelephoneRequired()\n {\n return $this->eavConfig->getAttribute('customer_address', 'telephone')->getIsRequired();\n }", "public function isOnlineFromPhone()\n\t{\n\t\ttry\n\t\t{\n\t\t\tif ( !$this->isOnline() ) return FALSE;\n\t\n\t\t\treturn ( $this->__deviceDetector( $this->sessionData['browser'] ) === 'PHONE' );\n\t\t}\n\t\tcatch ( \\RuntimeException $e )\n\t\t{\n\t\t\tif ( method_exists( get_parent_class(), __FUNCTION__ ) )\n\t\t\t{\n\t\t\t\treturn call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\t}", "function phone_validation($num)\n{\n return preg_match(\"/^[0-9]+$/\", $num);\n}", "function checkPhoneNumberValidity($phoneNum='')\n\t{\n\t\tglobal $db737;\n\t\tif(!$phoneNum)\n\t\t\treturn;\n\t\t$phoneNumber =phoneNumberCheck($phoneNum);\n\t\tif($phoneNumber){\n\t\t\t$sql =\"select PHONE_NUM from newjs.PHONE_JUNK WHERE PHONE_NUM IN('$phoneNumber','0$phoneNumber')\";\n\t\t $res = mysql_query($sql,$db737) or die(\"$sql\".mysql_error($db737));\n\t\t if($row = mysql_fetch_array($res))\n\t\t\t\t$phoneJunk =true;\n\t\t}\n\t\tif($phoneNumber && !$phoneJunk)\n\t\t\treturn $phoneNumber;\n\t\treturn;\t\n\t}", "function mycheck_phone( $string ) {\n if ( preg_match( '/^[+]?([\\d]{0,3})?[\\(\\.\\-\\s]?([\\d]{3})[\\)\\.\\-\\s]*([\\d]{3})[\\.\\-\\s]?([\\d]{4})$/', $string ) ) {\n return TRUE;\n } else {\n return FALSE;\n }\n}", "function is_valid_mobile($mobile)\n{\n if (is_null($mobile) || strlen($mobile) != 11)\n {\n return false;\n }\n $pattern = \"/^1(3|4|5|7|8)\\d{9}$/\";\n return preg_match($pattern, $mobile) == 1;\n}", "function validate_phone($field_input, array &$field): bool\n{\n $default = \"/\\+3706(\\d{7})$/\";\n\n if (!empty($field_input)) {\n if (!preg_match_all($default, $field_input)) {\n $field['error'] = 'Number must be like +3706XXXXXXX';\n }\n }\n\n return true;\n\n}", "private function checkPhone($data) {\n\t\t$data = trim(str_replace(\" \", \"\", $data)); // Remove spaces: \"+1 (212) 555 1337\" ->\"+1(212)5551337\"\n\t\tif(substr($data,0,1)==\"+\") {$data = substr($data,1);} // Remove plus: \"1(212)5551337\"\n\t\t$data = str_replace(\"(\",\"\",$data);\t\t// Remove start parenthesis: \"1212)5551337\"\n\t\t$data = str_replace(\")\",\"\",$data);\t\t// Remove end parenthesis: \"12125551337\"\n\t\tif(is_numeric($data)) {return true;}\t// If it is numeric now, it is a valid phone number\n\t\treturn false;\n\t}", "public function PhoneNoCheck($phone=\"\"){\n\t\t\t\n\t\t// if (preg_match(\"/^\\(?(\\d{3})\\)?[-\\. ]?(\\d{3})[-\\. ]?(\\d{4})$/\",$phone))\n\t\t if (preg_match(\"/^\\s*(?:\\+?(\\d{1,3}))?[-. (]*(\\d{3})[-. )]*(\\d{3})[-. ]*(\\d{4})(?: *x(\\d+))?\\s*$/\",$phone))\n\t\t\treturn true;\n\t\telse\n\t\t return false;\n\t\t}", "function valid_gsm_no($mobile,$formating=0)\n//Check whether a given no. is valid gsm no. or not.\n{\n\tif($formating)\n\t{\n\t\tif(strlen($mobile)==10)\n\t\t\t$mobile='91'.$mobile;\n\t}\n\tif( strlen($mobile)!=12 || !(ctype_digit($mobile)) )\n\t\treturn 0;\n\telse\n\t{\n\t\tif((substr($mobile,2,2)=='94' or substr($mobile,2,2)=='96' or substr($mobile,2,2)=='97' or substr($mobile,2,2)=='98' or substr($mobile,2,2)=='99'))\n return 1;\n\t}\n\treturn 0;\n}", "function contains_phone_number($string)\r\n{\r\n // Check for phone number\r\n if(ereg(\"[[:digit:]]{3,10}[\\. /\\)\\(-]*[[:digit:]]{6,10}\", $string))\r\n {\r\n return(true);\r\n }\r\n\r\n // Passed the test\r\n return(false);\r\n}", "function vUSPhone( $phoneNo )\r\n\t\t{\r\n\t\t\t# Checks if number has dashes\r\n\t\t\tif( strpos( $phoneNo,'-' ) )\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?[-\\s.]?\\d{3}[-\\s.]\\d{4}/x', $phoneNo);\r\n\t\t\t\t\r\n\t\t\t# Checks if number has periods\r\n\t\t\telseif( strpos( $phoneNo,'.' ) )\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?[.]?\\d{3}[.]\\d{4}/x', $phoneNo);\r\n\t\t\t\r\n\t\t\t# Validate just numbers\t\r\n\t\t\telse\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?\\d{3}\\d{4}/x', $phoneNo);\r\n\t\t\t\r\n\t\t}", "public function has_phone() {\r\n return ! empty( $this->phone );\r\n }", "function validate_phone_number($phone)\n\t\t{\n\t\t\t// Allow +, - and . in phone number\n\t\t\t$filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n\t\t\t// Remove \"-\" from number\n\t\t\t$phone_to_check = str_replace(\"-\", \"\", $filtered_phone_number);\n\t\t\t// Check the lenght of number\n\t\t\t// This can be customized if you want phone number from a specific country\n\t\t\tif (strlen($phone_to_check) < 9 || strlen($phone_to_check) > 14) {\n\t\t\treturn false;\n\t\t\t} else {\n\t\t\treturn true;\n\t\t\t}\n\t\t}", "public function getPhone();", "function check_type_code($type_code){\n\t\t\tif($this->db->get_where('type',array('code' => $type_code))->num_rows() > 0){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function testPhone()\n {\n $this->assertTrue(RuValidation::phone('+7 (342) 1234567'));\n $this->assertTrue(RuValidation::phone('+7 (41144) 1234'));\n }", "function verifyPhone ($testString) {\n $regex = '/^(?:1(?:[. -])?)?(?:\\((?=\\d{3}\\)))?([2-9]\\d{2})(?:(?<=\\(\\d{3})\\))? ?(?:(?<=\\d{3})[.-])?([2-9]\\d{2})[. -]?(\\d{4})(?: (?i:ext)\\.? ?(\\d{1,5}))?$/';\n\treturn (preg_match($regex, $testString));\n}", "function validate_phone_number($phone)\n{\n // $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n // Remove \"-\" and \"+\" from number\n $bad = array(\" \", \"-\", \"+\");\n $phone_to_check = str_replace($bad, \"\", $phone);\n\n // echo $phone_to_check.\"<br>\";\n // Check the lenght of number\n // This can be customized if you want phone number from a specific country\n // $regex = '/^[0-9]+$/';\n if (!filter_var($phone_to_check, FILTER_VALIDATE_INT)) {\n // echo('stringfdssssssssss');\n // die;\n return array('valid' => false, \"msg\" => \"must contain digits 0-9 only.\");\n } elseif (strlen($phone_to_check) < 10 || strlen($phone_to_check) > 14) {\n return array('valid' => false, \"msg\" => \"must be between 10 and 14 digits.\");\n } else {\n return array('valid' => true, \"msg\" => \"\");\n }\n}", "function validate_phone($input) {\n // Possible formats: (408) 375-2798, 408-375-2798, 408 375 2798, 4083752798, 408.375.2798\n\n if(preg_match(\"/^[(]?[0-9]{3}[)]?[.\\s-]?[0-9]{3}[.\\s-]?[0-9]{4}$/\",$input)){\n return true;\n }\n \n return false;\n}", "static function isPhoneUsed(string $phone) {\n $sql = 'SELECT phone FROM users WHERE phone = '.$phone;\n $row = $db->query($sql);\n\n if (empty($row)) {\n return false;\n } else {\n return true;\n }\n }", "function check_link($url, $phone) {\n }", "function validateMobileNumber($field)\n{\n if (preg_match(\"/^(\\s*|(009665|9665|\\+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7}))$/\", $field)) {\n return $field;\n } else {\n return false;\n }\n}", "private static function validate_number(&$phone)\n\t{\n\t\tif (substr($phone, 0, 1) == '+') {\n\t\t\t$phone = substr($phone, 1);\n\t\t}\n\n\n\t\tif (is_numeric($phone)) {\n\n\t\t\t// test if there's a 1 prepended.\n\t\t\tif (strlen($phone) === 11 && $phone[0] == 1) {\n\t\t\t\t//pop 1 off. \n\t\t\t\t$phone = substr($phone, 1);\n\t\t\t\treturn true;\n\n\t\t\t} elseif (strlen($phone) === 10) {\n\t\t\t\t// it's a 10 digit number... I guess that works.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// is invalid if no return by here. \n\t\treturn false;\n\t}", "function checkPhoneNumberPattern($value): string\r\n{\r\n if (is_numeric($value) && strlen($value) === 10) {\r\n return 'this is a correct phone number';\r\n } else {\r\n return 'this is NOT a correct phone number';\r\n }\r\n}", "private function checkNumero($tel)\n {\n $pattern = '/\\+\\d{2}+[0-9]{9,15}|[0-9]{9,15}/';\n if (!preg_match($pattern, $tel)){\n echo \"<br>ERRORE nel numero di telefono : \".$tel;\n throw new InvalidArgumentException();\n }\n else return true;\n }", "public function hasMobileExist(){\n return $this->_has(2);\n }", "function isBadPhone( string $field )\r\n {\r\n \r\n return ( array_search( $field, BAD_PHONES ) !== false || !preg_match( ALLOWED_CODES, $field ) ); \r\n }", "function validate_phone_format($phone) {\n if (preg_match('/^[+]?([\\d]{0,3})?[\\(\\.\\-\\s]?([\\d]{3})[\\)\\.\\-\\s]*([\\d]{3})[\\.\\-\\s]?([\\d]{4})$/',$phone, $number)) {\n \t$number = $number[2] . '-' . $number[3] . '-' . $number[4];\n\t\treturn $number;\n } else return FALSE;\n}", "function isPhoneNumber($string) {\n\tif(preg_match(\"/^(1?(?: |\\-|\\.)?(?:\\(\\d{3}\\)|\\d{3})(?: |\\-|\\.)?\\d{3}(?: |\\-|\\.)?\\d{4})$/\",$string)==1)\n\t\t\treturn true;\n\telse\n\t\t\treturn false;\n}", "static function validPhone($phone)\r\n {\r\n if (preg_match('/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/', $phone)) {\r\n return $phone;\r\n } else {\r\n return !empty($age);\r\n }\r\n }", "public function get_telephone();", "public function valid_phone($str)\n\t{\n\t\treturn ( ! ereg(\"^[0-9]{3}-[0-9]{3}-[0-9]{4}$\", $str)) ? FALSE : TRUE;\n\t}", "public function hasPhone()\n {\n return $this->get(self::PHONE) !== null;\n }", "public function hasMobileVerify(){\n return $this->_has(2);\n }", "function isLegalPhoneNum($test)\n{\n\tif(preg_match(\"/^\\([0-9]{3}\\) [0-9]{4}-[0-9]{4}$/\", $test))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function hasMobileIsExist(){\n return $this->_has(2);\n }", "function is_mobile_number_registered($mobile,$active){\n //check for users which are active\n if ($active == true){\n $count = Db::rowCount(\"user\",array(\n \"mobile\" => $mobile,\n \"active\" => \"y\",\n \"verified_otp\" => \"y\"\n ),array(\n \"=\",\"=\",\"=\"\n ));\n\n }else{\n //user active status dont matter\n $count = Db::rowCount(\"user\",array(\n \"mobile\" => $mobile\n ),array(\n \"=\"\n ));\n }\n\n return $count == 1 ? true : false;\n}", "public function hasMobile(){\n return $this->_has(4);\n }", "public function checkCardType($num)\n {\n if ($num == null) {\n return Eway_Rapid31_Model_Config::PAYPAL_STANDARD_METHOD;\n }\n return Mage::getModel('ewayrapid/request_token')->checkCardType($num);\n }", "function validate_mobile_number($mobile){\n if(preg_match('/^((\\+){0,1}91(\\s){0,1}(\\-){0,1}(\\s){0,1})?([0-9]{10})$/', $mobile,$matches)){\n return true;\n }\n return false;\n}", "public function getShipToPhone();", "function validateCC($cc_num, $type) {\n if ($type == \"American\") {$pattern = \"/^([34|37]{2})([0-9]{13})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Dinners\") {$pattern = \"/^([30|36|38]{2})([0-9]{12})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Discover\") {$pattern = \"/^([6011]{4})([0-9]{12})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Master\") {$pattern = \"/^([51|52|53|54|55]{2})([0-9]{14})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Visa\") {$pattern = \"/^([4]{1})([0-9]{12,15})$/\"; if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}}\n\n if($verified == false) {\n //if validation fail, print a message\n echo \"Credit card invalid. Please make sure that you entered a valid credit card \";\n } \n}", "public function validate_fields() {\n\n\t\t\t\t$phone = $this->sanatizePhone( $_POST['havanao_phone_number'] );\n\n\t\t\t\tif ( strlen( trim( preg_replace( '/^(\\+?250)\\d{9}/', '', $phone ) ) ) ) {\n\t\t\t\t\twc_add_notice( __( 'Invalid phone number provided. Please provide a valid Rwanda mobile phone number', 'havanao' ), 'error' );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasType(){\r\n return $this->_has(7);\r\n }", "public function testCellphoneAvailable()\n {\n $user = factory(User::class)->make();\n $this->assertTrue(User::isCellphoneAvailable($user->cellphone));\n }", "public function testPhone() {\n $this->assertEquals('666-1337', Format::phone(6661337));\n $this->assertEquals('(888) 666-1337', Format::phone('8886661337'));\n $this->assertEquals('1 (888) 666-1337', Format::phone('+1 8886661337'));\n }", "public static function is_e123_phone($in) {\r\n\t\t$regex = '@' . self::e123_phone_regex() . '@';\r\n\t\treturn preg_match($regex, $in);\r\n\t}", "public function hasMobile(){\n return $this->_has(8);\n }", "function oncall_member_edit_form_validate($form, &$form_state) {\n $phone_validator = array( \n 'us' => '/^(1([-\\. ]?\\d{3})[-\\. ]?)?(\\d{3})([-\\. ]?\\d{4})$/',\n 'uk' => '/^(44\\s?7\\d{3}|\\(?07\\d{3}\\)?)\\s?\\d{3}\\s?\\d{3}$/',\n 'uae' => '/^(97[\\s]{0,1}[\\-]{0,1}[\\s]{0,1}1|0)50[\\s]{0,1}[\\-]{0,1}[\\s]{0,1}[1-9]{1}[0-9]{6}$/',\n 'nz' => '/^\\([0]\\d{2}\\))(\\d{6,7}$/',\n );\n\n $validate = variable_get('oncall_validate_phone', 'none');\n if (isset($phone_validator[$validate])) {\n if (!preg_match($phone_validator[$validate], $form_state['values']['oncall_phone'])) {\n form_set_error('oncall_phone', t('That does not look like a valid telephone number'));\n } \n }\n}", "public function phoneCheck($phone){\n\t\t\t$sql = \"SELECT Contact_Number FROM customer WHERE Contact_Number = :Contact_Number\";\n\t\t\t$query = $this->db->pdo->prepare($sql);\n\t\t\t$query->bindValue(\":Contact_Number\", $phone);\n\t\t\t$query->execute();\n\n\t\t\tif ($query->rowCount() > 0) {\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function hasType(){\n return $this->_has(9);\n }", "function validate_mobile($mobile)\n{\n return preg_match('/^[0-9]{12}+$/', $mobile);\n}", "public function getBillingPhone();", "function isPhoneExists($cellphone)\n {\n \n $query=$this->db->query(\"SELECT * FROM xl_account WHERE cellphone='{$cellphone}' AND register_user=1\");\n\n if ($query->num_rows()>0) {\n #if exist return true\n return TRUE;\n }\n\n return FALSE; \n }", "function phone($string) {\n\n\n\t\t}", "function parseUSPhoneNumber($phoneNumber){\n\t\t$input = preg_replace('/\\D/', '', $phoneNumber);\n\t\t$areaCode;\n\t\t$phone;\n\t\t//if it's not 10 or 11 in length we have an issue\n\t\tif(strlen($input) == 11){\n\t\t\t$areaCode = substr($input, 1,3);\n\t\t\t$phone = substr($input, 4,7);\n\t\t\treturn [\"area\" => $areaCode, \"phone\" => $phone];\n\t\t} else if(strlen($input) == 10){\n\t\t\t$areaCode = substr($input, 0,3);\n\t\t\t$phone = substr($input, 3,7);\n\t\t\treturn [\"area\" => $areaCode, \"phone\" => $phone];\n\t\t\t//(123)123-1234\n\t\t}\n\t\treturn false;\n\t}", "public function size_of_phonenumber($contact_no){\t\n\t\tif (!empty($contact_no) && ctype_digit($contact_no)){\t\t\t\n\t\t\tif (strlen($contact_no) < 10){\n\t\t\t\treturn true;\n\t\t\t}else if(strlen($contact_no) > 12){\n\t\t\t\treturn true;\n\t\t\t}\n \t }\n }", "public function addPhone( $type, $number, $ext )\n\t{\n\t\t// database connection and sql query\n $core = Core::dbOpen();\n $sql = \"INSERT INTO user_phone (type, userID, phoneNum, ext ) VALUES ( :type, :userID, :number, :ext )\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':type', $type);\n $stmt->bindParam(':userID', $this->userID);\n $stmt->bindParam(':number', $number);\n $stmt->bindParam(':ext', $ext);\n Core::dbClose();\n\n\t\ttry\n {\n if( $stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch ( PDOException $e ) {\n echo \"Add phone number failed!\";\n }\n\t\treturn false;\n\t}", "function validPhone($phone)\n {\n //phone number should not be empty and can contain only numbers\n return !empty($phone) && filter_var($phone,FILTER_SANITIZE_NUMBER_INT);\n }", "function is_user_register($cellphone)\n {\n \n $query=$this->db->query(\"SELECT * FROM xl_account WHERE cellphone='{$cellphone}' AND register_user=1\");\n\n if ($query->num_rows()>0) {\n #if exist return true\n return TRUE;\n }\n\n return FALSE; \n }", "public function phone_check($value='')\n {\n $phone = $this->input->post('phone');\n $output = $this->m_vendorDetail->phone_check($phone);\n if (empty($output)) {\n $output = $this->m_vendorDetail->phone_user($phone);\n }\n\n if (empty($output)) {\n $otp = random_string('numeric','6');\n if ($this->m_vendorDetail->addOtp($this->email,$otp)) {\n if($this->otp_sms($otp))\n {\n $output = '';\n }else{\n $output = 3;\n }\n } else{\n $output = 3;\n }\n }\n\n echo $output;\n }", "public static function isPhoneNumber($input) {\n return preg_match(\"/^[0-9\\+ ]{9,20}$/\", $input);\n }", "public function test_phone_returns_true_when_optional_input_phone_10_area_bracket() {\n\t\t$optional = true;\n\t\t$result = self::$validator->validate('(555)555-5555', $optional);\n\t\t$this->assertTrue( $result );\n\t}", "function phoneNum($value) {\n\t$reg = \"/^\\([1-9]\\d{2}\\)\\s?\\d{3}\\-\\d{4}$/\";\n\treturn preg_match($reg,$value);\n}", "function comprobarTelefono($telefono){\r\n if(!preg_match(\"/^[0-9]{9}$/\", $telefono)){\r\n return false;\r\n }\r\n return true;\r\n}" ]
[ "0.6724517", "0.66715896", "0.65807974", "0.6490528", "0.6409186", "0.63800234", "0.632497", "0.6316218", "0.6312602", "0.627414", "0.6244501", "0.6222835", "0.6165996", "0.61563396", "0.6112475", "0.6108506", "0.60826933", "0.6062448", "0.6036832", "0.6032387", "0.6014921", "0.60128355", "0.600219", "0.59873515", "0.5981582", "0.59714836", "0.5963882", "0.5936265", "0.5924421", "0.59221876", "0.59207916", "0.5917663", "0.58958054", "0.58604205", "0.58591944", "0.58474326", "0.58303165", "0.581694", "0.5803058", "0.5796104", "0.5795358", "0.5793778", "0.5769921", "0.57617253", "0.5742988", "0.5741372", "0.57404536", "0.5725394", "0.57213163", "0.57100934", "0.5707757", "0.56958246", "0.56902564", "0.5648738", "0.5647024", "0.5643731", "0.56404096", "0.56383324", "0.563371", "0.5621932", "0.56120366", "0.5607796", "0.5598183", "0.5580412", "0.5558703", "0.5556156", "0.55468625", "0.55432916", "0.55432916", "0.55432916", "0.55432916", "0.55432916", "0.55432916", "0.55432916", "0.55432916", "0.55432916", "0.55432916", "0.55432916", "0.55362093", "0.5527366", "0.5505394", "0.550408", "0.550069", "0.54978204", "0.54966587", "0.54872876", "0.5486243", "0.5479049", "0.54543316", "0.5454123", "0.5452106", "0.545173", "0.5445899", "0.544084", "0.5437998", "0.5436707", "0.54357946", "0.54327655", "0.5429305", "0.5424434" ]
0.72108686
0
Function is used to Helps prevent XSS attacks
function encodeXSString($string) { // Remove dead space. $string = trim($string); // Prevent potential Unicode codec problems. $string = utf8_decode($string); // HTMLize HTML-specific characters. $string = htmlentities($string, ENT_QUOTES); $string = str_replace("#", "&#35;", $string); $string = str_replace("%", "&#37;", $string); return $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function html_xss_clean($text) {\n return htmlspecialchars($text);\n}", "function xssafe($data, $encoding = 'UTF-8')\n{\n //return htmlspecialchars($data,ENT_QUOTES | ENT_HTML401,$encoding);\n return htmlspecialchars($data);\n}", "function escape($value){//XSS attacks protection\n return htmlspecialchars($value , ENT_QUOTES,'UTF-8');\n }", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite', 'blockquote', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd')) {\n // Only operate on valid UTF-8 strings. This is necessary to prevent cross\n // site scripting issues on Internet Explorer 6.\n if (!kc_validate_utf8($string)) {\n return '';\n }\n // Store the text format.\n _filter_xss_split($allowed_tags, TRUE);\n // Remove NULL characters (ignored by some browsers).\n $string = str_replace(chr(0), '', $string);\n // Remove Netscape 4 JS entities.\n $string = preg_replace('%&\\s*\\{[^}]*(\\}\\s*;?|$)%', '', $string);\n\n // Defuse all HTML entities.\n $string = str_replace('&', '&amp;', $string);\n // Change back only well-formed entities in our whitelist:\n // Decimal numeric entities.\n $string = preg_replace('/&amp;#([0-9]+;)/', '&#\\1', $string);\n // Hexadecimal numeric entities.\n $string = preg_replace('/&amp;#[Xx]0*((?:[0-9A-Fa-f]{2})+;)/', '&#x\\1', $string);\n // Named entities.\n $string = preg_replace('/&amp;([A-Za-z][A-Za-z0-9]*;)/', '&\\1', $string);\n\n return preg_replace_callback('%\n (\n <(?=[^a-zA-Z!/]) # a lone <\n | # or\n <!--.*?--> # a comment\n | # or\n <[^>]*(>|$) # a string that starts with a <, up until the > or the end of the string\n | # or\n > # just a >\n )%x', '_filter_xss_split', $string);\n}", "function rehtmlspecialchars($arg){\n\t//$arg = str_replace(\"\", \"<\", $arg);\n\t//$arg = str_replace(\" \", \"_\", $arg);\n\t$arg = str_replace(\"/\", \"\", $arg);\n\t$arg = str_replace(\"&\", \"\", $arg);\n\t$arg = str_replace(\"'\", \"\", $arg);\n\t$arg = str_replace(\"#\", \"\", $arg);\n\t$arg = str_replace(\"(\", \"\", $arg);\n\t$arg = str_replace(\")\", \"-\", $arg);\n\t$arg = str_replace(\".\", \"\", $arg);\n\t\n\treturn $arg;\n\t}", "function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}", "function sanitxt($sanitxt) {\r\n\t$sanitxt = str_replace('><','> <',$sanitxt);\r\n\r\n\t// remove HTML tags\r\n\t$sanitxt = strip_tags($sanitxt);\r\n\r\n\t// remove multiple spaces\r\n\t$sanitxt = preg_replace('/\\s+/', ' ', $sanitxt);\r\n\r\n\t// convert smart quotes into normal\r\n\tconvert_smart_quotes($sanitxt);\r\n\r\n\t// replace quotes and ampersands with HTML chars (recommended)\r\n\t// and encode string to UTF-8. UTF-8 is default from PHP 5.4.0 only\r\n\r\n\t$sanitxt = htmlspecialchars($sanitxt,ENT_QUOTES,\"UTF-8\",FALSE);\r\n\r\nreturn($sanitxt);\r\n}", "function _xss_sanitization_esc_js( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_COMPAT );\n $safe_text = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', \"'\", stripslashes( $safe_text ) );\n $safe_text = str_replace( \"\\r\", '', $safe_text );\n $safe_text = str_replace( \"\\n\", '\\\\n', addslashes( $safe_text ) );\n return $safe_text;\n}", "function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n}", "function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n}", "function protection($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function xss_clean($str, $is_image = FALSE)\n{ \n $security =& load_class('Security','core');\n return $security->xss_clean($str, $is_image);\n}", "function sterilize($input){\r\n return htmlspecialchars($input);\r\n }", "function test_xss_attack(){\n $xssAttack = \"<script>alert('Malicious 35!')</script>\";\n\n // verificamos el contenido en formato de markdown con `` para convertirlo en texto escapado\n // sino las quitamos y colocamos {!! Markdown::convertToHtml(e($post->content)) !!} \"e()\"\n $comment = $this->createComment([\n 'comment' => \"$xssAttack. Texto normal.\"\n ]);\n\n $this->xss_attack($this, $comment->post->url, $xssAttack);\n }", "public function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n }", "function hte($str) {\n return htmlspecialchars($str);\n}", "function sanitize_string_xss(string $data): string\n{\n return filter_var($data, FILTER_SANITIZE_STRING);\n}", "function sanitizeString($str_input) {\r\n $str_input = strip_tags($str_input);\r\n $str_input = htmlentities($str_input);\r\n $str_input = stripslashes($str_input);\r\n return $str_input;\r\n}", "function anti_xss($text){\n\t\t$a = array( \n\t\t\t'@< [/!]*?[^<>]*?>@si',\n\t\t\t'@< ![sS]*?--[ tnr]*>@',\n\t\t\t'/(?i)\\<script\\>(.*?)\\<\\/script\\>/i',\n\t\t\t'/(?i)\\<script (.*?)\\>(.*?)\\<\\/script>/i',\n\t\t\t'/(?i)\\<style\\>(.*?)\\<\\/style\\>/i',\n\t\t\t'/(?i)\\<style (.*?)\\>(.*?)\\<\\/style>/i'\n\t ); \n\n\t $b = array( \n\t\t\t'',\n\t\t\t'',\n\t\t\thtml_entity_decode('<script>\\\\1</script>'),\n\t\t\thtml_entity_decode('<script \\\\1>\\\\2</script>'),\n\t\t\thtml_entity_decode('<style>\\\\1</style>'),\n\t\t\thtml_entity_decode('<style \\\\1>\\\\2</style>')\n\t\t);\n\n foreach($a AS $key => $val){\n\t\t\twhile(preg_match($val, $text)){\n\t\t\t\t$text = preg_replace($val, '', $text);\n\t\t\t}\n\t\t}\n\t\t$text = preg_replace($a, $b, $text);\n\t\treturn $text;\n\t}", "function xss_clean_data($string)\n{\n $CI = & get_instance();\n $return = $CI->security->xss_clean($string);\n return $return;\n}", "function secure_input($input) {\n\t\t\t$input = trim($input);\n\t\t\t$input = htmlspecialchars($input);\n\t\t\treturn $input;\n\t\t}", "function sanitize($string){\n\t$strip = strip_tags($string);\n\t$trim = trim($strip);\n\t$htmlchar = htmlspecialchars($trim);\n\treturn $htmlchar;\n\n}", "function htmlSafe($input) {\n\t//Only for HTML output, to prevent XSS and accidental breakage- not really needed here.\n\treturn htmlspecialchars($input);\n}", "function e($str) {\n return htmlspecialchars($str);\n}", "function sanitize_string($str)\r\n{\r\n\t$str = strip_tags($str);\r\n $str = htmlentities($str, ENT_QUOTES);\r\n return $str;\r\n}", "protected function sanitize() {}", "function removeXSS($val)\t{\n\t// this prevents some character re-spacing such as <java\\0script>\n\t// note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n\t$val = preg_replace('/([\\x00-\\x08][\\x0b-\\x0c][\\x0e-\\x20])/', '', $val);\n\n\t// straight replacements, the user should never need these since they're normal characters\n\t// this prevents like <IMG SRC=&#X40&#X61&#X76&#X61&#X73&#X63&#X72&#X69&#X70&#X74&#X3A&#X61&#X6C&#X65&#X72&#X74&#X28&#X27&#X58&#X53&#X53&#X27&#X29>\n\t$search = 'abcdefghijklmnopqrstuvwxyz';\n\t$search.= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t$search.= '1234567890!@#$%^&*()';\n\t$search.= '~`\";:?+/={}[]-_|\\'\\\\';\n\n\tfor ($i = 0; $i < strlen($search); $i++) {\n\t\t// ;? matches the ;, which is optional\n\t\t// 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n\t\t// &#x0040 @ search for the hex values\n\t\t$val = preg_replace('/(&#[x|X]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n\t\t// &#00064 @ 0{0,7} matches '0' zero to seven times\n\t\t$val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n\t}\n\n\t// now the only remaining whitespace attacks are \\t, \\n, and \\r\n\t$ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n\t$ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n\t$ra = array_merge($ra1, $ra2);\n\n\t$found = true; // keep replacing as long as the previous round replaced something\n\twhile ($found == true) {\n\t\t$val_before = $val;\n\t\tfor ($i = 0; $i < sizeof($ra); $i++) {\n\t\t\t$pattern = '/';\n\t\t\tfor ($j = 0; $j < strlen($ra[$i]); $j++) {\n\t\t\t\tif ($j > 0) {\n\t\t\t\t\t$pattern .= '(';\n\t\t\t\t\t$pattern .= '(&#[x|X]0{0,8}([9][a][b]);?)?';\n\t\t\t\t\t$pattern .= '|(&#0{0,8}([9][10][13]);?)?';\n\t\t\t\t\t$pattern .= ')?';\n\t\t\t\t}\n\t\t\t\t$pattern .= $ra[$i][$j];\n\t\t\t}\n\t\t\t$pattern .= '/i';\n\t\t\t$replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n\t\t\t$val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n\t\t\tif ($val_before == $val) {\n\t\t\t\t// no replacements were made, so exit the loop\n\t\t\t\t$found = false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $val;\n}", "public function XSSfilter()\n {\n /**\n * @var array Исключения для полей с визуальным редактором\n */\n $exceptionsAllowingHTML = array( 'contest_text', 'results_contest' );\n\n foreach ($_POST as $key => $value){\n if (is_array($value)) {\n foreach ($value as $sub_key => $sub_value) {\n $sub_value = stripos( $sub_value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $sub_value ;\n $_POST[$key][$sub_key] = Security::xss_clean(HTML::chars($sub_value));\n }\n continue;\n }\n $value = stripos($value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $value ;\n\n /** $exceptionsAllowingHTML — allow html tags (does not fire HTML Purifier) */\n if ( in_array($key, $exceptionsAllowingHTML) === false) {\n $_POST[$key] = Security::xss_clean(HTML::chars($value));\n }\n }\n foreach ($_GET as $key => $value) {\n $value = stripos( $value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $value ;\n $_GET[$key] = Security::xss_clean(HTML::chars($value));\n }\n\n }", "function sanitize($dirty){\n return htmlentities($dirty,ENT_QUOTES,\"UTF-8\");\n}", "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 xss_clean($var) {\r\n\treturn preg_replace('/(java|vb)script/i', '\\\\1 script', utf8_htmlspecialchars($var));\r\n}", "function antiinjection($data){\n\t$filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)));\n \treturn $filter_sql;\n}", "function safety($text){\r\n $text = strip_tags($text); //Remove html tags\r\n $text = $this->ixd->real_escape_string($text); // Make safe for Database.\r\n return $text;\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}", "function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"&#097;lert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"&#111;nload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"&lt;body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"&lt;html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $t );\n\t\t\n\t\treturn $t;\n }", "function filter($value){\n return htmlspecialchars($value);\n }", "function twig_safe_filter($string)\n{\n return $string;\n}", "public static function evilStrings()\n {\n while (true) {\n yield \"* WHERE 1=1; --\";\n yield \"<script>alert('xss')</script>\";\n }\n }", "function sanitize_string($a_string)\n{\n $a_string = htmlspecialchars($a_string, ENT_QUOTES);\n $a_string = strip_tags($a_string);\n return trim($a_string); \n}", "function e($string)\r\n{\r\n if ($string) {\r\n return htmlspecialchars($string);\r\n }\r\n}", "function sanitize($input) {\n return htmlspecialchars(strip_tags(trim($input)));\n }", "function sanitizeString($str){\n\t\tif(get_magic_quotes_gpc()) $str = stripslashes($str);\t\n\t\t$str= htmlentities($str);\n\t\t$str=strip_tags($str);\n\t\treturn $str;\n\t}", "function _xss_sanitization_sanitize_stored_html( $html ) {\n \n // URL protocols\n $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn');\n\n return kses($html, _xss_sanitization_allowed_tags(), $protocols);\n}", "public static function makeXSSsafe ($string)\n\t{\n\t\treturn str_replace (self::$searchXSS, self::$replaceXSS, $string);\n\t}", "protected function filterXss($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 escape($str) {\n return htmlspecialchars($str, ENT_QUOTES);\n}", "function secure_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n // tbd mysql_real_escape_string\r\n return $data;\r\n}", "function security($input)\n{\n $input = mysql_real_escape_string($input);\n $input = strip_tags($input);\n $input = stripslashes($input);\n return $input;\n}", "function pun_htmlspecialchars($str)\r\n{\r\n\t$str = preg_replace('/&(?!#[0-9]+;)/s', '&amp;', $str);\r\n\t$str = str_replace(array('<', '>', '\"'), array('&lt;', '&gt;', '&quot;'), $str);\r\n\r\n\treturn $str;\r\n}", "function sanitize($string) {\n $data = htmlspecialchars(stripslashes(strip_tags(trim($string))));\n return $data;\n}", "function fsl_scrub($string){\n \n $xss = new xss_filter();\n $string = $xss->filter_it($string); \n return $string;\n}", "public function xssFilter($value)\n {\n $filter = new CHtmlPurifier();\n $filter->options = array(\n 'AutoFormat.RemoveEmpty'=>false,\n 'Core.NormalizeNewlines'=>false,\n 'CSS.AllowTricky'=>true, // Allow display:none; (and other)\n 'HTML.SafeObject'=>true, // To allow including youtube\n 'Output.FlashCompat'=>true,\n 'Attr.EnableID'=>true, // Allow to set id\n 'Attr.AllowedFrameTargets'=>array('_blank','_self'),\n 'URI.AllowedSchemes'=>array(\n 'http' => true,\n 'https' => true,\n 'mailto' => true,\n 'ftp' => true,\n 'nntp' => true,\n 'news' => true,\n )\n );\n // To allow script BUT purify : HTML.Trusted=true (plugin idea for admin or without XSS filtering ?)\n\n /** Start to get complete filtered value with url decode {QCODE} (bug #09300). This allow only question number in url, seems OK with XSS protection **/\n $sFiltered=preg_replace('#%7B([a-zA-Z0-9\\.]*)%7D#','{$1}',$filter->purify($value));\n Yii::import('application.helpers.expressions.em_core_helper');// Already imported in em_manager_helper.php ?\n $oExpressionManager= new ExpressionManager;\n /** We get 2 array : one filtered, other unfiltered **/\n $aValues=$oExpressionManager->asSplitStringOnExpressions($value);// Return array of array : 0=>the string,1=>string length,2=>string type (STRING or EXPRESSION)\n $aFilteredValues=$oExpressionManager->asSplitStringOnExpressions($sFiltered);// Same but for the filtered string\n $bCountIsOk=count($aValues)==count($aFilteredValues);\n /** Construction of new string with unfiltered EM and filtered HTML **/\n $sNewValue=\"\";\n foreach($aValues as $key=>$aValue){\n if($aValue[2]==\"STRING\")\n $sNewValue.=$bCountIsOk ? $aFilteredValues[$key][0]:$filter->purify($aValue[0]);// If EM is broken : can throw invalid $key\n else\n {\n $sExpression=trim($aValue[0], '{}');\n $sNewValue.=\"{\";\n $aParsedExpressions=$oExpressionManager->Tokenize($sExpression,true);\n foreach($aParsedExpressions as $aParsedExpression)\n {\n if($aParsedExpression[2]=='DQ_STRING')\n $sNewValue.=\"\\\"\".$filter->purify($aParsedExpression[0]).\"\\\"\"; // This disallow complex HTML construction with XSS\n elseif($aParsedExpression[2]=='SQ_STRING')\n $sNewValue.=\"'\".$filter->purify($aParsedExpression[0]).\"'\";\n else\n $sNewValue.=$aParsedExpression[0];\n }\n $sNewValue.=\"}\";\n }\n }\n gc_collect_cycles(); // To counter a high memory usage of HTML-Purifier\n return $sNewValue;\n }", "static function removeXss($val) {\n\t\t// this prevents some character re-spacing such as <java\\0script>\n\t\t// note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n\t\t$val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n\t\t// straight replacements, the user should never need these since they're normal characters\n\t\t// this prevents like <IMG SRC=@avascript:alert('XSS')>\n\t\t$search = 'abcdefghijklmnopqrstuvwxyz';\n\t\t$search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$search .= '1234567890!@#$%^&*()';\n\t\t$search .= '~`\";:?+/={}[]-_|\\'\\\\';\n\t\tfor ($i = 0; $i < strlen($search); $i++) {\n\t\t // ;? matches the ;, which is optional\n\t\t // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n\t\t // @ @ search for the hex values\n\t\t $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n\t\t // @ @ 0{0,7} matches '0' zero to seven times\n\t\t $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n\t\t}\n\n\t\t// now the only remaining whitespace attacks are \\t, \\n, and \\r\n\t\t$ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n\t\t$ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n\t\t$ra = array_merge($ra1, $ra2);\n\n\t\t$found = true; // keep replacing as long as the previous round replaced something\n\t\twhile ($found == true) {\n\t\t $val_before = $val;\n\t\t for ($i = 0; $i < sizeof($ra); $i++) {\n\t\t $pattern = '/';\n\t\t for ($j = 0; $j < strlen($ra[$i]); $j++) {\n\t\t if ($j > 0) {\n\t\t $pattern .= '(';\n\t\t $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n\t\t $pattern .= '|';\n\t\t $pattern .= '|(&#0{0,8}([9|10|13]);)';\n\t\t $pattern .= ')*';\n\t\t }\n\t\t $pattern .= $ra[$i][$j];\n\t\t }\n\t\t $pattern .= '/i';\n\t\t $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n\t\t $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n\t\t if ($val_before == $val) {\n\t\t // no replacements were made, so exit the loop\n\t\t $found = false;\n\t\t }\n\t\t }\n\t\t}\n\t\treturn $val;\n\t}", "function protect($string) {\n\t$protection = htmlspecialchars(trim($string), ENT_QUOTES);\n\treturn $protection;\n}", "function e($str) {\n echo htmlspecialchars($str, ENT_QUOTES);\n}", "abstract public function sanitize();", "function escp($text) {\r\n return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\r\n}", "function sanitize($input) {\n\t\n\t\t$input = stripslashes($input);\n\t\t$input = htmlspecialchars($input);\n\t\n\t\treturn $input;\n\t}", "function convertHTML($strInput) //Convert to html special code\n{\n\t//$strInput = htmlspecialchars($strInput, ENT_QUOTES);\n\t$strInput = str_replace('\"', '&quot;', $strInput);\n\t$strInput = str_replace(\"'\", \"&#039;\", $strInput);\n\treturn $strInput;\n}", "function sanitize($input){\n $input = strip_tags($input);\n $input = htmlspecialchars($input);\n $input = trim($input);\n return $input;\n}", "function ___($text) {\n return htmlspecialchars($text);\n}", "function wp_kses_js_entities($content)\n {\n }", "function sanitize_input($str) {\n\treturn preg_replace(\"/[?'&<>\\\"]/\", \"\", $str);\n}", "function sanitizeFormPassword($inputText){ //green coloer = function name, Orange = parameter with variable\n\t$inputText = strip_tags($inputText);\t\n\treturn $inputText;\n}", "function sanitation($value) {\n\treturn strip_tags($value);\n}", "function sanitize_input($data)\n {\n $data = trim($data); //remove whitespaces \n $data = stripslashes($data); //such as '\n $data = htmlspecialchars($data); //such as >,<&\n return $data;\n }", "function sanitize($string)\n{\n\t$string = htmlspecialchars(trim($string), ENT_QUOTES, 'UTF-8');\n\treturn $string;\n}", "function cleanEvilTags($t){\r\n\t\t$t = preg_replace(\"/javascript/i\" , \"j&#097;v&#097;script\", $t);\r\n\t\t$t = preg_replace(\"/alert/i\" , \"&#097;lert\" , $t);\r\n\t\t$t = preg_replace(\"/about:/i\" , \"&#097;bout:\" , $t);\r\n\t\t$t = preg_replace(\"/onmouseover/i\", \"&#111;nmouseover\" , $t);\r\n\t\t$t = preg_replace(\"/onclick/i\" , \"&#111;nclick\" , $t);\r\n\t\t$t = preg_replace(\"/onload/i\" , \"&#111;nload\" , $t);\r\n\t\t$t = preg_replace(\"/onsubmit/i\" , \"&#111;nsubmit\" , $t);\r\n\t\t$t = preg_replace(\"/<body/i\" , \"&lt;body\" , $t);\r\n\t\t$t = preg_replace(\"/<html/i\" , \"&lt;html\" , $t);\r\n\t\t$t = preg_replace(\"/document\\./i\" , \"&#100;ocument.\" , $t);\r\n\t\treturn $t;\r\n\t}", "function h( $s ) {\n return htmlspecialchars($s, ENT_QUOTES, 'utf-8');\n}", "function escape($s) {\r\n //return mysql_real_escape_string(strip_tags($s)); // uncomment in when you will use connection with database\r\n return strip_tags($s);\r\n}", "private function javascript_protect($txt) \n\t\t{\n\t\t\t$txt = str_replace(\"'\",\"\\'\",$txt);\n\t\t\treturn $txt;\n\t\t}", "function _xssClean($str) {\n\t\tif (is_array($str)) {\n\n\t\t\twhile (list($key) = each($str)) {\n\n\t\t\t\t$str[$key] = $this->_xssClean($str[$key]);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\n\n\t\t$str = _removeInvisibleCharacters($str);\n\t\t$str = _htmlEncode($str);\n\t\t$str = filter_var($str, FILTER_SANITIZE_STRING);\n\n\t\treturn $str;\n\t}", "function js_protect($txt) \n\t{\n\t\t$txt = str_replace(\"'\",\"\\'\",$txt);\n\t\treturn $txt;\n\t}", "function secure($input)\n {\n\n $input = trim($input);\n $input = htmlentities($input);\n return $input;\n }", "function eL($key)\n{\n return Filters::noXSS(L($key));\n}", "function clean_output($string) \n{\n if (!($string)) return;\n echo htmlspecialchars($string, ENT_QUOTES);\n}", "function sanitize_text_field($str)\n {\n }", "function secure_input($data) {\n $data = trim($data);\n // remove backslashes (\\)\n $data = stripslashes($data);\n // save as HTML escaped code --> any scripts in input data will not run\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitise_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "static function login_html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }", "function sanitize_input($data) { \r\n $data = trim($data); \r\n $data = stripslashes($data); \r\n $data = htmlspecialchars($data); \r\n return $data; \r\n }", "function xss_clean($str, $is_image = FALSE)\n\t{\n\t\t/*\n\t\t* Is the string an array?\n\t\t*\n\t\t*/\n\t\tif (is_array($str))\n\t\t{\n\t\t\twhile (list($key) = each($str))\n\t\t\t{\n\t\t\t\t$str[$key] = $this->xss_clean($str[$key]);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\n\t\t/*\n\t\t* Remove Invisible Characters\n\t\t*/\n\t\t$str = $this->_remove_invisible_characters($str);\n\n\t\t/*\n\t\t* Protect GET variables in URLs\n\t\t*/\n\n\t\t// 901119URL5918AMP18930PROTECT8198\n\n\t\t$str = preg_replace('|\\&([a-z\\_0-9]+)\\=([a-z\\_0-9]+)|i', $this->xss_hash().\"\\\\1=\\\\2\", $str);\n\n\t\t/*\n\t\t* Validate standard character entities\n\t\t*\n\t\t* Add a semicolon if missing. We do this to enable\n\t\t* the conversion of entities to ASCII later.\n\t\t*\n\t\t*/\n\t\t$str = preg_replace('#(&\\#?[0-9a-z]{2,})([\\x00-\\x20])*;?#i', \"\\\\1;\\\\2\", $str);\n\n\t\t/*\n\t\t* Validate UTF16 two byte encoding (x00)\n\t\t*\n\t\t* Just as above, adds a semicolon if missing.\n\t\t*\n\t\t*/\n\t\t$str = preg_replace('#(&\\#x?)([0-9A-F]+);?#i',\"\\\\1\\\\2;\",$str);\n\n\t\t/*\n\t\t* Un-Protect GET variables in URLs\n\t\t*/\n\t\t$str = str_replace($this->xss_hash(), '&', $str);\n\n\t\t/*\n\t\t* URL Decode\n\t\t*\n\t\t* Just in case stuff like this is submitted:\n\t\t*\n\t\t* <a href=\"http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D\">Google</a>\n\t\t*\n\t\t* Note: Use rawurldecode() so it does not remove plus signs\n\t\t*\n\t\t*/\n\t\t$str = rawurldecode($str);\n\n\t\t/*\n\t\t* Convert character entities to ASCII\n\t\t*\n\t\t* This permits our tests below to work reliably.\n\t\t* We only convert entities that are within tags since\n\t\t* these are the ones that will pose security problems.\n\t\t*\n\t\t*/\n\n\t\t$str = preg_replace_callback(\"/[a-z]+=([\\'\\\"]).*?\\\\1/si\", array($this, '_convert_attribute'), $str);\n\n\t\t$str = preg_replace_callback(\"/<\\w+.*?(?=>|<|$)/si\", array($this, '_html_entity_decode_callback'), $str);\n\n\t\t/*\n\t\t* Remove Invisible Characters Again!\n\t\t*/\n\t\t$str = $this->_remove_invisible_characters($str);\n\n\t\t/*\n\t\t* Convert all tabs to spaces\n\t\t*\n\t\t* This prevents strings like this: ja\tvascript\n\t\t* NOTE: we deal with spaces between characters later.\n\t\t* NOTE: preg_replace was found to be amazingly slow here on large blocks of data,\n\t\t* so we use str_replace.\n\t\t*\n\t\t*/\n\n \t\tif (strpos($str, \"\\t\") !== FALSE)\n\t\t{\n\t\t\t$str = str_replace(\"\\t\", ' ', $str);\n\t\t}\n\n\t\t/*\n\t\t* Capture converted string for later comparison\n\t\t*/\n\t\t$converted_string = $str;\n\n\t\t/*\n\t\t* Not Allowed Under Any Conditions\n\t\t*/\n\n\t\tforeach ($this->never_allowed_str as $key => $val)\n\t\t{\n\t\t\t$str = str_replace($key, $val, $str);\n\t\t}\n\n\t\tforeach ($this->never_allowed_regex as $key => $val)\n\t\t{\n\t\t\t$str = preg_replace(\"#\".$key.\"#i\", $val, $str);\n\t\t}\n\n\t\t/*\n\t\t* Makes PHP tags safe\n\t\t*\n\t\t* Note: XML tags are inadvertently replaced too:\n\t\t*\n\t\t*\t<?xml\n\t\t*\n\t\t* But it doesn't seem to pose a problem.\n\t\t*\n\t\t*/\n\t\tif ($is_image === TRUE)\n\t\t{\n\t\t\t// Images have a tendency to have the PHP short opening and closing tags every so often\n\t\t\t// so we skip those and only do the long opening tags.\n\t\t\t$str = preg_replace('/<\\?(php)/i', \"&lt;?\\\\1\", $str);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$str = str_replace(array('<?', '?'.'>'), array('&lt;?', '?&gt;'), $str);\n\t\t}\n\n\t\t/*\n\t\t* Compact any exploded words\n\t\t*\n\t\t* This corrects words like: j a v a s c r i p t\n\t\t* These words are compacted back to their correct state.\n\t\t*\n\t\t*/\n\t\t$words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window');\n\t\tforeach ($words as $word)\n\t\t{\n\t\t\t$temp = '';\n\n\t\t\tfor ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++)\n\t\t\t{\n\t\t\t\t$temp .= substr($word, $i, 1).\"\\s*\";\n\t\t\t}\n\n\t\t\t// We only want to do this when it is followed by a non-word character\n\t\t\t// That way valid stuff like \"dealer to\" does not become \"dealerto\"\n\t\t\t$str = preg_replace_callback('#('.substr($temp, 0, -3).')(\\W)#is', array($this, '_compact_exploded_words'), $str);\n\t\t}\n\n\t\t/*\n\t\t* Remove disallowed Javascript in links or img tags\n\t\t* We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared\n\t\t* to these simplified non-capturing preg_match(), especially if the pattern exists in the string\n\t\t*/\n\t\tdo\n\t\t{\n\t\t\t$original = $str;\n\n\t\t\tif (preg_match(\"/<a/i\", $str))\n\t\t\t{\n\t\t\t\t$str = preg_replace_callback(\"#<a\\s+([^>]*?)(>|$)#si\", array($this, '_js_link_removal'), $str);\n\t\t\t}\n\n\t\t\tif (preg_match(\"/<img/i\", $str))\n\t\t\t{\n\t\t\t\t$str = preg_replace_callback(\"#<img\\s+([^>]*?)(\\s?/|$)#si\", array($this, '_js_img_removal'), $str);\n\t\t\t}\n\n\t\t\tif (preg_match(\"/script/i\", $str) OR preg_match(\"/xss/i\", $str))\n\t\t\t{\n\t\t\t\t$str = preg_replace(\"#<(/*)(script|xss)(.*?)\\>#si\", '[removed]', $str);\n\t\t\t}\n\t\t}\n\t\twhile($original != $str);\n\n\t\tunset($original);\n\n\t\t/*\n\t\t* Remove JavaScript Event Handlers\n\t\t*\n\t\t* Note: This code is a little blunt. It removes\n\t\t* the event handler and anything up to the closing >,\n\t\t* but it's unlikely to be a problem.\n\t\t*\n\t\t*/\n\t\t$event_handlers = array('[^a-z_\\-]on\\w*','xmlns');\n\n\t\tif ($is_image === TRUE)\n\t\t{\n\t\t\t/*\n\t\t\t* Adobe Photoshop puts XML metadata into JFIF images, including namespacing,\n\t\t\t* so we have to allow this for images. -Paul\n\t\t\t*/\n\t\t\tunset($event_handlers[array_search('xmlns', $event_handlers)]);\n\t\t}\n\n\t\t$str = preg_replace(\"#<([^><]+?)(\".implode('|', $event_handlers).\")(\\s*=\\s*[^><]*)([><]*)#i\", \"<\\\\1\\\\4\", $str);\n\n\t\t/*\n\t\t* Sanitize naughty HTML elements\n\t\t*\n\t\t* If a tag containing any of the words in the list\n\t\t* below is found, the tag gets converted to entities.\n\t\t*\n\t\t* So this: <blink>\n\t\t* Becomes: &lt;blink&gt;\n\t\t*\n\t\t*/\n\t\t$naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss';\n\t\t$str = preg_replace_callback('#<(/*\\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str);\n\n\t\t/*\n\t\t* Sanitize naughty scripting elements\n\t\t*\n\t\t* Similar to above, only instead of looking for\n\t\t* tags it looks for PHP and JavaScript commands\n\t\t* that are disallowed. Rather than removing the\n\t\t* code, it simply converts the parenthesis to entities\n\t\t* rendering the code un-executable.\n\t\t*\n\t\t* For example:\teval('some code')\n\t\t* Becomes:\t\teval&#40;'some code'&#41;\n\t\t*\n\t\t*/\n\t\t$str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\\s*)\\((.*?)\\)#si', \"\\\\1\\\\2&#40;\\\\3&#41;\", $str);\n\n\t\t/*\n\t\t* Final clean up\n\t\t*\n\t\t* This adds a bit of extra precaution in case\n\t\t* something got through the above filters\n\t\t*\n\t\t*/\n\t\tforeach ($this->never_allowed_str as $key => $val)\n\t\t{\n\t\t\t$str = str_replace($key, $val, $str);\n\t\t}\n\n\t\tforeach ($this->never_allowed_regex as $key => $val)\n\t\t{\n\t\t\t$str = preg_replace(\"#\".$key.\"#i\", $val, $str);\n\t\t}\n\n\t\t/*\n\t\t* Images are Handled in a Special Way\n\t\t* - Essentially, we want to know that after all of the character conversion is done whether\n\t\t* any unwanted, likely XSS, code was found. If not, we return TRUE, as the image is clean.\n\t\t* However, if the string post-conversion does not matched the string post-removal of XSS,\n\t\t* then it fails, as there was unwanted XSS code found and removed/changed during processing.\n\t\t*/\n\n\t\tif ($is_image === TRUE)\n\t\t{\n\t\t\tif ($str == $converted_string)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t//log_message('debug', \"XSS Filtering completed\");\n\t\treturn $str;\n\t}", "function s2_htmlencode($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "public function xss_clean(string $xss_string) {\n //Convert all characters to HTML entities\n return htmlentities($xss_string, ENT_QUOTES | ENT_IGNORE);\n }", "function secure_input($data) {\n // strip unnecessary chars (extra space, tab, newline, etc)\n $data = trim($data);\n // remove backslashes (\\)\n $data = stripslashes($data);\n // save as HTML escaped code --> any scripts in input data will not run\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitize($bad){\r\n\t\t\t$bad = stripslashes($bad);\r\n\t\t\t$bad = strip_tags($bad);\r\n\t\t\t$good = htmlentities($bad);\r\n\t\t\treturn $good;\r\n\t\t}", "function sanitize($str){\n $str = strip_tags($str);\n return $str;\n }", "function sanitize($str) {\n return trim(htmlspecialchars($str));\n}", "function filter_xss_bad_protocol($string) {\n return check_plain(kc_strip_dangerous_protocols($string));\n}", "function h($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "public function sanitize() {\n }", "function sani($bad){\r\n\t\t\t\t$bad = stripslashes($bad);\r\n\t\t\t\t$bad = strip_tags($bad);\r\n\t\t\t\t$good = htmlentities($bad);\r\n\t\t\t\treturn $good;\r\n\t\t\t}", "function test_input($string)\n{\n //$string = strip_tags($string);\n //$string = trim($string);\n //$string = stripslashes($string);\n $string = htmlspecialchars($string);\n\n return $string;\n}", "function safeEcho(string $text)\n{\n echo htmlspecialchars($text);\n}", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitize_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "function corectez($sir) {\n $sir = trim($sir);\n $sir = stripslashes($sir);\n $sir = htmlspecialchars($sir);\n return $sir;\n }", "function replacespecialcharsurl($str){\n\t\t$str=trim($str);\n\t\t$str=ereg_replace(\"&#039;\",\"\",$str);\n\t\t$str=ereg_replace(\"\\/\",\"\",$str);\n\t\t$str=ereg_replace(\"-\",\"\",$str);\n\t\t$str=ereg_replace('\"',\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"#\",\"\",$str);\n\t\t$str=ereg_replace(\"\\?\",\"\",$str);\n\t\t$str=ereg_replace(\",\",\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"&\",\"\",$str);\n\t\t$str=ereg_replace(\"\\.\",\"\",$str);\n\t\t$str=ereg_replace(\":\",\"\",$str);\n\t\t$str=ereg_replace(\"\\(\",\"\",$str);\n\t\t$str=ereg_replace(\"\\)\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"\\%\",\"\",$str);\n\t\t$str=ereg_replace(\"\\>\",\"\",$str);\n\t\t$str=ereg_replace(\" \",\" \",$str);\n\t\t$str=ereg_replace(\" \",\"-\",$str);\n\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=strtolower($str);\n\t\treturn $str;\n}" ]
[ "0.7633166", "0.7491818", "0.74354815", "0.7421306", "0.7402879", "0.73981524", "0.73446816", "0.7261159", "0.7260028", "0.72588044", "0.7247132", "0.72468615", "0.72234607", "0.72058105", "0.71686894", "0.71339834", "0.70547056", "0.70226353", "0.70134646", "0.7012734", "0.7007135", "0.6961409", "0.69536203", "0.69427246", "0.6936333", "0.69304", "0.69291747", "0.69208777", "0.6918305", "0.69174516", "0.6898324", "0.6885025", "0.6858423", "0.68564606", "0.6834022", "0.6813666", "0.6811788", "0.68041676", "0.67965513", "0.6777642", "0.67609733", "0.67521775", "0.6741755", "0.67374486", "0.67321384", "0.6731618", "0.6727997", "0.67207724", "0.66988665", "0.66890955", "0.66860527", "0.6685891", "0.6677725", "0.66594344", "0.66543317", "0.66517705", "0.66477466", "0.663922", "0.663607", "0.6630206", "0.66231346", "0.6596017", "0.6593453", "0.659182", "0.658964", "0.6588985", "0.65848535", "0.6579878", "0.6576918", "0.6574243", "0.6567833", "0.65659416", "0.6565842", "0.65657055", "0.65634567", "0.6562965", "0.6560158", "0.6558385", "0.65560704", "0.6553056", "0.65487593", "0.6541424", "0.6538685", "0.65318274", "0.6527009", "0.652353", "0.6522773", "0.65212727", "0.6513361", "0.65133214", "0.6511189", "0.6498499", "0.64959586", "0.6494742", "0.6491728", "0.6489845", "0.6488771", "0.6488771", "0.64844894", "0.64823365", "0.6477671" ]
0.0
-1
Function is used to Helps prevent XSS attacks
private function decodeXSString($string) { // Remove dead space. $string = trim($string); // Prevent potential Unicode codec problems. $string = utf8_decode($string); // HTMLize HTML-specific characters. $string = htmlentities($string, ENT_QUOTES); $string = str_replace("&#35;", "#", $string); $string = str_replace("&#37;", "%", $string); $length = intval($length); if ($length > 0) { $string = substr($string, 0, $length); } return $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function html_xss_clean($text) {\n return htmlspecialchars($text);\n}", "function xssafe($data, $encoding = 'UTF-8')\n{\n //return htmlspecialchars($data,ENT_QUOTES | ENT_HTML401,$encoding);\n return htmlspecialchars($data);\n}", "function escape($value){//XSS attacks protection\n return htmlspecialchars($value , ENT_QUOTES,'UTF-8');\n }", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite', 'blockquote', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd')) {\n // Only operate on valid UTF-8 strings. This is necessary to prevent cross\n // site scripting issues on Internet Explorer 6.\n if (!kc_validate_utf8($string)) {\n return '';\n }\n // Store the text format.\n _filter_xss_split($allowed_tags, TRUE);\n // Remove NULL characters (ignored by some browsers).\n $string = str_replace(chr(0), '', $string);\n // Remove Netscape 4 JS entities.\n $string = preg_replace('%&\\s*\\{[^}]*(\\}\\s*;?|$)%', '', $string);\n\n // Defuse all HTML entities.\n $string = str_replace('&', '&amp;', $string);\n // Change back only well-formed entities in our whitelist:\n // Decimal numeric entities.\n $string = preg_replace('/&amp;#([0-9]+;)/', '&#\\1', $string);\n // Hexadecimal numeric entities.\n $string = preg_replace('/&amp;#[Xx]0*((?:[0-9A-Fa-f]{2})+;)/', '&#x\\1', $string);\n // Named entities.\n $string = preg_replace('/&amp;([A-Za-z][A-Za-z0-9]*;)/', '&\\1', $string);\n\n return preg_replace_callback('%\n (\n <(?=[^a-zA-Z!/]) # a lone <\n | # or\n <!--.*?--> # a comment\n | # or\n <[^>]*(>|$) # a string that starts with a <, up until the > or the end of the string\n | # or\n > # just a >\n )%x', '_filter_xss_split', $string);\n}", "function rehtmlspecialchars($arg){\n\t//$arg = str_replace(\"\", \"<\", $arg);\n\t//$arg = str_replace(\" \", \"_\", $arg);\n\t$arg = str_replace(\"/\", \"\", $arg);\n\t$arg = str_replace(\"&\", \"\", $arg);\n\t$arg = str_replace(\"'\", \"\", $arg);\n\t$arg = str_replace(\"#\", \"\", $arg);\n\t$arg = str_replace(\"(\", \"\", $arg);\n\t$arg = str_replace(\")\", \"-\", $arg);\n\t$arg = str_replace(\".\", \"\", $arg);\n\t\n\treturn $arg;\n\t}", "function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}", "function sanitxt($sanitxt) {\r\n\t$sanitxt = str_replace('><','> <',$sanitxt);\r\n\r\n\t// remove HTML tags\r\n\t$sanitxt = strip_tags($sanitxt);\r\n\r\n\t// remove multiple spaces\r\n\t$sanitxt = preg_replace('/\\s+/', ' ', $sanitxt);\r\n\r\n\t// convert smart quotes into normal\r\n\tconvert_smart_quotes($sanitxt);\r\n\r\n\t// replace quotes and ampersands with HTML chars (recommended)\r\n\t// and encode string to UTF-8. UTF-8 is default from PHP 5.4.0 only\r\n\r\n\t$sanitxt = htmlspecialchars($sanitxt,ENT_QUOTES,\"UTF-8\",FALSE);\r\n\r\nreturn($sanitxt);\r\n}", "function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n}", "function _xss_sanitization_esc_js( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_COMPAT );\n $safe_text = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', \"'\", stripslashes( $safe_text ) );\n $safe_text = str_replace( \"\\r\", '', $safe_text );\n $safe_text = str_replace( \"\\n\", '\\\\n', addslashes( $safe_text ) );\n return $safe_text;\n}", "function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n}", "function protection($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function xss_clean($str, $is_image = FALSE)\n{ \n $security =& load_class('Security','core');\n return $security->xss_clean($str, $is_image);\n}", "function sterilize($input){\r\n return htmlspecialchars($input);\r\n }", "function test_xss_attack(){\n $xssAttack = \"<script>alert('Malicious 35!')</script>\";\n\n // verificamos el contenido en formato de markdown con `` para convertirlo en texto escapado\n // sino las quitamos y colocamos {!! Markdown::convertToHtml(e($post->content)) !!} \"e()\"\n $comment = $this->createComment([\n 'comment' => \"$xssAttack. Texto normal.\"\n ]);\n\n $this->xss_attack($this, $comment->post->url, $xssAttack);\n }", "public function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n }", "function hte($str) {\n return htmlspecialchars($str);\n}", "function sanitize_string_xss(string $data): string\n{\n return filter_var($data, FILTER_SANITIZE_STRING);\n}", "function sanitizeString($str_input) {\r\n $str_input = strip_tags($str_input);\r\n $str_input = htmlentities($str_input);\r\n $str_input = stripslashes($str_input);\r\n return $str_input;\r\n}", "function anti_xss($text){\n\t\t$a = array( \n\t\t\t'@< [/!]*?[^<>]*?>@si',\n\t\t\t'@< ![sS]*?--[ tnr]*>@',\n\t\t\t'/(?i)\\<script\\>(.*?)\\<\\/script\\>/i',\n\t\t\t'/(?i)\\<script (.*?)\\>(.*?)\\<\\/script>/i',\n\t\t\t'/(?i)\\<style\\>(.*?)\\<\\/style\\>/i',\n\t\t\t'/(?i)\\<style (.*?)\\>(.*?)\\<\\/style>/i'\n\t ); \n\n\t $b = array( \n\t\t\t'',\n\t\t\t'',\n\t\t\thtml_entity_decode('<script>\\\\1</script>'),\n\t\t\thtml_entity_decode('<script \\\\1>\\\\2</script>'),\n\t\t\thtml_entity_decode('<style>\\\\1</style>'),\n\t\t\thtml_entity_decode('<style \\\\1>\\\\2</style>')\n\t\t);\n\n foreach($a AS $key => $val){\n\t\t\twhile(preg_match($val, $text)){\n\t\t\t\t$text = preg_replace($val, '', $text);\n\t\t\t}\n\t\t}\n\t\t$text = preg_replace($a, $b, $text);\n\t\treturn $text;\n\t}", "function xss_clean_data($string)\n{\n $CI = & get_instance();\n $return = $CI->security->xss_clean($string);\n return $return;\n}", "function secure_input($input) {\n\t\t\t$input = trim($input);\n\t\t\t$input = htmlspecialchars($input);\n\t\t\treturn $input;\n\t\t}", "function sanitize($string){\n\t$strip = strip_tags($string);\n\t$trim = trim($strip);\n\t$htmlchar = htmlspecialchars($trim);\n\treturn $htmlchar;\n\n}", "function htmlSafe($input) {\n\t//Only for HTML output, to prevent XSS and accidental breakage- not really needed here.\n\treturn htmlspecialchars($input);\n}", "function e($str) {\n return htmlspecialchars($str);\n}", "function sanitize_string($str)\r\n{\r\n\t$str = strip_tags($str);\r\n $str = htmlentities($str, ENT_QUOTES);\r\n return $str;\r\n}", "protected function sanitize() {}", "function removeXSS($val)\t{\n\t// this prevents some character re-spacing such as <java\\0script>\n\t// note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n\t$val = preg_replace('/([\\x00-\\x08][\\x0b-\\x0c][\\x0e-\\x20])/', '', $val);\n\n\t// straight replacements, the user should never need these since they're normal characters\n\t// this prevents like <IMG SRC=&#X40&#X61&#X76&#X61&#X73&#X63&#X72&#X69&#X70&#X74&#X3A&#X61&#X6C&#X65&#X72&#X74&#X28&#X27&#X58&#X53&#X53&#X27&#X29>\n\t$search = 'abcdefghijklmnopqrstuvwxyz';\n\t$search.= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t$search.= '1234567890!@#$%^&*()';\n\t$search.= '~`\";:?+/={}[]-_|\\'\\\\';\n\n\tfor ($i = 0; $i < strlen($search); $i++) {\n\t\t// ;? matches the ;, which is optional\n\t\t// 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n\t\t// &#x0040 @ search for the hex values\n\t\t$val = preg_replace('/(&#[x|X]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n\t\t// &#00064 @ 0{0,7} matches '0' zero to seven times\n\t\t$val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n\t}\n\n\t// now the only remaining whitespace attacks are \\t, \\n, and \\r\n\t$ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n\t$ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n\t$ra = array_merge($ra1, $ra2);\n\n\t$found = true; // keep replacing as long as the previous round replaced something\n\twhile ($found == true) {\n\t\t$val_before = $val;\n\t\tfor ($i = 0; $i < sizeof($ra); $i++) {\n\t\t\t$pattern = '/';\n\t\t\tfor ($j = 0; $j < strlen($ra[$i]); $j++) {\n\t\t\t\tif ($j > 0) {\n\t\t\t\t\t$pattern .= '(';\n\t\t\t\t\t$pattern .= '(&#[x|X]0{0,8}([9][a][b]);?)?';\n\t\t\t\t\t$pattern .= '|(&#0{0,8}([9][10][13]);?)?';\n\t\t\t\t\t$pattern .= ')?';\n\t\t\t\t}\n\t\t\t\t$pattern .= $ra[$i][$j];\n\t\t\t}\n\t\t\t$pattern .= '/i';\n\t\t\t$replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n\t\t\t$val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n\t\t\tif ($val_before == $val) {\n\t\t\t\t// no replacements were made, so exit the loop\n\t\t\t\t$found = false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $val;\n}", "public function XSSfilter()\n {\n /**\n * @var array Исключения для полей с визуальным редактором\n */\n $exceptionsAllowingHTML = array( 'contest_text', 'results_contest' );\n\n foreach ($_POST as $key => $value){\n if (is_array($value)) {\n foreach ($value as $sub_key => $sub_value) {\n $sub_value = stripos( $sub_value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $sub_value ;\n $_POST[$key][$sub_key] = Security::xss_clean(HTML::chars($sub_value));\n }\n continue;\n }\n $value = stripos($value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $value ;\n\n /** $exceptionsAllowingHTML — allow html tags (does not fire HTML Purifier) */\n if ( in_array($key, $exceptionsAllowingHTML) === false) {\n $_POST[$key] = Security::xss_clean(HTML::chars($value));\n }\n }\n foreach ($_GET as $key => $value) {\n $value = stripos( $value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $value ;\n $_GET[$key] = Security::xss_clean(HTML::chars($value));\n }\n\n }", "function sanitize($dirty){\n return htmlentities($dirty,ENT_QUOTES,\"UTF-8\");\n}", "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 xss_clean($var) {\r\n\treturn preg_replace('/(java|vb)script/i', '\\\\1 script', utf8_htmlspecialchars($var));\r\n}", "function antiinjection($data){\n\t$filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)));\n \treturn $filter_sql;\n}", "function safety($text){\r\n $text = strip_tags($text); //Remove html tags\r\n $text = $this->ixd->real_escape_string($text); // Make safe for Database.\r\n return $text;\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}", "function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"&#097;lert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"&#111;nload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"&lt;body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"&lt;html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $t );\n\t\t\n\t\treturn $t;\n }", "function filter($value){\n return htmlspecialchars($value);\n }", "function twig_safe_filter($string)\n{\n return $string;\n}", "public static function evilStrings()\n {\n while (true) {\n yield \"* WHERE 1=1; --\";\n yield \"<script>alert('xss')</script>\";\n }\n }", "function sanitize_string($a_string)\n{\n $a_string = htmlspecialchars($a_string, ENT_QUOTES);\n $a_string = strip_tags($a_string);\n return trim($a_string); \n}", "function e($string)\r\n{\r\n if ($string) {\r\n return htmlspecialchars($string);\r\n }\r\n}", "function sanitize($input) {\n return htmlspecialchars(strip_tags(trim($input)));\n }", "function sanitizeString($str){\n\t\tif(get_magic_quotes_gpc()) $str = stripslashes($str);\t\n\t\t$str= htmlentities($str);\n\t\t$str=strip_tags($str);\n\t\treturn $str;\n\t}", "function _xss_sanitization_sanitize_stored_html( $html ) {\n \n // URL protocols\n $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn');\n\n return kses($html, _xss_sanitization_allowed_tags(), $protocols);\n}", "public static function makeXSSsafe ($string)\n\t{\n\t\treturn str_replace (self::$searchXSS, self::$replaceXSS, $string);\n\t}", "protected function filterXss($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 escape($str) {\n return htmlspecialchars($str, ENT_QUOTES);\n}", "function secure_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n // tbd mysql_real_escape_string\r\n return $data;\r\n}", "function security($input)\n{\n $input = mysql_real_escape_string($input);\n $input = strip_tags($input);\n $input = stripslashes($input);\n return $input;\n}", "function sanitize($string) {\n $data = htmlspecialchars(stripslashes(strip_tags(trim($string))));\n return $data;\n}", "function pun_htmlspecialchars($str)\r\n{\r\n\t$str = preg_replace('/&(?!#[0-9]+;)/s', '&amp;', $str);\r\n\t$str = str_replace(array('<', '>', '\"'), array('&lt;', '&gt;', '&quot;'), $str);\r\n\r\n\treturn $str;\r\n}", "function fsl_scrub($string){\n \n $xss = new xss_filter();\n $string = $xss->filter_it($string); \n return $string;\n}", "public function xssFilter($value)\n {\n $filter = new CHtmlPurifier();\n $filter->options = array(\n 'AutoFormat.RemoveEmpty'=>false,\n 'Core.NormalizeNewlines'=>false,\n 'CSS.AllowTricky'=>true, // Allow display:none; (and other)\n 'HTML.SafeObject'=>true, // To allow including youtube\n 'Output.FlashCompat'=>true,\n 'Attr.EnableID'=>true, // Allow to set id\n 'Attr.AllowedFrameTargets'=>array('_blank','_self'),\n 'URI.AllowedSchemes'=>array(\n 'http' => true,\n 'https' => true,\n 'mailto' => true,\n 'ftp' => true,\n 'nntp' => true,\n 'news' => true,\n )\n );\n // To allow script BUT purify : HTML.Trusted=true (plugin idea for admin or without XSS filtering ?)\n\n /** Start to get complete filtered value with url decode {QCODE} (bug #09300). This allow only question number in url, seems OK with XSS protection **/\n $sFiltered=preg_replace('#%7B([a-zA-Z0-9\\.]*)%7D#','{$1}',$filter->purify($value));\n Yii::import('application.helpers.expressions.em_core_helper');// Already imported in em_manager_helper.php ?\n $oExpressionManager= new ExpressionManager;\n /** We get 2 array : one filtered, other unfiltered **/\n $aValues=$oExpressionManager->asSplitStringOnExpressions($value);// Return array of array : 0=>the string,1=>string length,2=>string type (STRING or EXPRESSION)\n $aFilteredValues=$oExpressionManager->asSplitStringOnExpressions($sFiltered);// Same but for the filtered string\n $bCountIsOk=count($aValues)==count($aFilteredValues);\n /** Construction of new string with unfiltered EM and filtered HTML **/\n $sNewValue=\"\";\n foreach($aValues as $key=>$aValue){\n if($aValue[2]==\"STRING\")\n $sNewValue.=$bCountIsOk ? $aFilteredValues[$key][0]:$filter->purify($aValue[0]);// If EM is broken : can throw invalid $key\n else\n {\n $sExpression=trim($aValue[0], '{}');\n $sNewValue.=\"{\";\n $aParsedExpressions=$oExpressionManager->Tokenize($sExpression,true);\n foreach($aParsedExpressions as $aParsedExpression)\n {\n if($aParsedExpression[2]=='DQ_STRING')\n $sNewValue.=\"\\\"\".$filter->purify($aParsedExpression[0]).\"\\\"\"; // This disallow complex HTML construction with XSS\n elseif($aParsedExpression[2]=='SQ_STRING')\n $sNewValue.=\"'\".$filter->purify($aParsedExpression[0]).\"'\";\n else\n $sNewValue.=$aParsedExpression[0];\n }\n $sNewValue.=\"}\";\n }\n }\n gc_collect_cycles(); // To counter a high memory usage of HTML-Purifier\n return $sNewValue;\n }", "static function removeXss($val) {\n\t\t// this prevents some character re-spacing such as <java\\0script>\n\t\t// note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n\t\t$val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n\t\t// straight replacements, the user should never need these since they're normal characters\n\t\t// this prevents like <IMG SRC=@avascript:alert('XSS')>\n\t\t$search = 'abcdefghijklmnopqrstuvwxyz';\n\t\t$search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$search .= '1234567890!@#$%^&*()';\n\t\t$search .= '~`\";:?+/={}[]-_|\\'\\\\';\n\t\tfor ($i = 0; $i < strlen($search); $i++) {\n\t\t // ;? matches the ;, which is optional\n\t\t // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n\t\t // @ @ search for the hex values\n\t\t $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n\t\t // @ @ 0{0,7} matches '0' zero to seven times\n\t\t $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n\t\t}\n\n\t\t// now the only remaining whitespace attacks are \\t, \\n, and \\r\n\t\t$ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n\t\t$ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n\t\t$ra = array_merge($ra1, $ra2);\n\n\t\t$found = true; // keep replacing as long as the previous round replaced something\n\t\twhile ($found == true) {\n\t\t $val_before = $val;\n\t\t for ($i = 0; $i < sizeof($ra); $i++) {\n\t\t $pattern = '/';\n\t\t for ($j = 0; $j < strlen($ra[$i]); $j++) {\n\t\t if ($j > 0) {\n\t\t $pattern .= '(';\n\t\t $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n\t\t $pattern .= '|';\n\t\t $pattern .= '|(&#0{0,8}([9|10|13]);)';\n\t\t $pattern .= ')*';\n\t\t }\n\t\t $pattern .= $ra[$i][$j];\n\t\t }\n\t\t $pattern .= '/i';\n\t\t $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n\t\t $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n\t\t if ($val_before == $val) {\n\t\t // no replacements were made, so exit the loop\n\t\t $found = false;\n\t\t }\n\t\t }\n\t\t}\n\t\treturn $val;\n\t}", "function protect($string) {\n\t$protection = htmlspecialchars(trim($string), ENT_QUOTES);\n\treturn $protection;\n}", "function e($str) {\n echo htmlspecialchars($str, ENT_QUOTES);\n}", "abstract public function sanitize();", "function escp($text) {\r\n return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\r\n}", "function sanitize($input) {\n\t\n\t\t$input = stripslashes($input);\n\t\t$input = htmlspecialchars($input);\n\t\n\t\treturn $input;\n\t}", "function convertHTML($strInput) //Convert to html special code\n{\n\t//$strInput = htmlspecialchars($strInput, ENT_QUOTES);\n\t$strInput = str_replace('\"', '&quot;', $strInput);\n\t$strInput = str_replace(\"'\", \"&#039;\", $strInput);\n\treturn $strInput;\n}", "function sanitize($input){\n $input = strip_tags($input);\n $input = htmlspecialchars($input);\n $input = trim($input);\n return $input;\n}", "function ___($text) {\n return htmlspecialchars($text);\n}", "function wp_kses_js_entities($content)\n {\n }", "function sanitizeFormPassword($inputText){ //green coloer = function name, Orange = parameter with variable\n\t$inputText = strip_tags($inputText);\t\n\treturn $inputText;\n}", "function sanitize_input($str) {\n\treturn preg_replace(\"/[?'&<>\\\"]/\", \"\", $str);\n}", "function sanitation($value) {\n\treturn strip_tags($value);\n}", "function sanitize_input($data)\n {\n $data = trim($data); //remove whitespaces \n $data = stripslashes($data); //such as '\n $data = htmlspecialchars($data); //such as >,<&\n return $data;\n }", "function sanitize($string)\n{\n\t$string = htmlspecialchars(trim($string), ENT_QUOTES, 'UTF-8');\n\treturn $string;\n}", "function cleanEvilTags($t){\r\n\t\t$t = preg_replace(\"/javascript/i\" , \"j&#097;v&#097;script\", $t);\r\n\t\t$t = preg_replace(\"/alert/i\" , \"&#097;lert\" , $t);\r\n\t\t$t = preg_replace(\"/about:/i\" , \"&#097;bout:\" , $t);\r\n\t\t$t = preg_replace(\"/onmouseover/i\", \"&#111;nmouseover\" , $t);\r\n\t\t$t = preg_replace(\"/onclick/i\" , \"&#111;nclick\" , $t);\r\n\t\t$t = preg_replace(\"/onload/i\" , \"&#111;nload\" , $t);\r\n\t\t$t = preg_replace(\"/onsubmit/i\" , \"&#111;nsubmit\" , $t);\r\n\t\t$t = preg_replace(\"/<body/i\" , \"&lt;body\" , $t);\r\n\t\t$t = preg_replace(\"/<html/i\" , \"&lt;html\" , $t);\r\n\t\t$t = preg_replace(\"/document\\./i\" , \"&#100;ocument.\" , $t);\r\n\t\treturn $t;\r\n\t}", "function h( $s ) {\n return htmlspecialchars($s, ENT_QUOTES, 'utf-8');\n}", "function escape($s) {\r\n //return mysql_real_escape_string(strip_tags($s)); // uncomment in when you will use connection with database\r\n return strip_tags($s);\r\n}", "function _xssClean($str) {\n\t\tif (is_array($str)) {\n\n\t\t\twhile (list($key) = each($str)) {\n\n\t\t\t\t$str[$key] = $this->_xssClean($str[$key]);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\n\n\t\t$str = _removeInvisibleCharacters($str);\n\t\t$str = _htmlEncode($str);\n\t\t$str = filter_var($str, FILTER_SANITIZE_STRING);\n\n\t\treturn $str;\n\t}", "private function javascript_protect($txt) \n\t\t{\n\t\t\t$txt = str_replace(\"'\",\"\\'\",$txt);\n\t\t\treturn $txt;\n\t\t}", "function js_protect($txt) \n\t{\n\t\t$txt = str_replace(\"'\",\"\\'\",$txt);\n\t\treturn $txt;\n\t}", "function secure($input)\n {\n\n $input = trim($input);\n $input = htmlentities($input);\n return $input;\n }", "function eL($key)\n{\n return Filters::noXSS(L($key));\n}", "function clean_output($string) \n{\n if (!($string)) return;\n echo htmlspecialchars($string, ENT_QUOTES);\n}", "function sanitize_text_field($str)\n {\n }", "function secure_input($data) {\n $data = trim($data);\n // remove backslashes (\\)\n $data = stripslashes($data);\n // save as HTML escaped code --> any scripts in input data will not run\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitise_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "static function login_html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }", "function sanitize_input($data) { \r\n $data = trim($data); \r\n $data = stripslashes($data); \r\n $data = htmlspecialchars($data); \r\n return $data; \r\n }", "function xss_clean($str, $is_image = FALSE)\n\t{\n\t\t/*\n\t\t* Is the string an array?\n\t\t*\n\t\t*/\n\t\tif (is_array($str))\n\t\t{\n\t\t\twhile (list($key) = each($str))\n\t\t\t{\n\t\t\t\t$str[$key] = $this->xss_clean($str[$key]);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\n\t\t/*\n\t\t* Remove Invisible Characters\n\t\t*/\n\t\t$str = $this->_remove_invisible_characters($str);\n\n\t\t/*\n\t\t* Protect GET variables in URLs\n\t\t*/\n\n\t\t// 901119URL5918AMP18930PROTECT8198\n\n\t\t$str = preg_replace('|\\&([a-z\\_0-9]+)\\=([a-z\\_0-9]+)|i', $this->xss_hash().\"\\\\1=\\\\2\", $str);\n\n\t\t/*\n\t\t* Validate standard character entities\n\t\t*\n\t\t* Add a semicolon if missing. We do this to enable\n\t\t* the conversion of entities to ASCII later.\n\t\t*\n\t\t*/\n\t\t$str = preg_replace('#(&\\#?[0-9a-z]{2,})([\\x00-\\x20])*;?#i', \"\\\\1;\\\\2\", $str);\n\n\t\t/*\n\t\t* Validate UTF16 two byte encoding (x00)\n\t\t*\n\t\t* Just as above, adds a semicolon if missing.\n\t\t*\n\t\t*/\n\t\t$str = preg_replace('#(&\\#x?)([0-9A-F]+);?#i',\"\\\\1\\\\2;\",$str);\n\n\t\t/*\n\t\t* Un-Protect GET variables in URLs\n\t\t*/\n\t\t$str = str_replace($this->xss_hash(), '&', $str);\n\n\t\t/*\n\t\t* URL Decode\n\t\t*\n\t\t* Just in case stuff like this is submitted:\n\t\t*\n\t\t* <a href=\"http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D\">Google</a>\n\t\t*\n\t\t* Note: Use rawurldecode() so it does not remove plus signs\n\t\t*\n\t\t*/\n\t\t$str = rawurldecode($str);\n\n\t\t/*\n\t\t* Convert character entities to ASCII\n\t\t*\n\t\t* This permits our tests below to work reliably.\n\t\t* We only convert entities that are within tags since\n\t\t* these are the ones that will pose security problems.\n\t\t*\n\t\t*/\n\n\t\t$str = preg_replace_callback(\"/[a-z]+=([\\'\\\"]).*?\\\\1/si\", array($this, '_convert_attribute'), $str);\n\n\t\t$str = preg_replace_callback(\"/<\\w+.*?(?=>|<|$)/si\", array($this, '_html_entity_decode_callback'), $str);\n\n\t\t/*\n\t\t* Remove Invisible Characters Again!\n\t\t*/\n\t\t$str = $this->_remove_invisible_characters($str);\n\n\t\t/*\n\t\t* Convert all tabs to spaces\n\t\t*\n\t\t* This prevents strings like this: ja\tvascript\n\t\t* NOTE: we deal with spaces between characters later.\n\t\t* NOTE: preg_replace was found to be amazingly slow here on large blocks of data,\n\t\t* so we use str_replace.\n\t\t*\n\t\t*/\n\n \t\tif (strpos($str, \"\\t\") !== FALSE)\n\t\t{\n\t\t\t$str = str_replace(\"\\t\", ' ', $str);\n\t\t}\n\n\t\t/*\n\t\t* Capture converted string for later comparison\n\t\t*/\n\t\t$converted_string = $str;\n\n\t\t/*\n\t\t* Not Allowed Under Any Conditions\n\t\t*/\n\n\t\tforeach ($this->never_allowed_str as $key => $val)\n\t\t{\n\t\t\t$str = str_replace($key, $val, $str);\n\t\t}\n\n\t\tforeach ($this->never_allowed_regex as $key => $val)\n\t\t{\n\t\t\t$str = preg_replace(\"#\".$key.\"#i\", $val, $str);\n\t\t}\n\n\t\t/*\n\t\t* Makes PHP tags safe\n\t\t*\n\t\t* Note: XML tags are inadvertently replaced too:\n\t\t*\n\t\t*\t<?xml\n\t\t*\n\t\t* But it doesn't seem to pose a problem.\n\t\t*\n\t\t*/\n\t\tif ($is_image === TRUE)\n\t\t{\n\t\t\t// Images have a tendency to have the PHP short opening and closing tags every so often\n\t\t\t// so we skip those and only do the long opening tags.\n\t\t\t$str = preg_replace('/<\\?(php)/i', \"&lt;?\\\\1\", $str);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$str = str_replace(array('<?', '?'.'>'), array('&lt;?', '?&gt;'), $str);\n\t\t}\n\n\t\t/*\n\t\t* Compact any exploded words\n\t\t*\n\t\t* This corrects words like: j a v a s c r i p t\n\t\t* These words are compacted back to their correct state.\n\t\t*\n\t\t*/\n\t\t$words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window');\n\t\tforeach ($words as $word)\n\t\t{\n\t\t\t$temp = '';\n\n\t\t\tfor ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++)\n\t\t\t{\n\t\t\t\t$temp .= substr($word, $i, 1).\"\\s*\";\n\t\t\t}\n\n\t\t\t// We only want to do this when it is followed by a non-word character\n\t\t\t// That way valid stuff like \"dealer to\" does not become \"dealerto\"\n\t\t\t$str = preg_replace_callback('#('.substr($temp, 0, -3).')(\\W)#is', array($this, '_compact_exploded_words'), $str);\n\t\t}\n\n\t\t/*\n\t\t* Remove disallowed Javascript in links or img tags\n\t\t* We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared\n\t\t* to these simplified non-capturing preg_match(), especially if the pattern exists in the string\n\t\t*/\n\t\tdo\n\t\t{\n\t\t\t$original = $str;\n\n\t\t\tif (preg_match(\"/<a/i\", $str))\n\t\t\t{\n\t\t\t\t$str = preg_replace_callback(\"#<a\\s+([^>]*?)(>|$)#si\", array($this, '_js_link_removal'), $str);\n\t\t\t}\n\n\t\t\tif (preg_match(\"/<img/i\", $str))\n\t\t\t{\n\t\t\t\t$str = preg_replace_callback(\"#<img\\s+([^>]*?)(\\s?/|$)#si\", array($this, '_js_img_removal'), $str);\n\t\t\t}\n\n\t\t\tif (preg_match(\"/script/i\", $str) OR preg_match(\"/xss/i\", $str))\n\t\t\t{\n\t\t\t\t$str = preg_replace(\"#<(/*)(script|xss)(.*?)\\>#si\", '[removed]', $str);\n\t\t\t}\n\t\t}\n\t\twhile($original != $str);\n\n\t\tunset($original);\n\n\t\t/*\n\t\t* Remove JavaScript Event Handlers\n\t\t*\n\t\t* Note: This code is a little blunt. It removes\n\t\t* the event handler and anything up to the closing >,\n\t\t* but it's unlikely to be a problem.\n\t\t*\n\t\t*/\n\t\t$event_handlers = array('[^a-z_\\-]on\\w*','xmlns');\n\n\t\tif ($is_image === TRUE)\n\t\t{\n\t\t\t/*\n\t\t\t* Adobe Photoshop puts XML metadata into JFIF images, including namespacing,\n\t\t\t* so we have to allow this for images. -Paul\n\t\t\t*/\n\t\t\tunset($event_handlers[array_search('xmlns', $event_handlers)]);\n\t\t}\n\n\t\t$str = preg_replace(\"#<([^><]+?)(\".implode('|', $event_handlers).\")(\\s*=\\s*[^><]*)([><]*)#i\", \"<\\\\1\\\\4\", $str);\n\n\t\t/*\n\t\t* Sanitize naughty HTML elements\n\t\t*\n\t\t* If a tag containing any of the words in the list\n\t\t* below is found, the tag gets converted to entities.\n\t\t*\n\t\t* So this: <blink>\n\t\t* Becomes: &lt;blink&gt;\n\t\t*\n\t\t*/\n\t\t$naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss';\n\t\t$str = preg_replace_callback('#<(/*\\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str);\n\n\t\t/*\n\t\t* Sanitize naughty scripting elements\n\t\t*\n\t\t* Similar to above, only instead of looking for\n\t\t* tags it looks for PHP and JavaScript commands\n\t\t* that are disallowed. Rather than removing the\n\t\t* code, it simply converts the parenthesis to entities\n\t\t* rendering the code un-executable.\n\t\t*\n\t\t* For example:\teval('some code')\n\t\t* Becomes:\t\teval&#40;'some code'&#41;\n\t\t*\n\t\t*/\n\t\t$str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\\s*)\\((.*?)\\)#si', \"\\\\1\\\\2&#40;\\\\3&#41;\", $str);\n\n\t\t/*\n\t\t* Final clean up\n\t\t*\n\t\t* This adds a bit of extra precaution in case\n\t\t* something got through the above filters\n\t\t*\n\t\t*/\n\t\tforeach ($this->never_allowed_str as $key => $val)\n\t\t{\n\t\t\t$str = str_replace($key, $val, $str);\n\t\t}\n\n\t\tforeach ($this->never_allowed_regex as $key => $val)\n\t\t{\n\t\t\t$str = preg_replace(\"#\".$key.\"#i\", $val, $str);\n\t\t}\n\n\t\t/*\n\t\t* Images are Handled in a Special Way\n\t\t* - Essentially, we want to know that after all of the character conversion is done whether\n\t\t* any unwanted, likely XSS, code was found. If not, we return TRUE, as the image is clean.\n\t\t* However, if the string post-conversion does not matched the string post-removal of XSS,\n\t\t* then it fails, as there was unwanted XSS code found and removed/changed during processing.\n\t\t*/\n\n\t\tif ($is_image === TRUE)\n\t\t{\n\t\t\tif ($str == $converted_string)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t//log_message('debug', \"XSS Filtering completed\");\n\t\treturn $str;\n\t}", "function s2_htmlencode($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "public function xss_clean(string $xss_string) {\n //Convert all characters to HTML entities\n return htmlentities($xss_string, ENT_QUOTES | ENT_IGNORE);\n }", "function secure_input($data) {\n // strip unnecessary chars (extra space, tab, newline, etc)\n $data = trim($data);\n // remove backslashes (\\)\n $data = stripslashes($data);\n // save as HTML escaped code --> any scripts in input data will not run\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitize($bad){\r\n\t\t\t$bad = stripslashes($bad);\r\n\t\t\t$bad = strip_tags($bad);\r\n\t\t\t$good = htmlentities($bad);\r\n\t\t\treturn $good;\r\n\t\t}", "function sanitize($str){\n $str = strip_tags($str);\n return $str;\n }", "function sanitize($str) {\n return trim(htmlspecialchars($str));\n}", "function filter_xss_bad_protocol($string) {\n return check_plain(kc_strip_dangerous_protocols($string));\n}", "function h($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "public function sanitize() {\n }", "function sani($bad){\r\n\t\t\t\t$bad = stripslashes($bad);\r\n\t\t\t\t$bad = strip_tags($bad);\r\n\t\t\t\t$good = htmlentities($bad);\r\n\t\t\t\treturn $good;\r\n\t\t\t}", "function test_input($string)\n{\n //$string = strip_tags($string);\n //$string = trim($string);\n //$string = stripslashes($string);\n $string = htmlspecialchars($string);\n\n return $string;\n}", "function safeEcho(string $text)\n{\n echo htmlspecialchars($text);\n}", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitize_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "function corectez($sir) {\n $sir = trim($sir);\n $sir = stripslashes($sir);\n $sir = htmlspecialchars($sir);\n return $sir;\n }", "function replacespecialcharsurl($str){\n\t\t$str=trim($str);\n\t\t$str=ereg_replace(\"&#039;\",\"\",$str);\n\t\t$str=ereg_replace(\"\\/\",\"\",$str);\n\t\t$str=ereg_replace(\"-\",\"\",$str);\n\t\t$str=ereg_replace('\"',\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"#\",\"\",$str);\n\t\t$str=ereg_replace(\"\\?\",\"\",$str);\n\t\t$str=ereg_replace(\",\",\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"&\",\"\",$str);\n\t\t$str=ereg_replace(\"\\.\",\"\",$str);\n\t\t$str=ereg_replace(\":\",\"\",$str);\n\t\t$str=ereg_replace(\"\\(\",\"\",$str);\n\t\t$str=ereg_replace(\"\\)\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"\\%\",\"\",$str);\n\t\t$str=ereg_replace(\"\\>\",\"\",$str);\n\t\t$str=ereg_replace(\" \",\" \",$str);\n\t\t$str=ereg_replace(\" \",\"-\",$str);\n\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=strtolower($str);\n\t\treturn $str;\n}" ]
[ "0.7632616", "0.749142", "0.7433384", "0.74200284", "0.7403307", "0.7398101", "0.73434913", "0.7261273", "0.72595686", "0.7259059", "0.7247864", "0.7245306", "0.72233814", "0.7204616", "0.7167016", "0.71345145", "0.7053911", "0.7021877", "0.7013273", "0.70121104", "0.70074034", "0.6960142", "0.6953787", "0.69414604", "0.6934829", "0.6930234", "0.6927699", "0.6921657", "0.6918107", "0.6916517", "0.689725", "0.68855155", "0.68571305", "0.68552613", "0.683352", "0.68142605", "0.68103516", "0.68038183", "0.67954546", "0.6777806", "0.6759339", "0.6751273", "0.67411244", "0.6737191", "0.67311835", "0.6729475", "0.6727102", "0.6719142", "0.669815", "0.6688927", "0.66857386", "0.66850805", "0.6677988", "0.66587937", "0.66553015", "0.6650507", "0.66457653", "0.6638158", "0.66349334", "0.6628901", "0.66231", "0.6596054", "0.6592732", "0.6591433", "0.6590132", "0.6589174", "0.65847003", "0.6578995", "0.6576116", "0.6574863", "0.65670884", "0.6565922", "0.65652984", "0.6564794", "0.6562713", "0.656162", "0.65598947", "0.6556584", "0.6556446", "0.6551648", "0.6547728", "0.6540765", "0.65378106", "0.6531838", "0.6526116", "0.6522656", "0.6521867", "0.6521014", "0.6513728", "0.65129507", "0.651003", "0.64974225", "0.64946413", "0.6494477", "0.6491771", "0.64881265", "0.6487846", "0.6487846", "0.6483674", "0.6481564", "0.6477965" ]
0.0
-1
Function is used to prevent sql injection
private function preventSQLInjection($string) { foreach ($string as $key => $value) { //Escapes special characters in a string for use in an SQL statement $value = mysql_real_escape_string($value); } return $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function anti_injection($sql)\n{\n\t$sql = preg_replace(sql_regcase(\"/(from|select|insert|delete|where|drop table|show tables|#|\\*|--|\\\\\\\\)/\"),\"\",$sql);\n\t$sql = trim($sql);//limpa espaços vazio\n\t$sql = strip_tags($sql);//tira tags html e php\n\t$sql = addslashes($sql);//Adiciona barras invertidas a uma string\n\treturn $sql;\n}", "function sqlInjections($data){\n\t$value1=mysqli_real_escape_string($GLOBALS['link'],$data);\n\t$value1=trim($value1);\n\treturn $value1;\n\t}", "public function anti_injection($sql){\r\n /*\r\n\t\t$seg = preg_replace(sql_regcase(\"/(from|select|insert|delete|where|drop table|show tables|\\*|--|\\\\\\\\)/\"),\"\",$sql);\r\n\t\t$seg = trim($seg);//limpa espaços vazio\r\n\t\t$seg = strip_tags($seg);//tira tags html e php\r\n\t\t$seg = addslashes($seg);//Adiciona barras invertidas a uma string\r\n\t\treturn $seg;\r\n */\r\n return $sql;\r\n\t}", "function antiinjection($data){\n\t$filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)));\n \treturn $filter_sql;\n}", "function sqlsanitize($sql)\r\n{\r\n\t$trysan = str_replace(\"\\\\\", \"\\\\\\\\\", $sql);\r\n\t$trysan = str_replace(\"\\\"\", \"\\\"\\\"\", $trysan);\r\n\t$trysan = str_replace(\"'\", \"''\", $trysan);\r\n\treturn $trysan;\r\n}", "function sql_desanitize($sql)\r\n{\r\n\t$trysan = str_replace(\"\\\\\\\\\", \"\\\\\", $sql);\r\n\t$trysan = str_replace(\"\\\"\\\"\", \"\\\"\", $trysan);\r\n\t$trysan = str_replace(\"''\", \"'\", $trysan);\r\n\treturn $trysan;\r\n}", "function sanitize($data){\r\n $conn = db ();\r\n return mysqli_real_escape_string($conn, $data);\r\n}", "function sanitize_input($input) {\n $input = mysql_real_escape_string($input);\n return $input;\n}", "function sqlCode($s, $db){\n\t$result = preg_replace(\"/[^a-zA-Z0-9\\-]+/\", \"\", $s);\n\treturn trim($db->real_escape_string($result));\n}", "function sqlText($s, $db){\n\t// @ ! : _ - = + ? . , ' # / [ ] ( )\n\t$result = preg_replace(\"/[^a-zA-Z0-9@!: \\[\\]\\(\\)_\\-\\=\\+\\?\\.\\,\\'\\#\\/]+/\", \"\", $s);\n\treturn trim($db->real_escape_string($result));\n}", "function db_security($conn, $string) {\n if(ctype_digit($string))\n $string = intval($string);\n else {\n /*mysql_real_escape_string — Protège une commande SQL de la présence de caractères spéciaux*/\n $string = mysqli_real_escape_string($conn, $string);\n $string = addcslashes($string, '%_');\n }\n return ($string);\n }", "function safeSQL($source, &$connection) {\n\t\t// clean all elements in this array\n\t\tif (is_array($source)) {\n\t\t\tforeach($source as $key => $value)\n\t\t\t\t// filter element for SQL injection\n\t\t\t\tif (is_string($value)) $source[$key] = $this->quoteSmart($this->decode($value), $connection);\n\t\t\treturn $source;\n\t\t// clean this string\n\t\t} else if (is_string($source)) {\n\t\t\t// filter source for SQL injection\n\t\t\tif (is_string($source)) return $this->quoteSmart($this->decode($source), $connection);\n\t\t// return parameter as given\n\t\t} else return $source;\t\n\t}", "function protectPasswordFromInjection($sql, $formUse = true) {\n $sql = preg_replace(\"/(from|select|insert|delete|where|drop table|show tables|,|'|#|\\*|--|\\\\\\\\)/i\", \"\", $sql);\n $sql = trim($sql);\n $sql = strip_tags($sql);\n\n if(!$formUse || !get_magic_quotes_gpc())\n $sql = addslashes($sql);\n\n $sql = md5(trim($sql));\n\n return $sql;\n }", "function filterQuery($query){\n $query=htmlspecialchars(stripslashes($query));\n $query=str_ireplace(\"script\", \"blocked\", $query);\n $query=mysql_escape_string($query);\n\n return $query;\n}", "function input_validation($input) {\r\n\r\n global $con;\r\n $input_t = trim($input);\r\n $input_v = mysql_real_escape_string($con, $input_t);\r\n return $input_v;\r\n}", "function fixSQLInjection($value){\n $newstring=$value;\n //echo \"value=\".$value.\"<br/>\";\n $latestPos=0;\n $counter=0;\n if (strpos($value,',')!==false) throw new Exception (\"PASS. Comma is unavaiable as a character. PGSQL doesn\\'t like it :( \");\n //echo \"position of ': \";var_dump(strpos($value,'\\'')); echo \"<br/>\";\n while(($positionOfXrenb=strpos($value,'\\'',$latestPos))!==false){\n //echo \"GG\";\n $newstring = substr($newstring,0,$positionOfXrenb+$counter);\n $newstring.='\\'';\n $newstring.=substr($value,$positionOfXrenb,strlen($value)-$positionOfXrenb);\n //var_dump ($newstring);\n //echo \"<br/>\";\n $latestPos=$positionOfXrenb;\n $value[$positionOfXrenb]='X';\n $counter++;\n \n }\n //var_dump ($newstring);\n return $newstring;\n}", "function SQLFiltering($sql){\n // 해킹 공격을 대비하기 위한 코드\n $sql = preg_replace(\"/\\s{1,}1\\=(.*)+/\", \"\", $sql); // 공백이후 1=1이 있을 경우 제거\n $sql = preg_replace(\"/\\s{1,}(or|and|null|where|limit)/i\", \" \", $sql); // 공백이후 or, and 등이 있을 경우 제거\n $sql = preg_replace(\"/[\\s\\t\\'\\;\\=]+/\", \"\", $sql); // 공백이나 탭 제거, 특수문자 제거\n return $sql;\n}", "function sql_injection($str = NULL, $type = \"string\", $regex = \"/[^a-zA-Z0-9\\/~\\-_.():@,?\\'\\s]+/\") {\n\t\tswitch ($type) {\n\t\t\tcase 'string':\n\t\t\t\t$str = trim($str);\n\t\t\t\treturn preg_replace($regex, \"\", $str);\n\t\t\t\tbreak;\n\n\t\t\tcase 'numeric':\n\t\t\t\tif (is_numeric($str) === FALSE) return null;\n\t\t\t\treturn $str;\n\t\t\t\tbreak;\n\n\t\t\tcase 'date':\n\t\t\t\treturn validate_date_input($str);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'array':\n\t\t\t\tif (is_array($str) === FALSE) return null;\n\t\t\t\treturn $str;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif (is_array($type)) {\n\t\t\t\t\tif (array_key_exists($str, $type)) {\n\t\t\t\t\t\treturn $str;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t} else if (count(explode(\",\",$type)) > 0) {\n\t\t\t\t\t$data = explode(\",\",$type);\n\t\t\t\t\tif (array_search($str, $data) === FALSE) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn $str;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn preg_replace($regex, \"\", $str);\n\t}", "private function mysql_protect($string) \n {\n return @ mysql_escape_string(trim(strip_tags(addslashes($string))));\n }", "public function anti_sql_injection( $valor ) {\n\tif (!is_numeric( $valor )) {\n\t\t $valor = get_magic_quotes_gpc() ? stripslashes( $valor ): $valor ;\n\t\t $valor = function_exists('mysql_real_escape_string') ? mysql_real_escape_string( $valor ) : mysql_escape_string( $valor );\n\t}\n\treturn $valor;\n }", "private function mysql_protect($txt) \n\t\t{\n\t\t\t$txt = $this->link_mt->real_escape_string($txt);\n\t\t\treturn $txt;\n\t\t}", "function sanitizeInput(&$string){\n $string = $this->connection->real_escape_string($string);\n }", "function sql($sql)\n\t{\n\n\t}", "function check_sql($instring,$maxlen)\n {\n // Handling of quotes\n if(!get_magic_quotes_gpc()) $outstring = addslashes($instring);\n else $outstring = $instring;\n\n // Filter out potentially dangerous constructs\n $outstring = ereg_replace(\"&\",\"\\&\",$outstring);\n $outstring = ereg_replace(\";|\\|\",\"#\",$outstring);\n\n // and/or at start of string and followed by spaces\n //$outstring = ereg_replace(\"^[ ]*and[ ]+|^[ ]*or[ ]+\",\"# \",$outstring);\n\n // and/or preceded and followed by spaces\n //$outstring = ereg_replace(\"[ ]+and[ ]+|[ ]+or[ ]+\",\" # \",$outstring);\n\n $outstring = ereg_replace(\"^[ ]*where\",\"#\",$outstring);\n\n if($maxlen>0) $outstring=substr($outstring,0,$maxlen);\n\n return $outstring;\n }", "function protectNicknameFromInjection($sql, $formUse = true) {\n $sql = preg_replace(\"/(from|select|insert|delete|where|drop table|show tables|,|'|#|\\*|--|\\\\\\\\)/i\", \"\", $sql);\n $sql = trim($sql);\n $sql = strip_tags($sql);\n \n if(!$formUse || !get_magic_quotes_gpc())\n $sql = addslashes($sql);\n\n return $sql;\n }", "function cleanParameter($param) {\r\n global $db;\r\n $returnVal = mysqli_real_escape_string($db, $param);\r\n return ($returnVal);\r\n }", "function escaped_str($string)\n{\n $safe_string = Database::getInstance()->getConnection()->real_escape_string($string);\n return $safe_string;\n}", "function safe($fieldname)\n{\n global $db;\n $temp=$_GET[$fieldname];\n $temp=trim($temp);\n $temp=mysqli_real_escape_string($db,$temp);\n echo \"<br>$fieldname is: $temp<br>\";\n \n}", "function sql_real_escape_string($val,$dbh=NULL)\n {\n $s = sql_quote_string($val, $dbh);\n return (string) substr($s, 1, strlen($s) -2 );\n// return addslashes($val);\n }", "function db_input($string) {\n\t$DB = DB::DB()->getLink();\n\treturn $DB->real_escape_string($string);\n}", "function postValidate($string)\r\n\t{\r\n\t $instrucoesSQL = array( \"INSERT\", \"insert\", \"UPDATE\", \"update\", \"DELETE\", \"delete\", \"TRUNCATE\", \"truncate\", \"WHERE\", \"where\" );\r\n\r\n\t $retirandoPossiveisInjections = str_replace($instrucoesSQL, \"\", $string);\r\n\r\n\t return addslashes($retirandoPossiveisInjections);\r\n\t}", "function filtrarSql($valor) {\n\n $valor = str_replace(\"'\", \"\\'\", $valor);\n $valor = str_replace('\"', '\\\"', $valor);\n return $valor;\n}", "function security($input)\n{\n $input = mysql_real_escape_string($input);\n $input = strip_tags($input);\n $input = stripslashes($input);\n return $input;\n}", "function escape($unsafe_string) {\n return mysqli_real_escape_string($dbc , $unsafe_string);\n}", "function escape_sq($str)\n{\n $esc_str = str_replace(\"'\", \"''\", $str);\n return $esc_str;\n}", "function pdo_real_escape_string($str, $link=NULL) {\r\n return substr(pdo_handle($link)->quote($str), 1, -1);\r\n }", "function sanitize( $input ){\n $mysqli = self::dbconnect();\n $input = $mysqli->real_escape_string( $input );\n $input = trim($input);\n $input = htmlentities($input);\n $mysqli->close();\n return $input;\n }", "function test_input($con,$data){\r\n$data=trim($data);\r\n$data= stripslashes($data);\r\n$data= mysqli_real_escape_string($con, $data);\r\n$data= htmlspecialchars($data);\r\nreturn $data;\r\n}", "function check_input($value)\n{\n $value = strip_tags($value);\n $value = htmlentities($value);\n // remove slash\n if (get_magic_quotes_gpc())\n {\n $value = stripslashes($value);\n }\n// add '' on string\n if (!is_numeric($value))\n {\n $value =mysqli_real_escape_string($GLOBALS['conn'],$value);\n }\n return $value;\n}", "function sanitize_sql_string($string, $min='', $max='')\n{\n $string = nice_addslashes($string); //gz\n $pattern = \"/;/\"; // jp\n $replacement = \"\";\n $len = strlen($string);\n if((($min != '') && ($len < $min)) || (($max != '') && ($len > $max)))\n return FALSE;\n return preg_replace($pattern, $replacement, $string);\n}", "function secure_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n // tbd mysql_real_escape_string\r\n return $data;\r\n}", "function sanitizeMySql($conn, $var) {\n $var = $conn->real_escape_string($var);\n $var = sanitizeString($var);\n return $var;\n}", "function mysqli_fake_escape_string($input) { return $input; }", "function clean_for_db_reinsert($value) {\n//$value = str_replace(\"'\", \"''\", $value);\n$value = addslashes($value);\n$value = str_replace(\"\\'\", \"''\", $value);\n\treturn $value;\n\n}", "function sanitizeString($var)\n{\nglobal $connection;\n$var = strip_tags($var);\n$var = htmlentities($var);\n$var = stripslashes($var);\nreturn $connection->real_escape_string($var);\n}", "function escape_query_arg($argument,$db_conn)\r\n{\r\n \t//If magic quotes is on, strip the slashes first \r\n\tif(get_magic_quotes_gpc())\r\n\t\t$query = stripslashes($argument);\r\n\r\n\tif(function_exists('mysql_real_escape_string'))\r\n\t\treturn mysql_real_escape_string($argument,$db_conn);\r\n\telse\r\n\t\treturn mysql_escape_string($argument);\t\r\n}", "function sanitize_sql_orderby($orderby)\n {\n }", "function _replacePlaceholdersInSQL(&$data){\n // allow current user name in filter:\n $data['sql'] = str_replace('%user%', $_SERVER['REMOTE_USER'], $data['sql']);\n // allow current date in filter:\n $data['sql'] = str_replace('%now%', dformat(null, '%Y-%m-%d'),$data['sql']);\n }", "function str_sanitize($str){\n\t\t global $database;\n\t\t $str = $database->real_escape_string($str);\n\t return trim($str);\t\n}", "function mysql_prep($v){\n\t\tglobal $myconn;\n\t\t$v = trim($v);\n\t\t$v = $myconn->real_escape_string($v);\n\t\t\n\t\treturn $v;\n\t}", "function escape($s) {\r\n //return mysql_real_escape_string(strip_tags($s)); // uncomment in when you will use connection with database\r\n return strip_tags($s);\r\n}", "function quoteInput($value){\n\treturn mysqli_real_escape_string($this->conn,$value);\n}", "function pdo_escape_string($str, $link=NULL) {\r\n return pdo_real_escape_string($str, $link);\r\n }", "function esc_sql($data)\n {\n }", "function sqlite_escape_string($string)\n{\n $string = SQLite3::escapeString($string);\n $string = filter_var($string, FILTER_SANITIZE_STRING);\n return $string;\n}", "function db_escape($input)\n{\n\tglobal $db;\n\treturn $db->real_escape_string($input);\n}", "function OnlineSQLdecode($strPass){\n //\tstrPass = Replace(strPass, \"'%'\", \"%\")\n //\tstrPass = Replace(strPass, \"''\", \"'\")\n //\tstrPass = Replace(strPass, \"'|'\", \"|\")\n //\tOnlineSQLdecode = strPass\n //End If\n return $strPass;\n}", "function escape($string){\n global $connection;\n //var_dump($string);\n //var_dump(mysql_real_escape_string($connection,$string));\n //die;\n return mysqli_real_escape_string($connection,$string);\n}", "function check_input($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = htmlentities($data);\n $data = mysql_real_escape_string($data);\n return $data;\n}", "function check_input($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = htmlentities($data);\n $data = mysql_real_escape_string($data);\n return $data;\n}", "function sanitize($conn, $val){\n\t\t$val = stripslashes($val);\n\t\t$val = mysqli_real_escape_string($conn, $val);\n\t}", "function preventSQLInjection($code, $mysqli, $array,$getId=false){\n $stmt = $mysqli->prepare($code); \n $types = str_repeat('s', count($array)); \n $stmt->bind_param($types, ...$array); \n $stmt->execute();\n if($getId==true)\n return $mysqli->insert_id;\n}", "public function blnIsSqlInjectionSafe($strSub) {\n $arrMatches = array();\n $strPattern = \"/('\\\\s*(INSERT|UPDATE|DELETE)\\\\s*)/i\";\n if(\n preg_match(\n $strPattern, \n $strSub, \n $arrMatches\n )\n ) {\n $strDetails = \"\";\n if($this->blnDebug) $strDetails .= \" PATTERN: \".$strPattern;\n $this->XaoThrow(\n \"An SQL Injection attack has been detected. The database \" .\n \"query has not been executed and your request has been ignored.\"\n .$strDetails\n );\n return false;\n }\n return true;\n }", "function DMASanSQL($query)\n{\n if (is_string($query))\n {\n $sanQuery = mysql_real_escape_string($query);\n }\n return $sanQuery;\n}", "function q() {\n\t$args = func_get_args();\n\tif(func_num_args()===1) return $args[0];\n\treturn vsprintf(array_shift($args), array_map('mysql_real_escape_string',$args));\n}", "function safe_import($data)\n {\n return trim(mysql_real_escape_string($data));\n }", "private static function escapeSql($s) // {{{\n {\n $matches = array(\"\\\\\", \"'\", \"\\\"\" /*,\"\\0\", \"\\b\", \"\\n\", \"\\r\", \"\\t\"*/);\n $replacements = array(\"\\\\\\\\\", \"\\\\'\", \"\\\\\\\"\", /*\"\\\\0\", \"\\\\b\", \"\\\\n\", \"\\\\r\",\n \"\\\\t\"*/);\n $st = str_replace($matches, $replacements, $s);\n return $st;\n }", "function escape($string) {\n\tglobal $connection;\n\treturn mysqli_real_escape_string($connection, trim($string));\n\n}", "public static function setAntiInjection($string)\n {\n if (is_string($string)) {\n $string = preg_replace(\"/(select\\s|insert\\s|update\\s|delete\\s|truncate\\s|drop\\s|create\\s|alter\\s|delimiter\\s)|(SELECT\\s|INSERT\\s|UPDATE\\s|DELETE\\s|WHERE\\s|TRUNCATE\\s|DROP\\s|CREATE\\s|ALTER\\s|DELIMITER\\s)/\", \"\", $string);\n $string = trim($string);\n $string = addslashes($string);\n //$string = htmlentities($string);\n }\n return $string;\n }", "function dbescape($str) {\r\n\tglobal $msq;\r\n\treturn mysqli_real_escape_string($msq, $str);\r\n}", "public function _clean_by_sql($sql = '')\n {\n }", "function DB_real_escape($string){\n\n $connection = DB_get_connection();\n return mysqli_real_escape_string($connection, $string);\n\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 sanitizeDBData($input) {\n $halfSan = filter_var($input, FILTER_SANITIZE_EMAIL);\n\n //sets slashes infront of \" ' and \\\n $output = filter_var($halfSan, FILTER_SANITIZE_MAGIC_QUOTES);\n\n return $output;\n}", "function sanitize($data){\n$data=trim($data);\n$data=htmlspecialchars($data);\n$data=mysql_real_escape_string($data);\nreturn $data;\n}", "function confirm_query($string){\r\n \tif(!$string){\r\n \t\tdie(\"Problem in the query\");\r\n \t}\r\n }", "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 escape($string){\n \n global $connection;\n\n return mysqli_real_escape_string($connection, trim($string));\n}", "function SqlClean($s)\n{\n if(gettype($s) != \"string\") return $s;\n $okay_chars =\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ0123456789\";\n $okay_chars .=\"~`!@#$%^&*()-_=+[]{}\\|;:,.<>/? \"; \n $out = \"\";\n while(!blank($s) && $s !== false)\n {\n $c = substr($s, 0, 1);\n $s = substr($s, 1);\n $w = stripos($okay_chars, $c);\n if($w === FALSE) $out .= ' ';\n else $out .= $c;\n }\n return $out;\n}", "function sanitize($input){\n\tglobal $link;\n\t$input = htmlentities(strip_tags(trim($input)));\n\t$input = mysqli_real_escape_string($link, $input);\n\treturn $input;\n}", "function sanitize($data)\n {\n $data=trim($data);\n $data=mysql_real_escape_string($data);\n return $data;\n }", "function safe_import($data)\n {\n return trim(mysql_real_escape_string($data));\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 check_string($con, $string){\n $string = $con->real_escape_string($string);\n $string = strip_tags($string);\n $string = stripslashes($string);\n return $string;\n}", "public function inject()\n\t{\n\t\t$insert = '?id=1%27 and 1%3d1 union select ';\n\t\treturn $insert;\n\t}", "function escape_string($string){\n global $Connection;\n return mysqli_real_escape_string($Connection,$string);\n}", "public function sanitize($str){\n\t\tglobal $con;\n\t\t$invalid_characters = array(\"$\", \"%\", \"#\", \"<\", \">\", \"|\");\n\t\t$str = str_replace($invalid_characters, \"\", $str);\n\t\t$str=mysqli_real_escape_string($con,$str);\n\t\treturn $str;\n\t}", "function OnlineSQLencode($strPass){\n //\tstrPass = Replace(strPass, \"'\", \"\")\n //\tstrPass = Replace(strPass, \"|\", \"\")\n //\tstrPass = Replace(strPass, \"(\", \"\")\n //\tstrPass = Replace(strPass, \")\", \"\")\n //\tstrPass = Replace(strPass, \";\", \"\")\n //\tOnlineSQLencode = strPass\n //End If\n return $strPass;\n}", "function db_input($query_string, $link = 'db_link') {\n global $dblink;\n\n if (function_exists('mysqli_real_escape_string')) { // using PHPs function mysqli_real_escape_string (if already added)\n return mysqli_real_escape_string($dblink, $query_string);\n }\n\n return addslashes($query_string); // PHP function that adds slashes for adding to database safely\n\n}", "public function fetchSqlString();", "function real_escape($str){\n global $con;\n $escape = mysqli_real_escape_string($con,$str);\n return $escape;\n}", "function cleanInput($string)\n {\n return \"'\".mysql_real_escape_string($string, $this->LinkID).\"'\";\n }", "function escapeSQL($string, $wildcard=false)\n{\n\t$db = &atkGetDb();\n\treturn $db->escapeSQL($string, $wildcard);\n}", "function real_escape($string){\n global $con;\n $escape = mysqli_real_escape_string($con,$string);\n return $escape;\n}", "function mysql_safe_string($string)\n{\n if (get_magic_quotes_gpc() == 1)\n {\n $string = stripslashes($string);\n }\n\n if (function_exists(mysql_real_escape_string))\n {\n $string = mysql_real_escape_string($string);\n }\n else\n {\n $string = mysql_escape_string($string);\n }\n\n return trim($string);\n}", "function clean_input( $dirty_data ){\n\t//use the DB connection already established\n\tglobal $db;\n\t//clean the data and 'return' it so we can continue working with it\n\treturn mysqli_real_escape_string($db, strip_tags( $dirty_data ));\n}", "function mysql_prep_string($string) {\n global $db;\n return mysqli_real_escape_string($db->connection, htmlentities(strip_tags($string)));\n}", "function db_quote($value) {\n $connection = db_connect();\n return \"'\" . mysqli_real_escape_string($connection,$value) . \"'\";\n}", "function db_escape($connection, $string) {\n return mysqli_real_escape_string($connection, $string);\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}" ]
[ "0.7825689", "0.7748916", "0.7616032", "0.74244237", "0.7396642", "0.7092402", "0.6979242", "0.6972377", "0.6955046", "0.69055533", "0.6900027", "0.6862638", "0.6852522", "0.683997", "0.6827798", "0.6825387", "0.6807795", "0.68003863", "0.6790813", "0.6764267", "0.6743012", "0.673113", "0.6723234", "0.6717908", "0.6711656", "0.66617393", "0.66553617", "0.6649985", "0.66298586", "0.66273534", "0.6618519", "0.6590438", "0.6583237", "0.6581984", "0.6570788", "0.65604246", "0.6548945", "0.65474296", "0.65450144", "0.653754", "0.65347964", "0.6518055", "0.6501568", "0.6491099", "0.6450507", "0.6448548", "0.6444989", "0.6440275", "0.6438534", "0.64239186", "0.642201", "0.6414381", "0.6403692", "0.6403273", "0.639968", "0.63910025", "0.63823", "0.6379066", "0.63783115", "0.63783115", "0.6377496", "0.6371419", "0.63681793", "0.636179", "0.6349319", "0.63363963", "0.63330114", "0.631677", "0.6316215", "0.63148797", "0.6309247", "0.63088", "0.63020855", "0.6301899", "0.63016784", "0.62967885", "0.62815756", "0.626811", "0.62537706", "0.6252011", "0.6250569", "0.6245564", "0.6240376", "0.6239681", "0.62297785", "0.6227319", "0.6221382", "0.62175244", "0.62161446", "0.62094563", "0.6199877", "0.6190259", "0.6185965", "0.6183071", "0.6182978", "0.61818105", "0.61777925", "0.617761", "0.6173533", "0.6152716" ]
0.71296126
5
Computes total price with subcalculations.
public function computeTotal(FinancialInterface $financial): FinancialTotalData { $totalData = new FinancialTotalData(); $fractionDigits = $financial->getCurrency()->getFractionDigits(); $items = $financial->getItems(); // invoice supports only percentage discount $discountCoefficient = 1; if ($financial->getDiscountType() === FinancialInterface::DISCOUNT_PERCENTAGE) { $discountCoefficient = (100 - $financial->getDiscountValue()) / 100; } foreach ($items as $item) { $itemTotal = $item->getTotal(); if ($item instanceof FinancialItemServiceInterface) { $itemTotal += $item->getDiscountTotal(); } if ($financial->getItemRounding() === FinancialInterface::ITEM_ROUNDING_STANDARD) { $itemTotal = round($itemTotal, $fractionDigits); } $totalData->subtotal += $itemTotal; $taxLimit = $financial->getPricingMode() === Option::PRICING_MODE_WITH_TAXES ? 1 : 3; for ($i = 1; $i <= $taxLimit; ++$i) { /** @var Tax|null $tax */ $tax = $item->{"getTax$i"}(); $taxRate = $item->{"getTaxRate$i"}(); if (! $taxRate) { continue; } $itemTax = $this->taxCalculator->calculateTax( $itemTotal, $taxRate, $financial->getPricingMode(), $financial->getTaxCoefficientPrecision() ); $itemTax *= $discountCoefficient; if ($financial->getTaxRounding() === FinancialInterface::TAX_ROUNDING_PER_ITEM) { $itemTax = round($itemTax, $fractionDigits); } $taxKey = $tax ? sprintf('%s - %s%%', $tax->getName(), $taxRate) : $taxRate; if (array_key_exists($taxKey, $totalData->totalTaxes)) { $totalData->totalTaxes[$taxKey] += $itemTax; } else { $totalData->totalTaxes[$taxKey] = $itemTax; } if (array_key_exists($taxKey, $totalData->taxReport)) { $totalData->taxReport[$taxKey]['total'] += $itemTax; } else { $totalData->taxReport[$taxKey] = [ 'tax' => $tax, 'taxRate' => $taxRate, 'currency' => $financial->getCurrency(), 'total' => $itemTax, ]; } } $totalData->totalDiscount += $itemTotal * (1 - $discountCoefficient); } $totalData->subtotal = round($totalData->subtotal, $fractionDigits); $totalData->totalTaxAmount = 0.0; foreach ($totalData->totalTaxes as $key => $taxPrice) { $totalData->totalTaxes[$key] = round($taxPrice, $fractionDigits); $totalData->totalTaxAmount += $totalData->totalTaxes[$key]; } $totalData->totalTaxAmount = round($totalData->totalTaxAmount, $fractionDigits); // This is intentionally rounded before applying the minus sign. Although PHP rounds negative values using // half down algorithm rather than half up even when using the default rounding named PHP_ROUND_HALF_UP. $totalData->totalDiscount = round($totalData->totalDiscount, $fractionDigits); $totalData->totalDiscount *= -1; switch ($financial->getPricingMode()) { case Option::PRICING_MODE_WITHOUT_TAXES: $totalData->totalUntaxed = $totalData->subtotal + $totalData->totalDiscount; $totalData->total = $totalData->totalUntaxed + $totalData->totalTaxAmount; break; case Option::PRICING_MODE_WITH_TAXES: $totalData->total = $totalData->subtotal + $totalData->totalDiscount; $totalData->totalUntaxed = $totalData->subtotal - $totalData->totalTaxAmount; break; default: throw new \InvalidArgumentException('Unknown pricing mode.'); } // Adding and subtracting can cause minor rounding errors as well. $totalData->totalUntaxed = round($totalData->totalUntaxed, $fractionDigits); $financial->setTotal($totalData->total); $financial->setSubtotal($totalData->subtotal); $financial->setTotalUntaxed($totalData->totalUntaxed); $financial->setTotalDiscount($totalData->totalDiscount); $financial->setTotalTaxAmount($totalData->totalTaxAmount); $financial->setTotalTaxes($totalData->totalTaxes); $this->roundTotal($financial); return $totalData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function calcTotal()\n {\n\n $productBusinessService = new ProductBusinessService();\n\n // create an array to hold all subtotals\n $subtotals_array = array();\n $this->total_price = 0;\n\n foreach ($this->items as $item => $qty) {\n\n // get the price of the product from the database\n $product = $productBusinessService->getProductByID($item);\n\n // calculate the total (price * quantity)\n $product_subtotal = $product->getPrice() * $qty;\n\n // add that subtotal to the subtotal array\n $subtotals_array = $subtotals_array + array($item => $product_subtotal);\n\n // add the item subtotal to the cart total\n $this->total_price += $product_subtotal;\n }\n\n // set the subtotals array\n $this->subtotals = $subtotals_array;\n }", "public function calculateTotalPrice()\n {\n $this->price = CartHelper::getTotalPrice();\n\n if ($this->shippingCarrierId) {\n $shippingCarrier = ShippingCarrier::find($this->shippingCarrierId);\n if ($shippingCarrier) {\n $this->price += TaxesHelper::calcPriceWithTax($shippingCarrier->price);\n }\n }\n\n if ($this->paymentMethodId) {\n $paymentMethod = PaymentMethod::find($this->paymentMethodId);\n if ($paymentMethod) {\n $this->price += TaxesHelper::calcPriceWithTax($paymentMethod->price);\n }\n }\n\n $this->taxes = TaxesHelper::calcTaxPrice($this->price);\n }", "abstract function total_price($price_summary);", "public function __subTotal($items) {\n\n $price = 0.0;\n\n foreach ($items as $item) {\n\n// if ($item['currency_id'] == 2)\n// $currency = 1;\n//\n// if ($item['currency_id'] == 1)\n// $currency = 4.17;\n//\n// if ($item['currency_id'] == 3)\n// $currency = 4.50;\n\n //$price += $this->__lineItemTotal($item['qty'], $item['price'], $item['taxRate'], $item['currency_id']);\n //$price += $item['qty'] * $item['price'] * $currency;\n $price += $item['qty'] * $item['price'] * $item['rate'];\n }\n\n return $price;\n }", "function calculateTotalPrice()\n {\n $this->sellingPrice = $this->bid;\n $this->buyersPremium = $this->sellingPrice * 0.1;\n $this->totalPrice = $this->sellingPrice + $this->buyersPremium;\n\n return $this->totalPrice;\n }", "public function individual_products_total() {\n\n foreach($this->remaining_category_price as $remaining_category_prices){\n $this->individual_products_total += $remaining_category_prices['price'];\n }\n\n }", "public function getTotalPrice();", "public function getTotalPrice();", "public function subtotal()\n\t{\n\t\tif(count($this->cart) > 0)\n\t\t{\n\t\t\t$products = \\Model_Products::build();\n\t\t\tforeach($this->cart as $key => $item)\n\t\t\t{\n\t\t\t\t$products->or_where('ProductID', $key);\n\t\t\t}\n\t\t\t$products->selector('Product_Price, ProductID');\n\n\t\t\t$prices = $products->execute();\n\n\t\t\t$subtotal = 0;\n\n\t\t\tforeach($prices as $price)\n\t\t\t{\n\t\t\t\t$subtotal += (int)$price->Product_Price*$this->cart[$price->ProductID];\n\t\t\t}\n\t\t\t\n\t\t\treturn $subtotal;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getTotalPrice() {\n return $this->getQuantity()*$this->getPrice();\n }", "public function getSubTotal()\n {\n if (($this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity() && $this->unit_price_overridden == 'false'\n ) {\n return $this->unit_price * $this->getMinimumQuantity();\n } else {\n return $this->unit_price * $this->quantity;\n }\n\n }", "protected function calculatetotal()\n {\n $total = $this->UnitPrice() * $this->Quantity;\n $this->extend('updateTotal', $total);\n $this->CalculatedTotal = $total;\n return $total;\n }", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "public function total(): float\n {\n $price = $this->price;\n\n /* if ($this->hasOptions()) {\n foreach ($this->data['options'] as $item) {\n if (array_key_exists('price', $item)) {\n $price += $item['price'];\n }\n }\n }\n\n if ($includeTax) {\n $price = $this->tax->add($price);\n }*/\n\n return (float)($price * $this->quantity);\n }", "public function getTotalPrice()\n\t{\n\t\t$total = 0.0;\n\n\t\tforeach ($this->items as $item)\n\t\t{\n $total += $item->getPrice() + $item->getExtrasPrice();\n }\n\n\t\treturn $total;\n\t}", "function priceCart(){\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$sum += $book['precio']*$book['cantidad'];\n\t\t}\n\t\treturn $sum;\n\t}", "protected function calculatePrice()\n {\n $amount = 5 * $this->rate;\n $this->outputPrice($amount);\n }", "function totalPrice() {\n\n $total = 0;\n\n global $con;\n\n $ip = getIp();\n\n $run_price = mysqli_query($con,\"SELECT * FROM cart WHERE ip_add = '$ip'\");\n\n while($row_pro_price = mysqli_fetch_array($run_price)) {\n\n $pro_id = $row_pro_price['p_id'];\n $pro_qty = $row_pro_price['qty'];\n\n $run_pro_price2 = mysqli_query($con,\"SELECT * FROM products WHERE product_id = '$pro_id'\");\n\n while($row_pro_price2 = mysqli_fetch_array($run_pro_price2)) {\n\n $pro_price = array($row_pro_price2['product_price']);\n\n $pro_price_single = $row_pro_price2['product_price'];\n\n $pro_price_values = array_sum($pro_price);\n\n\n $total += $pro_price_values;\n\n if($pro_qty > 1) {\n $pro_price_single_all = $pro_price_single * $pro_qty;\n $total = $total + $pro_price_single_all - $pro_price_single;\n }\n\n\n }\n\n }\n echo \"$\" . $total;\n }", "public function getTotalPrice()\n {\n $tax = $this->tax->tax;\n $price = $this->getFinalPrice();\n $shipping = $this->shipping_cost;\n\n return ((($price + $shipping) * $tax) + $price + $shipping);\n }", "public function initTotal()\n {\n // Return val.\n $temp = 0;\n // Add cone price.\n $temp += $this->coneType['price'];\n // Add all scoops of ice cream.\n foreach ($this->scoops as $scoop) {\n $temp += $scoop['price'];\n }\n // Return total item cost.\n return $temp;\n }", "protected function calculatePrices()\n {\n }", "public function getTotalPrice()\n {\n // use format_currency to get correct decimals and avoid rounding errors\n return $this->getQuantity() * format_currency($this->getProductPrice(),null, true);\n// return $this->getQuantity() * format_currency($this->getNetPrice(),null, true);\n }", "function calculate()\n {\n $this->first_period = $this->second_period = $this->rebill_times = null;\n foreach ($this->getCalculators() as $calc)\n $calc->calculate($this);\n // now summarize all items to invoice totals\n $priceFields = array(\n 'first_subtotal' => null,\n 'first_discount' => 'first_discount',\n 'first_tax' => 'first_tax',\n 'first_shipping' => 'first_shipping',\n 'first_total' => 'first_total',\n 'second_subtotal' => null,\n 'second_discount' => 'second_discount',\n 'second_tax' => 'second_tax',\n 'second_shipping' => 'second_shipping',\n 'second_total' => 'second_total',\n );\n foreach ($priceFields as $k => $kk)\n $this->$k = 0.0;\n foreach ($this->getItems() as $item) {\n $this->first_subtotal += moneyRound($item->first_price * $item->qty);\n $this->second_subtotal += moneyRound($item->second_price * $item->qty);\n foreach ($priceFields as $k => $kk)\n $this->$k += $kk ? $item->$kk : 0;\n }\n foreach ($priceFields as $k => $kk)\n $this->$k = moneyRound($this->$k);\n /// set periods, it has been checked for compatibility in @see add()\n $mostExpensiveItem = null;\n foreach ($this->getItems() as $item) {\n if (!$mostExpensiveItem || $item->first_price > $mostExpensiveItem->first_price) {\n $mostExpensiveItem = $item;\n }\n $this->currency = $item->currency;\n if (empty($this->first_period) && $item->rebill_times)\n $this->first_period = $item->first_period;\n if (empty($this->second_period))\n $this->second_period = $item->second_period;\n if (empty($this->rebill_times))\n $this->rebill_times = $item->rebill_times;\n $this->rebill_times = max($this->rebill_times, $item->rebill_times);\n }\n\n // First period is empty, invoice has only one time items,\n // set first period from most expensive item.\n if (empty($this->first_period) && $mostExpensiveItem) {\n $this->first_period = $mostExpensiveItem->first_period;\n }\n\n if ($this->currency == Am_Currency::getDefault())\n $this->base_currency_multi = 1.0;\n else {\n $this->base_currency_multi = $this->getDi()->currencyExchangeTable->getRate($this->currency,\n sqlDate(!empty($this->tm_added) ? $this->tm_added : $this->getDi()->sqlDateTime));\n if (!$this->base_currency_multi)\n $this->base_currency_multi = 1;\n }\n $this->getDi()->hook->call(Am_Event::INVOICE_CALCULATE, array('invoice' => $this));\n\n $this->terms = null;\n if ((count($this->getItems()) == 1) &&\n ($item = $this->getItem(0)) &&\n ($item->item_type == 'product') &&\n ($pr = $item->tryLoadProduct()) &&\n ($bp = $pr->getBillingPlan()) &&\n $bp->terms) {\n\n if (((float)$bp->first_price == (float)$this->first_total) &&\n ($bp->first_period == $this->first_period) &&\n ((float)$bp->second_price == (float)$this->second_total) &&\n ($bp->second_period == $this->second_period) &&\n ($bp->rebill_times == $this->rebill_times)\n ) {\n $this->terms = $bp->terms;\n }\n }\n\n $this->terms = $this->getDi()->hook->filter($this->terms,\n Am_Event::INVOICE_TERMS, array('invoice' => $this));\n\n return $this;\n }", "function total_price() {\n\t\n\t $ip_add = getRealIpAddr();\n\t\t\n\t\tglobal $db;\n\t\t\n\t\t$total=0;\n\t\t\n\t\t$sel_price = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_price = mysqli_query($db, $sel_price);\n\t\t\n\t\twhile ($record= mysqli_fetch_array($run_price)){\n\t\t\t\n\t\t\t$pro_id = $record['p_id'];\n\t\t\t\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\t\t\t\n\t\t\t$run_pro_price = mysqli_query($db,$pro_price);\n\t\t\t\n\t\t\twhile($p_price=mysqli_fetch_array($run_pro_price)){\n\t\t\t\t\n\t\t\t\t$product_price = array($p_price['product_price']);\n\t\t\t\t\n\t\t\t\t$values = array_sum($product_price);\n\t\t\t\t\n\t\t\t\t$total += $values;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\techo \"Rs\" . $total;\n\t\n}", "public function getPrice() {\n $sum = parent::getPrice();\n foreach ($this->extraItems as $extraItem) {\n $sum += $extraItem->getPrice();\n }\n return $sum;\n }", "public function get_rows_total_price()\n\t{\n\t\t// TODO: This price should be stored not calculated every time!\n\t\t$total = 0;\n\n\t\tforeach ($this->get_rows() as $row)\n\t\t{\n\t\t\t$total += $row->prop(\"price\") * $row->prop(\"items\");\n\t\t}\n\n\t\treturn $total;\n\t}", "private function _calculateTotal()\n {\n\n if (!is_null($this->shipping_option_id)) {\n $this->total = $this->unit_price * $this->quantity - $this->promotion_amount -\n $this->discount_amount;\n $this->save();\n return;\n }\n\n if ($this->quantity == 0) {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if (is_null($pricing = $this->getPricing()) && $this->unit_price_overridden == 'false') {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if ($this->unit_price_overridden != 'true') {\n $this->unit_price = $pricing->price;\n }\n\n // Reset promotion to capture any adjustments affecting discount\n if (!is_null($promotion = $this->promotion)) {\n $this->save();//flush current values to db for promo calculations\n $promotion->calculate($this->invoice);\n $this->refresh();\n }\n\n /**\n * Multipay discount\n */\n if (!$this->invoice->discount_id && 'incomplete' == $this->invoice->status) {\n $discount = $this->invoice->user->account()->discounts()->active()->first();\n } else {\n $discount = $this->invoice->discount;\n }\n if ($discount) {\n // flush current values to db prior to calculations\n if (count($this->getDirty())) {\n $this->save();\n }\n $discount->calculate($this->invoice);\n $this->refresh();\n }\n\n $this->total = $this->getSubTotal() - $this->promotion_amount - $this->discount_amount;\n $this->save();\n }", "function price(){\n\n\t\t$total = 0; //initialize to 0 lest error\n\n\t\tglobal $con;\n\n\t\t$ip=getIP();\n\n\t\t$sel_price = \"select * from cart where ip_add='$ip'\"; //get price from what is in the cart for whoevers ip address\n\n\t\t$run_price = mysqli_query($con, $sel_price);\n\n\t\twhile ($p_price = mysqli_fetch_array($run_price)){\n\n\t\t\t$pro_id = $p_price['p_id'];\n\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\n\t\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\n\t\t\t//link to the products table to get prices\n\t\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){\n\n\t\t\t\t$product_price = array($pp_price['product_price']);\n\t\t\t\t//array to get all the prices in one\n\n\t\t\t\t$values = array_sum($product_price);\n\n\t\t\t\t$total +=$values; //sum\n\n\t\t\t}\n\t\t}\n\n\t\techo \"Ksh\" . $total;\n\n\t}", "public function getSubTotalCost()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->SubTotal) {\n $total += $item->SubTotal;\n }\n }\n \n return $total;\n }", "public function subtotal()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return $item['price'] * $item['quantity'];\n })->reduce(function($carry, $item) {\n return $carry + $item;\n });\n }", "function total_price(){\r\n\t\t$total = 0;\r\n\t\tglobal $con;\r\n\t\t$ip=getIp();\r\n\t\t$sel_price = \"select * from cart where ip_add='$ip'\";\r\n\t\t$run_price = mysqli_query($con,$sel_price);\r\n\t\twhile($p_price=mysqli_fetch_array($run_price)){\r\n\t\t\t\r\n\t\t\t$painting_id = $p_price['painting_id'];\r\n\t\t\t$painting_price = \"select * from painting where painting_id='$painting_id'\";\r\n\t\t\t$run_painting_price = mysqli_query($con,$painting_price);\r\n\t\t\twhile($pp_price = mysqli_fetch_array($run_painting_price)){\r\n\t\t\t\t\r\n\t\t\t\t$painting_price = array($pp_price['painting_price']);\r\n\t\t\t\t$values = array_sum($painting_price);\r\n\t\t\t\t\r\n\t\t\t$total += $values;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\techo \"$\".$total;\r\n\t\t\r\n\t}", "function calculerTotal () {\n\t $total = 0;\n\t \n\t foreach ($this->lignes as $lp) {\n\t $prod = $lp->prod;\n\t $prixLigne = $prod->prix * $lp->qte ;\n\t $total = $total + $prixLigne ;\n\t }\n\t \n\t return $total;\n\t }", "function total_price(){\n\t\n\t\t$total = 0;\n\t\t\n\t\tglobal $con; \n\t\t\n\t\t$ip = getIp(); \n\t\t\n\t\t\n\t\tif(isloggedin()){\n\t\t $c_id=$_SESSION['cid'];\n\t\t \n\t\t $sel_price = \"select * from cart where customer_id='$c_id'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t \n\t\t }\n\t\t}\n\t\telse{\n \t\t \n \t\t$sel_price = \"select * from cart where ip_add='$ip' AND customer_id='0'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t\n\t\t }\n\t\t\n\t\t}\n\t\t\n\t\techo \" €\" . $total.\" \";\n\t\t\n\t}", "function total_price(){\n\t\t//total price starts from 0\n\t\t$total=0;\n\tglobal $connection;\n\t\t$ip=getIp();\n\t\t//taken data from cart table using the customers ip address\n\t\t$select_price = \"select * from cart where ip_address='$ip'\";\n\t\t$run_price = mysqli_query($connection,$select_price);\n\t\t//this while loop takes data from product table according to the product id \n\t\twhile($product_price=mysqli_fetch_array($run_price)){\n\t\t\t$product_id=$product_price['product_id'];\n\t\t\t$product_price=\"select * from products where product_id='$product_id'\";\n\t\t\t$run_product_price=mysqli_query($connection, $product_price);\n\t\t\t//used an array to get all data into a single variable \n\t\t\twhile($pp_price=mysqli_fetch_array($run_product_price)){\n\t\t\t\t//product prices set in the array to add up\n\t\t\t\t$product_price=array($pp_price['product_price']);\n\t\t\t\t$values=array_sum($product_price);\n\t\t\t\t//total price \n\t\t\t\t$total +=$values;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo \"LKR. \" . $total;\n\t}", "public function getTotal()\n {\n $subTotal = $this->getSubTotal(false);\n\n $newTotal = 0.00;\n\n $process = 0;\n\n $conditions = $this\n ->getConditions()\n ->filter(function (CartCondition $cond) {\n return $cond->getTarget() === 'total';\n });\n\n // if no conditions were added, just return the sub total\n if (!$conditions->count()) {\n return Helpers::formatValue($subTotal, $this->config['format_numbers'], $this->config);\n }\n\n $conditions\n ->each(function (CartCondition $cond) use ($subTotal, &$newTotal, &$process) {\n $toBeCalculated = ($process > 0) ? $newTotal : $subTotal;\n\n $newTotal = $cond->applyCondition($toBeCalculated);\n\n $process++;\n });\n\n return Helpers::formatValue($newTotal, $this->config['format_numbers'], $this->config);\n }", "public function getTotalPrice(): float;", "public function calculateTotalPrice($items){\n $total = 0;\n foreach($items as $item){\n $total += $item['subtotal'];\n }\n return $total;\n }", "function total_price2(){\n\tglobal $conn;\n\t$ip = getIp();\n\t$total=0;\n\t$get_cart =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip'\");\n\twhile ( $row_cart=mysqli_fetch_array($get_cart)) {\n\t\t# code...\n\n\t\t$quantity= $row_cart[\"qty\"];\n\t\t$product_id=$row_cart['p_id'];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\twhile ( $row_price = mysqli_fetch_array($get_price)) {\n\t\n\t\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\t$total +=$sub_total;\n\t}\n\t\n\t}\n\t\n\n\treturn $total;\n\n\t\n}", "public function getTotal()\n {\n return $this->getAmount() * $this->getPrice();\n }", "public function getTotal(){\n $cantidad = $this->cantidad;\n\t\treturn $this->productos\n\t\t\t\t\t\t->map(function($prod){return $prod->precio;})\n\t\t\t\t\t\t->reduce(function($acum, $elem)use($cantidad){\n return $acum + ($elem * $cantidad);\n });\n\t}", "function total_price($totals){\n $sum = 0;\n $sub = 0;\n foreach($totals as $total ){\n $sum += $total['total_saleing_price'];\n $sub += $total['total_buying_price'];\n $profit = $sum - $sub;\n }\n return array($sum,$profit);\n}", "public function subtotal()\n {\n $subTotal = 0;\n foreach($this->items as $item) {\n $subTotal += $item->get(Cart\\Item::KEY_AMOUNT);\n }\n return $subTotal;\n }", "function total_price($price_summary) {\r\n return ($price_summary ['OfferedPriceRoundedOff']);\r\n }", "function totalPrice(){\n $ip_add=getRealIpAddr();\n global $db;\n $total = 0;\n $sel_price = \"SELECT * FROM cart where ip_add = '$ip_add'\";\n $run_price = mysqli_query($db, $sel_price);\n while ($record = mysqli_fetch_array($run_price)) {\n $pro_id = $record['p_id'];\n $pro_price = \"SELECT * FROM products where product_id = '$pro_id'\";\n $run_pro_price = mysqli_query($db, $pro_price);\n while ($p_price = mysqli_fetch_array($run_pro_price)) {\n $product_price = array($p_price['product_price']);\n $values = array_sum($product_price);\n $total += $values;\n }\n }\n echo \"$\" . $total;\n}", "public function total(): float\n {\n return $this->itemsPrice()->sum(fn (array $item) => $item['price']);\n }", "function CalculTotal($prix) {\n\n $this->totalHT += $prix;\n $this->totalTTC += $prix * (1 + ($this->TVA / 100));\n\n }", "function total( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the items or not? If $zcarriage='NO' exclude the zcarriage from the total cost\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND sku<>'zcarriage'\" : '';\n\n\t\t// The pu already contains vat\n\t\t$res = $this->db->query( \"SELECT SUM(ci.qty*ci.pu) price FROM cart_items ci INNER JOIN cart c ON c.id=ci.cart_id WHERE cart_id='\".$cart_id.\"' AND user='\".$user_no.\"' AND qty>0\".$zcarriage )->row_array();\n\t\treturn $res[ 'price' ];\n\t}", "function total_price(){\n\nglobal $db;\n\n$ip_add = getRealUserIp();\n\n$total = 0;\n\n$select_cart = \"select * from cart where ip_add='$ip_add'\";\n\n$run_cart = mysqli_query($db,$select_cart);\n\nwhile($record=mysqli_fetch_array($run_cart)){\n\n$pro_id = $record['p_id'];\n\n$pro_qty = $record['qty'];\n\n\n$sub_total = $record['p_price']*$pro_qty;\n\n$total += $sub_total;\n\n\n\n\n\n\n}\n\necho \"$\" . $total;\n\n\n\n}", "function getTotalPrice(){\n \treturn $this->myCart->total();\n }", "function calculate_totals() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$this->reset_totals();\n\t\t\t\n\t\t\t// Get count of all items + weights + subtotal (we may need this for discounts)\n\t\t\tif (sizeof($this->cart_contents)>0) foreach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\t\n\t\t\t\t$this->cart_contents_count \t= $this->cart_contents_count + $values['quantity'];\n\t\t\t\t\n\t\t\t\t// Base Price (inlusive of tax for now)\n\t\t\t\t$base_price \t\t\t= $_deals->get_sale();\n\t\t\t\t\t\n // Sub total is based on base prices (without discounts)\n $this->subtotal \t\t\t= $this->subtotal + ( $base_price * $values['quantity'] );\n\t\t\t\t\t\t\t\t\n\t\t\tendforeach;\n\t\t\t\n\t\t\t\n\t\t\t\tif (sizeof($this->cart_contents)>0) : foreach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t\n\t\t\t\t\t/** \n\t\t\t\t\t * Prices exclude tax\n\t\t\t\t\t *\n\t\t\t\t\t * This calculation is simpler - work with the base, untaxed price.\n\t\t\t\t\t */\n\t\t\t\t\t$_deals = $values['data'];\n\t\n\t\t\t\t\t// Base Price (i.e. no tax, regardless of region)\n\t\t\t\t\t$base_price \t\t\t\t= $_deals->get_sale();\n\t\t\n\t\t\t\t\t// Discounted Price (base price with any pre-tax discounts applied\n\t\t\t\t\t$discounted_price \t\t\t= $this->get_discounted_price( $values, $base_price, true );\t\t\n \t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Total item price (price, discount and quantity)\n\t\t\t\t\t$total_item_price \t\t\t= $discounted_price * $values['quantity'];\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Cart contents total is based on discounted prices and is used for the final total calculation\n\t\t\t\t\t$this->cart_contents_total = $this->cart_contents_total \t\t+ $total_item_price;\n\t\t\t\t\n\t\t\t\tendforeach; endif;\n\t\t\t\n\t\t\t// Only go beyond this point if on the cart/checkout\n\t\t\tif (!is_checkout() && !defined('WPDEALS_CHECKOUT') && !is_ajax()) return;\n\t\t\t\n\t\t\t// VAT exemption done at this point - so all totals are correct before exemption\n\t\t\tif ($cmdeals->customer->is_vat_exempt()) :\n\t\t\t\t$this->shipping_tax_total = $this->tax_total = 0;\n\t\t\tendif;\n\t\t\t\n\t\t\t// Allow plugins to hook and alter totals before final total is calculated\n\t\t\tdo_action('cmdeals_calculate_totals', $this);\n\t\t\t\t\t\n\t\t\t/** \n\t\t\t * Grand Total\n\t\t\t *\n\t\t\t * Based on discounted deals prices, discounted tax, shipping cost + tax, and any discounts to be added after tax (e.g. store credit)\n\t\t\t */\n\t\t\t$this->total = $this->cart_contents_total + $this->discount_total;\n\t\t\t\n\t\t\tif ($this->total < 0) $this->total = 0;\n\t\t}", "public function subtotal();", "public function getSubtotal()\n {\n $price = 0;\n\n foreach ($this->order_configurations as $config) {\n $products = EntityUtils::getRepository(\"Product\")->getProducts($config->configuration, true);\n foreach ($products as $product) {\n $price += $product->getDiscountedPrice($this->program->id) * $config->quantity;\n }\n }\n\n return number_format($price, 2, \".\", \",\");\n }", "function total_price($cart){\n\t\t$price = 0.0;\n\t\tif(is_array($cart)){\n\t\t \tforeach($cart as $isbn => $qty){\n\t\t \t\t$medicineprice = getmedicineprice($isbn);\n\t\t \t\tif($medicineprice){\n\t\t \t\t\t$price += $medicineprice * $qty;\n\t\t \t\t}\n\t\t \t}\n\t\t}\n\t\treturn $price;\n\t}", "public function getTotalCost()\n\t{\n\t\t$tprice = $this->getPrice();\n\n\t\tforeach ($this->options as $o)\n\t\t{\n\t\t\t$tprice += $o->getPrice() * $o->getQuantity();\n\t\t}\n\n\t\treturn $tprice;\n\t}", "public function getTotalPrice()\n {\n $stat = $this->getAllStat();\n return $stat['totalPrice'];\r\n }", "function total_price(){\n\t$total = 0; // agei instantiate kore dilam j zero\n\tglobal $con;\n\t$ip=getIp();\n\t$sel_price = \"select * from cart where ip_add='$ip'\";\n\t$run_price=mysqli_query($con, $sel_price);\n\twhile($p_price=mysqli_fetch_array($run_price)){\n\t\t$pro_id=$p_price['p_id'];//ip address wise product er id ta dibe, from there we can tell what is the prrice of product\n\t\t$pro_price=\"select * from products where product_id='$pro_id'\"; // cart table theke product id ta niye seta k product table er product ider sathe match kortese\n\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){// product table theke product id wise product price ta niye ashtese\n\t\t\t\t$product_price= array($pp_price['product_price']); //that certain user joto product cart a add korsilo segula sob k akta array te rakhlam\n\t\t\t\t$values= array_sum($product_price); //oi uporer array er sumation kore show korbe akta value..like total value \n\t\t\t\t$total+=$values;\n\t\t\n\t\t}\n\n\t}\n\techo $total;\n}", "function total_price(){\n\n global $db;\n\n $ip_add = getRealIpUser();\n\n $total = 0;\n\n $select_cart = \"select * from cart where ip_add='$ip_add'\";\n\n $run_cart = mysqli_query($db, $select_cart);\n\n while($record= mysqli_fetch_array($run_cart)){\n\n $pro_id = $record['p_id'];\n\n $pro_qty =$record['quantity'];\n\n $get_price = \"select * from products where product_id='$pro_id'\";\n\n $run_price = mysqli_query($db, $get_price);\n\n while($row_price=mysqli_fetch_array($run_price)){\n\n $sub_total = $row_price['product_price'] * $pro_qty;\n\n $total += $sub_total; \n\n }\n }\n\n echo \"&#8358; \" . $total;\n}", "function total_price()\r\n{\r\n global $db;\r\n $total=0;\r\n $ip_add=getRealIpAddr();\r\n $sel_price=\"select * from cart where ip_add='$ip_add'\";\r\n $run_price=mysqli_query($db,$sel_price);\r\n while($record=mysqli_fetch_array($run_price))\r\n {\r\n $pro_id=$record['p_id'];\r\n $pro_price=\"select * from products where product_id='$pro_id'\";\r\n $run_pro_price=mysqli_query($db,$pro_price);\r\n while($p_price=mysqli_fetch_array($run_pro_price))\r\n {\r\n $product_price=array($p_price['product_price']);\r\n $values=array_sum($product_price);\r\n $total +=$values;\r\n }\r\n }\r\n echo \"Rs. \" .$total;\r\n \r\n}", "function totalPrice(){\n \n global $conn;\n\n $ip_add = getUserIp();\n $total = 0;\n\n $select_cart = \"SELECT * FROM cart WHERE ip_address = '$ip_add'\";\n $run_select_cart = mysqli_query($conn, $select_cart) or die(\"Total Price Query Failed\");\n while($row_select_cart = mysqli_fetch_assoc($run_select_cart)){\n $pro_id = $row_select_cart['cart_id'];\n $product_qty = $row_select_cart['qty'];\n\n $get_price = \"SELECT * FROM products WHERE product_id = '$pro_id'\";\n $run_get_price = mysqli_query($conn, $get_price);\n while($row_get_price = mysqli_fetch_assoc($run_get_price)){\n $price_qty = $row_get_price['product_price'] * $product_qty;\n\n $total = $total + $price_qty; \n }\n }\n\n echo $total; \n }", "function total_price(){\n $ip_add=getRealIpAddr();\n $total=0;\n global $db;\n $sel_price=\"select * from cart where ip_add='$ip_add'\";\n $run_price =mysqli_query($db,$sel_price);\n while($record=mysqli_fetch_array($run_price)){\n \n $prod_id=$record['p_id'];\n $prod_price=\"select * from products where product_id='$prod_id'\";\n $run_pro_price=mysqli_query($db,$prod_price);\n while($p_price=mysqli_fetch_array($run_pro_price)){\n $product_price=array($p_price['product_price']);\n $values=array_sum($product_price);\n $total = $total + $values;\n }\n }\n\n echo \"INR \" . $total;\n}", "public function total()\n {\n if ($this->_isCartArray($this->cart()) === TRUE)\n {\n $price = 0;\n $vat = 0;\n foreach ($this->cart() as $key)\n {\n $item_price = ($key['price'] * $key['qty']);\n $item_vat = (($item_price/100)*$key['vat']);\n // $price =+ ($price + ($key['price'] * $key['qty']));\n $price += $item_price;\n $vat += $item_vat;\n }\n\n // $params = $this->_config['vat'];\n // $vat = $this->_formatNumber((($price / 100) * $params));\n\n return array(\n 'sub-total' => $this->_formatNumber($price),\n 'vat' \t\t=> $this->_formatNumber($vat),\n 'total' \t=> $this->_formatNumber($price + $vat)\n );\n }\n }", "function total_price($cart){\n $price = 0.0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $bookprice = getbookprice($isbn);\n if($bookprice){\n $price += $bookprice * $qty;\n }\n }\n }\n return $price;\n }", "function getPriceTotal()\n{\n\t$total = \\Cart::instance('shopping')->total();\n\n return $total;\n}", "function total_price()\n{\n global $db;\n $ip_add = getRealUserIp();\n $total = 0;\n $select_cart = \"select * from cart where ip_add='$ip_add'\";\n $run_cart = mysqli_query($db, $select_cart);\n while ($record = mysqli_fetch_array($run_cart)) {\n $pro_id = $record['p_id'];\n $pro_qty = $record['qty'];\n $sub_total = $record['p_price'] * $pro_qty;\n $total += $sub_total;\n }\n echo \"Rs.\" . $total;\n}", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "function total_price(){\n\t$total=0;\n\tglobal $conn;\n\t$ip = getIp();\n\t$sql = \"SELECT * FROM cart where ip_add='$ip'\";\n\t$result = $conn->query($sql);\n\twhile($row=$result->fetch_assoc()){\n\t\t$pro_id= $row[\"p_id\"];\n\t\t$pro_price= \"SELECT * FROM products where product_id='$pro_id' AND stock='0'\";\n\t\t$result2 = $conn->query($pro_price);\n\t\twhile($row2=$result2->fetch_assoc()){\n\t\t\t$product_price= array($row2[\"product_price\"]);\n\t\t\t$values = array_sum($product_price);\n\t\t\t$total +=$values;\n\t\t\t}\n\t}\n\techo number_format($total) ;\n}", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function subtotal()\n {\n return $this->getCartItemCollection()->sum(function (CartItem $item) {\n return $item->subtotal();\n });\n }", "function total_price(){\n\t\t\n\t global $db;\n\t \n $ip_add = getRealIpAddr(); /* saving ip address in local variable*/\n\t \n\t $total = 0; /*price should start from 0*/\n\n\t $sel_price =\"SELECT * FROM cart WHERE ip_add = '$ip_add'\"; /* when user is online,detect its ip address by selecting it from cart table*/\n\t\t\n\t$run_price = mysqli_query($db,$sel_price);\n\t\n\twhile($record=mysqli_fetch_array($run_price)) {\n\t\t\n\t$pro_id = $record['p_id'];\t /* We fetched p_id from cart table in database with fetch array.fetchimg all ids that are selected bu user till now*/\n\t /* relation between two tables.we are running another query cos price is not included in cart table.its in products table.so we are making relation between two tables to fetch price from another table*/\n\t$pro_price =\"SELECT * FROM products WHERE product_id= '$pro_id'\"; /* Now we are finding id in products table in database,those id that are present in cart table in database.only then we would able to get price of products*/\n\t\t\n\t$run_pro_price = mysqli_query($db,$pro_price);\n\t\n\twhile($p_price=mysqli_fetch_array($run_pro_price)){\n\t\t\n\t\t\n\t\t$product_price = array($p_price['product_price']); /* We need product_price from products table.we used array because we need multiple prices of products in array form like,500,400,300 and so on*/ \n\t\n\t $values = array_sum($product_price); /* we added prices of all products with the help of array_sum.its easy to add 2 things in php.but if things are more than 2 then arraysum is used to add sum of arrays.it will add price of records one by one as user click add cart button */\n\t\n\t $total += $values; /* we added values variable to total variable that was zero.if you delete products it will show 0*/\n\t\n\t}\n\t\n\t\n\t}\n\t\n\t echo \"$\" . $total; /* \"$\" currency*/\n\t}", "public function getTotalPrice()\n {\n return $this->_totalPrice;\n }", "public function total()\n {\n $total = 0;\n foreach($this->_data as &$product) {\n $total += ($product['price'] * $product['quantity']);\n }\n\n return $total;\n }", "public function getTotalPriceWithVatFromPriceObject(Price $price);", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "public function get_total(){\n $total = 0;\n \n // récupert tous les articles de la commande\n $articles = $this->get_all_articles();\n \n // parcourt ces articles\n foreach($articles as $a){\n $price = $a->get_price(true);\n \n // puis calcul le prix\n $total += $a->nb * $price;\n }\n \n return $total;\n }", "public function getSubtotalAttribute()\n {\n if ( $this->picked > 0 ) {\n return (float) $this->price * (float) $this->picked;\n }\n return (float) $this->price * (float) $this->quantity;\n }", "public function getTotal(): float\n {\n $total = 0;\n foreach ($this->itemsVolume as $code => $volume) {\n $total += $this->store->calculatePrice($code, $volume);\n }\n return $total;\n }", "public function getTotalPrice()\n {\n $price = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $price = $price + $basketProduct->getTotalPrice();\n }\n }\n \n return $price;\n }", "private function parse_total(){\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$product_constructor_name = '\\gcalc\\db\\product\\\\' . str_replace( '-', '_', $this->get_slug() );\n\t\t$product_constructor_exists = class_exists( $product_constructor_name );\n\t\t$product_constructor_cost_equasion_exists = $product_constructor_exists ? method_exists( $product_constructor_name, 'get_calc_data' ) : false;\n\n\n\n\t\t/*\n\t\tEquasion can be stored in product constructor or formats array.\n\t\tFormats array is a temporary means to keep data so product constructor is a preferred way\n\t\t */\n\t\t$total_cost_equasion = \n\t\t\t$product_constructor_cost_equasion_exists ? \n\t\t\t\t$product_constructor_name::get_calc_data( )\n\t\t\t\t: $production_formats->get_total_cost_equasion( $this->get_product_id() );\n\n\t\t$total_cost_equasion_string = $total_cost_equasion['equasion'];\n\n\t\t$total_cost_equasion = $total_cost_equasion_string;\n\t\t$total_pcost_equasion = $total_cost_equasion_string;\n\n\t\t\n\t\t/**\n\t\t * Keeps selling prices of used processes\n\t\t * @var array\n\t\t */\n\t\t$total_cost_array = array();\n\t\t/**\n\t\t * Keeps production costs of used processes\n\t\t * @var array\n\t\t */\n\t\t$total_pcost_array = array();\n\t\t/**\n\t\t * Keeps markups of used proceses\n\t\t * @var array\n\t\t */\n\t\t$total_markup_array = array();\n\t\t/**\n\t\t * All used in calculation formats\n\t\t * @var array\n\t\t */\n\t\t$used_formats_array = array();\n\t\t/**\n\t\t * All used in calculation media\t\t \n\t\t * @var array\n\t\t */\n\t\t$used_media_array = array();\n\n\t\t//checking credentials for data filter\t\t\n\t\t$credetials = $this->login();\n\t\t$al = $credetials['access_level'];\n\n\t\tforeach ($this->done as $key => $value) {\t\n\t\t\tif ( preg_match( '/'.$value->total['name'].'/', $total_cost_equasion_string )) {\n\t\t\t\t$total_cost_equasion = str_replace($value->total['name'], $value->total['total_price'], $total_cost_equasion);\t\t\t\t\t\t\n\t\t\t\t$total_pcost_equasion = str_replace($value->total['name'], $value->total['production_cost'], $total_pcost_equasion);\t\t\n\n\t\t\t\t$total_cost_array[ $value->total['name'] ] = $value->total['total_price'];\n\t\t\t\t$total_pcost_array[ $value->total['name'] ] = $value->total['production_cost'];\n\t\t\t\t$total_markup_array[ $value->total['name'] ] = $value->total['markup'];\n\t\t\t}\t\n\n\t\t\t//used formats total\n\t\t\tif ( preg_match( '/_format/', $value->total['name'] )) {\n\t\t\t\t$production_format_pieces = $value->total['extended']['production_format']['pieces'];\n\t\t\t\t$common_format_name = $value->total['extended']['production_format']['common_format']['name'];\n\t\t\t\t$common_format_width = $value->total['extended']['production_format']['common_format']['width'];\n\t\t\t\t$common_format_height = $value->total['extended']['production_format']['common_format']['height'];\n\n\t\t\t\t$production_format_format = $value->total['extended']['production_format']['format'];\n\t\t\t\t$production_format_width = $value->total['extended']['production_format']['width'];\n\t\t\t\t$production_format_height = $value->total['extended']['production_format']['height'];\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t* Filtering data\n\t\t\t\t*/\n\t\t\t\tif ( $al > 0) {\n\t\t\t\t\t\n\t\t\t\t\tif ($al > 5) { // admin, master only\n\t\t\t\t\t\t\n\t\t\t\t\t\t$format_str = $production_format_pieces .' '. __('slots', 'gcalc') .' '. $common_format_name .'('.$common_format_width.'x'.$common_format_height.')' \n\t\t\t\t\t\t\t.' @ '. $production_format_format.'('.$production_format_width.'x'.$production_format_height.')';\n\n\t\t\t\t\t} else { // no data for account, inner\n\t\t\t\t\t\t$format_str = '';\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t} else { // 0 - anonymous\n\t\t\t\t\t$format_str = $common_format_width.'x'.$common_format_height;\n\n\t\t\t\t}\n\n\n\t\t\t\t$used_formats_array[ $value->total['name'] ] = $format_str;\n\t\t\t}\n\t\t\t\n\t\t\t//used papers total\n\t\t\tif ( preg_match( '/_paper/', $value->total['name'] )) {\n\t\t\t\t$sheet_cost = $value->total['extended']['sheet_cost'];\n\t\t\t\t$sheets_quantity = $value->total['extended']['sheets_quantity'];\n\t\t\t\t$paper_price_per_kg = $value->total['extended']['paper']['price_per_kg'];\n\t\t\t\t$paper_label = $value->total['extended']['paper']['label'];\t\t\t\t\n\t\t\t\t$paper_thickness = $value->total['extended']['paper']['thickness'];\n\n\t\t\t\t/*\n\t\t\t\t* Filtering data\n\t\t\t\t*/\n\t\t\t\tif ( $al > 0) {\n\t\t\t\t\tif ($al > 5) { // admin, master only\n\t\t\t\t\t\t\n\t\t\t\t\t\t$media_str = $sheets_quantity .' x ' . $paper_label . ' (' . $paper_thickness . 'mm)'\n\t\t\t\t\t\t.' @ ' . $sheet_cost . ' PLN / '. __('sheet','gcalc') .' (' . $paper_price_per_kg . '/kg) ';\n\n\t\t\t\t\t} else { // no data for account, inner\n\t\t\t\t\t\t$media_str = '';\t\n\t\t\t\t\t}\n\t\t\t\t} else { // 0 - anonymous\n\t\t\t\t\t$media_str = $paper_label;\n\n\t\t\t\t}\n\n\t\t\t\t$used_media_array[ $value->total['name'] ] = $media_str;\n\n\t\t\t}\n\t\t}\n\t\teval('$total_cost_ = ' . $total_cost_equasion . ';');\n\t\teval('$total_pcost_ = ' . $total_pcost_equasion . ';');\n\n\t\t$average_markup = count($total_markup_array) > 0 ? array_sum( $total_markup_array ) / count($total_markup_array) : 1;\n\n\n\n\n\t\t$total_ = array(\n\t\t\t'equasion' => $total_cost_equasion_string,\t\t\t\n\t\t\t'used_formats' => $used_formats_array,\n\t\t\t'used_media' => $used_media_array,\n\n\t\t\t'total_markup' => $total_markup_array,\n\t\t\t'total_cost_equasion' => $total_cost_array,\n\t\t\t'total_pcost_equasion' => $total_pcost_array,\n\t\t\t\n\t\t\t'average_markup' => ( ( $total_cost_ - $total_pcost_ ) / $total_pcost_ ) + 1, \n\t\t\t'total_cost_' => $total_cost_,\n\t\t\t'total_pcost_' => $total_pcost_\n\t\t);\n\n\t\t\t\t/*\n\t\t\t\t* Filtering total data\n\t\t\t\t*/\n\t\t\t\tif ( $al > 0) {\n\t\t\t\t\tif ($al > 5) { // admin, master only\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t} else { // no data for account, inner\n\t\t\t\t\t\t\n\t\t\t\t\t\tunset($total_['used_formats']);\n\t\t\t\t\t\tunset($total_['used_media']);\n\t\t\t\t\t}\n\t\t\t\t} else { // 0 - anonymous\n\t\t\t\t\t$media_str = $paper_label;\n\n\t\t\t\t}\n\n\n\t\t$total_ = $this->merge_children_totals( $total_ );\n\t\t$this->total_ = $total_;\n\n\t}", "protected function calculate_item_subtotals() {\n\t\tforeach ( $this->items as $item_key => $item ) {\n\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\tif ( $this->cart->get_customer()->get_is_vat_exempt() ) {\n\t\t\t\t\t$item = $this->remove_item_base_taxes( $item );\n\t\t\t\t} elseif ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {\n\t\t\t\t\t$item = $this->adjust_non_base_location_price( $item );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$item->subtotal = $item->price;\n\t\t\t$subtotal_taxes = array();\n\n\t\t\tif ( $this->calculate_tax && $item->product->is_taxable() ) {\n\t\t\t\t$subtotal_taxes = WC_Tax::calc_tax( $item->subtotal, $item->tax_rates, $item->price_includes_tax );\n\t\t\t\t$item->subtotal_tax = array_sum( array_map( array( $this, 'round_line_tax' ), $subtotal_taxes ) );\n\n\t\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\t\t// Use unrounded taxes so we can re-calculate from the orders screen accurately later.\n\t\t\t\t\t$item->subtotal = $item->subtotal - array_sum( $subtotal_taxes );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax_data'] = array( 'subtotal' => wc_remove_number_precision_deep( $subtotal_taxes ) );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_subtotal'] = wc_remove_number_precision( $item->subtotal );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_subtotal_tax'] = wc_remove_number_precision( $item->subtotal_tax );\n\t\t}\n\t\t$this->set_total( 'items_subtotal', array_sum( array_map( 'round', array_values( wp_list_pluck( $this->items, 'subtotal' ) ) ) ) );\n\t\t$this->set_total( 'items_subtotal_tax', array_sum( array_values( wp_list_pluck( $this->items, 'subtotal_tax' ) ) ) );\n\n\t\t$this->cart->set_subtotal( $this->get_total( 'items_subtotal' ) );\n\t\t$this->cart->set_subtotal_tax( $this->get_total( 'items_subtotal_tax' ) );\n\t}", "function calculatePriceAmountQuantity(&$args) {\n global $_lib;\n\n // get all invoiceinline ids\n $invoiceinline_ids = array();\n foreach ($args as $arg_key => $arg_val) {\n preg_match(\"/^invoiceinline_.*_(\\d*)$/\", $arg_key, $matches);\n $invoiceinline_id = $matches[1];\n if($invoiceinline_id && !in_array($invoiceinline_id, $invoiceinline_ids)) {\n $invoiceinline_ids[] = $invoiceinline_id;\n }\n }\n\n $total_invoice_sum = 0;\n\n foreach ($invoiceinline_ids as $line_id) {\n $fields = array();\n $line_allowance_charge_sum = 0;\n\n // get invoice line allowancecharge sums\n foreach ($args as $arg_key => $arg_val) {\n if(preg_match(\"/^invoiceinline_(.*)_\".$line_id.\"$/\", $arg_key, $matches)) {\n $args[$arg_key] = $_lib['convert']->Amount($arg_val);\n if(in_array($matches[1], array(\"TotalWithoutTax\", \"UnitCustPrice\", \"QuantityDelivered\", \"TotalWithTax\", \"Vat\"))) {\n $fields[$matches[1]] = (float)$args[\"invoiceinline_$matches[1]_$line_id\"];\n }\n }\n if(preg_match(\"/^invoicelineallowancecharge_InvoiceLineID_(.*)$/\", $arg_key, $matches)) {\n $invoicelineallowancecharge_id = $matches[1];\n if( $args[\"invoicelineallowancecharge_InvoiceLineID_$invoicelineallowancecharge_id\"] == $line_id &&\n $args[\"invoicelineallowancecharge_AllowanceChargeType_$invoicelineallowancecharge_id\"] == \"line\") {\n $amount = (float)$_lib['convert']->Amount($args[\"invoicelineallowancecharge_Amount_$invoicelineallowancecharge_id\"]);\n if($args[\"invoicelineallowancecharge_ChargeIndicator_$invoicelineallowancecharge_id\"]) {\n $line_allowance_charge_sum += $amount;\n } else {\n $line_allowance_charge_sum -= $amount;\n }\n }\n }\n }\n\n if($fields[\"TotalWithTax\"]) { // this is in current invoice's currency\n if(!$fields[\"TotalWithoutTax\"]) {\n $fields[\"TotalWithoutTax\"] = round($fields[\"TotalWithTax\"] / (1 + $fields[\"Vat\"] / 100), 2);\n }\n $fields[\"TaxAmount\"] = round($fields[\"TotalWithTax\"] - $fields[\"TotalWithoutTax\"], 2);\n\n if (!$fields[\"QuantityDelivered\"] && $fields[\"UnitCustPrice\"]) {\n $fields[\"QuantityDelivered\"] = round(($fields[\"TotalWithoutTax\"] - $line_allowance_charge_sum) / $fields[\"UnitCustPrice\"], 2);\n } else if($fields[\"QuantityDelivered\"]) {\n $fields[\"UnitCustPrice\"] = round(($fields[\"TotalWithoutTax\"] - $line_allowance_charge_sum) / $fields[\"QuantityDelivered\"], 2);\n }\n } else {\n if($fields[\"TotalWithoutTax\"]) {\n if (!$fields[\"QuantityDelivered\"] && $fields[\"UnitCustPrice\"]) {\n $fields[\"QuantityDelivered\"] = round(($fields[\"TotalWithoutTax\"] - $line_allowance_charge_sum) / $fields[\"UnitCustPrice\"], 2);\n } else if($fields[\"QuantityDelivered\"]) {\n $fields[\"UnitCustPrice\"] = round(($fields[\"TotalWithoutTax\"] - $line_allowance_charge_sum) / $fields[\"QuantityDelivered\"], 2);\n }\n } else {\n $fields[\"TotalWithoutTax\"] = round($fields[\"QuantityDelivered\"] * $fields[\"UnitCustPrice\"] + $line_allowance_charge_sum, 2);\n }\n $fields[\"TotalWithTax\"] = round($fields[\"TotalWithoutTax\"] * (1 + $fields[\"Vat\"] / 100), 2);\n $fields[\"TaxAmount\"] = round($fields[\"TotalWithTax\"] - $fields[\"TotalWithoutTax\"], 2);\n }\n\n\n foreach ($fields as $key => $value) {\n $args[\"invoiceinline_\".$key.\"_\".$line_id] = $value;\n }\n\n $total_invoice_sum += $fields[\"TotalWithTax\"];\n }\n\n $args[\"invoicein_TotalCustPrice_\".$args[\"ID\"]] = $total_invoice_sum;\n }", "function get_cart_total() {\n\t\t\tif (!$this->prices_include_tax) :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total);\n\t\t\telse :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total + $this->tax_total);\n\t\t\tendif;\n\t\t}", "public function getPriceTotal()\n {\n if ($this->priceTotal == false) {\n $this->recalculatePriceTotal();\n }\n\n return $this->priceTotal;\n }", "public function Price() {\n\t\t$amount = $this->Amount();\n\n\t\t//Transform price here for display in different currencies etc.\n\t\t$this->extend('updatePrice', $amount);\n\n\t\treturn $amount;\n\t}", "public function getProductsCostTotal()\n {\n return $this->getProducts()->sum('price');\n }", "public function getSubTotal() {\n $total = 0;\n\n // Calculate total from items in the list\n foreach($this->Items() as $item) {\n $total += $item->getSubTotal();\n }\n\n return $total;\n }", "function getOverallOrderPrice(){\n\t\t$t=0;\n\t\t$a = Order::where('payment', 'verified')->get();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t\n\t\t$r = intVal($n->qty)*intVal($n->price);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "public function getSubtotalAddition()\n {\n $this->initializeSubtotals();\n\n return $this->getIfSet('addition', $this->data->amount->subtotals);\n }", "private function calculatePrice(): int\n {\n $distribution = $this->fullCost / $this->divider();\n return self::roundTo($distribution);\n }", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "function __lineItemTotal($qty, $price, $rate) {\n\n\n\n\n\n\n\n// if ($curency_id == 2)\n// $currency = 1;\n//\n// if ($curency_id == 1)\n// $currency = 4.17;\n//\n// if ($curency_id == 3)\n// $currency = 4.50;\n\n\n\n $line_total = $qty * $price * $rate;\n\n //$line_total = $line_total + (($line_total * $taxRate) / 100);\n\n\n\n return $line_total;\n }", "protected function _getTotal()\n {\n return $this->formatPriceWithComma($this->_getOrder()->getGrandTotal());\n }", "function getTotalPrice()\n {\n $total = 0;\n foreach ($_SESSION['cart'] as $key => $value) {\n $total += $_SESSION['cart'][$key]['total'];\n }\n return $total;\n }", "function compute_money_total($available, $frozen, $investment, $loaned, $interest, $owned, $fine)\n{\n return ($available + $frozen + $investment - ($loaned + $interest + $owned + $fine));\n}", "abstract public function getPrice();", "protected function calculate() {\n\t\t$this->calculate_item_totals();\n\t\t$this->calculate_shipping_totals();\n\t\t$this->calculate_fee_totals();\n\t\t$this->calculate_totals();\n\t}", "public function get_total_cost()\n {\n $num = \"0.00\";\n\n if (isset($_SESSION['cart'])) {\n // if there are items to display\n $ids = $this->get_ids();\n\n // get product ids\n global $products;\n $prices = $products->get_prices($ids);\n\n // loop through, adding the cost of each item * the number of item\n // in the cart to $num each time\n\n if ($prices != null) {\n foreach ($prices as $price) {\n $num += doubleval($price['price'] * $_SESSION['cart'][$price['id']]);\n }\n }\n }\n return $num;\n }", "public function getTotalVatFromPriceObject(Price $price);", "function es_set_cart_product_subtotal($sub_total , $cart_item, $cart_item_key) {\n\t\n\t$quantity = intval( $cart_item['quantity'] );\n\t$price = es_get_product_price($cart_item);\n\t$cart_item['data']->price = ( $price * $quantity );\t\n\t\n\treturn wc_price($cart_item['data']->price);\n}", "public function get_total_cost()\n\t{\n\t\t$num = '0.00';\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\t#if there are items to display \n\t\t\t\n\t\t\t#get product ids\n\t\t\t$ids = $this->get_ids();\n\t\t\t\n\t\t\t#get product prices\n\t\t\tglobal $Products;\n\t\t\t$prices = $Products->get_prices($ids);\n\t\t\t\n\t\t\t#loop throih adding the cost of each item and timesing it by the number of item in the cart. \n\t\t\tif($prices != NULL)\n\t\t\t{\n\t\t\t\tforeach($prices as $price)\n\t\t\t\t{\n\t\t\t\t\t$num += doubleval($price['price'] * $_SESSION['cart'][$price['id']]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "function calculate_total($tax, $sub){\n\t//echo $tax;\n\t//echo \" ____ \";\n\t//echo $sub;\n\treturn $tax + $sub;\n\t}" ]
[ "0.7817905", "0.7328541", "0.7240539", "0.70555615", "0.7049061", "0.69332236", "0.68989694", "0.68989694", "0.6889887", "0.68783087", "0.6799469", "0.67986226", "0.6787594", "0.673816", "0.6720404", "0.6690678", "0.6682172", "0.66661966", "0.6626938", "0.66060156", "0.6588202", "0.6572501", "0.65644854", "0.656407", "0.6533946", "0.6531947", "0.6527977", "0.6526515", "0.6521947", "0.6508849", "0.6502523", "0.6445018", "0.6428411", "0.6420506", "0.6401217", "0.6399387", "0.63972265", "0.63932484", "0.63866955", "0.63825405", "0.63541025", "0.63505495", "0.63340837", "0.6315442", "0.6311277", "0.6304747", "0.6289505", "0.6288038", "0.62868845", "0.62800634", "0.6239778", "0.62275743", "0.6223541", "0.62215936", "0.62122816", "0.6207852", "0.6202581", "0.6197993", "0.6196477", "0.6185802", "0.61759984", "0.6174497", "0.6168371", "0.6136934", "0.6132694", "0.61291206", "0.6122624", "0.61213917", "0.6115205", "0.60989285", "0.60964173", "0.6093562", "0.60917956", "0.60902095", "0.60849476", "0.60802346", "0.60511786", "0.6038957", "0.6034416", "0.602442", "0.6006949", "0.600472", "0.600303", "0.60010505", "0.5984367", "0.5971999", "0.59595925", "0.5954644", "0.5953307", "0.5951933", "0.5946305", "0.5938154", "0.59200877", "0.5919743", "0.59088814", "0.59085846", "0.59080404", "0.5900621", "0.58947694", "0.58931565", "0.5891975" ]
0.0
-1
Make new instance of self, or return already existing one.
public static function make(...$args): self { if (static::$Instance === NULL) { static::$Instance = new self(...$args); } return static::$Instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create() {\n $this->_lastCreate = true;\n return $this;\n }", "public function copy()\n {\n return new static($this);\n }", "public function duplicate(){\n\t\treturn self::cloneObject($this);\n\t}", "public function createClone()\n {\n return clone $this;\n }", "public function getNew()\n {\n $class = get_class($this);\n\n return new $class;\n }", "function &copy( )\n {\n $new = $this;\n $new->unsetID();\n $new->store();\n\n return $new;\n }", "public function copy(): self\n {\n return $this->immute(true); // force immute\n }", "public function copy(): Model\n {\n $new = $this->replicate();\n $new->push();\n\n return $new;\n }", "public static function make() {\n return new self();\n }", "public function build(): self\n {\n if ($this->type === 'primary') {\n return $this->primary();\n }\n if ($this->type === 'unique') {\n return $this->unique();\n }\n return $this->set();\n }", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function newInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public function __construct()\n {\n if (!self::$instance) {\n self::$instance = $this;\n //echo \"Create new object\";\n return self::$instance;\n } else {\n //echo \"Return old object\";\n return self::$instance;\n }\n }", "public function Create()\n\t{\n\t\treturn new self;\n\t}", "public function newCurrent()\n {\n return $this->newInstance($this->current);\n }", "public function makeNew()\n\t{\n\t\treturn new static($this->view);\n\t}", "public static function getNewInstance()\n {\n return self::$instance = new self();\n }", "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public function create()\n {\n return $this->get();\n }", "public function addnew() {\n\t\t$this->isAddingNew( true );\n\t\treturn $this;\n\t}", "public function clone() {\n\t\t\t$class = get_called_class();\n\t\t\t$obj = new $class($this->_db);\n\t\t\t$obj->setFromArray($this->toArray());\n\t\t\t$obj->setChanged($this->hasChanged());\n\t\t\treturn $obj;\n\t\t}", "function dup() {\n\t\t$slide = clone $this;\n\t\t$slide->gen_id();\n\t\t$slide->set_index($slide->get_index() + 1);\n\t\t$slide->set_lock(NULL);\n\n\t\t// Make sure all directories are created.\n\t\t$slide->write();\n\n\t\t$tmp = [];\n\t\tforeach ($this->get_assets() as $a) {\n\t\t\t$tmp[] = $a->clone($slide);\n\t\t}\n\t\t$slide->set_assets($tmp);\n\n\t\t// Write latest changes.\n\t\t$slide->write();\n\n\t\t$queue = $slide->get_queue();\n\t\t$queue->add($slide);\n\t\t$queue->write();\n\n\t\treturn $slide;\n\t}", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }", "public static function &CreateInstanceIfNotExists(){\n static $oInstance = null;\n\n if(!$oInstance instanceof self)\n $oInstance = new self();\n\n return $oInstance;\n }", "public function dup() {\n return new Image($this);\n }", "function __clone() { return $this; }", "function __clone() { return $this; }", "public function fresh()\n {\n if ($this->hasModel() && $this->exists()) {\n return odb($this->db(), $this->table())->find((int) $this->data['id']);\n }\n\n return $this;\n }", "public static function fresh()\n {\n $instance = new self();\n return $instance;\n }", "public static function fresh()\n {\n $instance = new self();\n return $instance;\n }", "public function save() {\n\n $this->get(\"id\") ? $this->_update() : $this->_create();\n return $this;\n\n }", "public function copy()\n {\n $that = clone($this);\n\n return $that;\n }", "public function newInstance()\n {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public function create()\n {\n return new $this->class;\n }", "public function makePrimary()\n\t{\n\t\t$this->mediable->media->each(function ($m) {\n\t\t\tupdater(Media::class)->with(['primary' => (int) false])->update($m);\n\t\t});\n\n\t\t// Now set this one as the primary\n\t\t$this->update(['primary' => (int) true]);\n\n\t\treturn $this;\n\t}", "public function copy()\n {\n if($this->is_copy)\n {\n return $this;\n }\n else\n {\n $obj = clone $this;\n $obj->is_copy = true;\n return $obj;\n }\n }", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function copy(): self;", "protected function factory()\n {\n $this->request = $this->request();\n $this->response = $this->response();\n $this->route = $this->route();\n\n return $this;\n }", "public static function instance() {\n\t\treturn new self;\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}", "private function persist(): static\n {\n if ($this->model == null) {\n $this->model = new $this->modelClass();\n $this->model->setUrl($this->url);\n $this->model->setElementsForParse($this->elementsForParse);\n $this->model->setRootIteratorElement($this->rootIteratorElement);\n $this->save();\n }\n return $this;\n }", "public static function make () {\n return new static;\n }", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "public function save() {\n\t\tif (array_intersect_key($this->toArray(TRUE), array_flip($this->primary))) {\n\t\t\t$this->update();\n\t\t} else {\n\t\t\t$this->insert();\n\t\t}\n\t\treturn $this;\n\t}", "function copy ()\n {\n return clone $this;\n }", "public function __construct() {\n return $this;\n }", "public function create()\n {\n $this->action(self::ACTION_CREATE);\n\n return $this;\n }", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "public function __clone() {\n\t\treturn clone $this;\n }", "public function current() {\t\t\n\t\treturn new $this->object_class($this->storage);\n\t}", "public static function forge()\n\t{\n\t\tif (empty(static::$instance)) {\n\t\t\tstatic::$instance = new static;\n\t\t}\n\t\t\n\t\treturn static::$instance;\n\t}", "public function clone(): Rut\n {\n return clone $this;\n }", "public function __construct ()\n {\n return this;\n }", "public abstract function make();", "public function getInstance(): self\n {\n return $this;\n }", "public function __clone()\n {\n $this->description = $this->description . ' - склонирован';\n\n self::$instances ++;\n\n return $this;\n }", "public static function create()\n\t{\n\t\treturn new self;\n\t}", "public function instance() {\n\t\n\t\treturn $this;\n\t\n\t}", "function get_clone()\r\n\t{\r\n\t\treturn clone($this);\r\n\t}", "public function copy()\n {\n $set = clone $this;\n return $set;\n }", "function get_copy()\r\n\t{\r\n\t\t$copy = clone($this);\r\n\r\n\t\t$copy->id = NULL;\r\n\r\n\t\treturn $copy;\r\n\t}", "public function create()\n {\n return $this->resource->create($this->toArray());\n }", "public static function make()\n {\n return new static;\n }", "public static function make()\n {\n return new static;\n }", "public static function create()\n\t\t{\n\t\t\treturn new self();\n\t\t}", "public static function create()\n {\n if (null === self::$instance) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }", "function makeClone()\n {\n $this->id = 0;\n }", "public function immutable()\n {\n return new self($this->readers, $this->writers, true);\n }", "public function save()\n {\n $this->clone = $this->items;\n\n return $this;\n }", "function getClone(){\n\t\t\treturn clone($this);\n\t\t}", "public function create()\n {\n foreach ($this->_getColumns() as $column) {\n $data[$column] = $this->get($column);\n }\n\n $data['updated_at'] = \\Carbon\\Carbon::now()->toDateTimeString();\n $data['is_active'] = true;\n $this->_localConfig->database()->insert($this->_getTable(), $data);\n\n return $this;\n }", "public function lock()\n {\n $this->locked = true;\n\n return $this;\n }", "public function copy(): static\n {\n $this->isCustomCodec = false;\n\n return $this;\n }", "public static function create() {\n return new self();\n }", "public function getInstance() {\r\n\t\tif ($this->ref) {\r\n\t\t\treturn $this->getRef();\r\n\t\t}\r\n\t\treturn $this;\r\n\t}", "protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }", "private function checkIfExist(): static\n {\n $this->model = $this->createQueryBuilder('p')\n ->andWhere('p.url = :val')\n ->setParameter('val', $this->url)\n ->getQuery()\n ->getOneOrNullResult();\n return $this;\n }", "public function lock()\r\n {\r\n $this->locked = true;\r\n\r\n return $this;\r\n }", "public function copy()\n {\n return new static($this->items, $this->params, $this->pages);\n }" ]
[ "0.66459405", "0.65240526", "0.6516446", "0.6483813", "0.64335793", "0.6373541", "0.63359493", "0.6267517", "0.62112397", "0.60843426", "0.605443", "0.605443", "0.605443", "0.605443", "0.60285753", "0.60259205", "0.6015681", "0.60155827", "0.5973562", "0.5954407", "0.59463865", "0.59332335", "0.5918519", "0.5918145", "0.5897599", "0.5897147", "0.5889247", "0.5864243", "0.58590895", "0.58590895", "0.58461714", "0.5840501", "0.5840501", "0.5831815", "0.57901573", "0.5773865", "0.5768367", "0.5768367", "0.57636416", "0.5747389", "0.574112", "0.5727775", "0.5716451", "0.57131916", "0.5682982", "0.5679069", "0.56773156", "0.5675504", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56610537", "0.56456685", "0.5644509", "0.5641898", "0.5640368", "0.56228983", "0.56136227", "0.559193", "0.5573566", "0.5572302", "0.5571095", "0.5566349", "0.5560588", "0.55580854", "0.5546499", "0.55460364", "0.5544109", "0.55423045", "0.55341196", "0.55338544", "0.5531761", "0.5531761", "0.5531263", "0.5523504", "0.551782", "0.5510497", "0.55068487", "0.5506677", "0.5496934", "0.5492408", "0.5489529", "0.5486811", "0.5482377", "0.54807425", "0.54758424", "0.5474698", "0.54730594" ]
0.0
-1
Clear already existing instance of self.
public static function clear(): void { if (static::$Instance !== NULL) { static::$Instance = NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clear(): self;", "public static function clear()\n {\n static::getInstance()->clear();\n }", "public function clear()\n {\n $this->fromArray(array());\n }", "public function clear()\n {\n $this->store->flush();\n return $this;\n }", "protected function clear() {}", "public function clear()\n {\n $this->data = [];\n $this->clearUID();\n return $this;\n }", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear()\n {\n // we don't clear the files atm\n return $this;\n }", "public function clear() {\n\t\t$this->store = array();\n\t\treturn $this;\n\t}", "public function clear()\n\t{\n\t\t$this->getObject()->clear();\n\t}", "public function clear(): static\n {\n $this->data = [];\n\n return $this;\n }", "function clear(){\r\n\t\t$_SESSION[self::_KEY_][get_class($this)]->reset();\r\n\t}", "public function clear()\n {\n $this->_id = null;\n $this->_title = null;\n $this->_positions = [];\n $this->_isDefault = null;\n }", "public function clear()\n {\n $this->redis->flushDb();\n return $this;\n }", "public function clear()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->multiRef = [];\n\n }", "public function clear() {\n $this->list = [];\n\n return $this;\n }", "public function clear () {\n \n }", "public function clear() {\n foreach ($this->Fields as $key => $item) {\n $this->$key = null;\n }\n }", "public function clear() {\n\t\t$this->adapter->clear();\n\n\t\treturn $this;\n\t}", "public function clear()\n {\n $this->collection = array();\n\n return $this;\n }", "public function clear()\n {\n $this->head = null;\n \n return $this;\n }", "public function clear() {\n $this->_attributes = [];\n return $this;\n }", "public function clear(): self\n {\n $this->items = [];\n return $this;\n }", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public static function clear()\n {\n self::$map = array();\n self::$instances = array();\n }", "function clear()\r\n\t{\r\n\t\t// Clear the all list\r\n\t\t$this->all = array();\r\n\r\n\t\t// Clear errors\r\n\t\t$this->error = new stdClass();\r\n\t\t$this->error->all = array();\r\n\t\t$this->error->string = '';\r\n\r\n\t\t// Clear this objects properties and set blank error messages in case they are accessed\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\t$this->{$field} = NULL;\r\n\t\t\t$this->error->{$field} = '';\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has many\" related objects\r\n\t\tforeach ($this->has_many as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has one\" related objects\r\n\t\tforeach ($this->has_one as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear the query related list\r\n\t\t$this->query_related = array();\r\n\r\n\t\t// Clear and refresh stored values\r\n\t\t$this->stored = new stdClass();\r\n\r\n\t\t$this->_refresh_stored_values();\r\n\t}", "public function clear()\n {\n $this->provider->clear();\n \n return $this;\n }", "public function clear(): self\n {\n $this->items = [];\n\n return $this;\n }", "public function clear() {\n\t\t$vars = get_object_vars($this);\n\t\tforeach ($vars as $key => $val) {\n\t\t\t$this->$key = null;\n\t\t}\n\t}", "public function clear() {\n $this->redis = null;\n }", "public function clear ()\n {\n\n $this->groups = null;\n $this->groups = array();\n $this->names = null;\n $this->names = array();\n\n }", "public function clear()\n\t{\n\t\t$this->makeId();\n\t}", "public function clear() {\n\t}", "public function clear()\n {\n $this->id = null;\n $this->name = null;\n $this->is_active = null;\n $this->is_closed = null;\n $this->from_date = null;\n $this->to_date = null;\n $this->sortable_rank = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear( );", "public static function clearInstance(){\n self::$instance = null;\n }", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear()\n {\n $this->items = array();\n $this->length = 0;\n\n return $this;\n }", "public function clear()\n {\n $this->id = null;\n $this->code = null;\n $this->category = null;\n $this->address = null;\n $this->address2 = null;\n $this->zipcode = null;\n $this->city = null;\n $this->geo_coordinate_x = null;\n $this->geo_coordinate_y = null;\n $this->distance_camping = null;\n $this->image = null;\n $this->priority = null;\n $this->tel = null;\n $this->fax = null;\n $this->email = null;\n $this->website = null;\n $this->created_at = null;\n $this->updated_at = null;\n $this->active = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear(): self\n {\n $this->stack = [];\n\n return $this;\n }", "public function clear() {\n $this->_data = [];\n }", "public function clear()\n\t{\n\t\t$this->attrs = array();\n\t\treturn $this;\n\t}", "public function clear()\n\t{\n\t\t$this->id = null;\n\t\t$this->uf_id = null;\n\t\t$this->nome = null;\n\t\t$this->slug = null;\n\t\t$this->longitude = null;\n\t\t$this->latitude = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}", "public function clear()\n {\n $this->cache->clean(\\Zend_Cache::CLEANING_MODE_ALL);\n return $this;\n }", "function clear()\n {\n $this->id = \"\";\n $this->offset = \"\";\n $this->title = \"\";\n $this->description = \"\";\n }", "public function clear() {\n\t\t$this->_where\t\t= array();\n\t\t$this->_order\t\t= array();\n\t\t$this->_isAddingNew\t= false;\n\t\t$this->_currentRow\t= 0;\n\t\t$this->_relationship\t= array();\n\t\t$this->_recordset\t= array();\n\t\t$this->_updateBuffer\t= array();\n\t\t$this->_limit\t\t= NULL;\n\t\t$this->_offset\t\t= NULL;\n\t\t$this->isDirty( false );\n\t}", "public function clearValues()\n {\n $this->_clearValues();\n\n return $this;\n }", "public function clear()\n {\n $this->_data = [];\n }", "public function clear()\n {\n $this->data = [];\n }", "public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}", "public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}", "public function clear()\n {\n }", "public function clear()\n {\n $this->repository = array();\n }", "public function clear() {\n\t\t$this->array = array();\n\t}", "public function clear()\n {\n $this->stack = [];\n\n return $this;\n }", "public function clear() {\r\n $this->rows = array();\r\n $this->heading = array();\r\n $this->footer = array();\r\n $this->auto_heading = TRUE;\r\n return $this;\r\n }", "public function clear()\n {\n $this->collection->clear();\n $this->keys = [];\n }", "public function clear()\n\t{\n\t\t$classvars = get_class_vars(__CLASS__);\n\n\t\tforeach ($classvars as $property => $value)\n\t\t{\n\t\t\tif ('_s_' == substr($property, 0, 3)) // Don't touch static variables\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tunset($this->$property);\n\t\t\t$this->$property = $value;\n\t\t}\n\n\t\t$objvars = get_object_vars($this);\n\n\t\tforeach ($objvars as $property => $value)\n\t\t{\n\t\t\tif (!array_key_exists($property, $classvars))\n\t\t\t{\n\t\t\t\tunset($this->$property);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "protected function _clear()\n\t{\n\t\t$this->_query = null;\n\t\t$this->_set = null;\n\t\t$this->_where = null;\n\t\t$this->_limit = null;\n\t}", "public function __destruct()\n {\n $this->clear();\n }", "public function __destruct()\n {\n $this->clear();\n }", "public function clear()\n {\n if (null !== $this->aCakeType) {\n $this->aCakeType->removeArticle($this);\n }\n if (null !== $this->aShape) {\n $this->aShape->removeArticle($this);\n }\n $this->article_id = null;\n $this->description = null;\n $this->price = null;\n $this->creation = null;\n $this->visible = null;\n $this->shape_id = null;\n $this->cake_type_id = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function Clear()\n {\n $this->items = array();\n }", "public function clear() \r\n {\r\n unset($this->elements);\r\n $this->elements = array();\r\n }", "public function clear()\n {\n $this->repository->clear();\n }", "public function clear()\n {\n $this->connection->del($this->key);\n\n if ($this->on_change) {\n call_user_func($this->on_change, []);\n }\n\n if ($this->on_clear) {\n call_user_func($this->on_clear, []);\n }\n }", "public function clear()\n {\n $this->items = array();\n }", "public function clear()\n {\n $this->params = array();\n\n return $this;\n }", "public function clear()\n\t{\n\t\t$this->venueid = null;\n\t\t$this->address = null;\n\t\t$this->address2 = null;\n\t\t$this->city = null;\n\t\t$this->province = null;\n\t\t$this->country = null;\n\t\t$this->latitude = null;\n\t\t$this->longitude = null;\n\t\t$this->phone = null;\n\t\t$this->name = null;\n\t\t$this->description = null;\n\t\t$this->website = null;\n\t\t$this->twitter = null;\n\t\t$this->facebook = null;\n\t\t$this->rssfeed = null;\n\t\t$this->closed = null;\n\t\t$this->lastfmid = null;\n\t\t$this->slug = null;\n\t\t$this->hasphotos = null;\n\t\t$this->submittedbyuser = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->applyDefaultValues();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}" ]
[ "0.80899763", "0.74770325", "0.74489224", "0.73735785", "0.7348643", "0.734052", "0.7313735", "0.7313735", "0.7313735", "0.7313735", "0.73075515", "0.72702", "0.72191054", "0.721777", "0.7217544", "0.72068506", "0.71406585", "0.71286416", "0.70977503", "0.7077768", "0.7072408", "0.7062059", "0.70475435", "0.7046088", "0.7030545", "0.70182365", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.69972366", "0.6978408", "0.6968347", "0.6958828", "0.6958602", "0.6953092", "0.6948089", "0.6909976", "0.6909136", "0.68912756", "0.68781155", "0.6870422", "0.6867862", "0.68636703", "0.68636703", "0.68636703", "0.68636703", "0.68636703", "0.68636703", "0.6860227", "0.68590295", "0.68467355", "0.68438905", "0.6839488", "0.68287325", "0.68270093", "0.68187886", "0.68124247", "0.6811775", "0.68114674", "0.68080044", "0.6805538", "0.6805538", "0.67998964", "0.6792662", "0.67779094", "0.6774786", "0.67549026", "0.67510086", "0.6749031", "0.67437536", "0.6739944", "0.6739944", "0.6734637", "0.6733591", "0.6730137", "0.6726538", "0.67192453", "0.6679379", "0.66706294", "0.6663088" ]
0.7325617
6
Method to set GET/POST for this class and load the configuration
public function init($gp, $tsConfig) { parent::init($gp, $tsConfig); $this->setEmailAndSubject(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->_config = request('_config');\n }", "protected function initialize()\n {\n if ($this->get('serverData') === null) {\n $this->set('serverData', (array) $_SERVER);\n }\n\n if ($this->get('getData') === null) {\n $this->set('getData', (array) $_GET);\n }\n\n if ($this->get('postData') === null) {\n $this->set('postData', (array) $_POST);\n }\n\n if ($this->get('sessionData') === null && isset($_SESSION)) {\n $this->set('sessionData', (array) $_SESSION);\n }\n\n $serverData = $this->get('serverData');\n\n if (!$this->get('projectRoot')) {\n $projectRoot = isset($serverData['_']) ? $serverData['_'] : $serverData['DOCUMENT_ROOT'];\n $this->set('projectRoot', $projectRoot);\n }\n\n if (!$this->get('url')) {\n if (isset($serverData['REDIRECT_URL'])) {\n $this->set('url', $serverData['REDIRECT_URL']);\n } elseif (isset($serverData['SCRIPT_NAME'])) {\n $this->set('url', $serverData['SCRIPT_NAME']);\n }\n }\n\n if (!$this->get('hostname')) {\n $this->set('hostname', isset($serverData['HTTP_HOST']) ? $serverData['HTTP_HOST'] : 'No Host');\n }\n\n $protocol = $this->get('secure') ? 'https' : 'http';\n $endPoint = $this->get('apiEndPoint') ?: $protocol . '://' . $this->get('host') . $this->get('resource');\n $this->set('apiEndPoint', $endPoint);\n }", "public function init()\n {\n if (isset($this->_server['REQUEST_METHOD'])) {\n $this->_properties = $this->_request;\n\n if (array_key_exists('parameters', $this->_get)\n && gettype($this->_get['parameters']) != 'array'\n && strlen(trim($this->_get['parameters'])) > 0\n ) {\n $paramData = explode('/', $this->_get['parameters']);\n for ($index = 0, $maxCount = sizeof($paramData); $index < $maxCount; $index += 2) {\n if (isset($paramData[$index+1])) {\n if ($paramData[$index+1] == \"_\") {\n $value = \"\";\n } else {\n $value = $paramData[$index+1];\n }\n $this->setProperty(\n $paramData[$index], $value\n );\n }\n }\n } elseif (isset($this->_get['parameters'])\n && gettype($this->_get['parameters']) == 'array'\n && count($this->_get['parameters']) > 0) {\n\n $paramData = $this->_get['parameters'];\n\n foreach ($paramData as $index => $value) {\n $this->setProperty($index, $value);\n }\n }\n\n return;\n }\n\n if (isset($this->_server['argv'])) {\n foreach ($this->_server['argv'] as $arg) {\n if (strpos($arg, '=')) {\n list($key, $val) = explode(\"=\", $arg);\n $this->setProperty($key, $val);\n }\n }\n }\n }", "public function loadConfig(){\n\t\t\n\t\t$opt[] = [\n\t\t\t'method' => 'setFormParams',\n\t\t\t'value'=>$this->paramsLoad(3, \\sevian\\s::getReq('command_idx'), \\sevian\\s::getReq('unit_idx'))\n\t\t\t\n\t\t];\n\t\t$this->info = $opt;//$form->getInfo();\n\t}", "public function __construct()\n {\n // Detect current request\n $this->detectRequest();\n\n // Load GET-parameters\n $this->loadGetParams();\n\n // Load POST-parameters\n $this->loadPostParams();\n\n // Detect AJAX\n $this->detectAJAX();\n }", "public function load()\n {\n $data = array(\n 'get' => (isset($_GET)) ? $_GET : null, \n 'post' => (isset($_POST)) ? $_POST : null,\n 'request' => (isset($_REQUEST)) ? $_REQUEST : null,\n 'files' => (isset($_FILES)) ? $_FILES : null,\n 'server' => (isset($_SERVER)) ? $_SERVER : null,\n 'session' => (isset($_SESSION)) ? $_SESSION : null\n );\n\n foreach ($data as $name => $value) {\n if ($value !== null) {\n $this->$name = $value;\n $global = strtoupper($name);\n unset($$global);\n }\n }\n }", "public function __construct()\n\t{\n\t\t$this->get = $_GET;\n\t\t$this->post = $_POST;\n\t\t$this->request = $_REQUEST;\n\t}", "public function setConfig()\n {\n $this->postcode = isset($_POST['postcode']) ? htmlspecialchars($_POST['postcode']) : '000-0000';\n $this->maptype = isset($_POST['maptype']) ? htmlspecialchars($_POST['maptype']) : 'Static MAP';\n $this->unit = isset($_POST['unit']) ? htmlspecialchars($_POST['unit']) : 'CELSIUS';\n $this->apiLocation = isset($_POST['apiLocation']) ? htmlspecialchars($_POST['apiLocation']) : 'Google';\n $this->apiWeather = isset($_POST['apiWeather']) ? htmlspecialchars($_POST['apiWeather']) : 'OpenWeatherMap';\n }", "private function __construct() {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n $this->data = $_GET;\n } else {\n if (isset($_SERVER['HTTP_CONTENT_TYPE'])) {\n $contentType = $_SERVER['HTTP_CONTENT_TYPE'];\n if (strpos($contentType, ';') !== false) {\n $split = explode(';', $contentType);\n $contentType = trim($split[0]);\n $enc = trim($split[1]);\n }\n if ($contentType == 'application/x-www-form-urlencoded') {\n $this->data = $_POST;\n } else if ($contentType == 'application/json') {\n $json = file_get_contents('php://input');\n $this->data = json_decode($json, true);\n }\n }\n }\n if (strpos($_SERVER['REQUEST_URI'], '/api/') === 0) {\n $this->route = explode('/', $_SERVER['REQUEST_URI']);\n }\n }", "public function __construct(){\r\n\t\t\t$this->request_vars = array();\r\n\t\t\t$this->data = '';\r\n\t\t\t$this->http_accept = (strpos($_SERVER['HTTP_ACCEPT'], 'json')) ? 'json' : 'xml';\r\n\t\t\t$this->method = 'GET';\r\n\t\t}", "private function loadGetParams()\n {\n if(isset($_GET)) {\n $this->getParams = $_GET;\n }\n }", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "private function getConfig() {\n // call the GetConfig API\n $args = array('hostname' => $this->hostname);\n $api = new \\xmlAPI('GetConfig', $this->_default_key, 'xml', $args);\n $api->server_url = $this->_default_server;\n $api->send();\n\n // change hostname if found by custom_name\n $this->hostname = $api->hostname;\n \n // save fields in metadata\n $this->key = $api->api_key ? $api->api_key : $this->_default_key;\n $this->server = $api->api_server ? $api->api_server : $this->_default_server;\n $this->controller_path = $api->controller_path;\n $this->controller = $api->controller;\n $this->error_page = $api->error_page ? $api->error_page : '404';\n $this->mode = $api->mode ? $api->mode : 'test';\n $this->site_path = $api->site_path ? $api->site_path : $this->hostname;\n $this->default_site_path = $api->default_site_path;\n $this->secure_domain = $api->secure_domain;\n \n // set the list of controllers this site can use\n $this->setRights($api->row);\n }", "public function initialize()\n {\n if (!$this->checked) {\n $this->config->checkConfig();\n $this->checked = true;\n $this->data = $this->config->get($this->path, $this->default);\n }\n }", "public function __construct()\n {\n $this->path = isset($_POST['path']) ? $_POST['path'] : '';\n $this->api = isset($_POST['api']) ? $_POST['api'] : '';\n $this->postparam = isset($_POST['postparam']) ? $_POST['postparam'] : '';\n $this->showHeader = isset($_POST['showHeader']) ? $_POST['showHeader'] : '';\n }", "public function populate_from_request()\r\n\t\t{\t\t\r\n\t\t\t// Interate through each class method.\r\n\t\t\tforeach(get_class_methods($this) as $method) \r\n\t\t\t{\t\t\r\n\t\t\t\t$key = str_replace('set_', '', $method);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t// If there is a request var with key matching\r\n\t\t\t\t// current method name, then the current method \r\n\t\t\t\t// is a set mutator for this request var. Run \r\n\t\t\t\t// it (the set method) with the request var. \r\n\t\t\t\tif(isset($_GET[$key]))\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\t$this->$method($_GET[$key]);\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function __construct() {\n\n $this->loadConfig();\n\n }", "protected function __construct() {\n if (isset($_POST)) {\n if (!Session::getInstance()->isCSRFValid($this->getPost('csrf_token'))) // CSRF attack!\n {\n $this->post = false; // it's not a valid post request\n\n }\n else $this->post = true;\n } \n if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')\n $this->ajax = true;\n $getParamsRemoved = explode('?',$_SERVER['REQUEST_URI']); // removes everything after a question mark, like google adwords stuff\n $this->query = $getParamsRemoved[0]; // set the querystring for the router\n if (isset($getParamsRemoved[1]))\n $this->parseGetParams($getParamsRemoved[1]);\n // inject the parameters to the params instance\n\n }", "public function init() {\n //TODO override and put config intialization code here\n }", "public function __construct()\n {\n\n // $configuration = $this->get('configuration');\n\n\n }", "protected function init()\n {\n $this->urlParams = array();\n $this->methodArguments = array();\n $this->lang = self::LANG_POLISH;\n $this->basePath = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.self::BASE_FOLDER.DIRECTORY_SEPARATOR;\n $this->loadConfig();\n }", "private function init(){\r\n\t\t$this->readDescriptionConfig();\r\n\t\t$this->readKeywordsConfig();\r\n\t\t$this->readMetaConfig();\r\n\t\t$this->readLinksConfig();\r\n\t\t$this->readScriptsConfig();\r\n\t}", "protected function _initGetParameters()\n {\n $get = new DataHolder($_GET);\n\n // add query params\n $queryString = substr($_SERVER['REQUEST_URI'], strlen($get->get('_path')) + 2);\n foreach (Util::queryStringToArray($queryString) as $key => $value)\n {\n $get->set($key, $value);\n }\n\n $this->set('_get', $get);\n }", "function __construct() {\n $this->init();\n \\base\\RequestRegistry::setRequest($this);\n }", "public function __construct() {\r\n session_start();\r\n\r\n //store the absolute script directory\r\n //note that this is not the admin directory\r\n self::$abs_path = dirname(dirname(__FILE__));\r\n\r\n //initialize the post variable\r\n if($_SERVER['REQUEST_METHOD'] == 'POST') {\r\n $this->post = $_POST;\r\n if(get_magic_quotes_gpc ()) {\r\n //get rid of magic quotes and slashes if present\r\n array_walk_recursive($this->post, array($this, 'stripslash_gpc'));\r\n }\r\n }\r\n\r\n //initialize the get variable\r\n $this->get = $_GET;\r\n //decode the url\r\n array_walk_recursive($this->get, array($this, 'urldecode'));\r\n }", "function init() {\n $this->properties = array();\n if(isset($_SERVER['REQUEST_METHOD'])) {\n $urlPieces = explode(\"/\", $_GET['q']);\n array_shift($urlPieces);// the way our mod_rewrite does this, it adds an empty string as an extra element on the beginning\n if($urlPieces[0] === \"a\") {// something like foo/bar/test\n $this->setProperty(\"app\", \"true\");\n $this->setProperty(\"cmd\", $urlPieces[1]);\n $this->setProperty(\"action\", $urlPieces[2]);\n } else {\n $this->setProperty(\"cmd\", $urlPieces[0]);\n $this->setProperty(\"action\", $urlPieces[1]);\n\n if(count($urlPieces) > 2) {\n for($i = 2; $i < count($urlPieces); ++$i) {\n $this->extras[] = $urlPieces[$i];\n }\n }\n }\n }\n\n if(isset($_SERVER['argv'][0])) {\n $argPieces = explode(\"&\", $_SERVER['argv'][0]);\n } else {\n $argPieces = array();\n }\n\n foreach($argPieces as $arg) {\n if(strpos($arg, '=')) {\n list($key, $val) = explode(\"=\", $arg);// a=login <- a = 'cmd' in CommandResolver\n $this->setProperty($key, $val);\n }\n }\n }", "public function __construct()\n\t{\n\t\t$this->uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';\n\t\t$this->method = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'get';\n\n\t\t$this->get = $_GET;\n\t\t$this->post = $_POST;\n\t\t$this->cookie = $_COOKIE;\n\t}", "public function __construct()\n {\n // get global configuration\n $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['roadworks']);\n if (is_array($extConf) && count($extConf)) {\n // call setter method foreach configuration entry\n foreach($extConf as $key => $value) {\n $methodName = 'set' . ucfirst($key);\n if (method_exists($this, $methodName)) {\n $this->$methodName($value);\n }\n }\n }\n }", "public function __construct()\n {\n if (!config('maelstrom.form_options.enabled')) {\n return abort(404);\n }\n\n $this->middleware(config('maelstrom.form_options.middleware'));\n $this->types = config('maelstrom.form_options.models');\n }", "protected function _init() {\n parent::_init();\n\n $session = $this->_config['classes']['session'];\n $this->_session = new $session();\n\n $this->_http_get = $this->sanitize($this->_config['http_get']);\n $this->_http_post = $this->sanitize($this->_config['http_post']);\n\n if ( !$this->_is_valid_request($this->_http_get)\n || !$this->_is_valid_request($this->_http_post) ) {\n $this->handle_CSRF();\n $this->_token = null;\n }\n\n if ( is_null($this->_token) ) {\n $this->_token = Auth::create_token();\n }\n\n if ( $this->_session->is_logged_in() ) {\n $user = $this->_config['classes']['user'];\n $this->_user = new $user(array('id' => $this->_session->get_user_id()));\n $this->_template = $this->_user->get_template();\n }\n }", "private function __construct()\n {\n // Overwrite _config from config.ini\n if ($_config = \\Phalcon\\DI::getDefault()->getShared('config')->auth) {\n foreach ($_config as $key => $value) {\n $this->_config[$key] = $value;\n }\n }\n\n $this->_cookies = \\Phalcon\\DI::getDefault()->getShared('cookies');\n $this->_session = \\Phalcon\\DI::getDefault()->getShared('session');\n $this->_security = \\Phalcon\\DI::getDefault()->getShared('security');\n }", "function WithPost()\n {\n $this->mUsername = $_POST['username'];\n $this->mPassword = $_POST['password'];\n $this->mPasswordConfirm = $_POST['passwordConfirm'];\n }", "protected function init()\n {\n $classParser = $this->getContainer()->get('classParser');\n $classParser->setAllowedMethods( array($this->allowedMethod) );\n $this->data = $classParser->getData($this->paths, $this->cacheFile);\n }", "function __construct() {\n\t\t\t$this->inicializar($_GET, $_POST, $_FILES, $_COOKIE, $_SERVER, array());\n\t\t}", "private function load_config() {\n $this->config = new Config();\n }", "public function initialize() \n {\n $this->setEngine(RequestEngine::class);\n $this->setStorage(SessionStorage::class);\n }", "public function config()\n\t{\n\t\tparent::config();\n\n\t\t// change inpu\n\t\tif(self::done_step('username'))\n\t\t{\n\t\t\t// if user go to this page from username page\n\t\t\t$this->data->mobile_username = 'eusername';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if user go to this page from mobile page\n\t\t\t$this->data->mobile_username = 'emobile';\n\t\t}\n\n\t\t// load temp username in username field\n\t\tif(self::get_session('username', 'temp_username'))\n\t\t{\n\t\t\t$this->data->get_username = self::get_session('username', 'temp_username');\n\t\t}\n\n\t\t$this->data->page['title'] = T_('Password');\n\t\t$this->data->page['desc'] = T_('Please enter password to enter');\n\n\t\tswitch (\\lib\\router::get_url(1))\n\t\t{\n\t\t\tcase 'recovery':\n\t\t\t\t$this->data->page['title'] = T_('Recovery Password');\n\t\t\t\t$this->data->page['desc'] = T_('If forget your password, Please enter new password. after pass verification your new password is usable.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'signup':\n\t\t\tcase 'set':\n\t\t\t\t$this->data->page['title'] = T_('Set Password');\n\t\t\t\t$this->data->page['desc'] = T_('Please set your password to secure signup.'). ' '. T_('Next time we only need your mobile and this password to enter');\n\t\t\t\tbreak;\n\n\t\t\tcase 'change':\n\t\t\t\t$this->data->page['title'] = T_('Change to new Password');\n\t\t\t\t$this->data->page['desc'] = T_('Please set your old and new password to change it');\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function __construct() {\n\n\t\t// get Session data\n\t\t$this->session = Session::get();\n\n\t\t// get Response format (json, unless html is explicitly asked for)\n\t\t(strpos($_SERVER['HTTP_ACCEPT'], 'html')) ? $this->format = 'html' : $this->format = 'json';\n\n\t\t// get URI data\n\t\t$this->uri = new URI();\n\n\t\t// get Request method\n\t\t$this->method = $this->crud_map[$_SERVER['REQUEST_METHOD']];\n\n\t\t// get Model\n\t\t$this->model = $this->uri->get('model', 'index');\n\n\t\t// get Request body\n\t\t//\t\t@todo: combine this switch into a simpler statement that uses php://input for all methods\n\t\t//\t\t\t\tand can tell if data is url encoded (parse_str) or json.\n\t\tswitch($this->method) {\n\t\t\tcase 'create':\n\t\t\t\t$this->data = $_POST;\n\t\t\t\tbreak;\n\t\t\tcase 'read':\n\t\t\t\t$this->data = $_GET;\n\t\t\t\tbreak;\n\t\t\tcase 'update':\n\t\t\t\tparse_str(file_get_contents('php://input'), $_put);\n\t\t\t\t$this->data = $_put;\n\t\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\tparse_str(file_get_contents('php://input'), $_delete);\n\t\t\t\t$this->data = $_delete;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// get User data\n\t\t$this->user = new User(Session::get('user_id',0));\n\t}", "public function __construct() {\n $this->setGetter( new HttpGetter() );\n }", "function __construct() {\n\tparent::__construct();\n\t$this->config = json_decode(file_get_contents(CONFIG_DIR . \"controllers/playlist.config.json\"), false);\n }", "private static function _initialise () {\r\n\t\tif (!self::$_request) {\r\n\t\t\tself::$_request = array_merge ($_GET, $_POST);\r\n\t\t}\n\t\t\r\n\t}", "public function __construct() {\n\t\tif(isset($_SERVER['REQUEST_URI']))\n\t\t\t$this->url = $_SERVER['REQUEST_URI'];\n\t\telse\n\t\t\t$this->url = '';\n\n\t\tif(isset($_POST))\n\t\t\t$this->data = $_POST;\n\t\telse\n\t\t\t$this->data = array();\n\t}", "function __construct() {\r\n\t\tparent::__construct();\r\n\t\tif (get_magic_quotes_gpc()) {\r\n\t\t\t$this->removeSlashes($_GET);\r\n\t\t\t$this->removeSlashes($_POST);\r\n\t\t}\r\n\t\t\r\n\t\tif (!strcasecmp($_SERVER['REQUEST_METHOD'], 'POST')) {\r\n\t\t\t$this->data = empty($_POST) ? array() : $_POST;\r\n\t\t\t$this->isPost = true;\r\n\t\t} else {\r\n\t\t\t$this->data = empty($_GET) ? array() : $_GET;\r\n\t\t\t$this->isPost = false;\r\n\t\t}\r\n\t\t@$this->data['PATH_INFO'] = $_SERVER['PATH_INFO'];\r\n\t}", "public function __construct() {\r\n\t\t$this->request_method = $_SERVER ['REQUEST_METHOD'];\r\n\t\t$this->url_elements = explode ( '/', $_SERVER ['PATH_INFO'] );\r\n\t\t$this->parseIncomingParams ();\r\n\t\t// Initialise json as default format\r\n\t\t$this->format = 'json';\r\n\t\tif (isset ( $this->parameters ['format'] )) {\r\n\t\t\t$this->format = $this->parameters ['format'];\r\n\t\t}\r\n\t}", "public function __construct()\n {\n // Store the instance statically\n static::$instance = $this;\n\n // Load the app's config\n $this->loadConfig();\n\n // Register the error handler\n $this->registerErrorHandler();\n\n // Create our request and response objects\n $this->request = new Request;\n $this->response = new Response;\n\n // Bootstrap the database\n Database::bootstrap($this->config->db->toArray());\n\n // Convert relative store paths to absolute, and bootstrap the cache\n foreach ($this->config->cache as $instance => $config) {\n $cacheStorePath = $config->store_path;\n if ($cacheStorePath !== null) {\n if (!is_dir($cacheStorePath) && is_dir(APP_ROOT.$cacheStorePath)) {\n $this->config->cache->{$instance}->store_path = APP_ROOT.$cacheStorePath;\n }\n }\n }\n Cache::bootstrap($this->config->cache->toArray());\n\n // Convert relative store paths to absolute, and bootstrap the session\n $sessionStorePath = $this->config->session->store_path;\n if ($sessionStorePath !== null) {\n if (!is_dir($sessionStorePath) && is_dir(APP_ROOT.$sessionStorePath)) {\n $this->config->session->store_path = APP_ROOT.$sessionStorePath;\n }\n }\n Session::bootstrap($this->config->session);\n\n // Include the app routes\n require APP_ROOT.'routes.php';\n\n // Register global view variables\n View::addGlobal('appName', $this->config->app->name);\n View::addGlobal('app', $this);\n View::addGlobal('input', $this->request->input);\n\n $this->compileAssets();\n\n // Execute routes\n Router::execute();\n\n if (PHP_SAPI !== 'cli') {\n $this->checkRoute();\n }\n }", "function __construct() {\r\n $this->config->token = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"token\", '');\r\n $this->config->api = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"api\", '');\r\n $this->config->sender = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"sender\", '');\r\n\t}", "protected function initConfiguration()\n {\n $this->initJsonConfiguration();\n $this->initApiGatewayConfiguration('kyc_service/' . $this->requestPath, false);\n }", "public function config()\n {\n }", "public function __construct()\n {\n parent::__construct();\n $this->config = config($this->configName);\n }", "function init()\n\t{\n $this->defineAttribute('ajaxController', false, 'org.glizycms.contents.controllers.autocomplete.ajax.PagePicker', COMPONENT_TYPE_STRING);\n $this->defineAttribute('type', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('protocol', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('makeLink', false, false, COMPONENT_TYPE_BOOLEAN);\n\t\t$this->defineAttribute('multiple',\tfalse, \tfalse,\tCOMPONENT_TYPE_BOOLEAN);\n $this->defineAttribute('queryString', false, __Config::get('glizycms.pagePicker.queryStringEnabled'), COMPONENT_TYPE_BOOLEAN);\n\t\tparent::init();\n\n\t}", "private function initConfig() {\n\t\t$configLoader = new ConfigLoader($this->_env);\n\n /** set config to Di container */\n $this->_di->set('config', $configLoader, TRUE);\n $this->_config = $configLoader;\n\t}", "public function __construct() {\n $this->config();\n parent::__construct();\n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "private function loadConfig() {\n\n //get pachage and configuration\n $pkg = Package::getByHandle(\"c5authy\");\n Loader::library('authy', $pkg);\n\n $co = new Config();\n $co->setPackageObject($pkg);\n\n $production = ( $co->get('authy_server_production') == \"1\" ? true : false );\n\n //set the values\n $this->api_key = $co->get('authy_api_key');\n $this->server = $production ? self::LIVE_SERVER : self::SANDBOX_SERVER;\n $this->auth_type = $co->get('authy_type');\n $this->sms_token = $co->get('authy_sms_tokens');\n }", "public function configure()\n {\n $this->setMethod('GET');\n $this->setFunctionPath('/Api/clusterGetServerStatus');\n $this->setParser(new \\ZendService\\ZendServerAPI\\Adapter\\ServersList());\n }", "public function __construct() { \n require __DIR__ . '/Config/parameters.php'; //⚠️️ DIR = cste magiq qui retourne chemin du doss ds lequel on est depuis la racine\n $this -> parameters = $parameters; // je mets ça ds ' protected $parameters; '\n /*⚠️️ Au moment où j'instancie cette classe, je récupère le fichier parameters.php, \n et je stocke tous les parameters de mon application dans la propriété $parameters */\n }", "public function __construct(){\n\t\t$this->request = $_REQUEST;\n\t\t$this->get = $_GET;\n\t\t$this->post = $_POST;\n\t\t$this->checkHtaccess();\n\t}", "function Loader($get, $post, $files)\n\t\t{\n\t\t\tif ($get['object'] == \"pages\")\n\t\t\t{\n\t\t\t\t$get['object'] = \"page\";\n\t\t\t\t$get['id'] = $get['action'];\n\t\t\t\t$get['action'] = \"view\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->config\t\t\t= Config::GetInstance();\n\t\t\t\n\t\t\t// blank screen of death? TAKE $this->session = new Session() out of\n\t\t\t// the Users constructor ffs\n\t\t\t\n\t\t\t$this->get\t\t\t\t= $get;\n\t\t\t$this->post\t\t\t\t= $post;\n\t\t\t$this->files\t\t\t= $files;\n\n\t\t\t$this->loaded\t\t\t= false;\n\t\t\t$this->error_message\t= \"\";\n\t\t\t\n\t\t\t$this->CONTROLLER\t\t= (empty($get['object'])) ? \"\" : ucwords(strtolower($get['object'])) . \"Controller\";\n\t\t\t$this->ACTION\t\t\t= ucwords(strtolower($get['action']));\n\t\t\t$this->ID\t\t\t\t= $get['id'];\n\t\t}", "abstract public function configure_method_settings();", "protected function construct() {\n\n $_aGet = $_GET;\n unset( $_aGet['post_type'], $_aGet['request'], $_aGet['page'], $_aGet['tab'], $_aGet['settings-updated'] );\n $this->aDefaultKeys['settings'] = $this->getQueryAdminURL( array( 'request' => 'autocomplete', 'post_type' => 'post' ) + $_aGet );\n $this->aDefaultKeys['settings2'] = array(\n 'hintText' => __( 'Type the title of posts.', 'admin-page-framework-demo' ),\n );\n\n /*\n * If the request key is set in the url and it yields 'autocomplete', return a JSON output and exit.\n */ \n if ( isset( $_GET['request'] ) && 'autocomplete' === $_GET['request'] ) {\n if ( did_action( 'init' ) ) {\n $this->_replyToReturnAutoCompleteRequest();\n } else { \n add_action( 'init', array( $this, '_replyToReturnAutoCompleteRequest' ) );\n }\n }\n\n }", "public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }", "public function loadConfigs()\n {\n self::$country_configs = self::getCountryConfigs();\n $configs = new parent();\n self::$categories = $configs->getCategories();\n self::$site_data = self::get_site_data();\n self::$payments_name = self::setPaymentGateway();\n }", "public function _initConfig() {\r\n $this->config = Yaf\\Application::app()->getConfig();\r\n Yaf\\Registry::set(\"config\", $this->config);\r\n\r\n //申明, 凡是以Foo和Local开头的类, 都是本地类\r\n $this->loader = Yaf\\Loader::getInstance();\r\n $this->loader->registerLocalNamespace([\"fly\"]);\r\n }", "function initialize() {\n $this->_configure = $this->config->item('biz_listing_configure');\n $this->_pagination = $this->config->item('pagination');\n $this->_validation = $this->config->item('biz_listing_validation');\n }", "private function setRequest() {\n // Create request object\n $this->request = Request::createFromGlobals();\n // Check caching and exit if so\n // - create a dummy response for possible 304\n $response = new Response();\n $seconds = Config::get()->pagecachetime;\n $response->setLastModified(new DateTime('-' . $seconds . ' seconds'));\n if ($response->isNotModified($this->getRequest())) {\n $response\n ->setSharedMaxAge($seconds)\n ->send();\n exit();\n }\n // Add better json request support\n // check request Content-Type\n $ctCheck = 0 === strpos(\n $this->request->headers->get('CONTENT_TYPE')\n , 'application/json'\n );\n // check request Method\n $methodCheck = in_array(\n strtoupper($this->request->server->get('REQUEST_METHOD', 'GET'))\n , array('PUT', 'DELETE', 'POST')\n );\n if ($ctCheck && $methodCheck) {\n $params = (array) json_decode($this->request->getContent());\n $this->request->request = new ParameterBag($params);\n }\n }", "public function load()\n {\n $this->settings = get_option($this->optionName);\n }", "protected function configure() {\n\n /** @noinspection PhpUndefinedClassConstantInspection */\n $this->setName(static::NAME)\n ->setDescription($this->getDescription());\n\n if(method_exists($this,'getOptions')) {\n $this->setDefinition(\n new InputDefinition($this->getOptions())\n );\n }\n }", "public function init() {\n $this->uri = ''; //En un futuro esto tomara pararemetros q vengan de GET\n session_start();\n //$this->generateFakeData();\n $this->validatePost();\n $this->requireView(); \n }", "public function setRequest()\n\t{\n\n\t\t/** http://localhost/molajo/index.php returns 'http' */\n\t\t$this->set('scheme', $this->symfony_request->getScheme());\n\n\t\t/** http://localhost/molajo/index.php returns 'http' */\n\t\t$this->set('is_secure', $this->symfony_request->isSecure());\n\n\t\t/** http://localhost:99/molajo/index.php retursn http:://localhost:99 (non-standard port) */\n\t\t$this->set('host', $this->symfony_request->headers->get('host'));\n\n\t\t/** http://localhost/molajo/index.php returns '/molajo' */\n\t\t$this->set('base_path', $this->symfony_request->getBasePath());\n\n\t\t/** http://localhost/molajo/index.php returns '/molajo' */\n\t\t$this->set('base_url', $this->symfony_request->getBaseURL());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('port', $this->symfony_request->getPort());\n\n\t\t/** http://localhost/molajo/index.php return http:://localhost */\n\t\t/** http://localhost/molajo:88/index.php return http:://localhost:88 */\n\t\t$this->set('http_host', $this->symfony_request->getHttpHost());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('request_uri', $this->symfony_request->getRequestUri());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('uri', $this->symfony_request->getUri());\n\n\t\t/** POST: Create GET: Read PUT: Update, DELETE: Delete */\n\t\t/** Many browsers do not support PUT or DELETE, $_SERVER['REQUEST_METHOD] supplements */\n\t\t$this->set('method', $this->symfony_request->getMethod());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('port', $this->symfony_request->getPort());\n\n\t\t$this->set('path_info', $this->symfony_request->getPathInfo());\n\n\t\t$this->set('query_string', $this->symfony_request->getQueryString());\n\n\t\tif ($this->symfony_request->getQueryString() == '') {\n\t\t\t$tempQueryParameters = array();\n\t\t} else {\n\t\t\t$tempQueryParameters = explode('&', $this->get('query_string'));\n\t\t}\n\n\t\t$query_parameters = array();\n\t\tif (count($tempQueryParameters) > 0) {\n\t\t\tforeach ($tempQueryParameters as $item) {\n\t\t\t\t$pair = explode('=', $item);\n\t\t\t\t$query_parameters[$pair[0]] = $pair[1];\n\t\t\t}\n\t\t}\n\t\t$this->set('query_parameters', $query_parameters);\n\n\t\t/** http://localhost/molajo/index.php returns '/molajo/index.php' */\n\t\t$this->set('base_url_path', $this->get('http_host') . $this->get('base_url')\n\t\t);\n\n\t\t/** http://localhost/molajo/index.php returns 'http://molajo/index.php' */\n\t\t$this->set('base_url_path_with_scheme',\n\t\t\t$this->get('scheme')\n\t\t\t\t. '://'\n\t\t\t\t. $this->get('http_host')\n\t\t\t\t. $this->get('base_url')\n\t\t);\n\n\t\t$this->set('ajax', $this->symfony_request->isXmlHttpRequest());\n\n\t\t$this->set('request_format', $this->symfony_request->getRequestFormat());\n\n\t\t$this->set('mime_type', $this->symfony_request->getMimeType($this->get('request_format')));\n\n\t\t$this->set('format', $this->symfony_request->getFormat($this->get('mime_type')));\n\n\t\t$this->set('content_type', $this->symfony_request->getContentType());\n\n\t\t/** Client */\n\t\t$this->set('client_ip', $this->symfony_request->getClientIp());\n\n\t\t/** Server */\n\t\t$this->set('user', $this->symfony_request->getUser());\n\n\t\t$this->set('password', $this->symfony_request->getPassword());\n\n\t\t$this->set('document_root', $this->symfony_request->server->get('DOCUMENT_ROOT'));\n\n\t\t$this->set('entry_point', $this->symfony_request->server->get('SCRIPT_FILENAME'));\n\n\t\t/** Language */\n\n\t\treturn true;\n\t}", "public function __construct()\n {\n $this->uri = $_SERVER['REQUEST_URI'];\n $this->method = $_SERVER['REQUEST_METHOD'];\n\n // Get all parameters from the request depending on request method\n $parameters = match ($this->method) {\n 'GET' => $_GET,\n 'POST' => $_POST,\n };\n // Remove 'path' from Request parameters because we use it in rewrite rule in htaccess for pretty url,\n // and it is handled by the Route later.\n unset($parameters['path']);\n $this->parameters = $parameters;\n }", "public function __construct() {\n\t\t$this->getRoutes = array();\n\t\t$this->postRoutes = array();\n\t}", "function __construct() {\n $this->getSystemConfig();\n }", "protected function configureRequest()\n {\n $this->transporter\n ->setMethod('getFields')\n ->setParam('version', 2);\n }", "public function init()\n {\n $this->fillFromConfig([\n 'columns',\n 'model',\n 'recordUrl',\n 'recordOnClick',\n 'noRecordsMessage',\n 'showPageNumbers',\n 'recordsPerPage',\n 'showSorting',\n 'defaultSort',\n 'showCheckboxes',\n 'showSetup',\n 'showTree',\n 'treeExpanded',\n 'showPagination',\n 'customViewPath',\n ]);\n\n /*\n * Configure the list widget\n */\n $this->recordsPerPage = $this->getSession('per_page', $this->recordsPerPage);\n\n if ($this->showPagination == 'auto') {\n $this->showPagination = $this->recordsPerPage && $this->recordsPerPage > 0;\n }\n\n if ($this->customViewPath) {\n $this->addViewPath($this->customViewPath);\n }\n\n $this->validateModel();\n $this->validateTree();\n }", "public function __construct() {\n\t\tunset($_REQUEST['app'], $_REQUEST['module'], $_REQUEST['method']);\n\n\t\t$this->setGetParameters();\n\t\t$this->setPostParameters();\n\t}", "protected function setGetData()\n\t{\n\t\t$this->request->addParams($this->query->getParams());\n\t}", "function __construct()\n {\n parent::__construct();\n $this->getvars = array();\n $this->postvars = array();\n }", "function final_init() {\r\n\r\n if ($this->query_only) {\r\n $this->allow_new = False; # bool, True to allow new command\r\n $this->allow_edit = False; # bool, True to allow edit command\r\n $this->allow_delete = False; # bool, True to allow delete command\r\n $this->allow_view = False; # bool, True to allow view command\r\n }\r\n\r\n # give change for fields to init them self after all definitions\r\n\t\tforeach ($this->properties as $key=>$col) {\r\n $this->properties[$key]->colvarname = $key; # notify field of their called-name\r\n $this->properties[$key]->init($this);\r\n }\r\n\r\n # set session for each module's browse-mode default value\r\n if (!$this->browse_mode_forced and $_REQUEST['set_browse_mode'] != '')\r\n $_SESSION['module_browse_mode'][$this->module] = $_REQUEST['set_browse_mode'];\r\n\r\n\r\n if ($this->module == $_REQUEST['m'] and $_SERVER['REQUEST_METHOD'] == 'POST') { # only do this if I'm the currently active module in page\r\n $this->post_handler();\r\n }\r\n if ($this->module == $_REQUEST['m'] and $_SERVER['REQUEST_METHOD'] == 'GET') { # only do this if I'm the currently active module in page\r\n $this->get_handler();\r\n }\r\n\r\n }", "private function loadPostParams()\n {\n if(isset($_POST)) {\n $this->postParams = $_POST;\n }\n }", "public function __construct()\r\n\t{\r\n\t\t// Primeiro limpamos o caminho informado na URL\r\n\t\t$this->setUrl();\r\n\r\n\t\t// Depois quebramos ela para ajudar no processo\r\n\t\t$this->setExplode();\r\n\r\n\t\t// Retiramos a Controller da URL (caso exista uma)\r\n\t\t$this->setController();\r\n\r\n\t\t// Retiramos a Action da URL (caso exista uma)\r\n\t\t$this->setAction();\r\n\r\n\t\t// Retiramos os Parâmetros da URL (caso eles existam)\r\n\t\t$this->setParams();\r\n\r\n\t\t// Organizamos a Controller e Action para buscar elas dinamicamente\r\n\t\t$this->arrangeControllerAction();\r\n\t}", "protected function init()\n {\n $this->autoRefresh = $this->createAutoRefreshSetting();\n\n // User setting --> textbox converted to int defining a validator and filter\n $this->refreshInterval = $this->createRefreshIntervalSetting();\n\n // User setting --> radio\n $this->color = $this->createColorSetting();\n }", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "private function __construct() {\r\n\t\t// proc will grab a different column of settings values.\r\n\t\t$testing = (int) $this->config()->testing;\r\n\t\t\r\n\t\t$sql = \"CALL settings_get($testing)\";\r\n $rs = $this->query($sql);\r\n \r\n if ($this->hasError()) {\r\n error_log($this->getError());\r\n $this->error = \"Unable to load settings\";\r\n }\r\n \r\n if ($rs->hasRecords()) {\r\n\t\t\twhile ($row = $rs->fetchArray()) {\r\n\t\t\t\t$this->{$row['label']} = $row['value'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Handle secure cookies\r\n\t\t\tif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) {\r\n\t\t\t\t$this->cookiesecure = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function __construct() {\n if (!$this->read() and !INSTALLING)\n trigger_error(\n __(\"Could not read the configuration file.\"),\n E_USER_ERROR\n );\n\n fallback($this->data[\"sql\"], array());\n fallback($this->data[\"enabled_modules\"], array());\n fallback($this->data[\"enabled_feathers\"], array());\n fallback($this->data[\"routes\"], array());\n }", "public function loadSettings()\n {\n $this->loadJSON($this->settings);\n }", "public static function init() {\n\t\t\tself::initErrorHandler();\n\t\t\tself::loadAppConfig();\n\t\t\tself::initDatabase();\n\t\t\tHttpCore::initSession();\n\t\t\tAuth::init();\n\t\t\tself::$baseUrl = HttpCore::getBaseUrl();\n\t\t\tself::loadRoutes();\n\t\t\tself::loadWidgets();\n\t\t}", "public function __construct()\n {\n if(isset($_GET['correo'])){$this->Correo=$_GET['correo'];}\n if(isset($_GET['pregunta'])){$this->Pregunta=$_GET['pregunta'];}\n if(isset($_GET['respuesta'])){$this->Respuesta=$_GET['respuesta'];}\n }", "public function __construct() {\n // BIG THANKS!!!\n foreach ($_POST as $key => $val) {\n if (substr($key, 0, 8) == 'action::') {\n $_POST['action'] = substr($key, 8);\n unset($_POST[$key]);\n }\n }\n\n $this->post = (object)$_POST;\n foreach($this->post as $key => $value) $this->post->$key = stripslashes($value);\n $this->_uri = array_key_exists('PATH_INFO', $_SERVER) ? $_SERVER['PATH_INFO'] : '';\n // Fix: workaround for lighttp rewrite rules, pse check for better solution\n if ('/index.php' === substr($this->_uri,0, 10))\n $this->_uri = substr($this->_uri, 10);\n $this->_rootUri = $this->getBaseUri() . substr($this->_uri, 1);\n\n $i = strrpos($_SERVER['SCRIPT_NAME'], '/') + 1;\n $this->baseUri = substr($_SERVER['REQUEST_URI'], 0, $i);\n\n $this->uri = $this->_uri;\n $this->requestUri = $_SERVER['REQUEST_URI'];\n }", "public function init()\n {\n // Prestashop does not support json responses in case of authentication error so I must check it here.\n if (!$this->checkAccess()) {\n http_response_code(401);\n $this->ajaxRenderJson(['error' => 'Invalid Token']);\n }\n\n // This is necessary to avoid rendering html templates, as we want a json response\n $this->ajax = true;\n $this->content_only = true;\n\n // Prestashop does not support custom urls with slash\n // This trick allows Prestashop to handle requests with slash in \"action\" parameter\n // /module/marmiads/endpoint?action=/feed/products will call displayAjaxFeedProducts()\n $_GET['action'] = str_replace('/', '_', $_GET['action']);\n\n parent::init();\n }", "function __loadConfig() {\n\t\t$area = $this->__determineArea();\n\t\tConfigure::write('Area', $area);\n\t\t$user = $this->User->findById($this->Session->read('Auth.User.id'));\n\t\tConfigure::write('User', $user['User']);\n\t}", "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "public function __construct() {\n $this->autodetectActions([\n // Method => pattern...should be set by default.\n HTTP::GET => new RegEx(\"get_(.+)$\")\n ]);\n }", "public function __construct( ) {\n foreach( $_REQUEST as $property=>$value){\n $this->$property = $value;\n }\n \n }", "protected function setUp()\n {\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $this->kml = new \\SimpleMappr\\Kml();\n }", "public function configure();", "public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }", "public function __construct() {\n $this->urlValues = $_GET;\n if (!isset($this->urlValues['c'])) {\n $this->controllerName = \"home\";\n $this->controllerClass = \"HomeController\";\n } else {\n $this->controllerName = strtolower($this->urlValues['c']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['c'])) . \"Controller\";\n }\n \n if (!isset($this->urlValues['a'])) {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['a']; \n }\n }", "function __construct() {\n //invoke the init method of the config object in context\n $this->init();\n }", "protected function _initPostParameters()\n {\n $this->set('_post', new DataHolder($_POST));\n }", "public function setUp() {\n\t\tparent::setUp();\n\n\t\t$_GET = array();\n\t\t$_POST = array();\n\t}", "public function configure()\n\t{\n\t\tif (!$this->form)\n\t\t{\n\t\t\t$this->form = new WebForm\\Form($this->getId());\n\t\t}\n\n\t\t$data = $this->form->get();\n\t\t$isCloud = Loader::includeModule('bitrix24');\n\n\t\t$this->fileDir = 'form';\n\t\t$this->fileName = str_replace(\n\t\t\t['#id#', '#sec#'],\n\t\t\t[$this->getId(), $data['SECURITY_CODE']],\n\t\t\t$isCloud ? 'loader_#id#.js' : 'loader_#id#_#sec#.js'\n\t\t);\n\n\t\t$name = 'crm.site.form.embed.unit';\n\t\t$this->addExtension($name);\n\t\t$module = $this->getModule($name);\n\t\t$module->getProfile()->setCallParameter($this->getCallParameter());\n\n\t\t$this->embeddedModuleName = 'crm.site.form.unit.loader';\n\t}" ]
[ "0.69704604", "0.66923237", "0.6664083", "0.66286254", "0.64483273", "0.6422629", "0.63996476", "0.63893896", "0.6375513", "0.6359138", "0.6328952", "0.632469", "0.62434", "0.62425995", "0.61944836", "0.6182098", "0.6180431", "0.6170887", "0.6164056", "0.6156281", "0.6138523", "0.6133356", "0.61229235", "0.6116009", "0.6108869", "0.6097772", "0.60960394", "0.6085723", "0.6079536", "0.60787106", "0.60671043", "0.60382295", "0.60373276", "0.60347575", "0.6011498", "0.6000487", "0.5998533", "0.59910417", "0.59895647", "0.59854156", "0.597722", "0.59722644", "0.5971986", "0.5945848", "0.59455234", "0.5925593", "0.5913909", "0.5913902", "0.5907367", "0.59024966", "0.58994424", "0.58958155", "0.5890801", "0.588969", "0.5886567", "0.58737236", "0.5864215", "0.5861376", "0.5856556", "0.5855864", "0.58538735", "0.5847472", "0.58431107", "0.584281", "0.5837273", "0.5836146", "0.5831777", "0.5830649", "0.5828173", "0.5827536", "0.5814593", "0.5809536", "0.57907575", "0.5788458", "0.57844716", "0.5779518", "0.5776596", "0.5767064", "0.57648456", "0.5756806", "0.5754606", "0.57524806", "0.574482", "0.57445204", "0.5743607", "0.5739441", "0.57360685", "0.57098746", "0.57061917", "0.570547", "0.57045245", "0.57011276", "0.56988156", "0.5693855", "0.56913227", "0.5689776", "0.5684652", "0.56836945", "0.56772035", "0.56757295", "0.56736445" ]
0.0
-1
Permuted multiples It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order. Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.
function same($s1, $s2) { $s1len = strlen($s1); $s2len = strlen($s2); if($s1len != $s2len) return false; for($i = 0; $i < $s1len; $i++) { $count = 0; for($j = 0; $j < $s1len; $j++) { if($s1[$i] == $s2[$j]) $count++; } if($count != 1) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function getMultiples(int ...$numbers) : int\n {\n $numbers = array_values($numbers);\n asort($numbers);\n\n $last = $numbers[count($numbers) - 1];\n $multiples = 0;\n\n for ($i = 5; $i <= $last; $i += 5) {\n if (in_array($i, $numbers)) {\n $multiples++;\n }\n }\n\n return $multiples;\n }", "function singleFromMult($num){\n if ( $num > 0)\n {\n return ($num - 1) % 9 + 1;\n }\n else\n {\n return 0;\n }\n}", "function euler_solution_003($product)\n{\n $answer = 1;\n $point = 3;\n $divisor = $product;\n\n while ( 0 == ( $divisor % 2 ) ) {\n $answer = 2;\n $divisor = ( $divisor / 2 );\n }\n\n while ($divisor != 1) {\n while (0 == ($divisor % $point)) {\n $answer = $point;\n $divisor = ($divisor / $point);\n }\n $point += 2;\n }\n return $answer;\n}", "function nonDivisibleSubset($k, $s) {\n $set = array_map(function($item) use($k) {return $item % $k;}, $s);\n $numbers = array_pad([], $k, 0);\n foreach($s as $item)\n {\n $numbers[$item % $k]++;\n }\n\n ksort($numbers);\n $hasEvenlyDivisible = $numbers[0] ? 1 : 0;\n $result = 0;\n unset($numbers[0]);\n foreach($numbers as $item => $itemsCount)\n {\n if($item > floor($k / 2))\n {\n break;\n }\n if($item == $k - $item)\n {\n $result += $itemsCount ? 1 : 0;\n }\n else\n {\n $result += max($itemsCount, $numbers[$k - $item]);\n }\n }\n\n return $result ? $result + $hasEvenlyDivisible : 0;\n\n}", "function checkDubs($numbers) {\n\t$x = 1;\n\t$d1 = (string)$numbers[0] . (string)$numbers[1];\n\t$d2 = (string)$numbers[2] . (string)$numbers[3];\n\t$d3 = (string)$numbers[4] . (string)$numbers[5];\n\t$d4 = (string)$numbers[6] . (string)$numbers[7];\n\tif ($d1 == $d2 && $d2 == $d3 && $d3 == $d4) {\n\t\t$x=$x+250;\n\t}\n\tif ($d1 == $d2 && $d2 == $d3) {\n\t\t$x=$x+100;\n\t}\n\tif ($d2 == $d3 && $d3 == $d4) {\n\t\t$x=$x+150;\n\t}\n\tif ($d1 == $d2) {\n\t\t$x=$x+100;\n\t}\n\tif ($d2 == $d3) {\n\t\t$x=$x+100;\n\t}\n\treturn $x;\n}", "function sum_of_3_and_5() {\n\n /*\n * Algorithmic solution\n * count of multiples of 3 = 1000 / 3 = 333;\n * count of multiples of 5 = 1000 / 5 = 199;\n *\n * sum of multiplies of 3\n * 1 * 3 + 2 * 3 + ... + 333 * 3 = 3 * (1 + ... + 333) = 3 * 333 * (333 + 1) / 2\n * sum of multiplies of 5\n * 1 * 5 + 2 * 5 + ... + 199 * 5 = 5 * (1 + ... + 199) = 5 * 199 * (199 + 1) / 2\n *\n * sum = 166833 + 99500 = 266333\n *\n */\n\n $sum = 0;\n for($i = 3; $i < 1000; $i += 3) {\n $sum += $i;\n }\n\n for($i = 5; $i < 1000; $i += 5) {\n $sum += $i;\n }\n\n return $sum; // 266333\n}", "function sumProperDivisors( $number ) {\n\n $factors = array();\n\n $max = floor( sqrt( $number ) );\n\n for( $factor = 1; $factor <= $max; $factor++ ) {\n\n if( $number % $factor == 0 ) {\n\n array_push( $factors, $factor );\n\n // Don't add the square root twice.\n if( $factor != $number / $factor ) {\n\n // A proper factor must be less than the number.\n if( $factor != 1 ) {\n\n array_push( $factors, $number / $factor );\n\n }\n\n }\n\n }\n\n }\n\n return array_sum( $factors );\n\n}", "function simplify_fraction($x) {\t// not a true simplifier, need prime factors\n\t$a = $x[0];\n\t$b = $x[1];\n\t$afs = prime_factors($a);\n\t$bfs = prime_factors($b);\n\n\t// Find\tcommon factors:\n\tforeach($afs as $af) {\n\t\tif (in_array($af, $bfs)) {\n\t\t\t// common factor found, remove from both (in fact, set to 1):\n\t\t\t$bkey = array_search($af, $bfs);\n\t\t\t$bfs[$bkey] = 1;\n\t\t\t$akey = array_search($af, $afs);\n\t\t\t$afs[$akey] = 1;\n\t\t}\n\t}\n\n\treturn array(array_product($afs), array_product($bfs));\n}", "function permutator_generate($tops){\r\n\t$max=1;\r\n\t$cas=array();\r\n\tforeach ($tops as $top) {$max=$max*$top;array_push($cas,0);}\r\n\t\r\n\t$res=array();\r\n\t\r\n\tarray_push($res,$cas);\r\n\t\r\n\tfor ($i=0;$i<$max-1;$i++){\r\n\t\t$cas[0]++;\r\n\t\tpermutator_overflow($cas,$tops);\r\n\t\tarray_push($res,$cas);\r\n\t\t\r\n\t}\r\n\t\r\n\treturn $res;\r\n\t\r\n}", "function UglyNumber($number)\n{\n while ($number%2 == 0){\n $number = $number/2;\n }\n while ($number%3 == 0){\n $number = $number/3;\n }\n while ($number%5 == 0){\n $number = $number/5;\n }\n if($number == 1){\n return 1;\n }else{\n return 0;\n }\n}", "function multiply($num)\r\n{\r\n $possible_solution = array();\r\n $ps_counter = 0;\r\n \r\n $data = array();\r\n $data_counter = 0;\r\n for($i1 = 1;$i1<=10;$i1++)\r\n {\r\n for($i2 = 1;$i2<=10;$i2++)\r\n {\r\n if(($i2 * $i1) == $num)\r\n {\r\n \r\n $data[$data_counter] = array($i1 , $i2);\r\n $data_counter++;\r\n \r\n }\r\n }\r\n }\r\n return $data;\r\n}", "private function generateMultiples($number, $max): array\n\t{\n\n\t\tfor ($index = 1; ($number * $index) <= $max; $index++)\n\t\t{\n\t\t\t$multiples[] = $number * $index;\n\t\t}\n\n\t\treturn $multiples;\n\t}", "function lcm( $a, $b) { return ($a * $b) / gcd($a, $b); }", "function lcm_arr($items){\n //Output: The LCM of the numbers\n while(2 <= count($items)){\n array_push($items, lcm(array_shift($items), array_shift($items)));\n }\n return reset($items);\n}", "function differentNumbers($number) {\n\t$arr = array();\n\tfor ($i=0; $i < 10; $i++) {\n\t\t$x = substr_count($number, $i);\n\t\t$arr[\"$i\"] = $x;\n\t}\n\t$count = count(array_filter($arr));\n\tswitch ($count) {\n\t\tcase 8:\n\t\treturn 0.8;\n\t\tbreak;\n\t\tcase 7:\n\t\treturn 0.9;\n\t\tbreak;\n\t\tcase 6:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tcase 5:\n\t\treturn 1.8;\n\t\tbreak;\n\t\tcase 4:\n\t\treturn 2.7;\n\t\tbreak;\n\t\tcase 3:\n\t\treturn 3.2; // Bliver lavere igen herefter, da numre med kun 2 eller 1 tal bliver højere gennem de andre funktioner alligevel\n\t\tbreak;\n\t\tcase 2:\n\t\treturn 2.1;\n\t\tbreak;\n\t\tcase 1:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tdefault:\n\t\treturn 0.8;\n\t\tbreak;\n\t}\n}", "public static function powm($a, $x, $p) {\n $result = 1;\n $c = $a;\n while($x) {\n if ($x & 1) {\n $result = $result * $c % $p;\n }\n $x >>= 1;\n $c = $c * $c % $p;\n }\n return $result;\n }", "function larFactor($number){\n // prime numbers\". So, 2*2*3 = 12; {2,3} are prime numbers.\n // A prime number is a number that can be divided only by one or itself.\n // \n // We're looking for the larges prime factor of a number. In our example, the answer is:3 \n // \n // Our algorithm? \n // \n // When should it stop? : When the product of the numbers is greater or equal to the passed\n // number.\n // \n // 2*2*2*2 = 16 {2} is the largest prime number.\n // 3*5 = 15, {5} is the largest prime number. \n // \n $count = 2; //Smallest primer number\n while($count*$count <= $number){\n \tif($number%$count==0){\n \t\t$number=$number/$count;\n \t}else{\n \t\t$count++;\n \t}\n }\n return $number;\n\n}", "function checkprime($x){\n \n $sqrt = sqrt($x);\n $counter = 2;\n \n while ($counter <= $sqrt){\n if ($x % $counter == 0){\n break;\n }\n else{\n $counter++;\n }\n }\n if ($x % $counter != 0){\n return $x;\n }\n}", "function verteilung3($n) {\n return (powInt($n, 3)) / 3;\n}", "public function generatate(int $number = 0)\n {\n $remaining = $number;\n $primes = [];\n\n for ($candidate = 2; $remaining > 1; $candidate++) {\n for (;$remaining % $candidate == 0; $remaining /= $candidate) {\n $primes[] = $candidate;\n }\n }\n\n return $primes;\n }", "public function testMultDistributive()\n {\n $this\n ->given(\n $a = $this->fromNative($this->randomNativeNumber())->toInteger(),\n $b = $this->fromNative($this->randomNativeNumber())->toReal(),\n $c = $this->fromNative($this->randomNativeNumber())->toDecimal()\n )\n ->then\n ->boolean(\n $a->mult($b->add($c))->equals($a->mult($b)->add($a->mult($c)))\n )->isTrue()\n ->boolean(\n $b->mult($a->add($c))->equals($b->mult($a)->add($b->mult($c)))\n )->isTrue()\n ->boolean(\n $c->mult($a->add($b))->equals($c->mult($a)->add($c->mult($b)))\n )->isTrue()\n ->boolean(\n $a->mult($b->sub($c))->equals($a->mult($b)->sub($a->mult($c)))\n )->isTrue()\n ->boolean(\n $b->mult($a->sub($c))->equals($b->mult($a)->sub($b->mult($c)))\n )->isTrue()\n ->boolean(\n $c->mult($a->sub($b))->equals($c->mult($a)->sub($c->mult($b)))\n )->isTrue()\n ;\n }", "private function fact($x) {\n // cache previously calculated factorials (just caching at the top level would suffice)\n static $memento_array = array(); \n $result = 1;\n $x_orig = $x;\n\n while ($x > 0) {\n if (isset($memento_array[$x])) {\n $x_fact = $memento_array[$x];\n $result *= $x_fact;\n break;\n } else {\n $result *= $x;\n $x--;\n }\n }\n if (!isset($memento_array[$x_orig])) {\n echo \"Factorial cached for \".$x_orig.\"\\n\";;\n $memento_array[$x_orig] = $result; // only need to save when not set\n }\n return $result;\n }", "function factorio($num)\n {\n $arr4 = [];\n for ($i = 1; $i <= $num; $i++) {\n array_push($arr4, $i);\n echo $i . \"<br>\";\n };\n\n $result = array_reduce($arr4, function ($a, $b) {\n $a *= $b;\n return $a;\n }, 1);\n return \"result: \" . $result . \"<br>\";\n }", "function pick_prime() {\r\n\t\t$primes = array(13,17,23,29,43,57,71);\r\n\t\t$i = rand(0,6);\r\n\t\t$j = $primes[$i];\r\n\t\treturn($j);\r\n\t}", "function p3_ex3() {\n $hundred = 100;\n $rand = mt_rand(1, 100);\n for ($i = 20; $hundred >= $i; $hundred--) {\n if ($hundred % 5 == 0 && $hundred != 100)\n $return .= 'resultat : '.($hundred * $rand).'<br />';\n else\n $return .= 'resultat : '.($hundred * $rand).', ';\n }\n\n return $return;\n}", "function func3($n) {\n for ($k = 0; $n; $n = (int) ($n / 10)) {\n $k = $n * 10;\n if ($k > $n)\n $n = $k;\n }\n return $n;\n}", "public static function montgomeryExponentation($n, $a, $c, $n_, $R) {\n //echo \"montgomeryExponentation(n=$n, a=$a, c=$c, n'=$n_, R=$R):\";\n $R2 = ($R * $R) % $n;\n //echo \"\\n R^2=\".$R2;\n //echo \"\\n x=\";\n $x = Algebra::montgomeryReduction($n, $n_, $R, 1 * $R2);\n //echo \"\\n s=\";\n $s = Algebra::montgomeryReduction($n, $n_, $R, $a * $R2);\n $cBin = base_convert($c, 10, 2);\n echo \"\\n c=bin(\" . $cBin . \")\";\n $k = strlen($cBin) - 1;\n if ($cBin[$k] == 1) {\n $x = $s;\n //echo \"\\n x=s=$s, koska c[0] = 1\\n\";\n }\n //echo \"\\n Silmukka alkaa:\";\n $t = 1;\n for ($i = $k - 1; $i >= 0; $i--) {\n //echo \"\\n\\tKIERROS $t:\";\n //echo \"\\n\\t s=mr(s^2)=\";\n $s = Algebra::montgomeryReduction($n, $n_, $R, pow($s, 2));\n if ($cBin[$i] == 1) {\n //echo \"\\n\\t\\t x=mr(x*s)=\";\n $x = Algebra::montgomeryReduction($n, $n_, $R, $x * $s);\n //echo \", koska c[\".$t.\"]=1\";\n }\n $t++;\n }\n //echo \"\\n Silmukka loppuu: \\n x=mr(x)=\";\n $x = Algebra::montgomeryReduction($n, $n_, $R, $x);\n //echo \"\\n\";\n return $x;\n }", "function lcm($a, $b) { \n\treturn ( $a / gcf($a,$b) ) * $b; \n}", "function num1BitsThirdSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n for ($c = 0; $number; $c++) {\n $number &= $number - 1;\n }\n\n return $c;\n}", "function isPowerOf($number, $k) {\n\t\t$check = false;\n\n\t\twhile($number > 0) {\n\t\t\t$digit = $number % $k;\n\n\t\t\tif($digit > 1) return false;\n\n\t\t\tif($digit == 1) {\n\t\t\t\tif($check) return false;\n\t\t\t\t$check = true;\n\t\t\t}\n\n\t\t\t$number /= $k;\n\t\t}\n\n\t\treturn true;\n\t}", "public static function montgomeryReduction(int $n, int $n_, int $R, int $x) {\n $u = ($x * $n_) % $R;\n $v = ($x + $u * $n) / $R;\n if ($v > $n) {\n $v = $v - $n;\n }\n //echo \"montgomeryReduction(n=$n, n'=$n_, R=$R, x=$x)=\".$v;\n echo $v;\n return $v;\n }", "public function sumNumbersB()\n {\n $suma = 0;\n $multiplos = [3, 5, 7];\n for($i = 1; $i<=1000; $i++)\n {\n foreach ($multiplos as $j)\n {\n if($i%$j !== 0)\n continue 2;\n }\n\n $suma = $suma + $i;\n\n }\n return $suma;\n }", "function candies($n, $m) {\n $result = 0; \n $result = intval($m/$n); \n $result = $n * $result; \n return $result;\n}", "function getFactors(int $number):array {\n for ($i = 2; $i < $number; $i++) {\n // Si le modulo de $number divisé par $i est 0, il s'agit d'un facteurs de ce nombre\n if($number % $i == 0){\n $factors[] = $i;\n }\n }\n var_dump($factors);\n return $factors;\n}", "function getTotalX($a, $b) {\n\n sort($a);\n sort($b);\n\n $minInA = $a[0];\n $maxInB = $b[count($b) - 1];\n $sizeA = count($a);\n $sizeB = count($b);\n\n $i = 1;\n $numbersBetween = 0;\n $factor = $minInA * $i;\n\n while ($factor <= $maxInB) {\n $allFactors = true;\n $divideAll = true;\n\n for ($j = 1; $j < $sizeA; $j++) {\n if ($factor % $a[$j] != 0) {\n $allFactors = false;\n break;\n }\n }\n\n for ($j = 0; $j < $sizeB; $j++) {\n if ($b[$j] % $factor != 0) {\n $divideAll = false;\n break;\n }\n }\n\n $numbersBetween += ($allFactors && $divideAll ? 1 : 0);\n $factor = $minInA * (++$i);\n }\n\n return $numbersBetween;\n\n}", "function findLargestPalindromeProduct($maxComponent){\n $largest = [0,0]; //this will store our working largest palindrome products\n for($i = 0; $i < $maxComponent; $i++){ //try every possible first number\n for($j = 0; $j < $maxComponent; $j++){ //try every possible 2nd number\n if(checkPalindrome($j*$i)){ //if the product is a palindrome\n if($largest[0]*$largest[1] < $i*$j){ //if the product is larger than our previous best\n $largest = [$i, $j]; //then update the working largest copy\n }\n }\n }\n }\n return($largest); //return the array containing the 2 numbers used to create the largest palindrome\n}", "function findVal($num, $multiple1, $multiple2, $valTrue) {\n\tif ( ((int)$num % $multiple1 == 0) && ((int)$num % $multiple2 == 0) && is_numeric($num) )\n\t{\n\t\treturn $valTrue;\n\t} \n\treturn $num;\n}", "function Fannkuch($n){\n $check = 0;\n $perm = array();\n $perm1 = array();\n $count = array();\n $maxPerm = array();\n $maxFlipsCount = 0;\n $m = $n - 1;\n\n for ($i=0; $i<$n; $i++) $perm1[$i] = $i;\n $r = $n;\n\n while (TRUE) {\n // write-out the first 30 permutations \n if ($check < 30){\n for($i=0; $i<$n; $i++) echo $perm1[$i]+1; \n echo \"\\n\";\n $check++;\n }\n\n while ($r != 1){ $count[$r-1] = $r; $r--; } \n if (! ($perm1[0]==0 || $perm1[$m] == $m)){ \n for($i=0; $i<$n; $i++) $perm[$i] = $perm1[$i]; \n $flipsCount = 0;\n\n while ( !(($k=$perm[0]) == 0) ) {\n $k2 = ($k+1) >> 1;\n for($i=0; $i<$k2; $i++) {\n $temp = $perm[$i]; $perm[$i] = $perm[$k-$i]; $perm[$k-$i] = $temp;\n }\n $flipsCount++;\n }\n\n if ($flipsCount > $maxFlipsCount) {\n $maxFlipsCount = $flipsCount;\n for($i=0; $i<$n; $i++) $maxPerm[$i] = $perm1[$i];\n }\n } \n\n while (TRUE) { \n if ($r == $n) return $maxFlipsCount;\n $perm0 = $perm1[0];\n $i = 0;\n while ($i < $r) {\n $j = $i + 1;\n $perm1[$i] = $perm1[$j];\n $i = $j;\n }\n $perm1[$r] = $perm0;\n\n $count[$r] = $count[$r] - 1;\n if ($count[$r] > 0) break;\n $r++;\n }\n }\n}", "function calculateLuckyNumbers(){\n $luckyNumbers = array();\n $bits = 62;\n for($i=0; $i<$bits; $i++) {\n for($j=0; $j<$i; $j++) {\n $luckyNumbers[] = pow(2, $i) + pow(2, $j);\n }\n }\n return $luckyNumbers;\n}", "function make_permutation() {\r\n\t\t//\r\n\t\t$permutation = array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\r\n\t\t\t\t\t\t\t -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\r\n\t\t\t\t\t\t\t -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\r\n\t\t\t\t\t\t\t -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1);\r\n\t\t//\r\n\t\tfor ( $i = 0; $i < 64; $i++ ) {\r\n\t\t\t$idx = 0;\r\n\t\t\twhile ( $idx != -1 ) {\r\n\t\t\t\t$j = rand(0,64);\r\n\t\t\t\tif ( $j == 64 ) $j--;\r\n\t\t\t\t$idx = $permutation[$j];\r\n\t\t\t\tif ( $idx == -1 ) $permutation[$j] = $i;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//\r\n\t\t//\r\n\t\t$permstr = \"\";\r\n\t\tfor ( $i = 0; $i < 64; $i++ ) {\r\n\t\t\t $j = $permutation[$i];\r\n\t\t\t if ( $i > 0 ) {\r\n\t\t\t\t$permstr .= ',';\r\n\t\t\t\tif ( !($i % 16) ) {\r\n\t\t\t\t\t$permstr .= \"\\n\\t\\t\\t\\t\";\r\n\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t $permstr .= $j;\r\n\t\t}\r\n\t\t\r\n\t\treturn($permstr);\r\n\t}", "function nprimo($n)\n {\n $primo=true;\n \n $i=2;\n while (($i< $n) & ($primo)){\n \n if($n%$i==0) {\n $primo=false;\n }\n $i++;\n }\n return $primo;\n }", "public function mt($index = null, $min = 0, $max = 1000)\n {\n static $op = array(0x0, 0x9908b0df); // Used for efficiency below to eliminate if statement\n static $mt = array(); // 624 element array used to get random numbers\n \n // Regenerate when reseeding or seeding initially\n if($this->seed !== $this->ps)\n {\n $s = $this->seed & 0xffffffff;\n $mt = array(&$s, 624 => &$s);\n $this->ps = $this->seed;\n \n for($i = 1; $i < 624; ++$i)\n $mt[$i] = (0x6c078965 * ($mt[$i - 1] ^ ($mt[$i - 1] >> 30)) + $i) & 0xffffffff;\n \n // This has been tweaked for maximum speed and elegance\n // Explanation of possibly confusing variables:\n // $p = previous index\n // $sp = split parts of array - the numbers at which to stop and continue on\n // $n = number to iterate to - we loop up to 227 adding 397 after which we finish looping up to 624 subtracting 227 to continue getting out 397 indices ahead reference\n // $m = 397 or -227 to add to $i to keep our 397 index difference\n // $i = the previous element in $sp, our starting index in this iteration\n for($j = 1, $sp = array(0, 227, 397); $j < count($sp); ++$j)\n {\n for($p = $j - 1, $i = $sp[$p], $m = ((624 - $sp[$j]) * ($p ? -1 : 1)), $n = ($sp[$j] + $sp[$p]); $i < $n; ++$i)\n {\n $y = ($mt[$i] & 0x80000000) | ($mt[$i + 1] & 0x7fffffff);\n $mt[$i] = $mt[$i + $m] ^ ($y >> 1) ^ $op[$y & 0x1];\n }\n }\n }\n \n // Select a number from the array and randomize it\n $y = $mt[$this->index = $this->index % 624];\n $y ^= $y >> 11;\n $y ^= ($y << 7) & 0x9d2c5680;\n $y ^= ($y << 15) & 0xefc60000;\n $y ^= $y >> 18;\n \n return $y % ($max - $min + 1) + $min;\n }", "public function testIfMultiplicationsIsCorrect()\n {\n $params = [12,4];\n $response = $this->multiplicationObject->calculate($params);\n $this->assertEquals(48, $response);\n }", "function promedio_general($vector){ \n $promedio=0;\n foreach ($vector as $key => $value) {\n foreach ($value as $c => $n) {\n $promedio=$promedio+$n;\n }\n }\n return ($promedio/10);\n }", "protected function lottery() {\n if (is_array(self::$lottery)) {\n $result = rand(1, self::$lottery[1]);\n if ($result <= self::$lottery[0]) {\n $this->cleanup();\n }\n }\n }", "public function getMultiplierForShot($shot)\n {\n $this->validateShotNumber($shot);\n\n return $this->multipliers[$shot - 1];\n }", "function q_factor($string)\r\n{\r\n \r\n $pos = strpos($string , \"^2\");\r\n \r\n $number1 = '';\r\n for($i = $pos-2;$i >= 0 ; $i--)\r\n {\r\n if(filter_var($string[$i] , FILTER_VALIDATE_INT) || $string[$i] == \"0\")\r\n {\r\n $number1 .= $string[$i];\r\n \r\n \r\n }\r\n else\r\n break;\r\n }\r\n $number = '' ;\r\n for($i=strlen($number1)-1 ;$i >=0 ; $i--)\r\n {\r\n $number .= $number1[$i];\r\n }\r\n \r\n $pos_num = ($pos - 1) - strlen($number); \r\n \r\n return array((int)$number , $pos_num);\r\n \r\n \r\n}", "function p3_ex2() {\n $rand = mt_rand(1, 100); // mt_rand is very better\n for ($i = 0; $i <= 20; $i++) {\n if ($i % 5 == 0 && $i != 0)\n $return .= 'resultat : '.($i * $rand).'<br />';\n else\n $return .= 'resultat : '.($i * $rand).', ';\n }\n\n return $return;\n}", "function solution($input)\n {\n $result = 1;\n\n $divisors_desc = array();\n $divisors_asc = array();\n $divisor_limit = $input;\n\n for($i = 2; $i < $divisor_limit; $i++){\n if($input % $i == 0){\n $divisor_limit = $input/$i;\n $divisors_desc[] = $divisor_limit;\n $divisors_asc[] = $i;\n }\n }\n //complexity O(n)\n \n $divisors = array_merge($divisors_desc,array_reverse($divisors_asc));\n print_r($divisors);\n\n //if no divisors exist, the number itself is prime\n if(count($divisors)==0){\n $result = $input;\n }\n\n //finding prime number in divisors list\n //starting from highest\n for($d = 0; $d < count($divisors); $d++)\n {\n $isPrime = true;\n $divisor_limit = $divisors[$d];\n\n //if any divisor is found, number is not prime\n for($x = 2; $x<$divisor_limit;$x++)\n {\n if($divisors[$d] % $x == 0){\n $isPrime = false;\n print_r($divisors[$d]. \"is not prime\\n divisor \". $x. \"\\n\");\n break;\n }\n }\n\n if($isPrime){\n $result = $divisors[$d];\n break;\n }\n }\n\n $solution = array();\n $solution['complexity'] = \"O(n2)\";\n $solution['result'] = $result;\n\n return $solution;\n }", "function elevaralcubo($num1){\n \n $res=pow($num1,3);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }", "private function bcmod($x, $y)\n {\n if (function_exists('bcmod')) {\n return bcmod($x, $y);\n }\n\n // how many numbers to take at once? carefull not to exceed (int)\n $take = 5;\n $mod = '';\n\n do {\n $a = (int)$mod . substr($x, 0, $take);\n $x = substr($x, $take);\n $mod = $a % $y;\n } while (strlen($x));\n\n return (int)$mod;\n }", "function lotto(){\n $numbers = $_GET['numbers'];\n $numbers = [9, 14, 28, 36, 41, 49];\n\n foreach($numbers as $num){\n echo $num.\"<br>\";\n }\n \n echo \"<br><br><br>\";\n \n $win = [];\n $i = 1;\n \n while($i < 13){\n $number = mt_rand(1, 49);\n \n if(($i%2) == 0){\n if(!in_array($number, $win)){\n $win[$i] = $number;\n $i++;\n }\n } else{\n $i++;\n }\n }\n \n sort($win);\n \n foreach($win as $w){\n echo $w.\"<br>\";\n }\n \n echo \"<br><br><br>\";\n \n $same = [];\n \n foreach($numbers as $player){\n $count = count($same);\n foreach($win as $computer){\n if($player == $computer){\n $same[$count] = $player;\n }\n }\n }\n \n sort($same);\n \n foreach($same as $w){\n echo $w.\"<br>\";\n }\n }", "public function printMultiplicationTable()\n {\n // Use range to make it resistent to mutation testing\n foreach (range(1, 12) as $x) {\n foreach (range(1, 12) as $y) {\n printf(\"%4d\", $x * $y);\n }\n echo \"\\n\";\n }\n }", "private function sumMul($limit, $number)\n {\n $greatestMultiple = $limit-1;\n while ($greatestMultiple%$number != 0) {\n $greatestMultiple--;\n }\n $last = $greatestMultiple / $number;\n return (integer) $number * $last * ($last + 1) / 2;\n }", "public function testMultOne()\n {\n $this\n ->given(\n $one = $this->fromNative(1),\n $number = $this->fromNative($this->randomNativeNumber())\n )\n ->then\n ->boolean(\n $number->mult($one)->equals($number)\n )->isTrue()\n ->boolean(\n $one->mult($number)->equals($number)\n )->isTrue()\n ;\n }", "public function testMultCommutative()\n {\n $this\n ->given(\n $a = $this->fromNative($this->randomNativeNumber())->toInteger(),\n $b = $this->fromNative($this->randomNativeNumber())->toReal(),\n $c = $this->fromNative($this->randomNativeNumber())->toDecimal()\n )\n ->then\n ->boolean(\n $a->mult($b)->equals($b->mult($a))\n )->isTrue()\n ->boolean(\n $a->mult($c)->equals($c->mult($a))\n )->isTrue()\n ->boolean(\n $b->mult($c)->equals($c->mult($b))\n )->isTrue()\n ;\n }", "function q24(array $lexemes, $permutationIndex)\n{\n\t$lexemesCount = count($lexemes);\n\t$size = Math::factorial($lexemesCount);\n\n\tif ($permutationIndex > $size) {\n\t\tthrow new LogicException('Index is superior to the size of the generatable permutations.');\n\t}\n\n\t$output = '';\n\twhile ($lexemesCount !== 0) {\n\t\t$x = Math::factorial($lexemesCount - 1);\n\t\tforeach ($lexemes as $index => $lexeme) {\n\t\t\tif ($permutationIndex <= $x) {\n\t\t\t\t$output .= $lexemes[$index];\n\t\t\t\tunset($lexemes[$index]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$permutationIndex -= $x;\n\t\t}\n\t\t--$lexemesCount;\n\t}\n\techo $output;\n}", "function num1BitsFirstSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n $countOf1 = 0;\n\n do {\n\n if ($number & 1) {\n ++$countOf1;\n }\n\n } while ($number = $number >> 1);\n\n return $countOf1;\n}", "function scramble($number) {\n \t\t// return (30533914 * (10033320 - $number + date('s') ) + 151647) % 99447774483;\n\t\t\t$r = rand(100000000000, 999999111111);\n\t\t\treturn abs($r + $id); //better consistency\n\n\t\t}", "final public function rabin_miller_primality_test($number, $k = 100)\n {\n $number = (int) $number;\n /* base cases - order matters - working with numbers greater than 3 */\n if ($number < 2) {\n return false;\n }\n\n if ($number === 2 || $number === 3) {\n return true;\n }\n\n if ($number % 2 === 0) {\n return false;\n }\n\n /* array for memoization */\n $verified = [];\n list($t, $u) = $this->rabin_miller_vars($number - 1);\n $r = $t - 1;\n do {\n if (count($verified) == $number - 2) {\n /* break do loop */\n $k = 0;\n } else {\n /* get a new unique base */\n do {\n $base = Math::random(2, $number - 1);\n } while (in_array($base, $verified));\n /* memoize the base and get another unique base */\n $verified[] = $base;\n $witness = Math::mod_pow($base, $u, $number);\n if ($witness != 0 && $witness !== 1 && $witness !== $number - 1) {\n for ($i = 1; $i <= $t; $i++) {\n $prev_witness = $witness;\n $witness = Math::mod_pow($witness, 2, $number);\n if ($witness == 1) {\n /* Determine if Non-trivial square root */\n if ($prev_witness != 1 && $prev_witness != $number - 1) {\n /* composite */\n return false;\n } else {\n /* loop again for accuracy */\n $i = $t;\n }\n } else if ($i == $t && $witness != 1) {\n /* composite */\n return false;\n }\n }\n }\n }\n } while (--$k > 0);\n /* most likely a prime */\n return true;\n }", "function lcm($a, $b) {\n return $this->lcd($a, $b);\n }", "function multitosingle($input, $output = array()) {\n ksort($input);\n foreach ($input as $value) {\n $key = count($output);\n if (is_array($value)) {\n $output = multitosingle($value, $output);\n }\n else {\n $output[$key] = $value;\n }\n }\n return $output;\n}", "public function getMultiplier(): int\n {\n $multiplier = 1;\n\n foreach (static::$qualityStepMultiplier as $day => $dayMultiplier) {\n if ($this->getItem()->sell_in <= $day) {\n $multiplier = $dayMultiplier;\n }\n }\n\n return $multiplier;\n }", "function getNumberOfDivisors($n) {\n $factors = 0;\n $i = 1;\n\n while ($i * $i < $n) {\n if ($n % $i === 0) {\n $factors += 2;\n }\n\n $i++;\n }\n\n if ($i * $i === $n) {\n $factors++;\n }\n\n return $factors;\n}", "function egyptianMultiplication($a, $n) {\n\t//we could use bits here\n\t//ONE DAY :P\n\t$startValue = $a;\n\tif ($n == 1) {\n\t\treturn $a;\n\t}\n\n\t$odd = $n % 2;\n\n\tif ($odd) {\n\t\t$n = $n - 1;\n\t}\n\t// $log2 = floor(log($n, 2));\n\n\t// for ($i = 0; $i < $log2; $i++) {\n\t// \t$n = $n / 2;\n\t// \t$a += $a;\n\t// }\n\t$i = 0;\n\twhile ($n != 1) {\n\t\t$n = $n / 2;\n\t\t$a += $a;\n\t\t$i++;\n\t}\n\n\tif ($odd) {\n\t\t$a += $startValue;\n\t}\n\treturn $a;\n}", "public function intMultiply( $k, $base = 0 );", "function num1BitsSecondSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n for ($c = 0; $number; $number >>= 1) {\n $c += $number & 1;\n }\n\n return $c;\n}", "function Factor($n){\n while($n%2==0){\n echo \"2 \\n\";\n $n=$n/2;\n }\n for($i=3;$i<=sqrt($n);$i=$i+2){\n while($n%$i==0){\n echo \"$i \\n\";\n $n=$n/$i;\n }\n }\n if($n>2){\n echo \"$n\\n\";\n }\n }", "public function generate(int $number): array\n {\n $factors = [];\n\n for ($divisor = 2; $number > 1; $divisor++) {\n for (; $number % $divisor === 0; $number /= $divisor) {\n $factors[] = $divisor;\n }\n\n }\n\n return $factors;\n }", "function iqTest(string $numbers): int\n{\n /** @var array{int} $arrayInt */\n $arrayInt = array_map(function ($val) {\n return $val % 2;\n }, explode(' ', $numbers));\n /** @var int $diffValue */\n $diffValue = array_sum($arrayInt) === 1 ? 1 : 0;\n\n return array_search($diffValue, $arrayInt) + 1;\n}", "function primo($num) {\n if ($num == 2 || $num == 3 || $num == 5 || $num == 7) {\n return True;\n } else {\n if ($num % 2 != 0) {\n for ($i = 3; $i <= sqrt($num); $i += 2) {\n if ($num % $i == 0) {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n }", "public function testDistinctBeatifulNumbersTotal()\r\n {\r\n $this->assertEquals(142, $this->numberOjb->count());\r\n }", "private function getUniqNums($min, $max, $quantity) {\n $numbers = range($min, $max);\n shuffle($numbers);\n return array_slice($numbers, 0, $quantity);\n }", "function factorial($in)\n {\n $out = 1;\n // Only if $in is >= 2\n for ($i = 2; $i <= $in; $i++) {\n $out *= $i;\n }\n return $out;\n }", "function sieveOfEratosthenesGenerator($maxNumber)\n{\n $serie = array_fill(0, $maxNumber, true);\n for ($i = 0; $i <= sqrt($maxNumber); $i++) {\n if ($i >= 2 && $serie[$i]) {\n for ($j = pow($i, 2); $j <= $maxNumber; $j += $i) {\n $serie[$j] = false;\n }\n } else {\n $serie[$i] = false;\n }\n }\n return array_keys(array_filter($serie));\n}", "function cubeIt($val) { \n return $val*$val*$val;\n }", "function recy($c)\n {\n $min = round(min((sqrt(($c )*35)),100)*100);\n $max = round(min((sqrt(($c+2)*35)),100)*100);\n return mt_rand($min,$max)/10000;\n }", "function verteilung4($n) {\n return (powInt($n, 1.5));\n}", "function is_ugly($num)\n {\n $z = $num;\n if ($num == 0)\n {\n return \"$num is not an Ugly number\";\n }\n \n $x = array(2, 3, 5);\n foreach ($x as $i)\n {\n while ($num % $i == 0)\n {\n $num /= $i;\n }\n } \n if ($num==1)\n {\n return \"$z is an Ugly number\";\n }\n else\n {\n return \"$z is not an Ugly number\";\n }\n\n }", "public static function integers()\n {\n // First, make sure the most common numbers are covered.\n yield 0;\n yield -1;\n yield 1;\n\n // Then generate random numbers from an increasing range.\n $half_of_randmax = mt_getrandmax() / 2;\n $lim = 1;\n $iterations = 0;\n while (true) {\n $iterations++;\n\n yield mt_rand(-$lim, $lim);\n\n if ($lim <= $half_of_randmax) {\n $lim *= 2;\n } else {\n // Start over when maxed out.\n $lim = 1;\n }\n }\n }", "function Gen(){\n\t$res=rand(0, 680);\n\tif( $res<50 ){ $n=6; }\n\tif( ($res>=50)&&($res<250) ){ $n=5; }\n\tif( ($res>=250)&&($res<400) ){ $n=4; }\n\tif( ($res>=400)&&($res<500) ){ $n=3; }\n\tif( ($res>=500)&&($res<600) ){ $n=2; }\n\tif($res>=600){ $n=1; }\n\treturn $n;\n}", "function next_pow($number)\n{\n if($number < 2) return 1;\n for($i = 0 ; $number > 1 ; $i++)\n {\n $number = $number >> 1;\n }\n return 1<<($i+1);\n}", "function multiplicacion($numeroUno,$numeroDos){\r\n return $resultado=$numeroDos*$numeroUno;\r\n}", "function num_divisors($n) {\n\tif($n % 2 == 0) $n /= 2;\n\t$divisors = 1;\n\t$count = 0;\n\twhile($n % 2 == 0) {\n\t\t$count += 1;\n\t\t$n /= 2;\n\t}\n\n\t$divisors = $divisors * ($count + 1);\n\t$p = 3;\n\twhile($n != 1) {\n\t\t$count = 0;\n\t\twhile($n % $p == 0) {\n\t\t\t$count += 1;\n\t\t\t$n /= $p;\n\t\t}\n\t\t$divisors = $divisors * ($count + 1);\n\t\t$p += 2;\n\t}\n\treturn $divisors;\n\n}", "function getPrime(array $numbers) : array {\n\n foreach ($numbers as $number) {\n // Prime est de base vrai\n $prime = true;\n for($i=2; $i < $number; $i++){\n // Si à un moment $number peut etre divisé par $i, alors ce n'est pas un nombre premier\n if($number % $i == 0){\n // On passe $prime à false et on arrete la boucle for\n $prime = false;\n break;\n }\n }\n\n if($prime){\n $primes[] = $number;\n }\n\n }\n return $primes;\n}", "function gmp_intval($gmpnumber)\n{\n}", "function armstrong_number(int $num){\n $temp = $num; // store the number in a temporary variable\n $result = 0; // variable to store the result\n\n // loop till the the temporary variable is not equal to zero\n while($temp != 0){\n $remainder = $temp%10; // get the remainder of temp variable divided by 10\n $result = $result + $remainder*$remainder*$remainder; // add the result with cube of the remainder\n\n $temp = $temp/10; // change the temp variable by dividing it by 10\n }\n\n return $result; // return result\n }", "public function createRandomMultiplier(): BigInteger\n {\n return BigInteger::random(256);\n }", "public function permutation(int ...$p) : Deck;", "public function run()\n {\n $num1 = 999;\n $num2 = 999;\n $limit = 910;\n return Palindrome::largestPalindromeProduct($num1, $num2, $limit);\n }", "function array_power_set($array) {\n $results = array(array());\n foreach ($array as $element)\n foreach ($results as $combination)\n array_push($results, array_merge(array($element), $combination));\n return array_slice($results,1);\n}", "function checkRecursive($x, $n, $curr_num = 1,$curr_sum = 0)\n{\n // Initialize number of ways to express\n // x as n-th powers of different natural\n // numbers\n $results = 0;\n \n // Calling power of 'i' raised to 'n'\n $p = power($curr_num, $n);\n $p + $curr_sum;\n while ($p + $curr_sum < $x)\n {\n // Recursively check all greater values of i\n $results += checkRecursive($x, $n, $curr_num+1,$p+$curr_sum);\n $curr_num++;\n $p = power($curr_num, $n);\n }\n \n // If sum of powers is equal to x\n // then increase the value of result.\n echo $p + $curr_sum;\n echo \"\\n\";\n if ($p + $curr_sum == $x)\n $results++;\n \n // Return the final result\n return $results;\n}", "private function computeGroup()\n {\n $this->group = [];\n\n foreach (range(1, $this->getSize()) as $number) {\n if (1 === $this->gcd($number, $this->getSize())) {\n $this->group[] = $number;\n }\n }\n }", "function getPrimes($n) {\n return array_keys(\n array_filter(sieveOfEratosthenes($n), function ($p) {\n return (! $p);\n })\n );\n}", "function soryArray($array)\r\n{\r\n //Create a bucket of arrays\r\n $bucket = array_fill(0, 9, array());\r\n $maxDigits = 0;\r\n //Determine the maximum number of digits in the given array.\r\n foreach ($array as $value) {\r\n $numDigits = strlen((string )$value);\r\n if ($numDigits > $maxDigits)\r\n $maxDigits = $numDigits;\r\n }\r\n $nextSigFig = false;\r\n for ($k = 0; $k < $maxDigits; $k++) {\r\n for ($i = 0; $i < count($array); $i++) {\r\n if (!$nextSigFig)\r\n $bucket[$array[$i] % 10][] = $array[$i];\r\n else\r\n $bucket[floor(($array[$i] / pow(10, $k))) % 10][] = $array[$i];\r\n }\r\n //Reset array and load back values from bucket.\r\n $array = array();\r\n for ($j = 0; $j < count($bucket); $j++) {\r\n foreach ($bucket[$j] as $value) {\r\n $array[] = $value;\r\n }\r\n }\r\n //Reset bucket\r\n $bucket = array_fill(0, 9, array());\r\n $nextSigFig = true;\r\n }\r\n return $array;\r\n}", "function add_many_fractions($list, $n) {\n\t$unique_denoms = range(2*$n, 2, -1);\n\t$max_denom = array_product($unique_denoms);\t// gets as big as 80 factorial - NO GO\n\tforeach ($list as $key => $frac) {\n\t\t// Cross-multiply:\n\t\t$list[$key][0] *= $max_denom / $frac[1];\n\t\t$list[$key][1] *= $max_denom / $frac[1];\n\t}\n\t// All denominators now equal.\n\t\n\t// Sum numerators:\n\t$sum = 0;\n\tforeach ($list as $frac) {\n\t\t$sum += $frac[0];\n\t}\n\t\n\t// Reassemble summed fraction:\n\treturn array($sum, $list[0][1]);\n}", "function getCommonFactor($first, $second, $tenPoint, $height) {\n $allNumbers = array(intval($first), intval($second));\n $upDown = $down;\n $interval = 1;\n $isCommon = false;\n $testNumber = intval(0.2181818181 * ($height/$tenPoint)); // when we've got more height than font, we'll start looking at a higher number for the common factor. Default will be 12.\n while(!$isCommon AND $testNumber > 3) {\n\t\t$isCommon = true; // if we make it through the following loop without changing this, then we've found our number!\n\t\tforeach($allNumbers as $num) {\n\t\t\t$remainder = $num % $testNumber;\n if($remainder != 0) {\n $isCommon = false;\n }\n\t\t}\n if(!$isCommon) {\n if($upDown == \"down\") {\n $testNumber = $testNumber - $interval;\n $upDown = \"up\";\n } else {\n $testNumber = $testNumber + $interval;\n $upDown = \"down\";\n }\n $interval++;\n }\n\t}\n if(!$isCommon) {\n return 12;\n } else {\n return $testNumber;\n }\n}", "function get_random_numbers($num, $max){\n\t$array = array();\n\twhile($num--){\n\t\tdo {\n\t\t\t$c = rand(1, $max);\n\t\t} while (in_array($c, $array));\n\t\t$array[] = $c;\n\t}\n\treturn $array;\n}", "function multiplicatinNum($bilangan1, $bilangan2){\n return $bilangan1 * $bilangan2; //perkalian bilangan1 dan bilangan2 serta mengembalikan hasil\n }", "function solution($A)\n{\n $pairs = $zeros = 0;\n\n foreach ($A as $k => $v) {\n $zeros += ($v === 0);\n\n if ($v===1) {\n $pairs += $zeros;\n }\n\n if ($pairs>1000000000) {\n $pairs = -1;\n break;\n }\n }\n\n return $pairs;\n}", "private function sumThreeAndFiveMultiples($limit)\n {\n $outputSum = 0;\n for ($i=1; $i < $limit; $i++){\n if ($i % 3 === 0 || $i % 5 === 0) {\n $outputSum += $i;\n }\n }\n return $outputSum;\n }" ]
[ "0.60221004", "0.55803484", "0.548248", "0.54167795", "0.5381424", "0.5342526", "0.5265571", "0.5188838", "0.518429", "0.5149134", "0.5133298", "0.5100229", "0.50669974", "0.50302136", "0.501802", "0.50090116", "0.49619687", "0.49556652", "0.49319443", "0.48976916", "0.48952088", "0.4861723", "0.4860487", "0.4848844", "0.48346734", "0.48202312", "0.48136425", "0.47802955", "0.47520018", "0.47444087", "0.47391006", "0.47360316", "0.47155753", "0.47139192", "0.470803", "0.46950543", "0.46905652", "0.46782547", "0.46751538", "0.46676704", "0.46523568", "0.46444616", "0.4641983", "0.46241608", "0.46186143", "0.46157366", "0.46108267", "0.46093762", "0.46045247", "0.4604315", "0.46035174", "0.45911753", "0.45671263", "0.45623997", "0.45613968", "0.45590103", "0.4536244", "0.4519666", "0.45087603", "0.4502005", "0.44908944", "0.44800985", "0.4478614", "0.4475459", "0.4475268", "0.44705245", "0.44642586", "0.44516894", "0.4447038", "0.443991", "0.44388184", "0.44351164", "0.44280815", "0.4424981", "0.442411", "0.44222704", "0.44220787", "0.44101337", "0.44072634", "0.44032043", "0.4396272", "0.43865624", "0.43834117", "0.43831074", "0.43717945", "0.43612036", "0.43607938", "0.436022", "0.43487048", "0.43456236", "0.43356544", "0.43349102", "0.43342185", "0.4330221", "0.4327552", "0.43261573", "0.4322814", "0.43206635", "0.43136647", "0.4311608", "0.43055743" ]
0.0
-1
Display a listing of the resource.
public function index() { return View::make('patients.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $genders = Gender::all()->lists("name","id"); $countries = Country::all()->lists("name","id"); return View::make('patients.create')->with("genders", $genders)->with("countries", $countries); }
{ "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 return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\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 {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create(){\n return view('form.create');\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 $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\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 create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\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\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "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}", "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 {\n return view('student::students.student.create');\n }" ]
[ "0.7593198", "0.7593198", "0.75881755", "0.75787884", "0.7570936", "0.74992913", "0.7436037", "0.7431172", "0.7386512", "0.7351077", "0.7337819", "0.73100585", "0.7295612", "0.72803086", "0.7272473", "0.72422874", "0.7229479", "0.7224403", "0.7184453", "0.7177193", "0.7173551", "0.71482", "0.71424824", "0.7141885", "0.7135663", "0.7126202", "0.7121413", "0.7113729", "0.7113729", "0.7113729", "0.7110717", "0.7092118", "0.7083616", "0.7080794", "0.7078082", "0.70561296", "0.70561296", "0.7054459", "0.703925", "0.70373696", "0.70346737", "0.70324355", "0.70287114", "0.7025425", "0.7025232", "0.7018496", "0.7016745", "0.7002774", "0.70019513", "0.69991785", "0.69942427", "0.69936013", "0.69929653", "0.6988009", "0.69856364", "0.6965122", "0.6964889", "0.6955187", "0.69511235", "0.69497", "0.6947041", "0.69432163", "0.6940678", "0.6939846", "0.6936846", "0.6936846", "0.6936506", "0.6933589", "0.69309", "0.69273484", "0.6925485", "0.6921386", "0.6917649", "0.6913987", "0.6910826", "0.6909406", "0.69085246", "0.6907409", "0.69021183", "0.6900961", "0.68997645", "0.68991655", "0.6894049", "0.68920606", "0.6892033", "0.6891114", "0.6890811", "0.6890811", "0.6887868", "0.6887327", "0.68854356", "0.688366", "0.68805534", "0.68766564", "0.68753666", "0.6872474", "0.68717086", "0.6869974", "0.6869806", "0.6868809", "0.68685615" ]
0.0
-1