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
Show the form for creating a new resource.
public function create() { return view('samples.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(...
[ "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.717428...
0.0
-1
Store a newly created resource in storage.
public function store(StoreSampleRequest $request) { $this->sampleService->storeData($request); return redirect()->route('samples.index') ->with('success','Sample created successfully.'); }
{ "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...
[ "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.63424...
0.0
-1
Display the specified resource.
public function show(Sample $sample) { $sample = $this->sampleService->get($sample); return view('samples.show', compact('sample')); }
{ "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...
[ "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.0
-1
Show the form for editing the specified resource.
public function edit(Sample $sample) { return view('samples.edit', compact('sample')); }
{ "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 ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(UpdateSampleRequest $request, Sample $sample) { $this->sampleService->updateData($request, $sample); return redirect()->route('samples.index') ->with('success','Sample updated successfully'); }
{ "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 ...
[ "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.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy(Sample $sample) { $this->sampleService->delete($sample); return redirect()->route('samples.index') ->with('success','Sample deleted successfully'); }
{ "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 ...
[ "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.5897...
0.0
-1
Get event info by URI.
function GetEventByURI($uri_path = '') { if ( ! $uri_path) { return false; } $data = $this->db ->join('status', 'status.id_status = event.id_status', 'left') ->join('event_detail', 'event_detail.id_event = event.id_event', 'left') ->join('localization', 'localization.id_localization = event_detail.id_localization', 'left') ->where('is_delete', 0) ->where('publish_date <=', $this->date_now) ->where("(expire_date >= '{$this->date_now}' OR expire_date IS NULL || expire_date = '0000-00-00')") ->where("LCASE({$this->db->dbprefix('event')}.uri_path)", strtolower($uri_path)) ->where("LCASE({$this->db->dbprefix('status')}.status_text)", "publish") ->where("LCASE({$this->db->dbprefix('localization')}.iso_1)", $this->lang->get_active_uri_lang()) ->order_by('event.id_event', 'desc') ->limit(1) ->get('event') ->row_array(); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEvent();", "private function getEventByUri($uri, $calendarId){\n\n\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t->addRawCondition('t.id', 'd.id');\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(DavEvent::model(),'d')\n\t\t\t->addCondition('calendar_id', $cal...
[ "0.6369309", "0.62550056", "0.61440885", "0.6005824", "0.58997524", "0.5811434", "0.5769192", "0.5727823", "0.5696106", "0.56900805", "0.566711", "0.5621523", "0.5589314", "0.555214", "0.5516269", "0.5495286", "0.548315", "0.548315", "0.548315", "0.5454822", "0.5448647", "0...
0.69409263
0
Get the default editing service.
public function get() { $editing_service = new DefaultPlaceEditingService( $this->commandBus, $this->uuidGenerator, $this->placeJsonLdRepository, $this->placeCommandFactory, $this->placeRepository ); if ($this->config->get('publication_date')) { $publicationDate = \DateTimeImmutable::createFromFormat( 'Y-m-d H:i:s', (string) $this->config->get('publication_date') . ' 00:00:00' ); $editing_service = $editing_service->withFixedPublicationDateForNewOffers($publicationDate); } return $editing_service; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getService ()\n {\n if (null === $this->_service) {\n $this->setService('Default_Service_Spirit');\n }\n return $this->_service;\n }", "protected function getRouting_ResourcesLocator_DefaultService()\n {\n return $this->services['routing.resources_l...
[ "0.6098191", "0.60196674", "0.5873266", "0.58377963", "0.5827025", "0.55958503", "0.5575934", "0.55286473", "0.55135185", "0.5478375", "0.54738855", "0.54738855", "0.5472626", "0.545844", "0.54470694", "0.5445974", "0.5443236", "0.54409003", "0.54353774", "0.5422558", "0.5409...
0.7202705
0
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.789145...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'equity_no' => 'required|integer', 'due_date' => 'required|string', 'monthly_equity' => 'required|numeric', 'penalty' => 'required|numeric', 'payment_status' => 'required|boolean', 'equity_id' => 'required|integer', 'equity_payment_id' => 'nullable|integer' ]; }
{ "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 sche...
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.76830...
0.0
-1
Run the database seeds.
public function run() { $settings = new \App\Settings(); $settings->title = 'Camo-Tec™ Интернет-магазин милитари одежды оригинального качества'; $settings->description = 'Camo-Tec™ Большой выбор милитари одежды | ① Низкие цены ② Высокое качество ③ Доставка: вся Украина - ☎ (063)135-15-40'; $settings->title_shop = 'Camo-Tec™'; $settings->owner = 'Camo-Tec™'; $settings->address = 'Наш офіс знаходиться за адресою: м. Одесса, вул. Базовая, 11, 65120'; $settings->geocode = '51.519,31.2706109'; $settings->email = 'info@camo-tec.com'; $settings->telephone = '+38(063) 135 15 40'; $settings->open = "<p class=\"adres icon-gps\">ул. Базовая, 11, 65120</p> <p class=\"phone icon-walkie-talkie\"><a href=\"tel:+380631351540\">+380 63 135 15 40</a>, <a href=\"tel:+380978882165\">+380 97 888 21 65</a></p> <p class=\"email icon-envelope\"><a href=\"mailto:info@camo-tec.com\">info@camo-tec.com</a></p>"; $settings->open_ua = "<p class=\"adres icon-gps\">ул. Базовая, 11, 65120</p> <p class=\"phone icon-walkie-talkie\"><a href=\"tel:+380631351540\">+380 63 135 15 40</a>, <a href=\"tel:+380978882165\">+380 97 888 21 65</a></p> <p class=\"email icon-envelope\"><a href=\"mailto:info@camo-tec.com\">info@camo-tec.com</a></p>"; $settings->open_en = "<p class=\"adres icon-gps\">ул. Базовая, 11, 65120</p> <p class=\"phone icon-walkie-talkie\"><a href=\"tel:+380631351540\">+380 63 135 15 40</a>, <a href=\"tel:+380978882165\">+380 97 888 21 65</a></p> <p class=\"email icon-envelope\"><a href=\"mailto:info@camo-tec.com\">info@camo-tec.com</a></p>"; $settings->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Get all templates in DB
public function get();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTemplatesFromDB();", "public function getAllTemplates(){ //return all templates in database to the select to choose from templates\n return TemplatesResource::collection(TemplateProject::all());\n }", "public function getTemplates(){\n\t\n\t\tif( empty($this->_templates) ){\n\t\n\t...
[ "0.8587745", "0.8293541", "0.7671164", "0.7665918", "0.753087", "0.73570216", "0.7201601", "0.71520114", "0.70985746", "0.70741546", "0.7063972", "0.7042091", "0.702012", "0.6945892", "0.6940633", "0.6890929", "0.68672633", "0.67723876", "0.67228", "0.67060196", "0.670375", ...
0.0
-1
Create new template in DB
public function create(array $data);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreateTemplate() {\n $searchService = $this->getProvider()->get('\\PM\\Search\\Service\\Template'); /* @var $searchService \\PM\\Search\\Service\\Template */\n\n $this->getExecutor()\n ->add(function(Database $database, Request $request) {\n $database->getTrans...
[ "0.7890813", "0.7311464", "0.70460373", "0.70460373", "0.6995139", "0.6991865", "0.69612586", "0.6884655", "0.6783113", "0.67503625", "0.6654896", "0.6636771", "0.6626456", "0.6605686", "0.65616757", "0.6547796", "0.65275747", "0.65047336", "0.6499517", "0.6474132", "0.645187...
0.0
-1
Set relations for templates
public function with($relations);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected\tfunction\tsetRelations() {}", "protected\tfunction\tsetRelations() {}", "public function setRelations() {}", "protected static function _relations() {\n\n\t}", "public function setFlexFormRelations() {}", "private function _set_relationships()\n {\n if(empty($this->_relationships))\n...
[ "0.7064877", "0.7064877", "0.6968517", "0.60422975", "0.5966083", "0.5935234", "0.5930831", "0.58936536", "0.58139664", "0.5715732", "0.5695804", "0.56883836", "0.56781334", "0.56683797", "0.56543374", "0.5558594", "0.55294317", "0.55130213", "0.55054", "0.546723", "0.5439897...
0.0
-1
Find a specific template
public function find($id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function locate( $template, $type, $templates )\n {\n // Set template path\n $this->path = $template;\n\n // Set template type\n $this->type = $type;\n\n // Get the current post ID\n $post_id = get_the_ID();\n\n // Get the current post type\n $post_type = get_post_type($post_id);\n\...
[ "0.72728074", "0.72377205", "0.6886425", "0.6819081", "0.6818397", "0.68077385", "0.6726459", "0.6682207", "0.6650232", "0.66247827", "0.65811116", "0.65474373", "0.65290385", "0.6516493", "0.65045923", "0.64993376", "0.6484759", "0.64760053", "0.644285", "0.64335823", "0.642...
0.0
-1
Get all templates from DB
public function getTemplatesFromDB();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllTemplates(){ //return all templates in database to the select to choose from templates\n return TemplatesResource::collection(TemplateProject::all());\n }", "public function getTemplates(){\n\t\n\t\tif( empty($this->_templates) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n...
[ "0.8262818", "0.7802904", "0.7788046", "0.7597968", "0.73624873", "0.7150043", "0.70923656", "0.7080438", "0.70491445", "0.7039374", "0.70229", "0.70114887", "0.7009191", "0.69464266", "0.6906768", "0.68943524", "0.6741189", "0.6728478", "0.67074895", "0.6686109", "0.66610825...
0.8624964
0
Set the current template
public function setTemplate(string $template_name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTemplate($template);", "function setTemplate($value) {\n $this->template = $value;\n }", "private function setTemplate(){\n if (isset($this->data['template']) && !empty($this->data['template'])){\n $template = APP_ROOT.'/app/templates/'.trim($this->data['template']).'.tpl'...
[ "0.7883507", "0.7669823", "0.7662215", "0.75787175", "0.75251883", "0.75251883", "0.7485281", "0.7469354", "0.7379844", "0.733009", "0.73219424", "0.72819096", "0.7260786", "0.72444814", "0.7234831", "0.72237295", "0.71667314", "0.71018815", "0.7084825", "0.7080313", "0.70738...
0.70421153
21
Get the current template name in use
public function getTemplate();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTemplateName() {\n\t\treturn $this->templateName;\n\t}", "function get_current_template_name() {\n\tglobal $wp_query;\n \n // Page\n\n if(is_page()) {\n return basename(get_page_template(), \".php\");\n }\n\n // Single post\n\n elseif (is_single()) {\n $post_id = $wp_query->get_queried_ob...
[ "0.83295673", "0.831259", "0.81922513", "0.8134848", "0.8124862", "0.7983114", "0.7759594", "0.77121305", "0.7693696", "0.76320994", "0.76021445", "0.7563171", "0.75602627", "0.74978226", "0.74807787", "0.74727434", "0.7463537", "0.7458871", "0.7453495", "0.73288584", "0.7315...
0.0
-1
Compile inky template to html and save it to storage
public function saveViewAsHtml($view, $data);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function compile()\n {\n\n $this->buildPage();\n\n if (defined('DEBUG_MARKUP') && DEBUG_MARKUP) {\n ob_start();\n $checkXml = new DOMDocument();\n\n if ($this instanceof LibTemplateAjax)\n $checkXml->loadXML($this->compiled);\n else\n $checkXml->loadHTML($this->compi...
[ "0.6645639", "0.6425443", "0.6419203", "0.634101", "0.6283008", "0.6145413", "0.612081", "0.61168337", "0.6092495", "0.6079933", "0.605958", "0.6041908", "0.6037524", "0.6027686", "0.60155994", "0.60021335", "0.5986662", "0.5959242", "0.5937195", "0.58969676", "0.5884751", ...
0.0
-1
Copy images to storage
public function copyImages();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function copyImages()\n {\n $media = [\n 'slider-woman-on-the-beach.jpg'\n ];\n\n $this->mediaMigration->copyMediaFiles($media, self::MIGRATION_MODULE, 'scandiweb/slider/s/l');\n }", "private function copyToStorage(Image $image) {\n \t$attrs = $image->attributesTo...
[ "0.74411803", "0.7068767", "0.6778374", "0.6717099", "0.6654278", "0.6540883", "0.63669074", "0.6115651", "0.59764445", "0.59682953", "0.58841497", "0.5808245", "0.58032787", "0.5763859", "0.5722151", "0.57065827", "0.56740564", "0.55958104", "0.55422777", "0.55406654", "0.55...
0.822315
0
Check if the template file exists
public function templateExists(string $template_name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function templateFileExists() {\r\n\t\treturn isset($this->strTemplateFile);\r\n\t}", "function tidyt_template_exists($template){\n if(!file_exists($template))\n return false;\n\n return true;\n}", "public function templateExists(): bool\n {\n return isset($this->templatePath);\n ...
[ "0.83062357", "0.8212553", "0.8185755", "0.81230104", "0.79498065", "0.78983283", "0.78868645", "0.7864358", "0.7802618", "0.7774709", "0.764139", "0.75449395", "0.75107086", "0.7459876", "0.74591666", "0.7390866", "0.73579377", "0.7337966", "0.73356795", "0.7304454", "0.7270...
0.77714336
10
Get base layouts from disk
public function getLayouts();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLayouts() {\n $path = APPPATH.'opencnab/layouts';\n $diretorio = dir($path);\n\n //Grava em um array todos eles para uso durante a aplicação.\n $cont = 0;\n while($arquivo = $diretorio -> read()){\n if($arquivo <> '.' && $arquivo <> '..'){\n ...
[ "0.73719394", "0.7041701", "0.6821285", "0.6519811", "0.64342403", "0.62710553", "0.6141716", "0.6125933", "0.6093813", "0.6000271", "0.5949763", "0.5933483", "0.58708304", "0.58612305", "0.58532274", "0.58215857", "0.58154225", "0.57714736", "0.57636", "0.5717954", "0.571380...
0.6428824
5
Get the validation rules for storing a new template
public function getValidationRulesStore(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeRules()\n {\n return [\n 'name' => 'required',\n 'photo' => 'required',\n 'is_public' => 'required|boolean',\n 'coordinates' => ['required', new Coordinate()],\n ];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t...
[ "0.69360214", "0.6770968", "0.66850615", "0.6679349", "0.6650378", "0.6612521", "0.65746075", "0.6534229", "0.64624435", "0.6462079", "0.644864", "0.64410067", "0.64383787", "0.6412144", "0.64084834", "0.64062905", "0.6388644", "0.6372055", "0.63683176", "0.6362413", "0.63444...
0.647067
8
Get validation rules for updating a template
public function getValidationRulesUpdate(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpdateRules()\n {\n return [\n \"id\" => \"required\"\n ];\n }", "public function getRulesForUpdate()\r\n\t{\r\n\t \treturn $this->rules_for_update ? $this->rules_for_update : array();\r\n\t}", "abstract protected function getValidationRules();", "public func...
[ "0.73560274", "0.7029944", "0.6998964", "0.69760776", "0.695345", "0.67695546", "0.67648745", "0.6729979", "0.6683829", "0.66539997", "0.6649985", "0.66413826", "0.66347283", "0.6589461", "0.6586514", "0.65696627", "0.65399384", "0.6539754", "0.65358686", "0.65288645", "0.652...
0.73301095
1
End Action controllers for generating enlistment report Start Action controllers for generating attendance report generate_voc_program_attendance_report function. commit 10/11/2018
public function generate_voc_program_attendance_report(){ $this->crud->credibilityAuth(array('Administrator','Registrar')); // get inputs $condition= array('vocational_program'=>$this->input->post('vocational_program'),'batch_year'=> $this->input->post('batch_year_id')); $range1 = $this->input->post('date_range1'); $range2 = $this->input->post('date_range2'); // get necessary report data $voc_program= $this->vocational_program_model->getVocationalPrograms('s',array('voc_program_id'=>$condition['vocational_program'])); $students = $this->admin_model->getStudentsBasicInfo($condition,'a'); $attendance = $this->admin_model->getStudentAttendanceByVocationalProgram($students,$range1,$range2,$condition['batch_year']); $att_record = $this->admin_model->getStudentDailyAttendanceRecord($students,$range1,$range2,$condition['batch_year']); $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date'); // generate report data in pdf or csv format from admin_report_model if((!empty($condition['vocational_program']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){ if(!empty($attendance)){ if($this->input->post('export_csv')){ $this->admin_report_model->generateStudentAttendanceByVocationalProgramCsv($attendance,$att_record,$att_dates,$voc_program,$range1,$range2); exit; }else if($this->input->post('export_pdf')){ $this->admin_report_model->generateVocProgramAttendanceReportPdf($attendance,$voc_program,$range1,$range2); } } $this->session->set_flashdata('warning', 'No reports found!.'); redirect('attendance_report'); } $this->session->set_flashdata('danger', 'Invalid input.'); redirect('attendance_report'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate_subject_code_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = ...
[ "0.76985073", "0.7221716", "0.6984586", "0.6580522", "0.650633", "0.6465776", "0.63977027", "0.63785875", "0.6225617", "0.6208223", "0.61751956", "0.614161", "0.6124895", "0.61182946", "0.6103934", "0.61004525", "0.6095921", "0.6072185", "0.60597414", "0.603011", "0.5998244",...
0.8395774
0
generate_subject_code_attendance_report function. commit 10/11/2018
public function generate_subject_code_attendance_report(){ $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty')); // get inputs $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id')); $range1 = $this->input->post('date_range1'); $range2 = $this->input->post('date_range2'); // get necessary report data $students = $this->admin_model->getStudentsBasicInfo($con,'a'); $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']); $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']); $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date'); // generate report data in pdf or csv format from admin_report_model if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){ if(!empty($attendance) && !empty($att_record)){ if($this->input->post('export_csv')){ $this->admin_report_model->generateStudentAttendanceBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2); exit; }else if($this->input->post('export_pdf')){ $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2); } } $this->session->set_flashdata('warning', 'No reports found!.'); }else{ $this->session->set_flashdata('danger', 'Invalid input.'); } redirect('attendance_report'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate_subject_code_remarks_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $th...
[ "0.77966917", "0.6952219", "0.6225241", "0.59348047", "0.5846901", "0.58378285", "0.5793984", "0.5739033", "0.57314277", "0.5726573", "0.57134396", "0.57125956", "0.57031906", "0.56990755", "0.5669414", "0.563711", "0.5636193", "0.56284374", "0.56207716", "0.55699575", "0.556...
0.79717195
0
End Action controllers for generating attendance report Start Action controllers for generating remarks report generate_subject_code_remarks_report function. commit 10/12/2018
public function generate_subject_code_remarks_report(){ $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty')); // get inputs $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id')); $range1 = $this->input->post('date_range1'); $range2 = $this->input->post('date_range2'); // get necessary report data $students = $this->admin_model->getStudentsBasicInfo($con,'a'); $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']); $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']); $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date'); // generate report data in pdf or csv format from admin_report_model if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){ if(!empty($attendance) && !empty($att_record)){ if($this->input->post('export_csv')){ $this->admin_report_model->generateStudentRemarksReportBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2); exit; }else if($this->input->post('export_pdf')){ $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2); } } $this->session->set_flashdata('warning', 'No reports found!.'); }else{ $this->session->set_flashdata('danger', 'Invalid input.'); } redirect('attendance_report'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate_subject_code_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = ...
[ "0.78921235", "0.6877639", "0.63729405", "0.63677514", "0.6346944", "0.6255291", "0.60872173", "0.6075249", "0.5999765", "0.59749573", "0.5970591", "0.5963558", "0.5930038", "0.59207654", "0.5920088", "0.5911183", "0.58961457", "0.58660185", "0.58473986", "0.5843417", "0.5839...
0.84146255
0
Display a listing of the resource.
public function index(Request $request) { return SearchProductCollection::collection( Product::where('name', 'LIKE','%'.$request->s.'%')->select('id', 'name')->get()); }
{ "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->re...
[ "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.683052...
0.0
-1
/ Update custom layout
public function changeLayoutEvent($observer){ $setting = Mage::helper("multidealpro"); $enable = $setting->getRecentDeal_EnableRecent(); $reference = $setting->getRecentDeal_BlockReference(); if($enable == 1){ if($reference != 'none'){ $type = $setting->getSidebar_BlockData_RecentDeal_Type(); $name = $setting->getSidebar_BlockData_RecentDeal_Name(); $template = $setting->getSidebar_BlockData_RecentDeal_Template(); $position = $setting->getRecentDeal_Position(); if(!preg_match("/^(before|after)\=\"[a-zA-Z0-9_.-]+\"/",$position)) $position = ""; if($reference == 'all'){ $xml = '<reference name="left">'; $xml .= '<block type="'.$type.'" '.$position.' name="'.$name.'" template="'.$template.'"/>'; $xml .= '</reference>'; $xml .= '<reference name="right">'; $xml .= '<block type="'.$type.'" '.$position.' name="'.$name.'" template="'.$template.'"/>'; $xml .= '</reference>'; }else{ $xml = '<reference name="'.$reference.'">'; $xml .= '<block type="'.$type.'" '.$position.' name="'.$name.'" template="'.$template.'"/>'; $xml .= '</reference>'; } $update = $observer->getEvent()->getLayout()->getUpdate(); $update->addUpdate($xml); } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initLayout();", "function afterLayout() { \t\t\n }", "public function renderLayout();", "public function update() {\n $this->view = $this->template->getView();\n $this->layout = $this->template->getLayout();\n }", "function initLayout(){\n $layout = array(\n ...
[ "0.74593246", "0.72889507", "0.7194638", "0.6947515", "0.6791371", "0.67908514", "0.6723251", "0.67140836", "0.67024606", "0.6693607", "0.6680688", "0.6670205", "0.66371924", "0.6630761", "0.66276765", "0.6590011", "0.6569911", "0.65672845", "0.65667856", "0.65654045", "0.656...
0.0
-1
Event Type Up Coming , Past , Draft
public static function getUserEventList($event_type,$id) { // Page My Event is Own Event $limit = 100; $page = 1; if($page=="") $page = 1; $date_now = date("Y-m-d"); $result = CommonFunction::resultPaging( $page, $limit, EventModel::where('userId', '=', $id)->count(), EventModel::where("status","=",$event_type)-> where("endDate",">=",$date_now)->where('userId', '=', $id)->take($limit)->skip(($page-1)*$limit)->get(array('id', 'name','description', 'avenueName','avanueAddress','latitude','longitude','coverImage','facebook','twitter','line','website','host','categoryId','status','private','share','userId','startDate','endDate','time','startTime','endTime')) ); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEventType(): string;", "function get_type_events()\n{\n return 'atu_events';\n}", "public function get_event_posttype(){\r\n\t\treturn $this->event_posttype;\r\n\t}", "function Submissions_Latex_Event()\n {\n $event=$this->Event();\n $event=$this->EventsObj()->ApplyAllE...
[ "0.6361297", "0.62281877", "0.60921997", "0.60668045", "0.5946989", "0.59179974", "0.5813758", "0.57842225", "0.57714874", "0.57533926", "0.57045645", "0.56834346", "0.56805813", "0.56698024", "0.5590879", "0.55824906", "0.55646247", "0.5562858", "0.55625516", "0.55597866", "...
0.0
-1
cancel action: take user to main screen
public function handleCancel() { // logit('HC: ' . print_r($this->data, true)); if ($this->data['submit_button'] == 'Cancel') { $this->data = array(); $this->error = array(); $this->_redirector->gotoUrl($this->mainpage); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancel() {\r\n\t\t$this->setRedirect ( 'index.php' );\r\n\t}", "function cancel() {\n\n\t\tif (KRequest::getVar('return')) {\n\t\t\t$url = KLink::base64UrlDecode(KRequest::getVar('return'));\n\t\t}\n\t\telse {\n\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t...
[ "0.8050979", "0.7746314", "0.770287", "0.755568", "0.7483072", "0.7398462", "0.7364269", "0.7322016", "0.7322016", "0.72616875", "0.72446644", "0.7201807", "0.71693695", "0.7162362", "0.71113497", "0.71113497", "0.70994234", "0.70049405", "0.69981426", "0.69097847", "0.687259...
0.68037504
25
Get the translations for common words
public function getTwords() { $this->tlist = getTranslatables($this->langtag); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function getTranslations();", "public function get_common_words()\n\t{\n\t\treturn array();\n\t}", "private function extractGettextStrings()\n {\n $translation = null;\n $translationObjects = array();\n $lookupDirectories = array(\n Strata::getVendorPath() ...
[ "0.7154993", "0.68198085", "0.67766815", "0.6621984", "0.6592838", "0.64911014", "0.64806175", "0.63997537", "0.6385001", "0.63393795", "0.6260629", "0.6241757", "0.6231555", "0.62023544", "0.62007684", "0.61967325", "0.6166923", "0.61475354", "0.6129332", "0.6129332", "0.611...
0.6330874
10
/ start the session
public function setupSession() { global $userid, $langtag; $this->echecklistNamespace = new Zend_Session_Namespace('eChecklist'); // logit("test: {$this->echecklistNamespace->lab['labnum']}"); if (isset($this->echecklistNamespace->user)) { $u = $this->echecklistNamespace->user; $user = $u; $this->usertype = $u['usertype']; $this->username = $u['userid']; $this->userfullname = $u['name']; $userid = $this->userid = $u['id']; // logit("{$this->username}, {$this->usertype}, {$this->userfullname}, {$this->userid}"); } // logit('TIME1: ' . isset($this->echecklistNamespace->lab)); if (isset($this->echecklistNamespace->lab)) { $this->lab = $this->echecklistNamespace->lab; // logit('ECLAB: ' . print_r($this->lab, true)); $this->labid = $this->lab['id']; $this->labname = $this->lab['labname']; $this->labnum = get_arrval($this->lab, 'labnum', 'No-NUM'); $this->showlab = "{$this->labnum}/{$this->labname}"; } else { $this->lab = null; $this->labid = 0; $this->labname = ''; $this->labnum = ''; $this->showlab = ''; } if (! isset($this->echecklistNamespace->lang)) { $this->echecklistNamespace->lang = 'EN'; } // clear selected audit if labid is not for this audit if (isset($this->echecklistNamespace->audit) || $this->echecklistNamespace->audit != null) { $au = new Application_Model_DbTable_Audit(); $this->audit = $au->getAudit($this->echecklistNamespace->audit['audit_id']); if ($this->labid != $this->audit['lab_id']) $this->echecklistNamespace->audit = null; } if (isset($this->echecklistNamespace->audit) || $this->echecklistNamespace->audit != null) { // logit('AUEC: '. print_r($this->echecklistNamespace->audit, true)); $au = new Application_Model_DbTable_Audit(); $this->audit = $this->echecklistNamespace->audit = $au->getAudit($this->echecklistNamespace->audit['audit_id']); $this->showaudit = "{$this->audit['tag']} - #{$this->audit['audit_id']}" . "- {$this->audit['labname']}"; // logit('ec audit: ' . print_r($this->audit, true)); // / {$this->audit['updated_at']}"; } else { $this->audit = null; $this->showaudit = ''; } $langtag = $this->view->langtag = $this->langtag = $this->echecklistNamespace->lang; // $this->langtag = $this->echecklistNamespace->lang; // logit('LT: '. $this->view->langtag); Zend_Session::start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function startSession() {}", "public static function startSession();", "public static function start()\r\n {\r\n if (!self::isStarted())\r\n session_start();\r\n }", "public final function start() \n\t{\n\t\tif (isset($_SESSION)) return;\n\t\tsession_start();\n\t}", "public f...
[ "0.90282655", "0.9003395", "0.845623", "0.8131663", "0.80436057", "0.79954684", "0.79706097", "0.7965818", "0.7944286", "0.7915886", "0.79023486", "0.7859829", "0.78356284", "0.7815267", "0.7812748", "0.7790747", "0.7772361", "0.7770696", "0.77402574", "0.7736278", "0.7678797...
0.0
-1
/ all CSS and js files are set up here
public function setHeaderFiles() { $csslist = array('/css/dtree.css', // charisma starts below '/charisma/css/bootstrap-cerulean.css','/charisma/css/bootstrap-responsive.css', '/charisma/css/charisma-app.css','/charisma/css/jquery-ui-1.8.21.custom.css', '/charisma/css/fullcalendar.css','/charisma/css/chosen.css', '/charisma/css/uniform.default.css','/charisma/css/jquery.noty.css', '/charisma/css/noty_theme_default.css','/charisma/css/elfinder.min.css', '/charisma/css/elfinder.theme.css','/charisma/css/opa-icons.css', '/css/echecklist-styles.css'); foreach($csslist as $f) { $this->view->headLink()->appendStylesheet("{$this->baseurl}{$f}"); } $jslist = array('/js/dtree.js','/charisma/js/jquery-1.7.2.min.js', '/charisma/js/jquery-ui-1.8.21.custom.min.js','/charisma/js/bootstrap-transition.js', '/charisma/js/bootstrap-alert.js','/charisma/js/bootstrap-modal.js', '/charisma/js/bootstrap-dropdown.js','/charisma/js/bootstrap-scrollspy.js', '/charisma/js/bootstrap-tab.js','/charisma/js/bootstrap-tooltip.js', '/charisma/js/bootstrap-popover.js','/charisma/js/bootstrap-button.js', '/charisma/js/bootstrap-collapse.js','/charisma/js/bootstrap-carousel.js', '/charisma/js/bootstrap-typeahead.js','/charisma/js/jquery.cookie.js', '/charisma/js/fullcalendar.min.js','/charisma/js/jquery.dataTables.min.js', '/charisma/js/jquery.chosen.min.js','/charisma/js/jquery.uniform.min.js', '/charisma/js/jquery.colorbox.min.js','/charisma/js/jquery.noty.js', '/charisma/js/jquery.elfinder.min.js','/charisma/js/jquery.raty.min.js', '/charisma/js/jquery.autogrow-textarea.js','/charisma/js/jquery.history.js', '/charisma/js/charisma.js','/js/helpers.js'); // '/js/helpers.js' foreach($jslist as $f) { $this->view->headScript()->appendFile("{$this->baseurl}{$f}"); } /* * logit ( "Links: {$this->view->headLink()}" ); logit ( "Scripts: {$this->view->headScript()}" ); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function frontEndStyleScripts(): void\n {\n wp_enqueue_style('users-data-bootstrap', plugin_dir_url(dirname(__FILE__)) . 'assets/css/bootstrap.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-fontawsome', plugin_dir_url(dirname(__FILE__)) . 'assets/css/font-awesome....
[ "0.74689645", "0.7461765", "0.7363478", "0.7338017", "0.7332753", "0.73314744", "0.7321029", "0.7306904", "0.7306904", "0.7260686", "0.7245947", "0.7168618", "0.7163276", "0.71445405", "0.7133125", "0.7123209", "0.7121005", "0.71161366", "0.71074015", "0.7105983", "0.7091901"...
0.0
-1
/ The input is an array of arrays array(top, array(array(icon, item),))+ The top level creates buttons the rest create the menu items
public function makeMenu($menu) { $out = array(); $out[] = "<div class=\"btn-group pull-left\">"; foreach($menu as $mx) { $i = 0; foreach($mx as $m) { $i ++; switch ($i) { case 1 : $icon = $m['icon']; $out[] = "<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"{$m['url']}\">"; $out[] = $this->makeIcon($icon[0], $icon[1]); $out[] = "<span class=\"hidden-phone\">{$m['text']}</span><span class=\"caret\"></span></a>"; $out[] = "<ul class=\"dropdown-menu\">"; break; default : foreach($m as $mi) { if (in_array('divider', $mi)) { $out[] = '<li class="divider"></li>'; continue; } $icon = $mi['icon']; $out[] = "<li><a href=\"{$this->baseurl}{$mi['url']}\">" . $this->makeIcon($icon[0], $icon[1]) . " {$mi['text']}</a></li>"; } } $out[] = "</ul></div>"; } } return implode("\n", $out); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildMenuArray() {}", "public function run()\n {\n $menus=[\n [\"parent_menu\" => 0,\"nombre\" => \"Catalogo\",\"url\" => \"javascript:;\",\"orden\" => 1,\"icono\" => \"fas fa-clipboard-list\"],\n [\"parent_menu\" => 0,\"nombre\" => \"Ventas\",\"url\" => \"javas...
[ "0.70731425", "0.6663052", "0.63483536", "0.62827134", "0.62827134", "0.62827134", "0.62827134", "0.62827134", "0.62827134", "0.62025917", "0.6186268", "0.61815566", "0.6144312", "0.61430544", "0.6093278", "0.609304", "0.60840833", "0.60700303", "0.6066067", "0.60537887", "0....
0.0
-1
/ Create the top line
public function setHeader() { $dt = date('j M, Y'); $name_header = ''; $ao = new Application_Model_DbTable_AuditOwner(); if ($this->usertype != '') { $name_header = "&nbsp {$this->userfullname}"; } $complete_user = array('ADMIN','USER','APPROVER'); $complete_audit = ''; $audit_id = $this->audit['audit_id']; logit("audit: " . print_r($this->audit, true)); $complete_audit .= <<<"END" <li class="divider"></li> <li class="tri"><span style="color:black;padding-left: 15px;"> With Selected Audit:</span></li> END; # incomplete and owned audit OR not incomplete audit can be viewed if (($this->audit['status'] == 'INCOMPLETE' && $this->audit['owner']) || $this->audit['status'] != 'INCOMPLETE') { $complete_audit .= <<<"END" <!li class="divider"></li--> <li><a href="{$this->baseurl}/audit/view"><span title=".icon .icon-color .icon-book " class="icon icon-color icon-book"></span> View Audit</a></li> END; } # only incomplete and owned audit can be edited if ($this->audit['status'] == 'INCOMPLETE' && $this->audit['owner']) { $complete_audit .= <<<"END" <!--li class="divider"></li--> <li><a href="{$this->baseurl}/audit/edit/"><span title=".icon .icon-color .icon-edit " class="icon icon-color icon-edit"></span> Edit Audit</a></li> END; } if (in_array($this->usertype, $complete_user)) { $complete_audit .= <<<"END" <!--li class="divider"></li--> <li><a href="{$this->baseurl}/audit/exportdata"><span title=".icon .icon-color .icon-extlink " class="icon icon-color icon-extlink"></span> Export Audit Data</a></li> END; if ($this->audit['owner']) { # $ao->isOwned($audit_id, $this->userid)) { $complete_audit .= <<<"END" <li><a href="{$this->baseurl}/audit/delete" onclick=" return confirm('Do you want to delete Selected Audit?');"> <span title=".icon .icon-color .icon-trash " class="icon icon-color icon-trash"></span> Delete Audit</a></li> END; } $complete_audit .= <<<"END" <li class="divider"></li> <li class="tri"><span style="color:black;padding-left: 15px;"> Change Audit State:</span></li> END; if ($this->audit['status'] == 'INCOMPLETE' && $ao->isOwned($audit_id, $this->userid)) { $complete_audit .= <<<"END" <li><a href="{$this->baseurl}/audit/complete"> <span title=".icon .icon-color .icon-locked " class="icon icon-color icon-locked"></span> Mark Audit Complete</a></li> END; } if ($this->audit['status'] == 'COMPLETE' && $ao->isOwned($audit_id, $this->userid)) { $complete_audit .= <<<"END" <li><a href="{$this->baseurl}/audit/incomplete"> <span title=".icon .icon-color .icon-unlocked " class="icon icon-color icon-unlocked"></span> Mark Audit Incomplete</a></li> END; } if ($this->audit['status'] == 'COMPLETE' && $this->usertype == 'APPROVER') { $complete_audit .= <<<"END" <li><a href="{$this->baseurl}/audit/finalize" onclick=" return confirm('Do you want to finalize Audit (#{$this->audit['audit_id']}-{$this->audit['tag']})?');"><span title=".icon .icon-color .icon-sent " class="icon icon-color icon-sent"></span> Mark Audit Finalized</a></li> <li><a href="{$this->baseurl}/audit/reject" onclick=" return confirm('Do you want to reject Audit (#{$this->audit['audit_id']}-{$this->audit['tag']})?');"><span title=".icon .icon-color .icon-cross " class="icon icon-color icon-cross"></span> Mark Audit Rejected</a></li> END; } } $this->header = <<<"END" <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> <a class="brand" href="{$this->baseurl}{$this->mainpage}"> <span title=".icon .icon-black .icon-check " class="icon icon-black icon-check"></span> <span>eChecklist</span> </a> END; $newuser = ''; if ($this->usertype != '') { if ($this->usertype == 'ADMIN') { $newuser = <<<"END" <li><a href="{$this->baseurl}/user/create"> <span title=".icon .icon-green .icon-user " class="icon icon-green icon-user"></span> New User</a></li> END; } $this->header = $this->header . <<<"END" <div class="btn-group pull-left" style="margin-left:100px;"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <span title=".icon .icon-blue .icon-clipboard " class="icon icon-blue icon-clipboard"></span> <span class="hidden-phone">Audit</span> <span class="caret"></span></a> <ul class="dropdown-menu"> END; if (in_array($this->usertype, $complete_user)) { $this->header .= <<<"END" <li><a href="{$this->baseurl}/audit/create"><span title=".icon .icon-green .icon-clipboard " class="icon icon-green icon-clipboard"></span> New Audit</a></li> END; } $this->header .= <<<"END" <li><a href="{$this->baseurl}/audit/search"><span title=".icon .icon-blue .icon-search " class="icon icon-blue icon-search"></span> Search for Audit</a></li> {$complete_audit} <li class="divider"></li> <li><a href="{$this->baseurl}/audit/runreports"><span title=".icon .icon-color .icon-newwin " class="icon icon-color icon-newwin"></span> Run Reports</a></li> END; if (in_array($this->usertype, $complete_user)) { $this->header .= <<<"END" <li class="divider"></li> <li><a href="{$this->baseurl}/audit/import"><span title=".icon .icon-blue .icon-import " class="icon icon-blue icon-archive"></span> Import Audit</a></li> END; } $this->header .= <<<"END" </ul> </div> <div class="btn-group pull-left"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <span title=".icon .icon-blue .icon-tag " class="icon icon-blue icon-tag"></span> <span class="hidden-phone">Lab</span> <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="{$this->baseurl}/lab/create"><span title=".icon .icon-green .icon-tag " class="icon icon-green icon-tag"></span> New Lab</a></li> <li><a href="{$this->baseurl}/lab/select"><span title=".icon .icon-blue .icon-search " class="icon icon-blue icon-search"></span> Select a Lab</a></li> <li class="divider"></li> <li><a href="{$this->baseurl}/lab/edit"><span title=".icon .icon-blue .icon-search " class="icon icon-blue icon-search"></span> Edit Selected Lab</a></li> </ul> </div> <div class="btn-group pull-left"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <span title=".icon .icon-blue .icon-user " class="icon icon-blue icon-user"></span> <span class="hidden-phone">User</span> <span class="caret"></span></a> <ul class="dropdown-menu"> {$newuser} <li><a href="{$this->baseurl}/user/find"><span title=".icon .icon-blue .icon-search " class="icon icon-blue icon-search"></span>Find User</a></li> </ul> </div> <!--div class="btn-group pull-left"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <span title=".icon .icon-blue .icon-flag " class="icon icon-blue icon-flag"></span> <span class="hidden-phone">Language</span> <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="{$this->baseurl}/language/switch/EN"><span title=".icon .icon-green .icon-flag " class="icon icon-green icon-flag"></span> English</a></li> <li><a href="{$this->baseurl}/language/switch/FR"><span title=".icon .icon-green .icon-flag " class="icon icon-green icon-flag"></span> French</a></li> <li><a href="{$this->baseurl}/language/switch/VI"><span title=".icon .icon-green .icon-flag " class="icon icon-green icon-flag"></span> Vietnamese</a></li> </ul> </div--> <!-- user dropdown starts --> <div class="btn-group pull-right"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <span title=".icon .icon-orange .icon-user " class="icon icon-orange icon-user"></span> <span class="hidden-phone"> {$name_header}</span> <span class="caret"></span> </a> <ul class="dropdown-menu"> <li><a href="{$this->baseurl}/user/profile"><span title=".icon .icon-blue .icon-contacts " class="icon icon-blue icon-contacts"></span> Profile</a></li> <li><a href="{$this->baseurl}/user/changepw"><span title=".icon .icon-blue .icon-contacts " class="icon icon-blue icon-contacts"></span> Change Password</a></li> <li class="divider"></li> <li><a href="{$this->baseurl}/user/logout">Logout</a></li> </ul> </div> <!-- user dropdown ends --> END; $auditinfo = ''; //if ($this->dialog_name == 'audit/edit') { $auditinfo = "<div style=\"margin:6px 0 6px 20px;padding-right:5px;\">Selected Audit: {$this->showaudit}</div>"; //} $this->header .= <<<"END" <div style="display:inline-block;"> <div style="margin:6px 0px 6px 20px;padding-right:5px;">Selected Lab: {$this->showlab}</div> {$auditinfo} <div style="clear:both;"></div></div> END; } else { $this->header = $this->header . <<<"END" <div class="btn-group pull-left" style="margin-left:100px;"> <a class="btn" href="{$this->baseurl}/user/login"><span title=".icon .icon-blue .icon-contacts " class="icon icon-blue icon-contacts"></span> Login</a></div> END; } $this->header = $this->header . <<<"END" </div> </div> <!-- style="clear:both;"></div --> </div> END; $this->view->header = $this->header; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function writeTop()\n {\n }", "public function writeTop() {}", "function mainTop(){\n\t\techo \"<table align='center' cellpadding='0' cellspacing='0' width='\".$this->width.\"'>\\n<tr>\\n<td width='\".$this->width.\"' class='main-bg'>\\n\";\n\t}", "private function createOrd()\n {\n $p...
[ "0.6666886", "0.6521405", "0.64529616", "0.6407904", "0.62402135", "0.6112981", "0.60777473", "0.6031556", "0.602862", "0.60093904", "0.5955672", "0.5924286", "0.59222615", "0.5911457", "0.58768445", "0.5871204", "0.5857616", "0.58297503", "0.5819533", "0.5818537", "0.5788684...
0.0
-1
Given the dialog rows, create the dialog using field templates to create individual rows
function calculate_dialog($drows, $value, $title, $langtag, $formtype = 'table') { require_once 'modules/Checklist/fillout.php'; $tlist = getTranslatables($langtag); $tout = array(); $this->importall = "{$this->baseurl}/audit/importall"; $this->import2lab = "{$this->baseurl}/audit/import2lab"; $this->cancelimport = "{$this->baseurl}/audit/cancelimport"; $title = $drows[0]['title']; $tout[] = <<<"END" <div style="margin-left:200px;"><h1 style="margin-bottom:10px;">{$title} <button id="helpbutton" onclick="return toggleHelp();">Help</button> </h1> </div> <div style="margin:15px 0;"> END; $tout[] = '<table border=0 style="width:900px;">'; $hid = array(); foreach($drows as $row) { $pos = $row['position']; // if ($pos ==0) continue; $type = $row['field_type']; $arow = array(); $field_label = get_lang_text($row['field_label'], '', ''); // , $row ['ltdefault'], $row ['ltlang'] ); $arow['field_label'] = $field_label . ':'; $arow['varname'] = $row['field_name']; $varname = $arow['varname']; $arow['baseurl'] = $this->baseurl; $arow['field_length'] = 0; //$row['field_length']; $info = $row['info']; switch ($type) { case '' : logit("ROW: " . print_r($row, true)); break; case 'hidden' : $val = get_arrval($value, $varname, ''); $hid[] = "<input type=\"hidden\" name=\"{$varname}\" value=\"{$val}\">"; break; case 'file' : $tout[] = <<<"END" <tr> <td class="n f right" style="width:200px;"> <td class="n f" style="width:600px;"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000" /> {$field_label}: <input name="uploadedfile" type="file" /> </td> </tr> END; break; case 'text' : $info = str_replace('"', '\"', $info); // logit("TEXT: {$info}"); $audit = $this->audit; eval("\$lines = \"$info\"; "); $tout[] = <<<"END" <tr> <td class="n f right" style="width:200px;"> <td class="n f" style="width:600px;"><div id="help2" style="font-size:1.4em;line-height:1.3em;">{$lines}</div></td> </tr> END; break; case 'info' : $tout[] = <<<"END" <tr> <td class="n f right" style="width:200px;"> <td class="n f" style="width:600px;"><div id="help" style="display:none;">{$info}</div></td> </tr> END; break; case 'info2' : $tout[] = <<<"END" <tr> <td class="n f right" style="width:200px;"> <td class="n f" style="width:600px;"><div id="help2" style="">{$info}</div></td> </tr> END; break; case 'heading' : $tout[] = <<<"END" <tr> <td class="n f right" style="width:50px;"> <td class="n f" style="width:750px;"><h3>{$field_label}</h3></td> </tr> END; break; case 'submit_button' : $arow['field_label'] = $field_label; //$arow['baseurl'] = $baseurl; $arow['homeurl'] = "{$this->baseurl}/audit/main"; // logit("HURL: {$arow['homeurl']}"); $field_label = ''; default : $inp = call_user_func("dialog_{$type}", $arow, $value, $tlist); $tout[] = <<<"END" <tr> <td class="n f right" style="width:300px;"> <label for="{$varname}" style="" class="inp">{$field_label}</label> </td><td class="n f" style="width:500px;">{$inp}</td> </tr> END; } } $tout[] = '</table></div></div>'; $tout[] = implode("\n", $hid); // logit('dialog: '. print_r($tout, true)); return implode("\n", $tout); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_form_row(){\n\t\t$index = $this->col_index;\n\t\t# remove the * at the start of the first line\n\t\t$this->col_data = preg_replace(\"/^\\*/\",\"\",$this->col_data);\n\t\t# split the lines and remove the * from each. The value in each line goes into the array $values\n\t\t$values = preg_split(\"/\\n\\...
[ "0.6556198", "0.59870917", "0.5853361", "0.58523697", "0.58466697", "0.57442164", "0.56297654", "0.56246775", "0.56168485", "0.55968034", "0.5580604", "0.5580604", "0.55728126", "0.55656314", "0.55607", "0.5549679", "0.5540511", "0.55240744", "0.55177873", "0.55157965", "0.54...
0.5987105
1
/ Get the Dialog data
public function getDialogLines() { $dialog = new Application_Model_DbTable_Dialog(); $this->drows = $dialog->getDialogRows($this->dialog_name); // logit('DROWS: ' . print_r($this->drows, true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getDialogHelper() {}", "public function getDialogList()\r\n {\r\n return $this->exec('dialog_list');\r\n }", "protected function createDialog() {\n $dialog = parent::createDialog();\n $dialog->fields = $this->builder()->getFields();\n return $dialog;\n }", "public fu...
[ "0.6525185", "0.6356299", "0.6072315", "0.5912436", "0.575329", "0.56440127", "0.562397", "0.5606318", "0.55821", "0.5576171", "0.5540002", "0.55317986", "0.55278236", "0.55097884", "0.55063707", "0.5504301", "0.5499986", "0.54999334", "0.5489991", "0.54784936", "0.5474387", ...
0.5741023
5
/ Create the dialog
public function makeDialog($value = array(''=>''), $morelines = '') { $this->getDialogLines(); // logit('makeDialog:'); $this->view->outlines = $this->calculate_dialog($this->drows, $value, $this->title, $this->view->langtag); if (is_array($this->error)) { logit('Error: ' . print_r($this->error, true)); $this->view->errorLines = implode("\n", $this->error); } else { $this->view->errorLines = ''; } $this->view->title = $this->title; if (isset($this->echecklistNamespace->flash)) { $this->view->flash = $this->echecklistNamespace->flash; // logit("FLASH: {$this->view->flash}"); $this->echecklistNamespace->flash = ''; // logit("there?: {$this->view->flash}"); } $this->view->outlines .= $morelines; $this->_helper->layout->setLayout('overall'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createDialog() {\n $dialog = parent::createDialog();\n $dialog->fields = $this->builder()->getFields();\n return $dialog;\n }", "function nc__dlg__create($src, $attrs){\n\n\t\t//output function name\n\t\tnc__util__func('class', 'nc__dlg__create');\n\n\t\t//start dialog\n\t\t$tmpDlgId...
[ "0.7593732", "0.7170996", "0.7111243", "0.66981536", "0.6662371", "0.6662371", "0.6662371", "0.6662371", "0.66160315", "0.6599571", "0.6599571", "0.6560312", "0.63280344", "0.6232092", "0.61839443", "0.61776173", "0.61298287", "0.60995287", "0.60743606", "0.6058387", "0.60475...
0.5936938
27
/ Collect all the post data
public function collectData() { $dialog = new Application_Model_DbTable_Dialog(); $this->getDialogLines(); $ignore_list = array('','' /*, 'submit_button'*/ ); $this->error = array(); $this->error[] = "<table><tr><th colspan='2'>Fix the following errors and retry</td></tr>"; $errorct = 0; $this->data = array(); $formData = $this->getRequest(); foreach($this->drows as $row) { if ($row['position'] == 0) continue; $type = $row['field_type']; $varname = $row['field_name']; $field_label = $row['field_label']; $validate = $row['validate']; if (in_array($type, $ignore_list)) { continue; } // logit('IN: '. $formData->getPost($varname,'')); $this->data[$varname] = $formData->getPost($varname, ''); // VALIDATION HERE if ($validate) { $msg = call_user_func($validate, $this->data[$varname]); logit("VAL: {$varname} {$validate} {$this->data[$varname]} -- {$msg}"); if ($msg) { // Enter into error array $errorct ++; $this->error[] = "<tr><td class=\"rpad\"><b>{$field_label}:</b></td>" . "<td> <Span class=\"error\">{$msg}</span></td></tr>"; } } } $this->error[] = "</table>"; if ($errorct == 0) $this->error = array(); $this->handleCancel(); // logit("ECT: " . count($this->error)); if (count($this->error) > 0) { $this->echecklistNamespace->flash = 'Correct errors and retry'; $this->makeDialog($this->data); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ParsePostData() {}", "public function parsePostData()\n {\n }", "protected function getPostValues() {}", "private function getPostData()\n {\n $postData = $this->request->getPostValue();\n\n /** Magento may adds the SID session parameter, depending on the store configur...
[ "0.77749026", "0.76259905", "0.7518642", "0.71201485", "0.70722157", "0.7051765", "0.701587", "0.69846755", "0.69653994", "0.69574696", "0.6909821", "0.68143743", "0.6812603", "0.6812572", "0.6781472", "0.6742499", "0.67285055", "0.67215836", "0.6695002", "0.6666398", "0.6652...
0.0
-1
/ Collect all the post data
public function collectExtraData($prefix = '') { // logit('REST: ' . print_r($this->getRequest()->getPost(), true)); $vars = $this->getRequest()->getPost(); $lprefix = strlen($prefix); $out = array(); foreach($vars as $n => $v) { if (substr($n, 0, $lprefix) == $prefix) { // logit("MATCH: {$n} => {$v}"); $out[$n] = $v; } } $this->extra = $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ParsePostData() {}", "public function parsePostData()\n {\n }", "protected function getPostValues() {}", "private function getPostData()\n {\n $postData = $this->request->getPostValue();\n\n /** Magento may adds the SID session parameter, depending on the store configur...
[ "0.77749026", "0.76259905", "0.7518642", "0.71201485", "0.70722157", "0.7051765", "0.701587", "0.69846755", "0.69653994", "0.69574696", "0.6909821", "0.68143743", "0.6812603", "0.6812572", "0.6781472", "0.6742499", "0.67285055", "0.67215836", "0.6695002", "0.6666398", "0.6652...
0.0
-1
Given lab rows show in a table
public function makeLabLines($rows, $cb = false) { $rev_level = rev('getLevels', $this->tlist); $rev_affil = rev('getAffiliations', $this->tlist); $rev_type = rev('getLTypes', $this->tlist); $edit_users = array('ADMIN','USER','APPROVER'); $ct = 0; $tout = array(); $tout[] = '<table style="margin-left:50px;color:black;">'; $tout[] = "<tr class='even'>"; if ($cb) { $first = "<td style='width:55px;'>Select/<br />Deselect All</td>"; } else { $first = "<td style='width:55px;'></td>"; } $etop = ''; #if (in_array($this->usertype, $edit_users)) { # $etop = "<td style='width:50px;'></td>"; #} $tout[] = <<<"END" {$first} <td style='width:100px;font-weight:bold;'>Lab Number</td> <td style='width:200px;font-weight:bold;'>Labname</td> <td style='width:85px;font-weight:bold;'>Country</td> <td style='width:100px;font-weight:bold;'>Level</td> <td style='width:145px;font-weight:bold;'>Affiliation</td> <td style='width:145px;font-weight:bold;'>SLMTA Lab Type</td> {$etop}</tr> END; foreach($rows as $row) { //logit("LAB: " . print_r($row, true)); $ct ++; $cls = ($ct % 2 == 0) ? 'even' : 'odd'; $edit = ''; #if (in_array($this->usertype, $edit_users)) { # $edit = "<a href=\"{$this->baseurl}/lab/edit/{$row['id']}\"" . # " class=\"btn btn-mini btn-warning\">Edit</a>"; #} $line = ''; if ($cb) { $name = "cb_{$row['id']}"; $line .= "<td style='width:40px;padding:2px 0;'>" . "<input type='checkbox' name='{$name}' id='{$name}'></td>"; } else if ($this->labnum == $row['labnum']) { $cls = 'hilight'; $line .= "<td><div style=\"color:red;\">Selected</div></td>"; } else { $butt = "<a href=\"{$this->baseurl}/lab/choose/{$row['id']}\"" . " class=\"btn btn-mini btn-success\">Select</a>"; $line .= "<td style='width:55px;padding:2px 0;'>{$butt}</td>"; } //$tout[] = "<tr class='{$cls}'>"; $tout[] = <<<"END" <tr class="{$cls}"> {$line} <td>{$row['labnum']}</td> <td>{$row['labname']}</td> <td>{$row['country']}</td> <td><p class="small">{$rev_level[$row['lablevel']]}</p></td> <td><p class="small">{$rev_affil[$row['labaffil']]}</p></td> <td><p class="small">{$rev_type[$row['slmta_labtype']]}</p></td> END; if ($edit != '') $tout[] = "<td style='width:40px;padding:2px 0;'>{$edit}</td>"; $tout[] = '</tr>'; // "<td style='width:45px;font-weight:bold;'>SLMTA</td>" . // <td>{$sl}</td> } $tout[] = '</table>'; $this->view->showlines = implode("\n", $tout); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exibeLab($lab, $qtdLinha, $qtdColuna){\n echo '<table border=\"0\" cellspacing=\"1\" cellpadding=\"20\" align=\"center\" style=\"margin-top:20px;\" >';\n for ($l=0; $l<$qtdLinha; $l++){\n echo '<tr>';\n for ($c=0; $c<$qtdColuna; $c++){\n ...
[ "0.7079118", "0.6730648", "0.6729151", "0.6586235", "0.6490279", "0.64900094", "0.64703673", "0.6467509", "0.6372382", "0.63648754", "0.6352889", "0.6337399", "0.6312124", "0.62397605", "0.6234957", "0.6219381", "0.62049246", "0.6203714", "0.6181953", "0.61750436", "0.6170919...
0.6785565
1
Given audit rows show in a table
public function makeAuditLines($rows, $options = array()) { $cb = false; $addsel = false; $cb = (get_arrval($options, 'cb', false)) ? true : false; $addsel = (get_arrval($options, 'addsel', false)) ? true : false; $rev_level = rev('getLevels', $this->tlist); $rev_affil = rev('getAffiliations', $this->tlist); $tout = array(); $ct = 0; if ($cb) { /* $tout[] = <<<"END" <form method="post" action="{$this->baseurl}/output/process" enctype="multipart/form-data" name="action" id="action"> END; */ } $tout[] = '<table style="margin-left:50px;color:black;">'; $tout[] = "<tr class='even'>"; if ($cb) { $tout[] = "<td style='width:55px;'><center>Select/<br />Deselect<br />All<br /><input type='checkbox' name='allcb' id='allcb'></center></td>"; } else { $tout[] = "<td style='width:55px;'></td>"; } $tout[] = <<<"END" <td style='width:43px;font-weight:bold;padding:2px 0;'>Audit<br />Id</td> <td style='width:55px;font-weight:bold;'>Type</td> <td style='width:55px;font-weight:bold;'>SLMTA<br />Type</td> <td style='width:55px;font-weight:bold;'>Slipta<br />Off.</td> <td style='width:130px;font-weight:bold;'>Date</td> <td style='width:100px;font-weight:bold;'>Labnum</td> <td style='width:150px;font-weight:bold;'>Labname</td> <td style='width:85px;font-weight:bold;'>Country</td> <td style='width:100px;font-weight:bold;'>Level</td> <td style='width:145px;font-weight:bold;'>Affiliation</td> <td style='width:45px;font-weight:bold;'>Co-<br />hort<br />Id</td> <td style='width:92px;font-weight:bold;'>Status</td> END; if (! $cb) { $tout[] = "<td></td></tr>"; } else { $tout[] = "</tr>"; } foreach($rows as $row) { logit('Audit: ' . print_r($row, true)); if (! $row['owner'] && $row['status'] == 'INCOMPLETE') continue; //if ($) $ct ++; $cls = ($ct % 2 == 0) ? 'even' : 'odd'; /*$edit = ($row['status'] == 'INCOMPLETE' && $row['owner']) ? "<a href=\"{$this->baseurl}/audit/edit/{$row['audit_id']}/\" class=\"btn btn-mini btn-inverse\">Edit</a>" : ''; $view = "<a href=\"{$this->baseurl}/audit/view/{$row['audit_id']}\" class=\"btn btn-mini btn-success\">View</a>"; */ $adduser = ''; if ($this->audit['audit_id'] != $row["audit_id"]) { $selx = "<a href=\"{$this->baseurl}/audit/choose/{$row["audit_id"]}\" class=\"btn btn-mini btn-info\">Select</a>"; } else { $cls = 'hilight'; $selx = "<div style=\"color:red;\">Selected</div>"; } $tout[] = "<tr class='{$cls} ' style=\"height:24px;\">"; if ($cb) { $name = "cb_{$row['audit_id']}"; $tout[] = "<td style='width:40px;padding:4px 0;'>" . "<center><input type='checkbox' name='{$name}' id='{$name}'></center></td>"; } else if ($addsel) { $butt = "<a href=\"{$this->baseurl}/lab/choose/{$row['audit_id']}\"" . " class=\"btn btn-mini btn-success\">Select</a>"; $tout[] = "<td style='width:40px;padding:2px 4px;'>{$butt}</td>"; } else { $tout[] = "<td style='width:40px;padding:2px 4px;'>{$selx}</td>"; } $tout[] = <<<"END" <td>{$row['audit_id']}</td> <td>{$row['audit_type']}</td><td>{$row['slmta_type']}</td><td>{$row['slipta_official']}</td> <td>{$row['end_date']}</td> <td>{$row['labnum']}</td> <td>{$row['labname']}</td><td>{$row['country']}</td> <td><p class="small">{$rev_level[$row['lablevel']]}</p></td> <td><p class="small">{$rev_affil[$row['labaffil']]}</p></td> <td>{$row['cohort_id']}</td><td>{$row['status']}</td> END; if (! $cb) { $tout[] = "<td></td></tr>"; //{$export} {$delete} } else { $tout[] = "</tr>"; } } if ($cb) { $tout[] = '<tr><td colspan=13 style="text-align:right;" ><input class="input-xlarge submit" type="submit" name="doit" value="Process Request">'; } $tout[] = '</table><div style="height: 65px;">&nbsp;</div>' . '<div style="clear: both;"></div>'; /* if ($cb) { $tour[] = '</form>'; }*/ $lines = implode("\n", $tout); return $lines; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_rows() {\r\n\r\n # Get the records registered in the prepare_items method\r\n $records = $this->items;\r\n\r\n //Loop for each record\r\n if(!empty($records)){foreach($records as $rec){\r\n $custom_data = unserialize($rec->custom_data);\r\n\r\n ech...
[ "0.6517728", "0.6334481", "0.6289868", "0.6157629", "0.61256266", "0.60881233", "0.60813653", "0.60756373", "0.60474914", "0.5940669", "0.59171593", "0.5913041", "0.5911586", "0.590998", "0.57955533", "0.5789427", "0.5724407", "0.57085544", "0.5692147", "0.5689637", "0.566365...
0.6260736
3
Given User rows show in a table
public function makeUserLines($rows, $cb = false) { global $user; logit("US: {$this->usertype}"); $rev_ut = rev('getUserTypes', $this->tlist); $ct = 0; $user_users = array('ADMIN', 'USER', 'APPROVER'); $ao = new Application_Model_DbTable_AuditOwner(); $owner = $ao->isOwned($this->audit['audit_id'], $this->userid); $tout = array(); /*if (in_array($this->usertype, array('ADMIN', 'USER', 'APPROVER'))) { //$tout[] = "<div style=\"margin-left:200px\"><h1 style=\"margin-bottom:10px;\">Add owner to the current Audit</h1></div>"; }*/ /*if ($this->usertype == 'ADMIN') { $tout[] = "<h1 style=\"margin-bottom:10px;\">Edit User</h1>"; } else { $tout[] = "<h1 style=\"margin-bottom:10px;\"></h1>"; }*/ $tout[] = '<table style="margin-left:200px;color:black;">'; $tout[] = "<tr class='even'>"; if ($cb) { $tout[] = "<td style='width:110px;'>Select/<br />Deselect All</td>"; } else { $tout[] = "<td style='width:110px;'></td>"; } $tout[] = <<<"END" <td style='width:100px;font-weight:bold;'>UserId</td> <td style='width:200px;font-weight:bold;'>Name</td> <td style='width:85px;font-weight:bold;'>UserType</td> END; foreach($rows as $row) { $ct ++; $cls = ($ct % 2 == 0) ? 'even' : 'odd'; $tout[] = "<tr class='{$cls}'>"; $firstcol = ''; if ($cb) { $name = "cb_{$row['id']}"; $firstcol = "<td style='width:40px;padding:2px 0;'>" . "<input type='checkbox' name='{$name}' id='{$name}'></td>"; } else { $sel = "<a href=\"{$this->baseurl}/user/edit/{$row['id']}\"" . " class=\"btn btn-mini btn-success\">Edit</a>"; $addo = ''; if (in_array($row['usertype'], $user_users)) { $addo = "<a href=\"{$this->baseurl}/user/addowner/{$row['id']}\" onclick=\"return confirm('Add {$row['name']} to owners of selected audit?');\" class=\"btn btn-mini btn-warning\">Add Owner</a>"; } $buttons = ''; // logit("UT: {$this->usertype}, {$this->audit['status']}"); if ($this->audit['status'] == 'INCOMPLETE') { $buttons .= $addo; //$firstcol .= "<td style='width:40px;padding:2px 0;'>{$addo}</td>"; } if ($this->usertype == 'ADMIN') { $buttons .= $sel; //$firstcol .= "<td style='width:40px;padding:2px 0;'>{$sel}</td>"; } if ($this->usertype == 'APPROVER') { $firstcol .= '<td></td>'; } $firstcol = "<td style='padding:2px 0;'>{$buttons}</td>"; } // $sl = ($row['slmta'] == 't') ? 'Yes' : 'No'; $tout[] = <<<"END" {$firstcol} <td>{$row['userid']}</td> <td>{$row['name']}</td> <td>{$rev_ut[$row['usertype']]}</td> END; // "<td style='width:45px;font-weight:bold;'>SLMTA</td>" . // <td>{$sl}</td> } $tout[] = '</table>'; $this->view->showlines = implode("\n", $tout); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function showUserTable() {\n echo \"<table id='users'>\n <tr>\n <th></th>\n <th>Utilisateur</th>\n <th>Mail</th>\n <th>Date de naissance</th>\n <th>Note</th>\n <th>Voitures</th>\n <th>Commentaires</th>\n </tr>\";\n ...
[ "0.7626501", "0.7227294", "0.6777034", "0.67097676", "0.66560143", "0.65461373", "0.65293396", "0.64735633", "0.64584124", "0.6457489", "0.6449465", "0.6431529", "0.6408757", "0.6348586", "0.6326245", "0.62955165", "0.62951094", "0.6273669", "0.6254081", "0.6253343", "0.62520...
0.6493794
7
This test must be in real server environment. In this test, I use Apache as server and set Server/src as DocumentRoot
public function test_upload_file() { $target_url = "http://localhost:9111/src/upload.php"; // test1.txt is just a file $file_with_full_path = realpath("../_files/test1.txt"); $post = array("username"=>"ddd", "password"=>"123456", "file"=>'@'.$file_with_full_path); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target_url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $result=curl_exec ($ch); curl_close ($ch); $this->assertEquals(1, $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testApacheModPhpEnvironment()\n\t{\n\t\t$old_server = $_SERVER;\n\t\t\n\t\ttry\n\t\t{\n\t\t\t// Request for http://localhost/ischool/\n\t\t\n\t\t\t$_SERVER['REQUEST_URI'] = '/ischool/';\n\t\t\t$_SERVER['QUERY_STRING'] = '';\n\t\t\t$_SERVER['REQUEST_METHOD'] = 'GET';\n\t\t\t$_SERVER['SCRIPT_NAME'] =...
[ "0.7046114", "0.6402921", "0.6263953", "0.6219726", "0.6209565", "0.620146", "0.61728406", "0.615131", "0.6122206", "0.6104392", "0.60449445", "0.6037353", "0.6029585", "0.59929097", "0.5992182", "0.5962277", "0.5934689", "0.59065354", "0.5876621", "0.5819222", "0.58124095", ...
0.0
-1
Shows a list of Brands, with or without searching
public function index(BrandRepository $brandRepository, Request $request): Response { // Form creation $searchForm = $this->createForm(BrandSearchType::class); // Request handling to check if the form has been submitted $searchForm->handleRequest($request); if ($searchForm->isSubmitted() && $searchForm->isValid()) { $search_category = $request->request->get('brand_search')['search_category']; $search_text = $request->request->get('brand_search')['search_text']; // Using the parameters from the request, we search specific Brands $brands = $brandRepository->searchBrands($search_category, $search_text); } else { $brands = $brandRepository->findAll(); } return $this->render('brand/index.html.twig', [ 'brands' => $brands, 'searchForm' => $searchForm->createView(), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function list()\n {\n $bname = request()->bname??'';\n $where=[];\n if($bname){\n $where[]=['bname','like',\"%$bname%\"];\n }\n $pageSize = config('app.pageSize');\n $data = Brand::where($where)->orderby('bid','desc')->paginate($pageSize);\n ret...
[ "0.7056262", "0.6738446", "0.67179465", "0.66575056", "0.66539764", "0.6542334", "0.6516114", "0.6488985", "0.6464205", "0.6463216", "0.64457875", "0.6441343", "0.6422803", "0.6405531", "0.6402624", "0.64015466", "0.6369618", "0.63621783", "0.6339621", "0.63138384", "0.629301...
0.0
-1
Adds a Brand to the database form the form submitted
public function addBrand(Request $request) { $brand = new Brand(); // Slugify initialisation to create the slug data using the name $slugify = new Slugify(); // Form creation $addForm = $this->createForm(BrandType::class, $brand); // Request handling to check if the form has been submitted $addForm->handleRequest($request); if ($addForm->isSubmitted() && $addForm->isValid()) { $brand->setSlug($slugify->slugify($brand->getName())); // Persistence in database $manager = $this->getDoctrine()->getManager(); $manager->persist($brand); $manager->flush(); // Adding a flash message to inform the user $this->addFlash('success', "Votre marque {$brand->getName()} a bien été ajoutée"); return $this->redirectToRoute('brand_index'); } return $this->render('brand/add.html.twig', [ 'addForm' => $addForm->createView(), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_brand() {\n\t\t$values=array(\"brand_name\"=>$_POST['brand_name'],\"description\"=>$_POST['description']);\n\t\tif($this->insert(\"brands\",$values)) {\n\t\t\t$result=$this->runQuery('getAll','select max(id) as id from brands');\n\t\t\techo json_encode($result);\n\t\t}\n\t\telse\n\t\t\techo 'Er...
[ "0.77343386", "0.7597405", "0.72044265", "0.7182926", "0.69446343", "0.6859133", "0.6856537", "0.683337", "0.68056345", "0.66860867", "0.6681569", "0.6680434", "0.6671762", "0.6659672", "0.6658704", "0.6565896", "0.6565298", "0.65460104", "0.65147", "0.65125257", "0.65038747"...
0.72361904
2
Returns building as an associative array
public function getAsArray() { return array("id" => $this->id, "name" => $this->name, "park" => get_object_vars($this->park), "code" => $this->code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build(): array;", "public function build(): array;", "public function build() {\n return array();\n }", "function prepare_array() {\n\n\t\t$obj['name'] = $this->name->value;\n\t\t$obj['url'] = $this->url->value;\n\t\t$obj['image'] = $this->image->value;\n\t\t$obj['description'] = $this->d...
[ "0.70043975", "0.70043975", "0.6835524", "0.63532203", "0.6292932", "0.6268556", "0.6268556", "0.62670064", "0.6239448", "0.62105656", "0.6057756", "0.59609956", "0.5943512", "0.591603", "0.5912895", "0.59085304", "0.5861741", "0.58555406", "0.58459735", "0.5838731", "0.58387...
0.5777218
33
Gets the invoice number.
public function getInvoiceNumber();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInvoiceNumber()\n {\n return $this->invoice_number;\n }", "public function getInvoiceNo()\n {\n return $this->invoice_no;\n }", "public function invoiceNumberGet(){\n\t\t$query = $this->db->get(__TBL_INVOICE_NUMBER);\n\t\tif(sizeof($query->row())>0) {\n\t\t\treturn ...
[ "0.8989883", "0.8889355", "0.82391787", "0.817727", "0.8126336", "0.8003016", "0.7888845", "0.7799404", "0.7781578", "0.7670661", "0.76130754", "0.75176215", "0.7414525", "0.73563915", "0.72741866", "0.7269154", "0.722487", "0.7197459", "0.7121563", "0.7044087", "0.7032775", ...
0.8861682
2
Gets the invoice timestamp.
public function getInvoiceTimestamp();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInvoiceDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->invoiceDate;\r\n\t}", "function getTimestamp() {\r\r\n\t\treturn $this->timestamp;\r\r\n\t}", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();...
[ "0.70949066", "0.70701075", "0.70630103", "0.70630103", "0.70630103", "0.70532495", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7046818", "0.7016278", "0.69950724", "0.69950724", "0.69841...
0.89875394
0
Returns list of contracts
public function index(DefaultListRequest $request) { $contracts = $this->contractRepository->listForPortal($request->validated(), ['user', 'status', 'supplier']); return response()->pagination(ContractResource::collection($contracts)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function contracts()\n {\n return $this->get('clients/negotiated_contracts');\n }", "public function getListContracts()\n {\n return isset($this->listContracts) ? $this->listContracts : null;\n }", "public function contracts()\n {\n return $this->hasMany(Contract::cla...
[ "0.785054", "0.7699089", "0.7588918", "0.7588918", "0.75650245", "0.7275409", "0.7239224", "0.7199798", "0.7106369", "0.7071394", "0.7041897", "0.69031763", "0.67519844", "0.668434", "0.65258884", "0.6225676", "0.61941826", "0.61712366", "0.6148977", "0.61281234", "0.6124369"...
0.0
-1
Return instance with specific attributes
public function withAttributes(array $attributes): Route;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function instatiation($the_record){\n\t\t$calling_class = get_called_class();\n\t\t$the_object = new $calling_class;\n\t\tforeach($the_record as $the_attribute => $value){\n\t\t\tif($the_object->has_the_attribute($the_attribute)){\n\t\t\t\t$the_object->$the_attribute = $value;\n\t\t\t}\t\n\t\t\t\n\t\...
[ "0.60058075", "0.59667873", "0.5939736", "0.5939736", "0.59099555", "0.5886525", "0.58503324", "0.58029956", "0.57605845", "0.5760507", "0.57291615", "0.5718571", "0.5630659", "0.56278586", "0.56020796", "0.5567476", "0.55523014", "0.5541296", "0.5523069", "0.5515091", "0.550...
0.0
-1
Returns route's attributes extracted from requested uri
public function getAttributes(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRouteParams();", "function getRouteParameters();", "public function getRouteAndParams()\n {\n $request = $this->get('request_stack')->getCurrentRequest();\n $routing = $request->attributes->all();\n\n $ret = new \\stdClass();\n\n $ret->route = $routing['_route'...
[ "0.68718106", "0.68537116", "0.66074836", "0.6521723", "0.64873403", "0.64407164", "0.6423572", "0.6364359", "0.6329508", "0.6279329", "0.6252957", "0.6234097", "0.62258506", "0.6168935", "0.61498904", "0.6120969", "0.6120969", "0.61090815", "0.6063787", "0.6053264", "0.60181...
0.0
-1
Returns instance with specific controller
public function withController($controller): Route;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getController( );", "public function getController();", "public function getController();", "public function getController();", "public function & GetController ();", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "private function getControllerToRun()\...
[ "0.74379545", "0.7347662", "0.7347662", "0.7347662", "0.71493137", "0.69633925", "0.68714404", "0.6871033", "0.68496025", "0.6798696", "0.6794582", "0.67191374", "0.67021775", "0.66841817", "0.6675059", "0.6658629", "0.66533273", "0.66448826", "0.6633175", "0.66272646", "0.66...
0.5825954
100
Should return callable that accepts psrrequest and return psrresponse instances or Controller instance.
public function getController();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __invoke(Request $request): Response;", "abstract function __invoke(RequestInterface $request, ResponseInterface $response, callable $next);", "public function call()\n {\n if (is_string($this->callable)) {\n $params = explode('#', $this->callable);\n $controller...
[ "0.62754923", "0.6197478", "0.61441594", "0.60338414", "0.602991", "0.58885384", "0.5733185", "0.5703796", "0.569862", "0.56861585", "0.5673458", "0.5660281", "0.56555027", "0.5644265", "0.5627077", "0.56253654", "0.5619791", "0.5573474", "0.5568193", "0.5533728", "0.54874396...
0.55652666
21
Returns expression that is later matched against requested uri.
public function getPath(): string;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExpression();", "public function parseUri()\n {\n return RouteMatch::uriToRegex($this);\n }", "public function match ($uri);", "public function match($uri);", "private static function _parseUri($uri, $expressions = [])\n {\n $pattern = explode('/', ltrim($uri, '...
[ "0.56797624", "0.5590424", "0.55856025", "0.54913354", "0.53815466", "0.52978593", "0.5285936", "0.5277744", "0.52549905", "0.52449566", "0.52354604", "0.5228532", "0.52077657", "0.52077657", "0.52054226", "0.51723003", "0.51678157", "0.51502526", "0.51144075", "0.51109594", ...
0.0
-1
Returns route that can be matched against specified methods.
public function withMethods(array $methods): Route;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getRoutesForMethod($method);", "public function test_match_withSupportedMethod()\n {\n $route = new Route('GET|POST', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if method provided is supported b...
[ "0.76350987", "0.72354025", "0.71437126", "0.6987343", "0.6827819", "0.6740208", "0.6739182", "0.6672395", "0.6671263", "0.6658784", "0.66331995", "0.6502796", "0.6476182", "0.6460012", "0.64570296", "0.6456512", "0.642763", "0.64084524", "0.6405221", "0.64032155", "0.6403215...
0.7759646
0
Returns requested methods that are accepted by the route.
public function getMethods(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function methodProvider()\n {\n return [\n ['GET'],\n ['POST'],\n ['PUT'],\n ['DELETE'],\n ['TRACE'],\n ['HEAD'],\n ['OPTIONS'],\n ];\n }", "public function getAllowedMethods()\n {\n return $this->me...
[ "0.72761667", "0.72357905", "0.70795137", "0.7053489", "0.7008258", "0.69958746", "0.69522023", "0.69238454", "0.69143105", "0.69075084", "0.69067985", "0.68593407", "0.68217874", "0.6778759", "0.6776919", "0.6776919", "0.6776919", "0.6774316", "0.67690665", "0.67478085", "0....
0.62978965
52
Retrieves a list of models based on the current search/filter conditions. Typical usecase: Initialize the model fields with values from filter form. Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields. Pass data provider to CGridView, CListView or any similar widget.
public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria=new CDbCriteria; $criteria->compare('id_fondo_prestazione',$this->id_fondo_prestazione); $criteria->compare('id_fondo',$this->id_fondo); $criteria->compare('id_prestazione',$this->id_prestazione); $criteria->compare('prezzo',$this->prezzo); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object...
[ "0.7212116", "0.7135383", "0.7093303", "0.70931214", "0.69846356", "0.6960259", "0.69467723", "0.69414675", "0.69331795", "0.69232404", "0.69098496", "0.69022155", "0.6897633", "0.6896968", "0.6891722", "0.6881716", "0.68790054", "0.68732494", "0.6849048", "0.6848422", "0.683...
0.0
-1
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants!
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function model() {\n return parent::model(get_called_class());\n }", "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className=__CLA...
[ "0.75750446", "0.7528519", "0.7271581", "0.72703993", "0.72617143", "0.7213263", "0.72127366", "0.7131883", "0.71287453", "0.71287453", "0.7102495", "0.7102467", "0.7102467", "0.7074701", "0.7064163", "0.7064163", "0.7064163", "0.7064163", "0.7064163", "0.7064163", "0.7064163...
0.0
-1
$this>student = new Student($firstName, $lastName, $myid, $major, $matricTerm, $gradTerm);
public function __construct($student, $current_term, $advising_term, $recommended_courses, $alt_courses) { $this->current_term = $_POST['student']['advising_session']['currentTerm']; $this->advising_term = $_POST['student']['advising_session']['advisingTerm']; $this->recommended_courses = array_filter($_POST['recommended_courses']); $this->alt_courses = array_filter($_POST['alt_courses']); $this->myid = $_POST['student']['myId']; $this->major = $_POST['student']['major']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n //$this->student = $student;\n }", "public function __construct(Student $student)\n {\n $this->student = $student;\n }", "public function __construct(Student $student)\n {\n $this->student = $student;\n }", "public function __construc...
[ "0.82339376", "0.7745634", "0.7745634", "0.73140645", "0.71429056", "0.71245354", "0.68542355", "0.6808063", "0.67865044", "0.6603559", "0.64958537", "0.6472064", "0.64181393", "0.6392068", "0.6389265", "0.6388969", "0.63882804", "0.6370463", "0.6324336", "0.63106567", "0.630...
0.6449225
12
Create the new item
public function addPost() { try { if (!isset($_REQUEST['add'])) { throw new Exception(_('Not able to add')); } $name = trim($_REQUEST['name']); $address = trim($_REQUEST['address']); $description = trim($_REQUEST['description']); $searchDN = trim($_REQUEST['searchDN']); $port = trim($_REQUEST['port']); $userNamAttr = trim($_REQUEST['userNamAttr']); $grpMemberAttr = trim($_REQUEST['grpMemberAttr']); $adminGroup = trim($_REQUEST['adminGroup']); $userGroup = trim($_REQUEST['userGroup']); $searchScope = trim($_REQUEST['searchScope']); if (!is_numeric($searchScope)) { $searchScope = 0; } $bindDN = trim($_REQUEST['bindDN']); $bindPwd = trim($_REQUEST['bindPwd']); $grpSearchDN = trim($_REQUEST['grpSearchDN']); $useGroupMatch = trim($_REQUEST['useGroupMatch']); if (empty($name)) { throw new Exception( _('Please enter a name for this LDAP server.') ); } if (empty($address)) { throw new Exception( _('Please enter a LDAP server address') ); } if (empty($searchDN)) { throw new Exception( _('Please enter a Search Base DN') ); } if (empty($port)) { throw new Exception( _('Please select an LDAP port to use') ); } if (!in_array($port, array(389, 636))) { throw new Exception( _('Please select a valid ldap port') ); } if (empty($adminGroup) && empty($userGroup)) { throw new Exception( _('Please Enter an admin or mobile lookup name') ); } if (empty($userNamAttr)) { throw new Exception( _('Please enter a User Name Attribute') ); } if (empty($grpMemberAttr)) { throw new Exception( _('Please enter a Group Member Attribute') ); } $LDAP = self::getClass('LDAP') ->set('name', $name) ->set('description', $description) ->set('address', $address) ->set('searchDN', $searchDN) ->set('port', $port) ->set('userNamAttr', $userNamAttr) ->set('grpMemberAttr', $grpMemberAttr) ->set('adminGroup', $adminGroup) ->set('userGroup', $userGroup) ->set('searchScope', $searchScope) ->set('bindDN', $bindDN) ->set('bindPwd', self::encryptpw($bindPwd)) ->set('useGroupMatch', $useGroupMatch) ->set('grpSearchDN', $grpSearchDN); if ($LDAP->save()) { self::setMessage(_('LDAP Server Added, editing!')); self::redirect( sprintf( '?node=ldap&sub=edit&id=%s', $LDAP->get('id') ) ); } } catch (Exception $e) { self::setMessage($e->getMessage()); self::redirect($this->formAction); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createNewItem();", "public function create()\n {\n // Not needed cause this is coming from the item listing\n }", "public function createItem($data);", "public function create()\n {\n $form = [\n \"name\" => [\n \"label\" => \"Name\",\n ...
[ "0.8859525", "0.83662033", "0.80289537", "0.7503938", "0.74844295", "0.7352031", "0.7345427", "0.72844076", "0.7166338", "0.7138711", "0.7129777", "0.7062197", "0.7010556", "0.69586515", "0.6931974", "0.69304067", "0.6914015", "0.69124097", "0.6901465", "0.689261", "0.6883987...
0.0
-1
Presents the user with fields to edit
public function edit() { $this->title = sprintf('%s: %s', _('Edit'), $this->obj->get('name')); unset($this->headerData); $this->attributes = array( array(), array(), ); $this->templates = array( '${field}', '${input}', ); $fields = array( _('LDAP Connection Name') => '<input class="smaller" type="text" ' . sprintf( 'id="name" name="name" value="%s"/>', ( $_REQUEST['name'] ? $_REQUEST['name'] : $this->obj->get('name') ) ), _('LDAP Server Description') => '<textarea name="description">' . ( $_REQUEST['description'] ? $_REQUEST['description'] : $this->obj->get('description') ) . '</textarea>', _('LDAP Server Address') => '<input class="smaller" type="text" ' . sprintf( 'id="address" name="address" value="%s"/>', ( $_REQUEST['address'] ? $_REQUEST['address'] : $this->obj->get('address') ) ), _('LDAP Server Port') => '<select id="port" name="port">' . sprintf( '<option value="">- %s -</option>', self::$foglang['PleaseSelect'] ) . sprintf( '<option value="389"%s>389</option>', ( $_REQUEST['port'] == 389 ? ' selected' : ( $this->obj->get('port') == 389 ? ' selected' : '' ) ) ) . sprintf( '<option value="636"%s>636</option>', ( $_REQUEST['port'] == 636 ? ' selected' : ( $this->obj->get('port') == 636 ? ' selected' : '' ) ) ) . '</select>', _('Use Group Matching (recommended)') => '<select id="useGroupMatch" ' . 'name="useGroupMatch">' . sprintf( '<option value="0"%s>%s</option>', ( $_REQUEST['useGroupMatch'] < 1 ? ' selected' : ( $this->obj->get('useGroupMatch') < 1 ? ' selected' : '' ) ), _('No') ) . sprintf( '<option value="1"%s>%s</option>', ( $_REQUEST['useGroupMatch'] > 0 ? ' selected' : ( $this->obj->get('useGroupMatch') > 0 ? ' selected' : '' ) ), _('Yes') ) . '</select>', _('Search Base DN') => '<input class="smaller" type="text" ' . sprintf( 'id="searchDN" name="searchDN" value="%s"/>', ( $_REQUEST['searchDN'] ? $_REQUEST['searchDN'] : $this->obj->get('searchDN') ) ), _('Group Search DN') => '<input class="smaller" type="text" ' . sprintf( 'id="grpSearchDN" name="grpSearchDN" value="%s"/>', ( $_REQUEST['grpSearchDN'] ? $_REQUEST['grpSearchDN'] : $this->obj->get('grpSearchDN') ) ), _('Admin Group') => '<input class="smaller" type="text" ' . sprintf( 'id="adminGroup" name="adminGroup" value="%s"/>', ( $_REQUEST['adminGroup'] ? $_REQUEST['adminGroup'] : $this->obj->get('adminGroup') ) ), _('Mobile Group') => '<input class="smaller" type="text" ' . sprintf( 'id="userGroup" name="userGroup" value="%s"/>', ( $_REQUEST['userGroup'] ? $_REQUEST['userGroup'] : $this->obj->get('userGroup') ) ), _('Initial Template') => '<select class="smaller" ' . 'id="inittemplate">' . '<option value="pick" selected >Pick a template</option>' . '<option value="msad">Microsoft AD</option>' . '<option value="open">OpenLDAP</option>' . '<option value="edir">Generic LDAP</option>' . '</select>', _('User Name Attribute') => '<input class="smaller" type="text" ' . sprintf( 'id="userNamAttr" name="userNamAttr" value="%s"/>', ( $_REQUEST['userNamAttr'] ? $_REQUEST['userNamAttr'] : $this->obj->get('userNamAttr') ) ), _('Group Member Attribute') => '<input class="smaller" type="text" ' . sprintf( 'id="grpMemberAttr" name="grpMemberAttr" value="%s"/>', ( $_REQUEST['grpMemberAttr'] ? $_REQUEST['grpMemberAttr'] : $this->obj->get('grpMemberAttr') ) ), _('Search Scope') => '<select id="searchScope" name="searchScope">' . sprintf( '<option value="">- %s -</option>', self::$foglang['PleaseSelect'] ) . sprintf( '<option value="0"%s>%s</option>', ( isset($_REQUEST['searchScope']) && $_REQUEST['searchScope'] == 0 ? ' selected' : ( $this->obj->get('searchScope') == 0 ? ' selected' : '' ) ), _('Base only') ) . sprintf( '<option value="1"%s>%s</option>', ( $_REQUEST['searchScope'] == 1 ? ' selected' : ( $this->obj->get('searchScope') == 1 ? ' selected' : '' ) ), _('Base and subtree') ) . sprintf( '<option value="2"%s>%s</option>', ( $_REQUEST['searchScope'] == 2 ? ' selected' : ( $this->obj->get('searchScope') == 2 ? ' selected' : '' ) ), _('Subtree and below') ) . '</select>', _('Bind DN') => '<input class="smaller" type="text" ' . sprintf( 'id="bindDN" name="bindDN" value="%s"/>', ( $_REQUEST['bindDN'] ? $_REQUEST['bindDN'] : $this->obj->get('bindDN') ) ), _('Bind Password') => '<input class="smaller" type="password" ' . sprintf( 'id="bindPwd" name="bindPwd" value="%s"/>', ( $_REQUEST['bindPwd'] ? $_REQUEST['bindPwd'] : $this->obj->get('bindPwd') ) ), '&nbsp;' => sprintf( '<input class="smaller" name="update" type="submit" value="%s"/>', _('Update') ), ); foreach ((array)$fields as $field => &$input) { $this->data[] = array( 'field' => $field, 'input' => $input, ); unset($input); } unset($fields); self::$HookManager->processEvent( 'LDAP_EDIT', array( 'headerData' => &$this->headerData, 'data' => &$this->data, 'templates' => &$this->templates, 'attributes' => &$this->attributes ) ); printf('<form method="post" action="%s">', $this->formAction); $this->render(); echo '</form>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "public function edit($id)\n {\n // show form edit user info\n }", "public function e...
[ "0.79757607", "0.7586839", "0.75672776", "0.75478166", "0.75290686", "0.7512355", "0.75066555", "0.7485564", "0.7468899", "0.7453889", "0.7453889", "0.7453623", "0.7412758", "0.7325566", "0.7292886", "0.7279879", "0.7270516", "0.72588414", "0.725782", "0.72061926", "0.7195884...
0.0
-1
Updates the current item
public function editPost() { self::$HookManager->processEvent('LDAP_EDIT_POST', array('LDAP'=> &$LDAP)); try { if (!isset($_REQUEST['update'])) { throw new Exception(_('Not able to update')); } $name = trim($_REQUEST['name']); $address = trim($_REQUEST['address']); $description = trim($_REQUEST['description']); $searchDN = trim($_REQUEST['searchDN']); $port = trim($_REQUEST['port']); $userNamAttr = trim($_REQUEST['userNamAttr']); $grpMemberAttr = trim($_REQUEST['grpMemberAttr']); $adminGroup = trim($_REQUEST['adminGroup']); $userGroup = trim($_REQUEST['userGroup']); $searchScope = trim($_REQUEST['searchScope']); $grpSearchDN = trim($_REQUEST['grpSearchDN']); $useGroupMatch = trim($_REQUEST['useGroupMatch']); if (!is_numeric($searchScope)) { $searchScope = 0; } $bindDN = trim($_REQUEST['bindDN']); $bindPwd = trim($_REQUEST['bindPwd']); if (empty($name)) { throw new Exception( _('Please enter a name for this LDAP server.') ); } if (empty($address)) { throw new Exception( _('Please enter a LDAP server address') ); } if (empty($searchDN)) { throw new Exception( _('Please enter a Search Base DN') ); } if (empty($port)) { throw new Exception( _('Please select an LDAP port to use') ); } if (!in_array($port, array(389, 636))) { throw new Exception( _('Please select a valid ldap port') ); } if (empty($adminGroup) && empty($userGroup)) { throw new Exception( _('Please Enter an admin or mobile lookup name') ); } if (empty($userNamAttr)) { throw new Exception( _('Please enter a User Name Attribute') ); } if (empty($grpMemberAttr)) { throw new Exception( _('Please enter a Group Member Attribute') ); } $LDAP = $this->obj ->set('name', $name) ->set('description', $description) ->set('address', $address) ->set('searchDN', $searchDN) ->set('port', $port) ->set('userNamAttr', $userNamAttr) ->set('grpMemberAttr', $grpMemberAttr) ->set('adminGroup', $adminGroup) ->set('userGroup', $userGroup) ->set('searchScope', $searchScope) ->set('bindDN', $bindDN) ->set('bindPwd', self::encryptpw($bindPwd)) ->set('useGroupMatch', $useGroupMatch) ->set('grpSearchDN', $grpSearchDN); if (!$LDAP->save()) { throw new Exception(_('Database update failed')); } self::$HookManager->processEvent( 'LDAP_EDIT_SUCCESS', array('LDAP' => &$this->obj) ); self::setMessage(_('LDAP information updated!')); } catch (Exception $e) { self::$HookManager->processEvent( 'LDAP_EDIT_FAIL', array('LDAP' => &$this->obj) ); self::setMessage($e->getMessage()); } self::redirect($this->formAction); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update()\n {\n $this->_checkItem();\n $service = $this->getService();\n $entry = $service->getGbaseItemEntry( $this->getItem()->getGbaseItemId() );\n $this->setEntry($entry);\n $this->_prepareEnrtyForSave();\n $entry = $service->updateGbaseItem($this->ge...
[ "0.72943974", "0.7294069", "0.7202141", "0.7130964", "0.68864375", "0.6863934", "0.6794802", "0.6701028", "0.66977096", "0.66950154", "0.6657857", "0.66260296", "0.66260296", "0.661687", "0.65942335", "0.65860444", "0.6567765", "0.6567144", "0.65186554", "0.6514473", "0.65121...
0.0
-1
Array of the Category as Key and value is an array of Permissions public static $lonelyCategories = []; // Array of Permissions with no dots, i.e. category only ex:"CatOnly" public static $categoriesAsRouteAndDots = []; // Array of Permissions that uses also a category only ex:"role , role.edit , role.create" Setup function to prepare the above arrays to be sent to the roles and permissions view
public static function setup($userRole, $currentRole, $systemPage = false) { // The order of calling these functions is important self::setupRoleWithPermissions($userRole, $currentRole, $systemPage); return self::setupCategoriesPermissions(); //self::setupCategoryOnlyArrays(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function setupCategoriesPermissions()\n\t{\n\t\t$result = [];\n\n\t\t// Looping into userPermissions and getting the category as the key and the value as an array of permissions\n\t\tforeach(self::$userPermissions as $userPermissionWithDots)\n\t\t{\n\t\t\t// checking if the permission has a menu cat...
[ "0.75904715", "0.6096608", "0.60560286", "0.59835404", "0.59796053", "0.5973939", "0.5953304", "0.5952189", "0.587637", "0.58674043", "0.58674043", "0.5845741", "0.58433443", "0.58433443", "0.5807611", "0.58025277", "0.5789925", "0.5789925", "0.5789925", "0.5776075", "0.57546...
0.0
-1
Setup the view only mode for roles
public static function listPermissions($userRole, $currentRole, $systemPage = false) { $result = []; $allRoles = RoleModel::pluck('role', 'id')->toArray(); $permissions = self::setupRoleWithPermissions($userRole, $currentRole, $systemPage)[$currentRole]; foreach ($permissions as $permission) { $details = explode('.', $permission); if(sizeof($details) == 1) { $result[$details[0]][] = trans('admin.view'); } else { if(is_numeric($details[1])) { $result[$details[0]][] = $allRoles[$details[1]]; } else { $result[$details[0]][] = trans('admin.'. $details[1]); } } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function canDisplayRolesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ROLE);\n\t}", "public function roles_protected() {\n return true;\n }", "public function rol_conductor_only_access()\n {\n if ($this->rol != 3) {\n exit($thi...
[ "0.6468875", "0.62288415", "0.6203476", "0.6102243", "0.6102243", "0.6102243", "0.6102243", "0.6098629", "0.6078775", "0.60782737", "0.6075366", "0.6046241", "0.6043239", "0.60359174", "0.6014452", "0.6007143", "0.6003408", "0.5988276", "0.59766304", "0.59682846", "0.59558076...
0.0
-1
Getting all parent roles, i.e. roles that can manage the passed role and their managers too
public static function getAllParentRoles($userRole, $system) { // Filling $allParentsWithChildren if(empty(self::$allParentsWithChildren)) { // Getting all role-manage permission for the current user $parents = PermissionModel::where('permission' , 'like' , 'role-manage.%'); // if system flag then get all roles in the estate plus the roles with site_id = null if($system) { $rolesInEstate = self::getRolesInEstate(true); $parents = $parents->whereIn('role_id', array_keys($rolesInEstate)); } $parents = $parents->get()->toArray(); // Will store all Parents and their role-manage roles foreach ($parents as $parent) { self::$allParentsWithChildren[$parent['role_id']][] = substr($parent['permission'], 12); } } self::getParentRoles($userRole, $system); return self::$parentRoles; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParentRoles()\n {\n $parents = collect([]);\n\n $parent = $this->parent;\n\n while (!is_null($parent)) {\n $parents->push($parent);\n $parent = $parent->parent;\n }\n\n return $parents;\n }", "public function getAllRolesWithParentR...
[ "0.7576922", "0.755707", "0.6676651", "0.66742086", "0.6570631", "0.6514543", "0.6443818", "0.64192414", "0.6373145", "0.6320286", "0.6260952", "0.62567264", "0.6199791", "0.61962324", "0.618351", "0.61752534", "0.6166003", "0.6156555", "0.60732806", "0.607302", "0.60693574",...
0.66226614
4
Recursively get parent roles
public static function getParentRoles($userRole, $system) { $parents = []; // Saving userRole to KnownParents to avoid endless recursion self::$knownParents[] = $userRole; // Looping in all Parents and if the userRole is in the children then add this parent to knownparents foreach (self::$allParentsWithChildren as $parentRole => $childrenRoles) { // If the role is in the childrenRoles then add the $parentRole to $parents if(in_array($userRole, $childrenRoles)) $parents[] = $parentRole; } // Add to ParentRoles unique roles self::$parentRoles = array_unique (array_merge (self::$parentRoles, $parents)); // Recursively get paretroles foreach ($parents as $parent) { if(!in_array($parent, self::$knownParents)) self::getParentRoles($parent, $system); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParentRoles()\n {\n $parents = collect([]);\n\n $parent = $this->parent;\n\n while (!is_null($parent)) {\n $parents->push($parent);\n $parent = $parent->parent;\n }\n\n return $parents;\n }", "public function getAllRolesWithParentR...
[ "0.75837404", "0.74578226", "0.67772174", "0.6699273", "0.66572404", "0.66326034", "0.65161085", "0.6456166", "0.6384521", "0.6374006", "0.6365956", "0.6302173", "0.62929684", "0.6245197", "0.61783767", "0.6143905", "0.6115913", "0.61003155", "0.60457706", "0.6044245", "0.602...
0.6107252
17
Getting all roles that user can manage
public static function getManagedRoles($userRole, $system) { // Getting all role-manage permission for the current user $result = PermissionModel::where('role_id', $userRole) ->where('permission' , 'like' , 'role-manage.%') ->select('permission') ->get() ->toArray(); // if system flag then get all roles in the estate plus the roles with site_id = null if($system) { $rolesInEstate = self::getRolesInEstate(true); } // Putting only the role_id in the $rolesToManage array by cutting 12 characters from the permission i.e. cutting 'role-manage.' foreach ($result as $rows) { foreach ($rows as $row) { $roleId = substr($row, 12); if ($roleId != $userRole) { if ($system) { // If in the $rolesInEstate then add it to the results if (in_array($roleId, array_keys($rolesInEstate))) { self::$rolesToManage[$roleId] = $roleId; } } else { self::$rolesToManage[$roleId] = $roleId; } } } } return self::$rolesToManage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_all_roles(){\n return Role::all();\n }", "public function get_all_roles()\n {\n return App\\Role::all();\n }", "public function getAllRoles(): array;", "public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}", "function getAllRo...
[ "0.8534246", "0.8351405", "0.8285688", "0.8250701", "0.8227924", "0.8065377", "0.80469906", "0.8037908", "0.80370104", "0.8025936", "0.8022992", "0.7960547", "0.7945367", "0.7937081", "0.7934523", "0.7818265", "0.78171194", "0.77983", "0.77753156", "0.7768571", "0.77578336", ...
0.0
-1
setting up rolesWithPermission Array Key is role id Value Array of Permissions
public static function setupRoleWithPermissions($userRole, $currentRole, $systemPage) { $result = []; $sites = session('admin.site.estate'); // Setting up the roles to manage self::getManagedRoles($userRole, $systemPage); $rolesAndPermissions = RoleModel::orderBy('role') ->with('permissions'); $rolesAndPermissions = $rolesAndPermissions ->whereIn( 'id', [$userRole, $currentRole] ); $rolesAndPermissions = $rolesAndPermissions->get()->toArray(); // Looping into the result from DB to setup the rolesWithPermissions array foreach($rolesAndPermissions as $rolesAndPermission) { $roleId = $rolesAndPermission['id']; $roleName = $rolesAndPermission['role']; $permissions = $rolesAndPermission['permissions']; $tempArray = []; // Gathering the permissions per role_id foreach ($permissions as $permission) { $tempArray[] = $permission['permission']; } // Fill only the managed roles //if(!$systemPage or in_array($roleId, self::$rolesToManage) or $roleId == $userRole) if(in_array($roleId, self::$rolesToManage) or $roleId == $userRole ) { // Create an array with a Key as role_id and value as an array of permissions $result[$roleId] = $tempArray; self::$roles[$roleId] = $roleName; } } if(isset($result[$userRole])) { // They key is the role id, so if you pass 0 you will get DevPermissions self::$userPermissions = $result[$userRole]; } // Remove Dev permissions and User's permissions if(!is_null($currentRole)) { //excluding Dev Role array_forget($result,0); array_forget(self::$roles,0); // Excluding the current user role array_forget($result,$userRole); array_forget(self::$roles,$userRole); } self::$rolesWithPermissions = $result; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function build_permissions_for_role($role_id)\n\t{\n\t\t$permissions = self::get_roles_permissions($role_id);\n\t\t$permissions_array = array();\n\t\t\n\t\tforeach($permissions as $permission)\n\t\t\t$permissions_array[] = $permission->permission_id;\n\t\t\n\t\t$permissions_not_in = array();\n\t\t\n...
[ "0.6899211", "0.66653204", "0.6607921", "0.6488249", "0.64642787", "0.6435225", "0.6271761", "0.6257895", "0.6232714", "0.6183075", "0.6168831", "0.61673814", "0.61548", "0.61502916", "0.6148395", "0.61162215", "0.61159456", "0.60929424", "0.6092681", "0.6079594", "0.60613817...
0.56442213
93
Sets up the $categoryWithPermissions array Key is the category name Value is permission with dots
private static function setupCategoriesPermissions() { $result = []; // Looping into userPermissions and getting the category as the key and the value as an array of permissions foreach(self::$userPermissions as $userPermissionWithDots) { // checking if the permission has a menu category or not, it is separated in the DB with | $userCategoryPermission = explode ('.',$userPermissionWithDots,2); $userCategory = $userCategoryPermission[0]; // if the permission is without a dot then it is a category only if(count($userCategoryPermission) > 1) { $userPermission = $userCategoryPermission[1]; } else { $userPermission = ''; } if(is_numeric($userPermission)) { // If the permission is a number this means it is a role-manage permission // Add it if the role is in the roles to manage array if (in_array($userPermission, self::$rolesToManage)) { $result[$userCategory][] = $userPermission; } } else { $result[$userCategory][] = $userPermission; } } self::$categoryWithPermissions = $result; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request)\n {\n $category=new User_category();\n\n $this->validate(request(),[\n 'name'=>'required',\n 'description'=>'required',\n ]);\n\n // User::create($request->all());\n\n\n $category->category_name=$request->input('name');\n ...
[ "0.5981092", "0.597878", "0.58900464", "0.5832863", "0.5684485", "0.56338066", "0.5620916", "0.555938", "0.5548968", "0.5526383", "0.53283894", "0.5316216", "0.53121877", "0.530834", "0.53014857", "0.5289787", "0.52774435", "0.5274407", "0.5219961", "0.5214245", "0.52108973",...
0.7674575
0
Checks the widgets array types and return an array of widget arrays for [estate, company, site]
public static function reArrangeWidgets($widgetsWithRoleWidget) { $resultWidgets = []; // Temporary order $tempCount = 1; foreach ($widgetsWithRoleWidget as $widgetWithRoleWidget) { // If it has a role_widget , store the order otherwise increase the tempCount if(!empty($widgetWithRoleWidget['role_widget'])) { $count = 0; foreach($widgetWithRoleWidget['role_widget'] as $roleWidget) { $widgetOrder = $roleWidget['order']; $count++; $resultWidgets[$widgetOrder] = $widgetWithRoleWidget; } } else { // Nothing in the roleWidget table, so do a tempCounter $widgetOrder = 'temporder'.$tempCount++; $resultWidgets[$widgetOrder] = $widgetWithRoleWidget; } } // Arranging the arrays ksort($resultWidgets); $result = []; array_walk($resultWidgets, function(&$item, $key ) use (&$result){ $result[$item['title']] = $item; }); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWidgetsByInputType() {\n\t\t$types = array();\n\t\tif ($this->hasParameter('widgets')) {\n\t\t\tforeach ($this->getParameter('widgets') as $name => $widget) {\n\t\t\t\t$inputs = $widget['input'];\n\t\t\t\tforeach($inputs as $input) {\n\t\t\t\t\tif ($input == 'all') {\n\t\t\t\t\t\t$list = ['selec...
[ "0.7318295", "0.72710973", "0.68388367", "0.6704475", "0.66627747", "0.6440505", "0.6228853", "0.6199707", "0.61488533", "0.6118774", "0.6072267", "0.60693485", "0.60111624", "0.5997781", "0.58919805", "0.58465445", "0.58134866", "0.57845575", "0.57830346", "0.5772307", "0.57...
0.0
-1
Getting all roles for all users page Also gets roles that the current user can manage and in his estate in the system>users page
public static function getRolesForUsers($userRole , $system = false) { // Getting id and role name and site id $result = RoleModel::select('id', 'role' , 'site_id') ->where('id' ,'!=' , 0); $rolesToManage = self::getManagedRoles($userRole, $system); $result = $result->whereIn('id' , $rolesToManage) ->get() ->toArray(); $roles = []; // Setting up the dropdownlist as the key will be the role id and the value would be the role name and the site id between brackets foreach ($result as $row) { $roles[$row['id']] = $row['role']. ($row['site_id'] ? ' (' . $row['site_id'] .')' : ''); } return $roles; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }", "private function get_all_roles(){\n return Role::all();\n }", "public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ...
[ "0.81732506", "0.80759096", "0.8057559", "0.7959857", "0.79342175", "0.7845392", "0.7789526", "0.7775129", "0.7741722", "0.7731037", "0.77181286", "0.76908153", "0.7643663", "0.7601832", "0.7586477", "0.75755", "0.75644255", "0.7561339", "0.7547973", "0.75365", "0.75161767", ...
0.0
-1
Widgets for current permission level Uses the role id to get all widgets linked to the role
public static function getAllowedWidgets($roleId = null) { if(is_null($roleId)) $roleId = session('admin.user.role_id'); // Getting an array of the widgets allowed to the current role_id $allowedWidgets = PermissionModel::where('role_id', $roleId) ->where('permission', 'like', 'widgets.%') ->get() ->pluck('permission') ->map(function($permission){ return explode('.', $permission)[1];}) ->toArray(); // Searching the widgets for the widget title and getting its role_widget data too $widgetsWithRoleWidgets = self::getWidgetsWithRoleWidgets($allowedWidgets, $roleId); return $widgetsWithRoleWidgets; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roles_dashboard_update_widget_definitions() {\n\n\t$widget_types = elgg_get_widget_types('all', true);\n\tforeach ($widget_types as $handler => $options) {\n\t\t$context = $options->context;\n\t\t$context[] = 'dashboard';\n\t\t$context = array_unique($context);\n\t\telgg_register_widget_type($handler, $op...
[ "0.622101", "0.5974379", "0.58389336", "0.58389336", "0.5833121", "0.5819376", "0.5814579", "0.5766606", "0.57638645", "0.568372", "0.5662139", "0.5602385", "0.5586383", "0.55735177", "0.555928", "0.55482394", "0.5543467", "0.55425495", "0.5511548", "0.5493753", "0.54492646",...
0.73286635
0
Getting all Widgets and their types and routes
public static function getAllWidgets($widgets = []) { $widgetIds = []; foreach($widgets as $widget) { $widgetIds[] = $widget['id']; } $allWidgets = []; $widgets = WidgetModel::select('title', 'type', 'routes', 'description') ->whereIn('id', $widgetIds) ->get()->toArray(); foreach($widgets as $widget) { $allWidgets[$widget['title']]['type'] = isset($allWidgets[$widget['title']]['type']) ? $allWidgets[$widget['title']]['type']. ',' . $widget['type'] : $widget['type'] ; $allWidgets[$widget['title']]['routes'] = $widget['routes']; $allWidgets[$widget['title']]['description'] = $widget['description']; } return $allWidgets; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function list()\n\t{\n\t\treturn $this->widgets()->orderBy('order')->get();\n\t}", "function getWidgets() {\n \t$returnArray = array();\n \tforeach($this->_widgetRegistry as $name => $item) {\n \t\t$returnArray[] = array('name' => $name, 'description' => $item['description']);\n \t}\n \tret...
[ "0.73280096", "0.7266385", "0.70905507", "0.7090283", "0.70264596", "0.6970121", "0.69011205", "0.6875017", "0.6836236", "0.6819798", "0.6819798", "0.6769803", "0.6704183", "0.6682997", "0.66001445", "0.6578597", "0.6556884", "0.6556642", "0.64795953", "0.6478857", "0.6478131...
0.59951735
41
Search the widget table with an array of widget names to see if it exists NOTE: $roleId is the role of the current page
private static function getWidgetsWithRoleWidgets($widgets, $roleId) { $resultArray = []; $widgetsWithRoleWidgets = WidgetModel::whereIn('title', $widgets) ->with(['RoleWidget' => function($q) use ($roleId){ $q->where('role_id', $roleId); }]) ->get() ->toArray(); // Handling multiple routes per widget array_map(function($widget) use(&$resultArray){ $explodedRoutes = explode(',', $widget['routes']); // If the widget has many routes i.e. comma separated values if( count($explodedRoutes) > 1) { // Explode them and create a new item per widget with the new route foreach ($explodedRoutes as $route) { $widget['routes'] = $route; $resultArray[] = $widget; } } else $resultArray[] = $widget; }, $widgetsWithRoleWidgets); // Array Map to remove un-related role_widgets $resultArray = array_map(function($widgetWithRoleWidget){ $currectRoute = $widgetWithRoleWidget['routes']; // If there is many role_widgets we need to delete the ones that is not related to the route of the current widget if(count($widgetWithRoleWidget['role_widget']) > 1) // Looping in the role_widget array that comes from the widgets->with('role_widget') foreach($widgetWithRoleWidget['role_widget'] as $key=>$roleWidget) // If the role_widget has different route than the one we are handling then remove it if($roleWidget['route'] != $currectRoute) // Removing un-related role_widget since it has a wrong order and is causing issues unset($widgetWithRoleWidget['role_widget'][$key]); // Rebasing the array $widgetWithRoleWidget['role_widget'] because some items were removed $widgetWithRoleWidget['role_widget'] = array_values($widgetWithRoleWidget['role_widget']); return $widgetWithRoleWidget; },$resultArray); return $resultArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getAllowedWidgets($roleId = null)\n\t{\n\t\tif(is_null($roleId))\n\t\t\t$roleId = session('admin.user.role_id');\n\n\t\t// Getting an array of the widgets allowed to the current role_id\n\t\t$allowedWidgets = PermissionModel::where('role_id', $roleId)\n\t\t\t->where('permission', 'like', 'wi...
[ "0.6091939", "0.59373146", "0.5907592", "0.5765418", "0.57094204", "0.565774", "0.5656863", "0.5650943", "0.5532597", "0.55309236", "0.5510215", "0.54818714", "0.5468283", "0.54403627", "0.54263186", "0.54263186", "0.54260135", "0.537454", "0.5350149", "0.5344331", "0.5295872...
0.56317306
8
Getting all roles in your estate
public static function getRolesInEstate($includeNullSiteId) { $sites = session('admin.site.estate'); $result = RoleModel::whereIn('site_id', $sites); if ($includeNullSiteId) $result = $result->orWhere('site_id', null); $result = $result->pluck('role', 'id')->toArray(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }", "private function get_all_roles(){\n return Role::all();\n }", "function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}", "public function ge...
[ "0.8438758", "0.8363587", "0.835138", "0.83139884", "0.8311581", "0.82662916", "0.82418776", "0.8193743", "0.8166139", "0.81491333", "0.814431", "0.8109995", "0.80133724", "0.80125684", "0.7985148", "0.7985148", "0.7985148", "0.79817426", "0.7955572", "0.7946759", "0.79171425...
0.0
-1
Returns a string representation of the entity.
public function __toString() { return (string) $this->getToken(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __toString(){\n\t\t$strings = array();\n\t\tforeach ($this->entities as $entity){\n\t\t\t$strings[] = sprintf(\"%s\", $entity);\n\t\t}\n\t\treturn implode($strings);\n\t}", "public function __toString() {\n\t\t$str = \"\";\n\t\t$str .= \"EntityMapperClassName: \" . $this->_entityMapperClassName . \"<br ...
[ "0.761324", "0.73691225", "0.7357622", "0.729037", "0.7267188", "0.71429473", "0.7123928", "0.70859015", "0.70589125", "0.7055733", "0.7022846", "0.7011571", "0.70051783", "0.7005033", "0.69886297", "0.69778335", "0.69778335", "0.69778335", "0.69778335", "0.69778335", "0.6977...
0.0
-1
Register any events for your application.
public function boot() { parent::boot(); Brand::observe(BrandObserver::class); Email::observe(EmailObserver::class); Media::observe(MediaObserver::class); Category::observe(ScrappedCategoryMappingObserver::class); ScrapedProducts::observe(ScrappedProductCategoryMappingObserver::class); // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerEvents()\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "protected funct...
[ "0.82186323", "0.8194245", "0.76956534", "0.7522409", "0.7307849", "0.7138719", "0.69926506", "0.69516087", "0.68208784", "0.6811024", "0.6798247", "0.6771752", "0.6726646", "0.66949767", "0.66883945", "0.6659465", "0.66186184", "0.6601663", "0.6570876", "0.6551585", "0.65515...
0.0
-1
Create a new controller instance.
public function __construct() { try { $this->middleware('auth:admin'); $this->middleware('admin'); } catch (Exception $ex) { return redirect()->back()->withErrors($ex->getMessage() . " In " . $ex->getFile() . " At Line " . $ex->getLine())->withInput(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this-...
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.687...
0.0
-1
Display a listing of the resource.
public function index() { try { $user = Auth::guard('admin')->user(); $all_records = new AmenityList; $datas = $all_records->orderBy('name', 'ASC')->paginate(5); return view('admin.amenitylist.index')->with(compact('user', 'datas')); } catch (Exception $ex) { return redirect()->back()->withErrors($ex->getMessage() . " In " . $ex->getFile() . " At Line " . $ex->getLine())->withInput(); } }
{ "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->re...
[ "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.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { try { $user = Auth::guard('admin')->user(); return view('admin.amenitylist.create')->with(compact('user')); } catch (Exception $ex) { return redirect()->back()->withErrors($ex->getMessage() . " In " . $ex->getFile() . " At Line " . $ex->getLine())->withInput(); } }
{ "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(...
[ "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.717428...
0.0
-1
Store a newly created resource in storage.
public function store(AmenityListRequest $request) { try { $amenity_list = new AmenityList; $amenity_list->name = $request->name; if ($amenity_list->save()) { $flag = 'success'; $msg = "Record Added Successfully"; } else { $flag = 'danger'; $msg = "Record Not Added Successfully"; } $request->session()->flash($flag, $msg); return redirect(route('amenitylist.index')); } catch (Exception $ex) { return redirect()->back()->withErrors($ex->getMessage() . " In " . $ex->getFile() . " At Line " . $ex->getLine())->withInput(); } }
{ "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...
[ "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.63424...
0.0
-1
Display the specified resource.
public function show($id) { try { } catch (Exception $ex) { return redirect()->back()->withErrors($ex->getMessage() . " In " . $ex->getFile() . " At Line " . $ex->getLine())->withInput(); } }
{ "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...
[ "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.0
-1
Show the form for editing the specified resource.
public function edit($id) { try { $user = Auth::guard('admin')->user(); $edit_data = AmenityList::find($id); return view('admin.amenitylist.edit')->with(compact('user', 'edit_data')); } catch (Exception $ex) { return redirect()->back()->withErrors($ex->getMessage() . " In " . $ex->getFile() . " At Line " . $ex->getLine())->withInput(); } }
{ "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 ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(AmenityListRequest $request, $id) { try { $edit_data = AmenityList::find($id); if ($request->name) { $edit_data->name = $request->name; } else { $edit_data->status = $request->status; } if ($edit_data->save()) { $flag = 'success'; $msg = 'Record Updated Successfully'; } else { $flag = 'danger'; $msg = 'Record Not Updated Successfully'; } $request->session()->flash($flag, $msg); return redirect(route('amenitylist.index')); } catch (Exception $ex) { return redirect()->back()->withErrors($ex->getMessage() . " In " . $ex->getFile() . " At Line " . $ex->getLine())->withInput(); } }
{ "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 ...
[ "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.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy(Request $request, $id) { try { if (AmenityList::where('id', $id)->delete()) { $flag = 'success'; $msg = 'Record Deleted Successfully'; } else { $flag = 'danger'; $msg = 'Record Not Deleted Successfully'; } $request->session()->flash($flag, $msg); return redirect()->back(); } catch (Exception $ex) { return redirect()->back()->withErrors($ex->getMessage() . " In " . $ex->getFile() . " At Line " . $ex->getLine())->withInput(); } }
{ "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 ...
[ "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.5897...
0.0
-1
get returns after a listing has been made
public function get_item_return_details($dom, $sku, $item_id){ //push each entry into new array $update_item_array = array(); $update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_REVISE_INV_RESPONSE); foreach ($update_item_response as $item){ //ad sku to first entry of array array_push($update_item_array, $sku); array_push($update_item_array, $item_id); //errors $error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS); foreach ($error_messages as $errormsg){ $error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != "" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : "No Error"; array_push($update_item_array, $error); } } return $update_item_array; //DOM_ELEMENT_SHORT_ERROR_MSG }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listing();", "function listing() {\r\n\r\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 (...
[ "0.69911814", "0.69135123", "0.6191085", "0.61634105", "0.6106261", "0.6106261", "0.60919493", "0.6079555", "0.60730743", "0.60586506", "0.6057292", "0.5979495", "0.59759116", "0.5966504", "0.5867618", "0.58074546", "0.5806632", "0.58025557", "0.5796107", "0.5766682", "0.5763...
0.0
-1
get returns after a listing has been made
public function get_item_title_details($dom, $sku, $item_id){ //push each entry into new array $update_item_array = array(); $update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_REVISE_ITEM_RESPONSE); foreach ($update_item_response as $item){ //ad sku to first entry of array array_push($update_item_array, $sku); array_push($update_item_array, $item_id); //errors $error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS); foreach ($error_messages as $errormsg){ $error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != "" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : "No Error"; array_push($update_item_array, $error); } } return $update_item_array; //DOM_ELEMENT_SHORT_ERROR_MSG }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listing();", "function listing() {\r\n\r\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 (...
[ "0.69911814", "0.69135123", "0.6191085", "0.61634105", "0.6106261", "0.6106261", "0.60919493", "0.6079555", "0.60730743", "0.60586506", "0.6057292", "0.5979495", "0.59759116", "0.5966504", "0.5867618", "0.58074546", "0.5806632", "0.58025557", "0.5796107", "0.5766682", "0.5763...
0.0
-1
get returns after a listing has been made
public function get_item_remove_details($dom, $sku, $item_id){ //push each entry into new array $update_item_array = array(); $update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_END_ITEM_RESPONSE); foreach ($update_item_response as $item){ //ad sku to first entry of array array_push($update_item_array, $sku); array_push($update_item_array, $item_id); //errors $error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS); foreach ($error_messages as $errormsg){ $error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != "" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : "No Error"; array_push($update_item_array, $error); } } return $update_item_array; //DOM_ELEMENT_SHORT_ERROR_MSG }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listing();", "function listing() {\r\n\r\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 (...
[ "0.69911814", "0.69135123", "0.6191085", "0.61634105", "0.6106261", "0.6106261", "0.60919493", "0.6079555", "0.60730743", "0.60586506", "0.6057292", "0.5979495", "0.59759116", "0.5966504", "0.5867618", "0.58074546", "0.5806632", "0.58025557", "0.5796107", "0.5766682", "0.5763...
0.0
-1
get returns after a listing has been made
public function get_shipcost_details($dom, $sku, $item_id){ //push each entry into new array $update_item_array = array(); $update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_SHIPCOST_RESPONSE); foreach ($update_item_response as $item){ //ad sku to first entry of array array_push($update_item_array, $sku); array_push($update_item_array, $item_id); $costs = $item->getElementsByTagName(DOM_ELEMENT_SHIP_DETAILS); foreach ($costs as $costsmsg){ $serv_opts = $costsmsg->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_OPTIONS); foreach($serv_opts as $serv){ $costers = trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) != "" ? trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) : "No Cost Entered - Error"; array_push($update_item_array, $costers); } } //errors $error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS); foreach ($error_messages as $errormsg){ $error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != "" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : "No Error"; array_push($update_item_array, $error); } } return $update_item_array; //DOM_ELEMENT_SHORT_ERROR_MSG }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listing();", "function listing() {\r\n\r\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 (...
[ "0.69911814", "0.69135123", "0.6191085", "0.61634105", "0.6106261", "0.6106261", "0.60919493", "0.6079555", "0.60730743", "0.60586506", "0.6057292", "0.5979495", "0.59759116", "0.5966504", "0.5867618", "0.58074546", "0.5806632", "0.58025557", "0.5796107", "0.5766682", "0.5763...
0.0
-1
get returns after a listing has been made
public function get_promo_update_details($dom, $sku, $item_id){ //push each entry into new array $update_item_array = array(); $update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_ADD_PROMO_RESPONSE); foreach ($update_item_response as $item){ //ad sku to first entry of array array_push($update_item_array, $sku); array_push($update_item_array, $item_id); //errors $error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS); foreach ($error_messages as $errormsg){ $error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != "" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : "No Error"; array_push($update_item_array, $error); } } return $update_item_array; //DOM_ELEMENT_SHORT_ERROR_MSG }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listing();", "function listing() {\r\n\r\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 (...
[ "0.69911814", "0.69135123", "0.6191085", "0.61634105", "0.6106261", "0.6106261", "0.60919493", "0.6079555", "0.60730743", "0.60586506", "0.6057292", "0.5979495", "0.59759116", "0.5966504", "0.5867618", "0.58074546", "0.5806632", "0.58025557", "0.5796107", "0.5766682", "0.5763...
0.0
-1
get returns after a listing has been made
public function get_listings_details($dom){ //push each entry into new array $update_item_array = array(); $update_item_array['itemnumber'] = array(); $update_item_array['customlabel'] = array(); $update_item_array['quantity'] = array(); $update_item_array['quantitysoldandavailable'] = array(); $update_item_array['sellprice'] = array(); $update_item_array['starttime'] = array(); $update_item_array['endtime'] = array(); $update_item_array['itemtitle'] = array(); $update_item_array['stockcntrl'] = array(); $update_item_array['listingtype'] = array(); $update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_LISTINGSSHOW_RESPONSE); foreach ($update_item_response as $item){ $activelist = $item->getElementsByTagName(DOM_ELEMENT_LISTINGS_ACTIVELIST); foreach ($activelist as $activelistshow){ $itemarrays = $activelistshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMARRAY); foreach($itemarrays as $itemarray){ $inditems = $itemarray->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMSS); foreach($inditems as $inditemshow){ $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) : "Listing Type - Error"; array_push($update_item_array['listingtype'], $costers); $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) : "Item Num - Error"; array_push($update_item_array['itemnumber'], $costers); $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) : "SKU - Error"; array_push($update_item_array['customlabel'], $costers); $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) : "0"; array_push($update_item_array['quantity'], $costers); $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) : "0"; array_push($update_item_array['quantitysoldandavailable'], $costers); $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) : "price sold - Error"; array_push($update_item_array['sellprice'], $costers); $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) : "0"; array_push($update_item_array['starttime'], $costers); $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) : ""; array_push($update_item_array['endtime'], $costers); $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) : ""; array_push($update_item_array['itemtitle'], $costers); $costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) != "" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) : "FALSE"; array_push($update_item_array['stockcntrl'], $costers); } } } //errors $error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS); foreach ($error_messages as $errormsg){ $error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != "" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : "No Error"; array_push($update_item_array, $error); } } return $update_item_array; //DOM_ELEMENT_SHORT_ERROR_MSG }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listing();", "function listing() {\r\n\r\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 (...
[ "0.69911814", "0.69135123", "0.6191085", "0.61634105", "0.6106261", "0.6106261", "0.60919493", "0.6079555", "0.60730743", "0.60586506", "0.6057292", "0.5979495", "0.59759116", "0.5966504", "0.5867618", "0.58074546", "0.5806632", "0.58025557", "0.5796107", "0.5766682", "0.5763...
0.0
-1
Method to cancel an edit
public function cancelSection() { JRequest::checkToken() or jExit(JText::_('JInvalid_Token')); // Initialize variables. $app = &JFactory::getApplication(); $modelName = $app->getUserState('com_eve.roles.model'); $app->setUserState('com_eve.roles.model', null); $app->setUserState('com_eve.sectionCorporation.corporationID', null); $app->setUserState('com_eve.sectionCorporation.section', null); $model = &$this->getModel($modelName, 'EveModel'); $this->setRedirect(JRoute::_('index.php?option=com_eve&view=access', false)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancel()\n {\n $this->resetInput();\n $this-...
[ "0.7971961", "0.7971961", "0.7912603", "0.7880044", "0.77153593", "0.75337124", "0.7409863", "0.7395446", "0.7395446", "0.73497146", "0.7342042", "0.73310894", "0.72818875", "0.7216394", "0.70027643", "0.6968806", "0.6789235", "0.6731828", "0.6706536", "0.6681796", "0.6671871...
0.59457237
77
/ Method to cancel an edit
public function cancelSectionCorporation() { JRequest::checkToken() or jExit(JText::_('JInvalid_Token')); // Initialize variables. $app = &JFactory::getApplication(); $modelName = $app->getUserState('com_eve.roles.model'); $app->setUserState('com_eve.roles.model', null); $app->setUserState('com_eve.section.id', null); $model = &$this->getModel($modelName, 'EveModel'); $this->setRedirect(JRoute::_('index.php?option=com_eve&view=corporation&layout=edit', false)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancelEdit($data) {\n\t\t\n\t\t// Redirect back to the edit page\n\...
[ "0.7973752", "0.7973752", "0.79198354", "0.79074275", "0.7807706", "0.75633234", "0.73769945", "0.73651814", "0.7357975", "0.7357975", "0.7286203", "0.72808856", "0.72268707", "0.71638274", "0.69999546", "0.69441086", "0.68874484", "0.67438036", "0.67428577", "0.6693798", "0....
0.0
-1
Method to save a Section.
public function saveSection() { // Check for request forgeries. JRequest::checkToken() or jexit(JText::_('JInvalid_Token')); // Initialize variables. $app = &JFactory::getApplication(); $model = $this->getModel('Sectionroles'); $data = JRequest::getVar('jform', array(), 'post', 'array'); // Validate the posted data. $data = $model->validate($data); // Check for validation errors. if ($data === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if (JError::isError($errors[$i])) { $app->enqueueMessage($errors[$i]->getMessage(), 'notice'); } else { $app->enqueueMessage($errors[$i], 'notice'); } } // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_eve&view=roles&layout=edit', false)); return false; } // Attempt to save the character. $return = $model->save($data); if ($return === false) { // Save failed, go back to the character and display a notice. $message = JText::sprintf('JError_Save_failed', $model->getError()); $this->setRedirect('index.php?option=com_eve&view=roles&layout=edit', $message, 'error'); return false; } /* // Save succeeded, check-in the character. if (!$model->checkin()) { // Check-in failed, go back to the character and display a notice. $message = JText::sprintf('JError_Checkin_saved', $model->getError()); $this->setRedirect('index.php?option=com_eve&view=character&layout=edit', $message, 'error'); return false; } */ $this->setMessage(JText::_('JController_Save_success')); // Redirect the user and adjust session state based on the chosen task. switch (strtolower($this->_task)) { case 'applysection': // Redirect back to the edit screen. $app->setUserState('com_eve.section.id', $return); $this->setRedirect(JRoute::_('index.php?option=com_eve&view=roles&layout=edit', false)); break; default: // Clear the member id and data from the session. $app->setUserState('com_eve.roles.model', null); $app->setUserState('com_eve.section.id', null); $app->setUserState('com_eve.section.data', null); // Redirect to the list screen. $this->setRedirect(JRoute::_('index.php?option=com_eve&view=access', false)); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n {\n return $this->write($this->filename, $this->sections);\n }", "public function store(SectionRequest $request)\n {\n $section = new Section($request->all());\n $section->school_id = session('current_school');\n $section->save();\n return redi...
[ "0.7178136", "0.6470738", "0.637008", "0.63407415", "0.6306735", "0.62149984", "0.60658956", "0.6033704", "0.6002403", "0.58844393", "0.5856264", "0.5821594", "0.5803537", "0.5745109", "0.5741303", "0.5741133", "0.5724405", "0.57226545", "0.5715549", "0.56910145", "0.56159", ...
0.6468554
2
Method to save a Section.
public function saveSectionCorporation() { // Check for request forgeries. JRequest::checkToken() or jexit(JText::_('JInvalid_Token')); // Initialize variables. $app = &JFactory::getApplication(); $model = $this->getModel('SectionCorporationRoles'); $data = JRequest::getVar('jform', array(), 'post', 'array'); // Validate the posted data. $data = $model->validate($data); // Check for validation errors. if ($data === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if (JError::isError($errors[$i])) { $app->enqueueMessage($errors[$i]->getMessage(), 'notice'); } else { $app->enqueueMessage($errors[$i], 'notice'); } } // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_eve&view=roles&layout=edit', false)); return false; } // Attempt to save the character. $return = $model->save($data); if ($return === false) { // Save failed, go back to the character and display a notice. $message = JText::sprintf('JError_Save_failed', $model->getError()); $this->setRedirect('index.php?option=com_eve&view=roles&layout=edit', $message, 'error'); return false; } /* // Save succeeded, check-in the character. if (!$model->checkin()) { // Check-in failed, go back to the character and display a notice. $message = JText::sprintf('JError_Checkin_saved', $model->getError()); $this->setRedirect('index.php?option=com_eve&view=character&layout=edit', $message, 'error'); return false; } */ $this->setMessage(JText::_('JController_Save_success')); // Redirect the user and adjust session state based on the chosen task. switch (strtolower($this->_task)) { case 'applysectioncorporation': // Redirect back to the edit screen. $app->setUserState('com_eve.sectionCorporation.corporationID', $data['corporationID']); $app->setUserState('com_eve.sectionCorporation.section', $data['section']); $this->setRedirect(JRoute::_('index.php?option=com_eve&view=roles&layout=edit', false)); break; default: // Clear the member id and data from the session. $app->setUserState('com_eve.roles.model', null); $app->setUserState('com_eve.sectionCorporation.corporationID', null); $app->setUserState('com_eve.sectionCorporation.section', null); // Redirect to the list screen. $this->setRedirect(JRoute::_('index.php?option=com_eve&task=corporation.edit&corporationID='.$data['corporationID'], false)); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n {\n return $this->write($this->filename, $this->sections);\n }", "public function store(SectionRequest $request)\n {\n $section = new Section($request->all());\n $section->school_id = session('current_school');\n $section->save();\n return redi...
[ "0.7178136", "0.6470738", "0.6468554", "0.637008", "0.63407415", "0.6306735", "0.62149984", "0.60658956", "0.6033704", "0.6002403", "0.58844393", "0.5856264", "0.5821594", "0.5803537", "0.5745109", "0.5741303", "0.5741133", "0.5724405", "0.57226545", "0.5715549", "0.56910145"...
0.54651827
54
/ viewAddResources Renders the add resources page
public function viewAddResources() { echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/edit-resources.php'); echo Template::instance()->render('view/include/footer.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_resources()\n\t{\n\t\t\n\t}", "public function actionAdd()\n\t{\n\t\t$this->render('add');\n\t}", "public function postAddResource()\n {\n\n $errors = validateAddResources();\n\n if(!($errors === true)) {\n\n $this->_f3->set('errors', $errors);\n echo ...
[ "0.70956415", "0.686092", "0.67862123", "0.66067195", "0.65433717", "0.6538168", "0.6532919", "0.6522265", "0.6388805", "0.63888025", "0.62770903", "0.6261078", "0.62582153", "0.6235059", "0.6217802", "0.6195584", "0.61924314", "0.6179709", "0.61661065", "0.6148068", "0.61478...
0.79143375
0
/ viewEditResources Loads a specific resource for editing and renders the edit resources page
public function viewEditResources() { $database = new Database(); $id = $this->_params['id']; $resource = $database->getResourceById($id); $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description'] , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] , $resource['Link'], $resource['active']); $this->_f3->set('Resource', $availableResource); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/edit-resources.php'); echo Template::instance()->render('view/include/footer.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function postEditResources()\n {\n $id = $this->_params['id'];\n\n $errors = validateEditResource($id);\n\n if(!($errors === true)) {\n $database = new Database();\n\n $resource = $database->getResourceById($id);\n /*construct($resourceID = \"0\", $re...
[ "0.7460722", "0.69512355", "0.68485713", "0.6796208", "0.67901796", "0.67579526", "0.67425245", "0.6713578", "0.6629987", "0.6572274", "0.6498282", "0.64602315", "0.6423282", "0.6422785", "0.6415895", "0.6414357", "0.64009565", "0.63885695", "0.63796145", "0.6374096", "0.6373...
0.8596455
0
/ postAddResource Checks to see if the user data is valid if so it will add it to the DB if the user data is invalid will reload the add user page.
public function postAddResource() { $errors = validateAddResources(); if(!($errors === true)) { $this->_f3->set('errors', $errors); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/edit-resources.php'); echo Template::instance()->render('view/include/footer.php'); } else { $this->_f3->reroute('/Admin'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function post_add_users() {\n\t}", "public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n...
[ "0.6500552", "0.6489134", "0.6451038", "0.6303201", "0.61842513", "0.6104865", "0.6099151", "0.605396", "0.6046741", "0.603245", "0.59373516", "0.59210557", "0.59074485", "0.59061795", "0.59047186", "0.5889217", "0.58758897", "0.5873581", "0.58488464", "0.5834428", "0.5826928...
0.70471954
0