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
Permission not linked with this profile
public function permissionsAvailable($filter = null) { $permissions = Permission::whereNotIn('permissions.id', function($query) { $query->select('permission_role.permission_id'); $query->from('permission_role'); $query->whereRaw("permission_role.role_id={$this->id}"); }) ->where(function ($queryFilter) use ($filter) { if ($filter) $queryFilter->where('permissions.name', 'LIKE', "%{$filter}%"); }) ->paginate(); return $permissions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function permissions() {\r\n\t\treturn false;\r\n\t}", "protected function getCurrentPermission() {}", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "protected function fixPermi...
[ "0.66033596", "0.6342334", "0.631757", "0.631757", "0.631757", "0.631757", "0.631757", "0.63036233", "0.6260023", "0.6201802", "0.6152378", "0.61147827", "0.6084393", "0.6023199", "0.5998642", "0.5976748", "0.58997715", "0.589125", "0.5869823", "0.58655125", "0.5861333", "0...
0.0
-1
Getters and Setters Get the representative
function &getRepresentative() { return $this->_representative; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "public function get_superficie(){ return $this->_superficie;}", "abstract public function g...
[ "0.6536918", "0.6536918", "0.6536918", "0.6536918", "0.6536918", "0.6536918", "0.6421507", "0.6376491", "0.62641203", "0.62633926", "0.6224822", "0.6180357", "0.6159016", "0.6148007", "0.6108451", "0.6107597", "0.60961473", "0.60827214", "0.6051411", "0.604969", "0.604443", ...
0.68535274
0
Overridden template methods Initialize form data from the representative entry.
function initData() { $representative =& $this->getRepresentative(); if ($representative) { $this->_data = array( 'representativeId' => $representative->getId(), 'role' => $representative->getRole(), 'representativeIdType' => $representative->getRepresentativeIdType(), 'representativeIdValue' => $representative->getRepresentativeIdValue(), 'name' => $representative->getName(), 'phone' => $representative->getPhone(), 'fax' => $representative->getFax(), 'email' => $representative->getEmail(), 'url' =>$representative->getUrl(), 'isSupplier' => $representative->getIsSupplier(), ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function populateForm() {}", "function form_init_data()\r\n {\r\n // Initialize the form fields\r\n\r\n $this->set_hidden_element_value(\"_action\", FT_ACTION_ADD) ;\r\n\r\n $this->set_element_value(\"Meet Start\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"...
[ "0.699834", "0.6687139", "0.6514736", "0.6486754", "0.6485428", "0.6310033", "0.6254733", "0.6198665", "0.61752015", "0.6124816", "0.61114603", "0.6106294", "0.6097164", "0.6070012", "0.6039383", "0.60147935", "0.59728515", "0.5940988", "0.5937115", "0.59309214", "0.5920533",...
0.609098
13
Assign form data to usersubmitted data.
function readInputData() { $this->readUserVars(array( 'representativeId', 'agentRole', 'supplierRole', 'representativeIdType', 'representativeIdValue', 'name', 'phone', 'fax', 'email', 'url', 'isSupplier', )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setSubmittedValues()\n {\n if ( $this->setFundraiserId() ) {\n $this->setFundraiserProfile(); \n }\n\n $this->setAmount();\n \n $this->setFirstName();\n $this->setLastName();\n $this->setEmail();\n $this->setTelephone();\n ...
[ "0.6879008", "0.67440283", "0.6742243", "0.67021453", "0.66969603", "0.666315", "0.6487733", "0.6458788", "0.63520545", "0.63301873", "0.63288194", "0.62586707", "0.6256629", "0.62461996", "0.624598", "0.6236322", "0.6232091", "0.61999315", "0.6168742", "0.616817", "0.61649",...
0.0
-1
The followings are the available columns in table 'tbl_audit_trail':
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WriteAuditTrailOnAdd(&$rs) {\n\t\tglobal $mst_vendor;\n\t\t$table = 'mst_vendor';\n\n\t\t// Get key value\n\t\t$key = \"\";\n\t\tif ($key <> \"\") $key .= EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$key .= $rs['kode'];\n\n\t\t// Write Audit Trail\n\t\t$filePfx = \"log\";\n\t\t$curDate = date(\"Y/m/d\");\n\t\t$curTi...
[ "0.58903563", "0.5804952", "0.5765722", "0.5761494", "0.5751377", "0.5745253", "0.57414013", "0.57055414", "0.5587757", "0.55292755", "0.55138564", "0.5485987", "0.54815865", "0.54543823", "0.5400708", "0.5376485", "0.536115", "0.5356386", "0.5327246", "0.5315218", "0.5303601...
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search($options = array()) { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('old_value',$this->old_value,true); $criteria->compare('new_value',$this->new_value,true); $criteria->compare('action',$this->action,true); $criteria->compare('model',$this->model); $criteria->compare('field',$this->field,true); $criteria->compare('stamp',$this->stamp,true); $criteria->compare('username',$this->username); $criteria->compare('model_id',$this->model_id); $criteria->order='t.id desc'; $criteria->mergeWith($this->getDbCriteria()); return new CActiveDataProvider( get_class($this), array_merge( array( 'criteria'=>$criteria, ), $options ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('w...
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.597930...
0.0
-1
Display a listing of the resource.
public function index() { $fuels = Fuel::all(); $generators = Generator::where('status', 0)->get(); $assets = Asset::where('status', 0)->get(); return view('Generator.index',compact('generators', 'assets', 'fuels')); }
{ "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() { $generators = Generator::where('status', 0)->get(); $assets = Asset::where('status', 0)->get(); return view('Generator.index',compact('generators')); }
{ "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(Request $request) { $validatedData = $request->validate([ 'model' => 'required', 'capacity' => 'required', 'manufacturing_date' => 'required', 'first_used_date' => 'required', 'first_odometer' => 'required', 'asset_id' => 'required', ]); $generator = new Generator(); $generator->model = $request['model']; $generator->capacity = $request['capacity']; $generator->manufacturing_date = $request['manufacturing_date']; $generator->first_used_date = $request['first_used_date']; $generator->first_odometer = $request['first_odometer']; $generator->asset_id = $request['asset_id']; $generator->save(); activity()->log('Added new Generator '.$request['model'].' capacity '.$request['capacity']); return redirect()->route('generator.index')->with('success','Generator added 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($id) { $generators = Generator::find($id); $receivings = Receiving::all(); $receivedId = $generators->receiving_id; return view('Generator.show',compact('generators', 'receivings')); }
{ "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) { $generator = Generator::find($id); $generator_asset_id = $generator->asset_id; $generator_asset = Asset::find($generator_asset_id); $assets = Asset::all(); // $vehicled_driver_id = $vehicle->driver_id; // $vehicled_driver = Driver::find($vehicled_driver_id); // $drivers = Driver::all(); return view('Generator.edit',compact('generator','generator_asset','assets','generator')); }
{ "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(Request $request, $id) { $validatedData = $request->validate([ 'model' => 'required', 'capacity' => 'required', 'manufacturing_date' => 'required', 'first_used_date' => 'required', 'first_odometer' => 'required', /* 'asset_id' => 'required', */ ]); $generator = Generator::find($id); $generator_asset_id = $generator->asset_id; $generator->model = $request['model']; $generator->capacity = $request['capacity']; $generator->manufacturing_date = $request['manufacturing_date']; $generator->first_used_date = $request['first_used_date']; $generator->manufacturing_date = $request['manufacturing_date']; $generator->first_odometer = $request['first_odometer']; $generator_asset_id = $request['asset_id']; if($generator_asset_id !=NULL){ $generator->asset_id = $generator_asset_id; } $generator->save(); activity()->log('Edited Generator '.$request['model'].' informations with '.$request['capacity'].' capacity '); return redirect()->route('generator.index')->with('success', 'Generator 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($id) { $generator = Generator::find($id); activity()->log('Deleted Generator '.$generator->model.' with '.$generator->capacity.' capacity '); $generator->delete(); return redirect()->route('generator.index')->with('success', 'Generator 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
The query report function
function report(&$irc, &$data) { global $adminchannel; global $users; $input = explode(" ", $data->message); //Report command - used by normal players to report another player to the admins if(strtolower(substr($data->message, 0, 7)) == "!report") { //If a nick was entered $input = explode(" ", $data->message); if($input[1] != "") { //If the user is in the channel if($users->is_added($users->nicktoqauth($input[1])) == true) { $reasoncheck = $input[0] . " " . $input[1]; $reason = str_replace($reasoncheck, "", $data->message); if($reason != "") { //Tell user the report is successful $irc->message(SMARTIRC_TYPE_QUERY, $data->nick, "\x0302,00Report: The user has been successfully reported to the admins"); //Tell the admins in the admin channel $irc->message(SMARTIRC_TYPE_CHANNEL, $adminchannel, "\x02\x0304Report:\x02\x03 ".$data->nick." reported ".$input[1]." (via PM) for:".$reason); //Record in MySQL mysql_pu_addreport($data->nick, $input[1], $reason); } else { $irc->message(SMARTIRC_TYPE_QUERY, $data->nick, "\x0302,00Report: Please enter a reason when attempting to report another player"); } } else { $irc->message(SMARTIRC_TYPE_QUERY, $data->nick, "\x0302,00Report: The person you reported is not invited to this pickup, please double-check you entered the name correctly"); } } else { $irc->message(SMARTIRC_TYPE_QUERY, $data->nick, "\x0302,00Report: !report <nick> <reason>"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getReport() ;", "public function get_query_log()\n {\n }", "public function reportListing()\n {\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.r...
[ "0.69480157", "0.6880098", "0.68651414", "0.68444467", "0.6816307", "0.66602457", "0.66602457", "0.66305923", "0.65538704", "0.6512989", "0.64980054", "0.64923275", "0.64923275", "0.6384686", "0.6371433", "0.6369469", "0.6353576", "0.6353576", "0.6346453", "0.6346453", "0.634...
0.0
-1
A user has typed something
function user_active(&$irc, &$data) { global $users; global $pickupchannel; global $pickup; //Remind the user they are added if((time() - $users->last_active($users->nicktoqauth($data->nick))) > 360) { if($pickup->is_added($users->nicktoqauth($data->nick))) { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": Remember you are added to this pickup. If you can't play type !del"); } } $users->user_active($data->nick); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cli_keyboardInput() {}", "public function getUserInput()\n {\n // TODO: Implement getUserInput() method.\n }", "public function getUserInput()\n {\n // TODO: Implement getUserInput() method.\n }", "public function getInput();", "public function getInput();", "pub...
[ "0.6223841", "0.59488744", "0.59488744", "0.5884164", "0.5884164", "0.5884164", "0.58016026", "0.5791626", "0.5745689", "0.56747735", "0.56547093", "0.5634551", "0.56049377", "0.5524392", "0.5509945", "0.5422995", "0.5338059", "0.5336933", "0.5329342", "0.53264594", "0.531978...
0.0
-1
Check user list on join
function init_names(&$irc, &$data) { //Bring variables into scope global $users; global $PickupBot; global $queue; global $pickupchannel; $userlist = array(); //Unregister name list hook $irc->unregisterActionhandler(SMARTIRC_TYPE_NAME, '', &$PickupBot, 'init_names'); //Issue whois on names $counter = 0; $size = count($data->messageex); while($counter < $size) { $input = str_replace("@", "", $data->messageex[$counter]); $input = str_replace("+", "", $input); array_push($userlist, $input); $counter++; } //Add check commands to the Queue $counter = 0; while($counter < $size) { if($userlist[$counter] !== "Q") { $queue->add_item($userlist[$counter], "check"); $irc->whois($userlist[$counter]); } $counter++; } $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x02\x0302,00Bot initialised!"); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "NOW WITH A NEW VANILLA FLAVOUR"); init_hooks(); DisablePickup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loginUserConditionMatchesMultipleLoggedInUsers() {}", "public function loginUserConditionMatchesMultipleLoggedInUsers() {}", "public function get_user_list($list){\n if(get_instance()->ecl('Instance')->mod('lists', 'if_user_has_list', [get_instance()->ecl('Instance')->user(),$list,'email...
[ "0.67944664", "0.6793565", "0.6751185", "0.6268942", "0.6207929", "0.61670244", "0.6135367", "0.61185694", "0.60294163", "0.600132", "0.5988337", "0.5987466", "0.59751683", "0.59295964", "0.5924153", "0.58977383", "0.5889871", "0.58772075", "0.58542055", "0.58370394", "0.5831...
0.0
-1
Bring variables into scope
function join(&$irc, &$data) { global $pickupchannel; global $adminchannel; global $pickup; global $queue; global $chanjoin; global $ircinfo; //Check if this is the bot itself joining if($chanjoin < 3) { //Check if this is the pickup channel if($data->channel == $ircinfo->pickupchan) { //Join the bot and admin channel $irc->join($ircinfo->adminchan, $ircinfo->adminchan_pass); $irc->join($ircinfo->botchan, $ircinfo->botchan_pass); //Names the pickup channel $irc->names($ircinfo->pickupchan); } //Increment the channel join counter $chanjoin++; } else { //Get data to variables $nick = $data->nick; //Add user check to the queue $queue->add_item($nick, "check"); //Issue whois $irc->whois($nick); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "protected function initVars() {\n\n\t\t}", "protected function constructScopes() {}", "protected function init()\n...
[ "0.6641644", "0.64826626", "0.63503706", "0.6087459", "0.601733", "0.59810543", "0.59457684", "0.58883715", "0.5882299", "0.5871234", "0.58675045", "0.5817405", "0.57688063", "0.56937355", "0.5668305", "0.56221455", "0.5615361", "0.56122386", "0.5597342", "0.55550665", "0.555...
0.0
-1
Bring variables into scope
function nick_change(&$irc, &$data) { global $pickup; global $users; global $pickupstatus; $users->nick_change($data->nick, $data->message); $pickup->nick_change($data->nick, $data->message); //Update topic if($pickup->is_added($users->nicktoqauth($data->nick)) == true) { if($pickupstatus === true) { SetTopic(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "protected function initVars() {\n\n\t\t}", "protected function constructScopes() {}", "protected function init()\n...
[ "0.6641644", "0.64826626", "0.63503706", "0.6087459", "0.601733", "0.59810543", "0.59457684", "0.58883715", "0.5882299", "0.5871234", "0.58675045", "0.5817405", "0.57688063", "0.56937355", "0.5668305", "0.56221455", "0.5615361", "0.56122386", "0.5597342", "0.55550665", "0.555...
0.0
-1
Bring variables intro scope
function leave(&$irc, &$data) { global $pickup; global $users; global $irc; global $pickupchannel; global $pickup; global $pickupstatus; //Get data $nick = $data->nick; $qauth = $users->nicktoqauth($nick); //Remove from pickup if($pickup->is_added($qauth) == true) { $pickup->rm_player($qauth); SetTopic(); } //Mark the user out the channel $users->mark_outchannel($qauth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initVars() {\n\n\t\t}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_a...
[ "0.6239318", "0.60357803", "0.6015769", "0.59770525", "0.5899266", "0.5839367", "0.58005595", "0.57610434", "0.56655604", "0.5633504", "0.56105554", "0.5561419", "0.5555634", "0.5545249", "0.55423653", "0.5534709", "0.55232894", "0.54867923", "0.547725", "0.5475054", "0.54621...
0.0
-1
Bring variables intro scope
function quit(&$irc, &$data) { global $pickup; global $users; global $irc; global $pickupchannel; global $pickup; global $pickupstatus; //Get data $nick = $data->nick; $qauth = $users->nicktoqauth($nick); //Remove from pickup if($pickup->is_added($qauth)) { $pickup->rm_player($qauth); SetTopic(); } //Mark the user out the channel $users->mark_outchannel($qauth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initVars() {\n\n\t\t}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_a...
[ "0.6239318", "0.60357803", "0.6015769", "0.59770525", "0.5899266", "0.5839367", "0.58005595", "0.57610434", "0.56655604", "0.5633504", "0.56105554", "0.5561419", "0.5555634", "0.5545249", "0.55423653", "0.5534709", "0.55232894", "0.54867923", "0.547725", "0.5475054", "0.54621...
0.0
-1
Bring variables into scope
function whois_queue(&$irc, &$data) { global $pickupchannel; global $pickup; global $queue; global $users; global $invites; global $bans; //print_r($data); //print_r($queue); //Check for commands on queue if($data->rawmessageex[1] == "330") { if($queue->get_item($data->rawmessageex[3]) != false) { //Shift the command off the queue $queue_item = $queue->get_item($data->rawmessageex[3]); $qauth = $data->rawmessageex[4]; //Take Queue info to variables $map = $queue_item["map"]; $nick = $queue_item["nick"]; $class = $queue_item["class"]; //Queue command switch switch($queue_item["command"]) { case "check": //Check if the user is on the invite list if($users->is_added($qauth) == true) { if($users->is_banned($qauth) == false) { //Update nick on users $users->nick_change_join($qauth, $nick); $users->mark_inchannel($qauth); } else { $irc->message(SMARTIRC_TYPE_QUERY, "Q", "TEMPBAN ".$pickupchannel." *!*@".$qauth.".users.quakenet.org 1m You have been banned from this channel: ".$bans->info($qauth)->reason); } } else { //Temp ban the user //$irc->message(SMARTIRC_TYPE_QUERY, "Q", "TEMPBAN ".$pickupchannel." *!*@".$qauth.".users.quakenet.org 1m This is an invite-only pickup."); NewUser($qauth, $nick); } break; } } //Invite queue check $info = $invites->info($data->rawmessageex[3]); if($info->nick == $data->rawmessageex[3]) { if($users->is_added($data->rawmessageex[4])) { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00The user \"".$info->nick."\" is already added to this pickup channel"); } else { //Add qauth as stage2 $invites->stage2($info->nick, $data->rawmessageex[4], $data->rawmessageex[3]); } } } //No Such Nick reply from WHOIS if($data->rawmessageex[1] == "401") { $info = $invites->info($data->rawmessageex[3]); if($info->nick == $data->rawmessageex[3]) { //Inform the channel that the user does not exist $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00No user with the nick \"".$info->nick."\" exists on quakenet. Please check again."); //And delete the invite $invites->rm_invite($data->rawmessageex[3]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "protected function initVars() {\n\n\t\t}", "protected function constructScopes() {}", "protected function init()\n...
[ "0.6641644", "0.64826626", "0.63503706", "0.6087459", "0.601733", "0.59810543", "0.59457684", "0.58883715", "0.5882299", "0.5871234", "0.58675045", "0.5817405", "0.57688063", "0.56937355", "0.5668305", "0.56221455", "0.5615361", "0.56122386", "0.5597342", "0.55550665", "0.555...
0.0
-1
Bring variables into scope
function whois_check(&$irc, &$data) { global $pickupchannel; global $pickup; global $queue; global $users; //Check for commands on queue if($data->rawmessageex[1] == "330") { if($queue[$data->rawmessageex[3]][0]["nick"] == $data->rawmessageex[3]) { //Get qauth and nick $nick = $data->rawmessageex[3]; $qauth = $data->rawmessageex[4]; //Check the queue if($users->is_banned($qauth)) { if($queue[$data->rawmessageex[3]][0]["command"] == "check") { //Check if the user is in the database if($users->is_added($qauth) == false) { $irc->message(SMARTIRC_TYPE_QUERY, "Q", "TEMPBAN ".$pickupchannel." *!*@".$qauth.".users.quakenet.org 1m This is an invite-only pickup."); //$irc->kick($pickupchannel, $nick, "This is an invite-only pickup."); //Remove command array_shift($queue[$nick]); } else { if($users->is_banned($qauth) === false) { $users->nick_change_join($qauth, $nick); $users->mark_inchannel($qauth); array_shift($queue[$nick]); } else { $irc->message(SMARTIRC_TYPE_QUERY, "Q", "TEMPBAN ".$pickupchannel." *!*@".$qauth.".users.quakenet.org 1m This is an invite-only pickup."); array_shift($queue[$nick]); } } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "protected function initVars() {\n\n\t\t}", "protected function constructScopes() {}", "protected function init()\n...
[ "0.6641644", "0.64826626", "0.63503706", "0.6087459", "0.601733", "0.59810543", "0.59457684", "0.58883715", "0.5882299", "0.5871234", "0.58675045", "0.5817405", "0.57688063", "0.56937355", "0.5668305", "0.56221455", "0.5615361", "0.56122386", "0.5597342", "0.55550665", "0.555...
0.0
-1
Get the command from the input
function ChannelSay(&$irc, &$data) { $input = strtolower($data->message); $input = str_replace("!", "", $input); $command = explode(" ", $input, 2); global $pickupchannel; global $pickup; global $queue; global $users; global $waitbot; global $afk; global $classflood; global $startstatus; $nick = $data->nick; switch($command[0]) { //Admin remove user from pickup command case "adel": if($users->is_admin($data->nick)) { //Get entered nick $user = explode(" ", $data->message); $user = $user[1]; if($user != "") { $userq = $users->nicktoqauth($user); if($userq != false) { rm_player($userq); //Kill the pickup start process if this person was 12th if($waitbot->status == true) { if($waitbot->type > 0) { $waitbot->KillBot(); global $afk; } $afk->clear(); } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->message, "\x0302,00".$data->nick.": The user you entered could not be found"); } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->message, "\x0302,00!adel: Admin Delete Command: !adel <nick>"); } } break; //Add as Scout case "sc": case "sco": case "scout": case "scoot": if($pickup->count_class("scout") < 4) { $nick = $data->nick; $class = "scout"; $map = $command[1]; $qauth = $users->nicktoqauth($nick); //Check if this player has not hit flood //Perform a whois check if qauth is false if($qauth == false) { $queue->add_item($data->nick, "check"); $irc->whois($data->nick); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have 2 logins with your Q account in this channel, if you definitely wish to add, type the command again"); } else { //Add the player add_player($qauth, $nick, $class, 2 ,$map); //Check if the pickup is now full if($pickup->player_count() == 12) { start_pickup_s1(); } } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Sorry ".$data->nick.", All of the scout spots are already filled. :("); //Check if the pickup is now full /*if($pickup->player_count() == 12) { start_pickup_s1(); }*/ } break; //Add as Soldier case "sol": case "soldier": case "sold": case "soulja": case "soli": case "solli": case "solly": if($pickup->count_class("soldier") < 4) { $nick = $data->nick; $class = "soldier"; $map = $command[1]; $qauth = $users->nicktoqauth($nick); //Perform a whois check if qauth is false if($qauth == false) { $queue->add_item($data->nick, "check"); $irc->whois($data->nick); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have 2 logins with your Q account in this channel, try to add again"); } else { //Add the player add_player($qauth, $nick, $class, 2, $map); //Check if the pickup is now full if($pickup->player_count() == 12) { start_pickup_s1(); } } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Sorry ".$data->nick.", All of the soldier spots are already filled. :("); } break; //Add as Demoman case "de": case "dem": case "demo": case "demoman": case "negro": if($pickup->count_class("demoman") < 2) { $nick = $data->nick; $class = "demoman"; $map = $command[1]; $qauth = $users->nicktoqauth($nick); //Perform a whois check if qauth is false if($qauth == false) { $queue->add_item($data->nick, "check"); $irc->whois($data->nick); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have 2 logins with your Q account in this channel, try to add again"); } else { //Add the player add_player($qauth, $nick, $class, 2, $map); //Check if the pickup is now full if($pickup->player_count() == 12) { start_pickup_s1(); } } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Sorry ".$data->nick.", All of the demo spots are already filled. :("); } break; //Add as Medic case "med": case "medic": case "madic": if($pickup->count_class("medic") < 2) { $nick = $data->nick; $class = "medic"; $map = $command[1]; $qauth = $users->nicktoqauth($nick); //Perform a whois check if qauth is false if($qauth == false) { $queue->add_item($data->nick, "check"); $irc->whois($data->nick); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have 2 logins with your Q account in this channel, try to add again"); } else { //Add the player add_player($qauth, $nick, $class, 2, $map); //Check if the pickup is now full if($pickup->player_count() == 12) { start_pickup_s1(); } } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Sorry ".$data->nick.", All of the medic spots are already filled. :("); } break; //Delete from the pickup case "del": case "delete": case "rem": case "remove": $nick = $data->nick; $qauth = $users->nicktoqauth($nick); rm_player($qauth); //Kill the pickup start process if this person was 12th if($waitbot->status == true) { if($waitbot->type > 0) { $waitbot->KillBot(); global $afk; } } $afk->clear(); break; //Map Vote case "map": case "vote": $nick = $data->nick; $qauth = $users->nicktoqauth($nick); $map = $command[1]; //Check if the user was added if($pickup->is_added($qauth) == true) { //Change topic if this map was not already voted for if($pickup->mapvote($qauth, find_map($map)) != true) { SetTopic(); } } break; case "rdy": case "ready": if($waitbot->status == true) { if($waitbot->type == 1) { //Check if the user was marked as afk if($afk->is_afk($users->nicktoqauth($data->nick))) { $afk->rm_player($users->nicktoqauth($data->nick)); } //Check if everyone has now readied up if(count($afk->afklist) == 0) { //Run straight to stage 2 start_pickup_s2(); } else { rupmessage(); } } } break; case "afk": if($waitbot->status == false) { //Mark the user afk $users->mark_afk($users->nicktoqauth($data->nick)); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have been marked as afk, simply type something in the channel to be marked as back."); } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You cannot mark yourself as afk during this time"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function command()\n {\n return $this->parseCommand()[0];\n }", "public function getCommand() {}", "public function getCommand(string $command);", "public function getCommand();", "private function get_command(){\n if (!isset($_POST['command'])) {\n die(\"No command re...
[ "0.7548257", "0.7465151", "0.7457068", "0.74011767", "0.73530495", "0.7253527", "0.7126704", "0.71205306", "0.7037723", "0.6936631", "0.69175893", "0.69175893", "0.6888208", "0.68816423", "0.6867757", "0.6867757", "0.6867757", "0.6867757", "0.68676025", "0.6865471", "0.686547...
0.0
-1
Get the command from the input
function info(&$irc, &$data) { $command = explode(" ", $data->message); $command[0] = strtolower($command[0]); $command[0] = str_replace("!", "", $command[0]); global $pickupchannel; global $pickup; global $queue; global $skill; global $messages; global $users; global $invites; global $messageflood; global $skillstack; $nick = $data->nick; //Check for set message command if($command[0] == "setmessage") { //Check if issuer was an admin if($users->is_admin($nick)) { $new_command = strtolower($command[1]); $preload = "!setmessage ".$command[1]." "; $new_message = str_replace($preload, "", $data->message); if(isset($command[1]) || ($command[1] != "")) { if(isset($command[2]) || ($command[2] != "")) { //Check if it exists $counter1 = 0; $exists = false; while($counter1 < count($messages)) { if($messages[$counter1]["command"] == $new_command) { $exists = $counter1; $counter1 = count($messages) + 1; } $counter1++; } if($exists === false) { $position = count($messages); $messages[$position]["command"] = $new_command; $messages[$position]["message"] = $new_message; //Add to MySQL mysql_pu_addmessage($new_command, $new_message); //Inform the channel $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00New message successfully added: !".$new_command); } else { $messages[$exists]["message"] = $new_message; //Update on MySQL mysql_pu_updatemessage($new_command, $new_message); //Inform the channel $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Existing message successfully updated: !".$new_command); } //Change input so the new command will be displayed $command[0] = $new_command; } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00No Message was entered"); } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00No command was entered"); } } } //Check for delete message command if($command[0] == "delmessage") { //Check if issuer was an admin if($users->is_admin($nick)) { $old_command = strtolower($command[1]); //Check if it exists $counter1 = 0; $exists = false; while($counter1 < count($messages)) { if($messages[$counter1]["command"] == $old_command) { $exists = $counter1; $counter1 = count($messages) + 1; } $counter1++; } if($exists === false) { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00No such message exists: !".$old_command); } else { //Remove from the messages list $messages[$exists]["command"] = ""; $messages[$exists]["message"] = ""; //Check if the array should be re-oredered $counter2 = $exists + 1; $messages_size = count($messages); if($counter2 < $messages_size) { $counter3 = $exists; while($counter2 < $messages_size) { $messages[$counter3]["command"] = $messages[$counter2]["command"]; $messages[$counter3]["message"] = $messages[$counter2]["message"]; $messages[$counter2]["command"] = ""; $messages[$counter2]["message"] = ""; //Unset $counter2 element if it is the end of the array $unset = $counter2 + 1; if(($unset) == $messages_size) { unset($messages[$counter2]); } //Increment both counters $counter2++; $counter3++; } } else { //Unset current position unset($messages[$exists]); } //Remove in MySQL mysql_pu_delmessage($old_command); //Inform the channel $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Successfully deleted message: !".$old_command); } } } //////////////////////////////////////////////// //This functionality has now been replaced by MessageBot (messagebot.php) //!skill command to let players see their skill rating in the bot /*if(strtolower($command[0]) == "skill") { if($command[1] == "") { $user = $nick; $user = $users->nicktoqauth($nick); } else { if($users->nicktoqauth($command[1]) != false) { $user = $users->nicktoqauth($command[1]); } } //Get the players skill as each class $scout = $users->Get_Skill($user, "scout"); $demo = $users->get_skill($user, "demo"); $soldier = $users->get_skill($user, "soldier"); $medic = $users->get_skill($user, "medic"); //Create output message $output = "\x0302,00\x02Skill:\x02 " . $users->qauthtonick($user) . " || Scout: ".$scout." / Demo: ".$demo." / Soldier: ".$soldier." / Medic: ".$medic; //Check spam class if($skillstack->trigger($user) == true) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $output); } }*/ if(strtolower($command[0]) == "matches") { //Look up match info from web server $stats = file_get_contents("http://pickup.pixelgaming.eu/dynamic.php?job=stats"); $stats = explode(":", $stats); $stats = $stats[0]; //Generate output $output = "\x0302,00" . $stats . " matches have been played since 8th February 2011"; //Check messageflood if((time() - $messageflood['matches']) > 20) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $output); } $messageflood['matches'] = time(); } if(strtolower($command[0]) == "players") { //Look up match info from web server $stats = file_get_contents("http://pickup.pixelgaming.eu/dynamic.php?job=stats"); $stats = explode(":", $stats); $stats = $stats[1]; //Generate output $output = "\x0302,00There are currently " . $stats . " players invited to this channel"; //Check messageflood if((time() - $messageflood['players']) > 20) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $output); } $messageflood['players'] = time(); } //Change command name for some commonly used commands switch($command[0]) { case "mum": case "voice": case "vent": case "ventrilo": case "ventrillo": $command[0] = "mumble"; break; case "req": case "reqs": case "requis": case "requi": case "requirements": $command[0] = "requirements"; break; case "rule": case "rul": case "ruls": $command[0] = "rules"; break; } //Check message array and display if it matches /*$counter = 0; while($counter < count($messages)) { if($messages[$counter]["command"] == $command[0]) { //Check messages anti flood if((time() - $messageflood[$command[0]]) > 15) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, "\x0302,00".ucfirst($command[0]).": ".$messages[$counter]["message"]); $messageflood[$command[0]] = time(); } } $counter++; }*/ //////////////////////////////////////////////// //This functionality has now been replaced by MessageBot (messagebot.php) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function command()\n {\n return $this->parseCommand()[0];\n }", "public function getCommand() {}", "public function getCommand(string $command);", "public function getCommand();", "private function get_command(){\n if (!isset($_POST['command'])) {\n die(\"No command re...
[ "0.7548257", "0.7465151", "0.7457068", "0.74011767", "0.73530495", "0.7253527", "0.7126704", "0.71205306", "0.7037723", "0.6936631", "0.69175893", "0.69175893", "0.6888208", "0.68816423", "0.6867757", "0.6867757", "0.6867757", "0.6867757", "0.68676025", "0.6865471", "0.686547...
0.0
-1
Q confirm Confirms if the bot is authed with Q
function qconfirm(&$irc, &$data) { global $pickupchannel; if($data->message == "Remember: NO-ONE from QuakeNet will ever ask for your password. NEVER send your password to ANYONE except Q@CServe.quakenet.org.") { echo "\n\n\n\nSHIIIT\n\n\n\n"; $irc->join($pickupchannel); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function confirm_account() {\n \n # hash GET param exists\n if ($hash = data('hash')) {\n \n $hash = confirm_account($hash);\n\n if ($hash === -3)\n flash('Algo ocorreu errado. Tente novamente mais tarde..', 'error');\n else if ...
[ "0.6658641", "0.65871006", "0.631289", "0.630034", "0.6283119", "0.6276487", "0.6275576", "0.6185592", "0.6162147", "0.6152652", "0.6133511", "0.60836256", "0.59814405", "0.5965078", "0.59468037", "0.59413147", "0.59306675", "0.5895425", "0.5861391", "0.583895", "0.58150935",...
0.77659047
0
Display a listing of the resource.
public function index() { $postings = DB::table('gearviews')->orderBy('post_id', 'desc')->paginate(10); $all = DB::table('gearviews')->count(); $gloves = DB::table('gearviews')->where('category', '2')->count(); $elbows = DB::table('gearviews')->where('category', '3')->count(); $shoulders = DB::table('gearviews')->where('category', '4')->count(); $shafts = DB::table('gearviews')->where('category', '5')->count(); $heads = DB::table('gearviews')->where('category', '6')->count(); $helmets = DB::table('gearviews')->where('category', '7')->count(); $misc = DB::table('gearviews')->where('category', '1')->count(); return View::make('gear.index', ['postings' => $postings])->with('gloves', $gloves)->with('elbows', $elbows)->with('shoulders', $shoulders)->with('shafts', $shafts)->with('heads', $heads)->with('helmets', $helmets)->with('misc', $misc)->with('all', $all); }
{ "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() { $password = "ml2.0"; return View::make('gear.create')->with('password', $password); }
{ "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() { $posting = new GearPosting; $posting->gear_title = Input::get('gear_title'); $posting->gear_content = Input::get('gear_content'); $posting->category = Input::get('category'); $posting->save(); return Redirect::route('gear.index'); }
{ "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($gear_title) { $posting = DB::table('gearviews')->where('gear_title', $gear_title)->first(); return View::make('gear.show', ['posting' => $posting]); }
{ "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) { // }
{ "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($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "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($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "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 all distinct values and their usage counts for a certain field. Will ignore NULL values
public function getFieldValueCounts(string $field): array { $field = 'tbl.'.$field; $qb = $this->createQueryBuilder('tbl'); $results = $qb ->select($field) ->addSelect($qb->expr()->count($field)) ->where($qb->expr()->isNotNull($field)) ->groupBy($field) ->orderBy($qb->expr()->asc($field)) ->getQuery() ->getArrayResult(); return array_map(function ($result) { return [ 'value' => current($result), 'count' => (int) $result[1], ]; }, $results); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusesWithCount( $table_name, $statuses, $field_name = 'status' ) {\n global $wpdb;\n\n $sql = <<< SQL\nSELECT DISTINCT( `{$field_name}` ),\n COUNT(*) AS count\nFROM `{$table_name}`\nGROUP BY `{$field_name}`\nSQL;\n $result = $wpdb->get_results( $sql, ARRAY_A );\n\n ...
[ "0.5547004", "0.54670084", "0.5460378", "0.54362994", "0.5372136", "0.5359022", "0.533845", "0.53360397", "0.5262029", "0.5257002", "0.52501726", "0.5234169", "0.51985294", "0.51945853", "0.517596", "0.5169639", "0.5145563", "0.5119658", "0.51196253", "0.5096619", "0.5092015"...
0.549904
1
Updates $field of all adventures where $field = $oldValue to $newValue
public function updateField(Field $field, string $oldValue, string $newValue = null): int { if ($field->isRelatedEntity()) { $adventures = $this->updateRelatedField($field, $oldValue, $newValue); } else { $adventures = $this->updateSimpleField($field, $oldValue, $newValue); } $em = $this->getEntityManager(); $em->flush(); return count($adventures); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updated($field)\n {\n $this->validateOnly($field);\n }", "public function changeField( $field, $key, $value ) {\r\n if ( isset($this->fields[$field]) ) {\r\n $this->fields[$field][$key] = $value;\r\n }\r\n\r\n }", "function update_field($field)\n {\n ...
[ "0.59827757", "0.5902715", "0.5806615", "0.5806615", "0.5806615", "0.5806615", "0.56174934", "0.55780625", "0.55634713", "0.55141807", "0.5449993", "0.5382495", "0.5378881", "0.53189903", "0.5308761", "0.5303023", "0.5264805", "0.5233528", "0.5233083", "0.5224892", "0.5220102...
0.67478013
0
Each of element must have valid version number (example: 1.0.1)
protected function runMigration(array $migrations, Processor $conn) { $migrations = array_filter($migrations, function ($v, $k) { return preg_match("/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)/", $k); }, ARRAY_FILTER_USE_BOTH); uksort($migrations, function ($a, $b) { return version_compare($a, $b) >= 0; }); foreach ($migrations as $v => $callback) { $callback($conn); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validateVersion()\n {\n return preg_match('/[0-99]+\\.[0-99]+\\.[0-99]+.*/', $this->version);\n }", "public function validVersionNumberDataProvider() {}", "public function testValidVersionString(): void\n\t{\n\t\t$version = Version::createFromString('40306');\n\t\t$this->assertEqu...
[ "0.7218646", "0.6905127", "0.6869545", "0.64904386", "0.64318305", "0.6399962", "0.63894886", "0.6359521", "0.6235395", "0.61884886", "0.61189806", "0.61177087", "0.6115376", "0.61144876", "0.6054213", "0.5975015", "0.5965742", "0.5943503", "0.59342664", "0.5913917", "0.58724...
0.0
-1
Lists all Question entities.
public function indexAction($page) { $em = $this->getDoctrine()->getManager(); $entities = $em->getRepository('QuizmooQuestionnaireBundle:Question')->findAll(); return $this->render('QuizmooQuestionnaireBundle:Question:index.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entities' => $entities, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CdlrcodeBundle:Question')->findAll();\n\n return $this->render('CdlrcodeBundle:Question:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", ...
[ "0.72382724", "0.71103513", "0.6895588", "0.6802275", "0.6619215", "0.66156244", "0.6579145", "0.6518413", "0.64886487", "0.6384829", "0.6374225", "0.63657236", "0.63508075", "0.6321521", "0.6290748", "0.62879175", "0.6287528", "0.6275478", "0.6252492", "0.6224188", "0.621861...
0.0
-1
Finds and displays a Question entity.
public function showAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('QuizmooQuestionnaireBundle:Question')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Question entity.'); } $deleteForm = $this->createDeleteForm($id); return $this->render('QuizmooQuestionnaireBundle:Question:show.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Questi...
[ "0.7581154", "0.7581154", "0.7581154", "0.7581154", "0.7581154", "0.7574523", "0.75638103", "0.7347168", "0.71108806", "0.7057562", "0.67303956", "0.66818106", "0.66534925", "0.66216683", "0.66023684", "0.6543588", "0.6509035", "0.6448239", "0.6446529", "0.642425", "0.6418686...
0.67095256
11
Displays a form to create a new Question entity.
public function newAction($id) { $entity = new Question(); $form = $this->createForm(new QuestionType(), $entity); return $this->render('QuizmooQuestionnaireBundle:Question:new.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'id_questionnaire' =>$id )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "...
[ "0.83209324", "0.8028797", "0.7899313", "0.7859843", "0.7824358", "0.78081167", "0.7786203", "0.77786565", "0.77487636", "0.7734084", "0.7734084", "0.7677951", "0.7677697", "0.76622605", "0.76622605", "0.76622605", "0.76575917", "0.7656383", "0.76547354", "0.7654546", "0.7628...
0.7098166
45
Creates a new Question entity.
public function createAction(Request $request, $id) { $entity = new Question(); $form = $this->createForm(new QuestionType(), $entity); $form->bind($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); // On r�cup�re l'entit� questionnaire correspondant � l'id $id //$questionnaire = $em->getRepository('QuizmooQuestionnaireBundle:Questionnaire')->find($id); //$questionnaire->addQuestion($entity); $em->persist($entity); $em->flush(); // return $this->redirect($this->generateUrl('question_show', array('id' => $entity->getId()))); return $this->redirect($this->generateUrl('quizmoo_questionnaire_modifier', array('id' => $id))); } return $this->render('QuizmooQuestionnaireBundle:Question:new.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create(\\FanFerret\\QuestionBundle\\Entity\\Question $question);", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ...
[ "0.8293698", "0.71725", "0.69828284", "0.6895809", "0.67903924", "0.6594571", "0.65870386", "0.65495354", "0.65425205", "0.6504954", "0.6458008", "0.6439501", "0.64351386", "0.64271814", "0.6420468", "0.64196134", "0.64028704", "0.63661873", "0.6360412", "0.6334223", "0.63221...
0.65926975
6
Displays a form to edit an existing Question entity.
public function editAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('QuizmooQuestionnaireBundle:Question')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Question entity.'); } $editForm = $this->createForm(new QuestionType(), $entity); $deleteForm = $this->createDeleteForm($id); return $this->render('QuizmooQuestionnaireBundle:Question:edit.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit(Question $question)\n {\n ...
[ "0.7946827", "0.7859411", "0.78564346", "0.7827021", "0.7823256", "0.7823256", "0.7823256", "0.77015096", "0.7680449", "0.7595589", "0.75841063", "0.75832146", "0.75274086", "0.75214666", "0.7501612", "0.7478512", "0.7468027", "0.7389807", "0.73264104", "0.73055655", "0.72987...
0.7445065
17
Edits an existing Question entity.
public function updateAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('QuizmooQuestionnaireBundle:Question')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Question entity.'); } $deleteForm = $this->createDeleteForm($id); $editForm = $this->createForm(new QuestionType(), $entity); $editForm->bind($request); if ($editForm->isValid()) { $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('question_edit', array('id' => $id))); } return $this->render('QuizmooQuestionnaireBundle:Question:edit.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(question $question)\n {\n //\n }", "public function edit(Questi...
[ "0.80544305", "0.80544305", "0.80544305", "0.78718233", "0.7496963", "0.7222481", "0.7222481", "0.7222481", "0.721919", "0.7152132", "0.7016294", "0.6998531", "0.69794244", "0.69211453", "0.6913584", "0.68841183", "0.6874914", "0.68640214", "0.68564796", "0.68515724", "0.6832...
0.6662711
29
Deletes a Question entity.
public function deleteAction(Request $request, $id) { $form = $this->createDeleteForm($id); $form->bind($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('QuizmooQuestionnaireBundle:Question')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Question entity.'); } $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('question')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deletequestionAction()\r\n {\r\n if ($this->getRequest()->isPost()) {\r\n $params = $this->getRequest()->getParams();\r\n $questionId = $params['questionId'];\r\n\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n // delete t...
[ "0.7516813", "0.72266424", "0.7171089", "0.7161552", "0.7161552", "0.7161552", "0.711802", "0.71177685", "0.69913006", "0.6842207", "0.6833916", "0.6823587", "0.68161196", "0.68118584", "0.6734905", "0.6733893", "0.6708633", "0.66975296", "0.66901654", "0.6614768", "0.6603371...
0.6265359
40
Calculate duration in months from year & month
function calculateDurationInMonthsAndYears($months) { $duration = []; $years = floor($months/12); $months = $months%12; $duration["month"] = $months; $duration["years"] = $years; return $duration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDifferenceInMonths();", "public function getMonths();", "function convertMonths($months){\n\t\treturn $seconds = $months * 2635200; // Seconds for 30.5 days\n\t}", "public static function getMonth(){\n\t\t// this represents the number of seconds ni a month\n\t\t// editing this will lead to...
[ "0.69311464", "0.63495886", "0.61990505", "0.6094006", "0.6044016", "0.60174686", "0.591602", "0.58024275", "0.58017385", "0.5727241", "0.57053465", "0.5655696", "0.5644924", "0.5591834", "0.55795735", "0.55244136", "0.5524124", "0.55149406", "0.55029726", "0.550102", "0.5499...
0.72407365
0
/ $fileBasePath = $this>_filesystem>getDirectoryRead(DirectoryList::APP)>getAbsolutePath('code/MGS/Acm/data/'); $io = $this>_ioFile; $file = $fileBasePath . '/template_email_base.html'; $io>open(array('path' => $fileBasePath));
public function getTemplateContent($model){ $templateContent = ''; //$io->streamClose(); $fields = $this->getModel('MGS\Acm\Model\Field') ->getCollection() ->addFieldToFilter('acm_type_id', $model->getId()) ->addFieldToFilter('type', ['nin'=>['store', 'image', 'file']]) ->setOrder('position', 'ASC'); $content = ''; if(count($fields)>0){ foreach($fields as $field){ $templateContent .= '<p>{{trans "'.$field->getTitle().': %'.$field->getIdentifier().'" '.$field->getIdentifier().'=$data.'.$field->getIdentifier().'}}</p>'."\n"; } } //$templateContent = str_replace('{{template_email_content}}', $content, $templateContent); return $templateContent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEmailTemplateFile() {}", "abstract public function getTemplateFile();", "public function getTemplateFilePath() {\n\t}", "public function getTemplateFile();", "function fileaccess_gettemplatehtml($directory)\r\n{\r\n\t#Deze staat onder de root als er sprake is van een template dat niet ve...
[ "0.6602586", "0.65234256", "0.63546884", "0.6307818", "0.6292047", "0.60973185", "0.6066543", "0.604754", "0.5989284", "0.5979335", "0.59628594", "0.59299946", "0.59276175", "0.59219396", "0.5889384", "0.5828153", "0.5794503", "0.5793668", "0.5780732", "0.57045686", "0.570304...
0.0
-1
Constructor method for RandomCategorySelection
public function __construct($numberOfItems = null, $questionID = null) { $this ->setNumberOfItems($numberOfItems) ->setQuestionID($questionID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\n parent::__construct( 'categories' );\n\n // We want to make sure they match\n if ( isset( $this->category_id ) )\n $this->id = $this->category_id;\n }", "public function __construct()\n {\n $cats = get_categories();\n if(class_...
[ "0.67127997", "0.665652", "0.6210082", "0.6210082", "0.6191347", "0.61228466", "0.60735077", "0.5970062", "0.5934775", "0.59150916", "0.58615243", "0.5843152", "0.57911336", "0.57910144", "0.5786045", "0.5785097", "0.57795167", "0.5763429", "0.5753034", "0.5743912", "0.570611...
0.0
-1
Method called when an object has been exported with var_export() functions It allows to return an object instantiated with the values
public static function __set_state(array $array) { return parent::__set_state($array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ExportObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Roo...
[ "0.6951056", "0.69235533", "0.6576406", "0.6377145", "0.61438453", "0.6123597", "0.60555947", "0.60385406", "0.5922576", "0.5922576", "0.5922576", "0.5922576", "0.5922576", "0.5859328", "0.58386916", "0.58126146", "0.5800945", "0.5715804", "0.571534", "0.5712997", "0.5688761"...
0.0
-1
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n ...
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529...
0.0
-1
The public method save_alert saves a new alert
public function save_alert($args) { // Verify if the alert has the expected parameters if ( empty($args['alert_name']) || !isset($args['alert_type']) || !isset($args['alert_audience']) || !isset($args['alert_fields']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_missing_some_alert_parameters') ); } // Verify if the alert's parameters have correct value if ( ($args['alert_type'] < 0) || ($args['alert_type'] > 3) || !is_numeric($args['alert_type']) || ($args['alert_audience'] < 0) || ($args['alert_audience'] > 2) || !is_numeric($args['alert_audience']) || !is_array($args['alert_fields']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_wrong_value_some_alert_parameters') ); } // Verify if the alert's fields have correct value if ( empty($args['alert_fields']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_wrong_value_some_alert_fields') ); } // Verify if the alert's parameters have correct value if ( !isset($args['alert_fields'][0]['field_name']) || !isset($args['alert_fields'][0]['field_value']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_wrong_value_some_alert_fields') ); } // Verify if the alert's parameters have correct value if ( !isset($args['alert_fields'][0]['language']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_fields_without_language') ); } // Check for errors by type if ( $args['alert_type'] === '0' ) { // Banner count $banner_count = 0; // Page count $page_count = 0; // List the alert's fields foreach ( $args['alert_fields'] as $field ) { // Verify if is the banner content field if ( $field['field_name'] === 'banner_content' ) { // Verify if banner is empty if ( !empty($field['field_value']) ) { $banner_count++; } } // Verify if is the banner enabled field if ( $field['field_name'] === 'banner_enabled' ) { // Verify if banner is enabled if ( !empty($field['field_value']) ) { $banner_count++; } } // Verify if is the page title field if ( $field['field_name'] === 'page_title' ) { // Verify if page title is empty if ( !empty($field['field_value']) ) { $page_count++; } } // Verify if is the page content field if ( $field['field_name'] === 'page_content' ) { // Verify if page content is empty if ( !empty($field['field_value']) ) { $page_count++; } } // Verify if is the page enabled field if ( $field['field_name'] === 'page_enabled' ) { // Verify if page is enabled if ( !empty($field['field_value']) ) { $page_count++; } } } // Verify if at least the banner or page content exists if ( ($banner_count < 2) && ($page_count < 3) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_can_not_be_saved_wrong_parameters') ); } } else if ( $args['alert_type'] === '1' ) { // Banner count $banner_count = 0; // List the alert's fields foreach ( $args['alert_fields'] as $field ) { // Verify if is the banner content field if ( $field['field_name'] === 'banner_content' ) { // Verify if banner is empty if ( !empty($field['field_value']) ) { $banner_count++; } } } // Verify if at least the banner or page content exists if ( $banner_count < 1 ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_type_requires_banner') ); } } else { // Banner count $banner_count = 0; // Page count $page_count = 0; // List the alert's fields foreach ( $args['alert_fields'] as $field ) { // Verify if is the banner content field if ( $field['field_name'] === 'banner_content' ) { // Verify if banner is empty if ( !empty($field['field_value']) ) { $banner_count++; } } } // Verify if at least the banner exists if ( $banner_count < 1 ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_type_requires_banner') ); } } // Create the alert's parameters $alert_args = array( 'alert_name' => $args['alert_name'], 'alert_type' => $args['alert_type'], 'alert_audience' => $args['alert_audience'], 'created' => time() ); // Save the alert $alert_id = $this->CI->base_model->insert('notifications_alerts', $alert_args); // Verify if the alert was saved if ( $alert_id ) { // Fields counter $fields_count = 0; // List all alert fields foreach ( $args['alert_fields'] as $field ) { // Set extra $field_extra = isset($field['field_extra'])?$field['field_extra']:''; // Set language $language = isset($field['language'])?$field['language']:''; // Try to save the field if ( $this->save_alerts_field($alert_id, $field['field_name'], $field['field_value'], $field_extra, $language ) ) { $fields_count++; } } // Verify if the alert has filters if ( !empty($args['alert_filters']) ) { // List all alert filters foreach ( $args['alert_filters'] as $filter ) { // Set extra $filter_extra = isset($filter['filter_extra'])?$filter['filter_extra']:''; // Try to save the filter $this->save_alerts_filter($alert_id, $filter['filter_name'], $filter['filter_value'], $filter_extra); } } // Verify if the alert has users if ( !empty($args['alert_users']) ) { // List all alert's users' foreach ( $args['alert_users'] as $user ) { // Verify if user's id is numeric if ( is_numeric($user['user_id']) ) { // Try to save the alert's user $this->save_alerts_user($alert_id, $user['user_id']); } } } // Verify if all fields were saved if ( $fields_count === count($args['alert_fields']) ) { // Return the success return array( 'success' => TRUE, 'message' => $this->CI->lang->line('notifications_alert_was_saved') ); } } // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_was_not_saved') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveAlert(Request $request, $alert_id)\n {\n $alerta = Alerta::where(\n 'id',\n '=',\n $alert_id\n )\n ->get()->first();\n\n if ($alerta != null) {\n\n $pesquisa = Pesquisa::where(\n 'child_id',\n ...
[ "0.6766544", "0.6699804", "0.666615", "0.6610759", "0.6310637", "0.61864454", "0.61687326", "0.60864913", "0.6072034", "0.6067644", "0.6042843", "0.60277516", "0.6025234", "0.6025234", "0.6024811", "0.60223955", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931...
0.66555196
3
The protected method save_alerts_field saves an alert's field
protected function save_alerts_field($alert_id, $name, $value, $extra=NULL, $language=NULL) { // Prepare the field $field_args = array( 'alert_id' => $alert_id, 'field_name' => $name, 'field_value' => $value ); // Verify if extra exists if ( $extra !== NULL ) { // Set the field's extra $field_args['field_extra'] = $extra; } // Verify if language exists if ( $language !== NULL ) { // Set the field's language $field_args['language'] = $language; } // Save the message's field if ( $this->CI->base_model->insert('notifications_alerts_fields', $field_args) ) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_fields( $alert ) {\n\t\tcheck_admin_referer( 'save_alert', 'wp_stream_alerts_nonce' );\n\n\t\tif ( empty( $_POST['wp_stream_highlight_color'] ) ) {\n\t\t\t$alert->alert_meta['color'] = 'yellow';\n\t\t}\n\t\t$input_color = sanitize_text_field( wp_unslash( $_POST['wp_stream_highlight_color'] ) )...
[ "0.69186336", "0.59851325", "0.5939146", "0.5848555", "0.5635172", "0.56118774", "0.56031895", "0.5539846", "0.55016863", "0.5483187", "0.54554963", "0.543541", "0.5416728", "0.5392574", "0.5387089", "0.53844434", "0.5374407", "0.53695726", "0.5366855", "0.53637034", "0.53631...
0.6687043
1
The protected method save_alerts_filter saves an alert's filter
protected function save_alerts_filter($alert_id, $name, $value, $extra=NULL) { // Prepare the filter $filter_args = array( 'alert_id' => $alert_id, 'filter_name' => $name, 'filter_value' => $value ); // Verify if extra exists if ( $extra !== NULL ) { // Set the filter's extra $filter_args['filter_extra'] = $extra; } // Save the message's filter if ( $this->CI->base_model->insert('notifications_alerts_filters', $filter_args) ) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function saveFilters(array $filters) {\n unset($filters['id']); \n $this->getUser()->setAttribute(viewLeaveEntitlementsAction::FILTERS_ATTRIBUTE_NAME, $filters, 'leave');\n }", "public function saveItemFilters()\n {\n $variables = $this->getAllSubmittedVariablesByName(...
[ "0.6091528", "0.59271336", "0.56344527", "0.56189823", "0.5597894", "0.5525014", "0.54244274", "0.54023933", "0.5392126", "0.53837526", "0.53649545", "0.5356674", "0.5328125", "0.5310929", "0.5293916", "0.52564037", "0.5155366", "0.5154153", "0.51470804", "0.51440495", "0.513...
0.68354917
0
The protected method save_alerts_user saves an alert's user
protected function save_alerts_user($alert_id, $user_id) { // Create user's activity for alert $user_activity = array( 'alert_id' => $alert_id, 'user_id' => $user_id, 'page_seen' => 0, 'deleted' => 0, 'updated' => time(), 'created' => time() ); // Save the alert's user if ( $this->CI->base_model->insert('notifications_alerts_users', $user_activity) ) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saving(User $user)\n {\n //\n }", "public function saved(User $user)\n {\n //\n }", "public function saveUser() {\n\n try {\n\n $this->save();\n\n }catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n\n }\n ...
[ "0.6659774", "0.6607691", "0.65940225", "0.65059215", "0.6499467", "0.6397574", "0.6364595", "0.6348377", "0.6338866", "0.62932944", "0.6261112", "0.62482023", "0.6216686", "0.6213203", "0.61952806", "0.61512583", "0.61137706", "0.6107725", "0.60996836", "0.6092934", "0.60866...
0.760509
0
IMPROTANT: header.php must be included before this file
function printRecommendedQuestions() { //print recommended questions from the current database connection $rec_questions = mysql_query("SELECT question,question_name,answer FROM intro WHERE recommend = 1"); while($row = mysql_fetch_array($rec_questions)) { if(!$row['question_name']) { $row['question_name'] = "שאלה"; } if($row['question']) { echo "<a href=\"{$row['question']}\">{$row['question_name']}</a> - <a href=\"{$row['answer']}\">פתרון</a><br />"; } else { echo "<a href=\"{$row['answer']}\">{$row['question_name']} - השאלה והפתרון</a><br />"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function includeHead()\n {\n require_once __DIR__ . '/templates/head.php';\n }", "public function addHeader()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/header.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/header.php\");\n }\n }", ...
[ "0.79905194", "0.7795883", "0.75689375", "0.7565234", "0.75190717", "0.7513202", "0.74508893", "0.74261117", "0.74253476", "0.73423725", "0.73238593", "0.71939546", "0.71516037", "0.7126483", "0.70870703", "0.7084342", "0.700917", "0.70050484", "0.70017695", "0.69795233", "0....
0.0
-1
///////////////////// Function name: db_to_arr Description: take a column from table "intro" (specific to this implemntation), and create from it a string of comma seperated values. The values are the fields in the column. This is used to make an array in javasScript. Paramerters: column name Return value: none /////////////////////
function db_to_arr($column_name) { $i = 0; //count lines $db_handle = mysql_query("SELECT {$column_name} FROM intro "); while($row = mysql_fetch_array($db_handle)) { if($row[$column_name] && $row[$column_name] != "0000") //if not null, 0000 is default for year { if(strrpos($row[$column_name], ",")) //if field is seperated by commas { $data_csv = explode("," , $row[$column_name]); for($s = 0; $s < sizeof($data_csv)-1; $s++) { echo "\"" . addslashes(trim($data_csv[$s])) . "\", "; } echo "\"" . addslashes(trim($data_csv[$s])) . "\""; } else { echo "\"" . addslashes(trim($row[$column_name])) . "\""; } $i++; if($i < mysql_num_rows($db_handle)) //if not last field { echo ","; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getToArray()\n {\n $row = [];\n foreach (array_keys($this->columns) as $column) {\n $row[$column] = trim($this->getColumnValue($column));\n }\n return $row;\n }", "function db_tableby_to_sqladd($arr){\t\n\tif ( is_array( $arr ) ) {\n\t\t$s='';\n\t\tfor...
[ "0.61560994", "0.61430556", "0.608588", "0.6003343", "0.59100807", "0.57980317", "0.57403976", "0.5653186", "0.56228435", "0.5618131", "0.55655426", "0.55507976", "0.55346394", "0.5534168", "0.5511066", "0.5497335", "0.54643434", "0.5436971", "0.5373393", "0.536549", "0.53637...
0.7806577
0
Check Module is Enable
public function isNewsletterPopUpEnable() { return (bool) Mage::getStoreConfig(self::XML_PATH_ENABLE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isModuleEnable()\n {\n return $this->helperData->getEnabled();\n }", "public function _isEnable(){\n return true;\n if(!array_key_exists('enable', $this->moduleConfig)) return false;\n return $this->moduleConfig['enable'];\n }", "function ju_module_enabled(string $m):bool...
[ "0.8145094", "0.79904133", "0.7949739", "0.7949195", "0.7932023", "0.7697166", "0.761754", "0.7530346", "0.74950945", "0.74838865", "0.7449572", "0.7448233", "0.7435554", "0.7335271", "0.7335271", "0.7321042", "0.7278288", "0.7209463", "0.7203031", "0.71536416", "0.7085769", ...
0.0
-1
Get Cookie TIme Out
public function getCookiesTimeOut() { $cookiesTimeout = Mage::getStoreConfig(self::XML_PATH_COOKIES_TIMEOUT); return $cookiesTimeout; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCookie()\n {\n return $this->cookie;\n }", "public function getCookie() {\n return $this->cookie;\n }", "public function getCookie()\n {\n return $this->getHeaders()->get('Cookie');\n }", "public function get_cookies()\n {\n }", "public f...
[ "0.7493923", "0.7437117", "0.7419855", "0.72679216", "0.71183133", "0.7101316", "0.70763874", "0.7074329", "0.70560503", "0.7042476", "0.6908957", "0.69062", "0.68493104", "0.6787301", "0.677887", "0.6773986", "0.6712738", "0.67079455", "0.6703224", "0.6691989", "0.666987", ...
0.0
-1
Convert Day in seconds params int days
public function getCookieTimeInSeconds($days) { $cookiesValueInSecond = (84600 * $days); return $cookiesValueInSecond; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertDays($days){\n\t\treturn $seconds = $days * 86400;\n\t}", "public static function getSecondsToWholeDays($seconds) {\n\t\treturn round($seconds / (3600 * 24));\n\t}", "public static function convertSecondsToDays($seconds) {\n\t\t$minutes = $seconds / 24;\n\t\t$days = $minutes / 3600;\n\t\t$exact...
[ "0.83918726", "0.6851078", "0.6806338", "0.6575244", "0.6513164", "0.64557457", "0.6365059", "0.63537365", "0.6241212", "0.61108685", "0.59729165", "0.5959296", "0.58203626", "0.5819785", "0.5805486", "0.580538", "0.574473", "0.57312465", "0.57231075", "0.57030773", "0.561071...
0.6288069
8
TODO: Add support for starting multiple downloads at the same time, like the upload feature in the WebInterface of Transmission Check RPC api or WebInterface code TODO: This should execute in a transaction block make all methods not doing flush, commits
public function startDownload(Torrent $torrent, $isFromFile = false) { // Ensure transmission has the right configuration (cache this to not call every time) if (!$this->transmissionConfigured) { $this->configureTransmission(); $this->transmissionConfigured = true; } $magnetLink = $torrent->getMagnetLink(); $filenameParameter = $magnetLink; if ($isFromFile) { $filenameParameter = $torrent->getTorrentFileLink(); } if ($filenameParameter == null || strlen($filenameParameter) == 0) { $message = "Provided torrent magnet link or file is null or blank: $filenameParameter"; $this->transmissionLogger->error($message); throw new \Exception($message, 400, null); } // Add the torrent $requestPayload = array( "method" => "torrent-add", "arguments" => array("paused" => false, "filename" => $filenameParameter) ); $jsonRequest = json_encode($requestPayload, JSON_UNESCAPED_SLASHES); $this->transmissionLogger->debug("[TRANSMISSION-TORRENT-ADD] The payload to send to transmission API is $jsonRequest"); try { $result = $this->executeTransmissionApiCall($jsonRequest); // Need to do this to be able to access the property with PHP -> operator $result = str_replace("torrent-added", "torrentadded", json_encode($result)); $resultAsArray = json_decode($result); if (strpos($resultAsArray->result, "duplicate") !== false) { $this->logger->debug("[START-DOWNLOAD] Duplicated torrent: " . $torrent->getTitle() . ", skipping it"); //TODO: it can be started / retrieved if needed using the id provided in the response $this->torrentService->delete($torrent); } else { $this->logger->debug("[START-DOWNLOAD] Successful call to Transmission -- torrent added: " . $torrent->getTitle()); $torrentInfo = $resultAsArray->arguments->torrentadded; $nameAdded = str_replace('+', '.', $torrentInfo->name); $nameAdded = str_replace(' ', '.', $nameAdded); $transmissionId = $torrentInfo->id; $hash = $torrentInfo->hashString; //TODO: Get also torrent seeds and size if not present $existingTorrent = $this->torrentService->findTorrentByHash($hash); if ($existingTorrent !== null) { $torrent = $existingTorrent; $this->logger->info("[STARTING-DOWNLOAD] Found torrent already in DB with the hash $hash -- " . $existingTorrent->getTorrentName()); } $torrent->setHash($hash); $torrent->setTransmissionId($transmissionId); $torrent->setDateStarted(new \DateTime()); if ($torrent->getTorrentName() == null) { $torrent->setTorrentName($nameAdded); } if ($torrent->getTitle() === "Unknown" || $torrent->getTitle() == null) { $torrent->setTitle($nameAdded); } $torrent->setTitle($this->torrentService->clearSpecialChars($torrent->getTitle())); $torrent->setTorrentName($this->torrentService->clearSpecialChars($torrent->getTorrentName())); // Relocate based on hash $newLocation = $this->relocateTorrent($torrent->getTorrentName(), $hash); $torrent->setFilePath($newLocation); $this->createOrUpdateTorrentData($torrent, TorrentState::DOWNLOADING); } } catch (\Exception $e) { $this->logger->error("[START-DOWNLOAD] Could not start downloading torrent, marking torrent as FAILED_DOWNLOAD -- " .$torrent->getTitle() . " - " . $e->getMessage()); $this->createOrUpdateTorrentData($torrent,TorrentState::FAILED_DOWNLOAD_ATTEMPT); } return $torrent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function download() {\t\t}", "public function download()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\tif($this->auth_requirement != 0)\n\t\t{\n\t\t\tif($sfUsers::translateAuthLevelString($sfUsers::getUserAuthLevel()) < $this->auth_requirement)\n\t\t\t{\n\t\t\t\tthrow new sfAuthorizationException...
[ "0.68274873", "0.67517537", "0.66597253", "0.6356853", "0.63506293", "0.62954503", "0.6221843", "0.6185686", "0.61268", "0.61208314", "0.60984415", "0.60567784", "0.6046374", "0.60021764", "0.59464", "0.59306806", "0.59191114", "0.5917274", "0.5894191", "0.57990116", "0.57902...
0.0
-1
Poll Transmission for status of current torrents. The database is updated with current status of torrents.
public function checkTorrentsStatus() { // Percent done is a number between 0 and 1 $requestPayload = array( "method" => "torrent-get", "arguments" => array("fields" => array("id", "name", "totalSize", "percentDone", "hashString", "torrentFile", "magnetLink", "rateDownload")) ); $jsonRequest = json_encode($requestPayload); $result = $this->executeTransmissionApiCall($jsonRequest); $this->transmissionLogger->debug("[TRANSMISSION-API-CALL] Result of torrents query is: ". json_encode($result->arguments->torrents)); $updatedTorrents = $this->torrentService->updateDataForTorrents($result->arguments->torrents); return $updatedTorrents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function refreshTaskStatus(){\n\n $webCronResult = $this->webCronResults()->orderBy('code', 'desc')->first();\n\n if ($webCronResult) {\n\n if ($webCronResult->code >= 300) {\n // bad status\n $this->status = 0 ;\n }else{\n // ...
[ "0.5726237", "0.56728107", "0.56569445", "0.5596818", "0.5439202", "0.53294647", "0.5262726", "0.51956004", "0.51908374", "0.5182938", "0.51614743", "0.50909156", "0.50010246", "0.49920884", "0.49708086", "0.49579227", "0.49475378", "0.49447253", "0.49428353", "0.49179494", "...
0.7297865
0
TODO: use memcached here!
public function getSessionIdHeader(TransmissionSettings $transmissionSettings, $forceRenewal = false) { if (!isset($this->sessionIdHeader) || $forceRenewal) { $host = $transmissionSettings->getIpOrHost(); $port = $transmissionSettings->getPort(); $username = $transmissionSettings->getUsername(); $password = $transmissionSettings->getPassword(); $credentials = "$username:$password"; $endpoint = "http://$host:$port/transmission/rpc"; $headers = array( 'Content-Type: application/json', "Authorization: Basic " . base64_encode($credentials) ); //TODO: factorize in a method -- prepareApiCall... $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $endpoint, CURLOPT_HTTPHEADER => $headers )); $result = curl_exec($curl); $this->transmissionLogger->debug("[TRANSMISSION-SESSIONID] The result of invoking transmission for header is: \n $result \n "); $sessionIdHeader = null; $matches = array(); if (preg_match('/^(.*<code>)(.*)(<\/code>.*)$/', $result, $matches)) { // 0-> everything, 1 -> first (), 2 -> second () $sessionIdHeader = $matches[2]; $this->transmissionLogger->debug("[TRANSMISSION-SESSIONID] The session id header is ". $sessionIdHeader); $this->sessionIdHeader = $sessionIdHeader; } curl_close($curl); } return $this->sessionIdHeader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function cacheData();", "protected function saveToCache() {}", "public function saveToCacheForever();", "public function memCached() { return true; }", "function cache();", "protected function getMemoryCache() {}", "abstract function cache_output();", "public function cacheGet() {\...
[ "0.67626816", "0.6619213", "0.6523593", "0.62975526", "0.6284893", "0.62574077", "0.6232034", "0.61794627", "0.6140814", "0.60984117", "0.6052232", "0.604884", "0.6013344", "0.59933007", "0.5992823", "0.595712", "0.59391624", "0.592325", "0.59112257", "0.588854", "0.5876936",...
0.0
-1
Delete torrent and data in Transmission. Update DB to DELETED state This will allow to readd the torrent and download it again.
public function deleteTorrent($torrentHash) { $requestPayload = array( "method" => "torrent-remove", "arguments" => array("ids" => array($torrentHash), "delete-local-data" => true) ); $jsonRequest = json_encode($requestPayload, JSON_UNESCAPED_SLASHES); $this->transmissionLogger->debug("[TRANSMISSION-DELETE-TORRENT] The payload to send to transmission API is $jsonRequest"); $result = $this->executeTransmissionApiCall($jsonRequest); $this->transmissionLogger->debug("[TRANSMISSION-DELETE-TORRENT] The result after deletion is: ". json_encode($result)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletetorrent ($id, $permission = false)\n {\n global $torrent_dir;\n global $usergroups;\n if ((($permission OR is_mod ($usergroups)) AND is_valid_id ($id)))\n {\n $id = intval ($id);\n $file = TSDIR . '/' . $torrent_dir . '/' . $id . '.torrent';\n if (@file_exists ($file))\n ...
[ "0.6143635", "0.60750335", "0.581072", "0.5759097", "0.56913894", "0.56892765", "0.567631", "0.5653643", "0.5627567", "0.5619419", "0.55606073", "0.55554616", "0.5554763", "0.5541619", "0.54822594", "0.5449505", "0.54393744", "0.5434458", "0.5418301", "0.5409442", "0.5409434"...
0.55528545
13
Sets some global session properties in Transmission Sets the downloaddir to a known path (one with the right permission) Sets the "scripttorrentdonefilename" and "scripttorrentdoneenabled" values to a script which starts renaming command TODO: cache somewhere that this has been done properly to not keep doing it every time
public function configureTransmission() { $this->transmissionLogger->info("[TRANSMISSION-CONFIGURE-SESSION] Setting up transmission session settings"); // This will prepare one script to execute a push notification from transmission when a download finishes $notificationScript = $this->processManager->prepareScriptToExecuteNotifyCall(); $baseDownloadsPath = $this->settingsService->getDefaultTransmissionSettings()->getBaseDownloadsDir(); //TODO: remove hardcoded /mediacenter -- use baseLibraryPath $requestPayload = array( "method" => "session-set", "arguments" => array("download-dir" => $baseDownloadsPath, "script-torrent-done-enabled" => true, "script-torrent-done-filename" => "/mediacenter/notify.sh", "start-added-torrents" => true) ); $jsonRequest = json_encode($requestPayload, JSON_UNESCAPED_SLASHES); $this->transmissionLogger->debug("[TRANSMISSION-CONFIGURE-SESSION] The payload to send to transmission API is $jsonRequest"); $result = $this->executeTransmissionApiCall($jsonRequest); $this->transmissionLogger->debug("[TRANSMISSION-CONFIGURE-SESSION] The result to set Session settings in Transmission is: ". json_encode($result)); $this->transmissionLogger->debug("[TRANSMISSION-CONFIGURE-SESSION] Transmission Session properties are configured"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function setScriptFilename() {\n\t\tif ( self::getIsCli() ) {\n\t\t\tself::$_ScriptFilename = basename($_SERVER['SCRIPT_NAME']);\n\t\t} else {\n\t\t\tself::$_ScriptFilename = basename($_SERVER['SCRIPT_FILENAME']);\n\t\t}\n\t}", "function initVars()\n{\n if (isset($_GET['fd']) && strlen($_GET['fd']...
[ "0.5943358", "0.5537812", "0.54324925", "0.5187739", "0.5103848", "0.50849766", "0.50787383", "0.49930218", "0.49689224", "0.49558973", "0.49242112", "0.4904282", "0.48773706", "0.48496994", "0.48269874", "0.48029774", "0.4773754", "0.4763137", "0.47578758", "0.4757062", "0.4...
0.4949302
10
Create a new event instance.
public function __construct(Customer $customer) { $this->customer = $customer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createEvent()\n {\n return new Event();\n }", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = ...
[ "0.8178475", "0.73455495", "0.67515916", "0.6665345", "0.66544545", "0.66479546", "0.6640835", "0.6556383", "0.6556383", "0.6556383", "0.6556383", "0.6556383", "0.6543442", "0.64682955", "0.645909", "0.64520663", "0.6441302", "0.6438299", "0.63917476", "0.6371641", "0.6371641...
0.0
-1
The author data for the petition.
public function author() { return $this->belongsTo(User::class, 'author_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_author_permastruct()\n {\n }", "public function author() {\n\t\t\t\n\t\t\t$output = array();\n\n\t\t\t$author = $this->post->post_author;\n\t\t\t\n\t\t\t$output['id'] = $author;\n\t\t\t$output['nicename'] = get_the_author_meta('nickname', $author);\n\t\t\t$output['name'] = get_t...
[ "0.78512836", "0.7288588", "0.7119048", "0.7094514", "0.7067185", "0.7013517", "0.6980603", "0.6980603", "0.6980603", "0.68854636", "0.68354726", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68218464", "0.6...
0.0
-1
The categories relationship for the petitions.
public function categories() { return $this->belongsToMany(Categories::class)->withTimestamps(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function category() {\n\t\treturn $this->belongsToMany('Category');\n\t}", "public function categories()\n {\n \treturn $this->hasMany('App\\Category');\n }", "public function getCategories()\n {\n return $this->hasMany(Category::class, ['id' => 'category_id'])\n ->viaTable...
[ "0.73084545", "0.72652906", "0.72470623", "0.7245617", "0.71972847", "0.7189656", "0.7185332", "0.715868", "0.7149742", "0.7136953", "0.71268445", "0.71114373", "0.71114373", "0.7105843", "0.70697415", "0.70697415", "0.70697415", "0.7069422", "0.7069422", "0.7069422", "0.7045...
0.66148424
72
Create a new controller instance.
public function __construct() { parent::__construct(); }
{ "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
Run the database seeds.
public function run() { $user = User::first(); Todo::unsetEventDispatcher(); factory(Todo::class, rand(10, 20))->create([ 'user_id' => $user->id, ]); }
{ "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
Dipsplay image for resizing
public function getResize() { $ratio = 1.0; $image = Input::get('img'); $dir = Input::get('dir'); $original_width = Image::make(base_path() . "/" . Config::get('lfm.images_dir') . $dir . "/" . $image)->width(); $original_height = Image::make(base_path() . "/" . Config::get('lfm.images_dir') . $dir . "/" . $image)->height(); $scaled = false; if ($original_width > 600) { $ratio = 600 / $original_width; $width = $original_width * $ratio; $height = $original_height * $ratio; $scaled = true; } else { $height = $original_height; $width = $original_width; } if ($height > 400) { $ratio = 400 / $original_height; $width = $original_width * $ratio; $height = $original_height * $ratio; $scaled = true; } return View::make('laravel-filemanager::resize') ->with('img', Config::get('lfm.images_url') . $dir . "/" . $image) ->with('dir', $dir) ->with('image', $image) ->with('height', number_format($height, 0)) ->with('width', $width) ->with('original_height', $original_height) ->with('original_width', $original_width) ->with('scaled', $scaled) ->with('ratio', $ratio); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }", "public function show_image() {\n\t $options = Request::get(\"params\");\n\...
[ "0.7092627", "0.7031123", "0.68330747", "0.67053425", "0.6561827", "0.64876324", "0.6459978", "0.6454423", "0.6400824", "0.6396083", "0.63904625", "0.63521814", "0.6270974", "0.6262182", "0.6232434", "0.62207997", "0.62072235", "0.6189692", "0.6172086", "0.61320376", "0.61188...
0.5660515
82
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE produit (id INT AUTO_INCREMENT NOT NULL, reference VARCHAR(255) NOT NULL, designation VARCHAR(255) DEFAULT NULL, quantite INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, login VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), UNIQUE INDEX UNIQ_8D93D649AA08CB10 (login), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE emplacement (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE historique (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, produit_id INT DEFAULT NULL, date DATETIME NOT NULL, action VARCHAR(255) NOT NULL, quantite INT NOT NULL, INDEX IDX_EDBFD5ECA76ED395 (user_id), INDEX IDX_EDBFD5ECF347EFB (produit_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE historique ADD CONSTRAINT FK_EDBFD5ECA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)'); $this->addSql('ALTER TABLE historique ADD CONSTRAINT FK_EDBFD5ECF347EFB FOREIGN KEY (produit_id) REFERENCES produit (id)'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNE...
[ "0.80062366", "0.79145443", "0.79145443", "0.79145443", "0.7572342", "0.756089", "0.75283176", "0.7498379", "0.7493237", "0.7453656", "0.74463314", "0.7433381", "0.74307704", "0.7427088", "0.741794", "0.73779047", "0.7374933", "0.7370453", "0.73637444", "0.73505706", "0.73290...
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE historique DROP FOREIGN KEY FK_EDBFD5ECF347EFB'); $this->addSql('ALTER TABLE historique DROP FOREIGN KEY FK_EDBFD5ECA76ED395'); $this->addSql('DROP TABLE produit'); $this->addSql('DROP TABLE user'); $this->addSql('DROP TABLE emplacement'); $this->addSql('DROP TABLE historique'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo'...
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.705336...
0.0
-1
Determine whether the user can view any models.
public function viewAny(User $user) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "private function canView(): bool\n {\n return true;\n }", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "public function au...
[ "0.6862475", "0.67325985", "0.6683704", "0.6636148", "0.65336263", "0.6531583", "0.65228844", "0.65157175", "0.65027", "0.64962524", "0.64939487", "0.6492319", "0.6490075", "0.6443429", "0.64300334", "0.64055836", "0.6399019", "0.63855416", "0.6379551", "0.6366862", "0.636240...
0.0
-1
Determine whether the user can view the model.
public function view(User $user) { if($user->permisos->contains('slug', 'Paciente.ver')) { return true; }elseif($user->permisos->contains('slug', 'ver.Paciente')) { return true; }elseif($user->permisos->contains('slug', 'Paciente.editar')) { return true; }elseif($user->permisos->contains('slug', 'Editar.Paciente')) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') &&...
[ "0.74192244", "0.73926866", "0.73587644", "0.731265", "0.72216856", "0.72160876", "0.70797694", "0.70411503", "0.7034548", "0.6997131", "0.69464743", "0.68929696", "0.68870556", "0.6883539", "0.68338764", "0.68131477", "0.68131477", "0.6810962", "0.6809471", "0.68050355", "0....
0.0
-1
Determine whether the user can create models.
public function create(User $user) { if($user->permisos->contains('slug', 'Paciente.crear')) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canCreate();", "public function canCreate();", "private function canCreate()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($ro...
[ "0.7778275", "0.7778275", "0.7579488", "0.75224614", "0.751396", "0.7406157", "0.7359211", "0.71444124", "0.71313286", "0.70818734", "0.7059168", "0.70359224", "0.6997148", "0.69920594", "0.69206184", "0.6914132", "0.6859784", "0.68434596", "0.68231726", "0.6808316", "0.68039...
0.0
-1
Determine whether the user can update the model.
public function update(User $user, Paciente $paciente) { if($user->permisos->contains('slug','Paciente.editar')){ return true; }elseif($user->permisos->contains('slug', 'Editar.Paciente')) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "function updatesAllowed() {\n\t\treturn $this->getupdatable() ...
[ "0.81162834", "0.781202", "0.7761809", "0.7756841", "0.7743874", "0.7647602", "0.7609891", "0.7579814", "0.75415283", "0.75036174", "0.74731016", "0.74154335", "0.7396818", "0.7354857", "0.7346884", "0.73095524", "0.7292035", "0.7230987", "0.71980274", "0.7171308", "0.7150799...
0.0
-1
Determine whether the user can delete the model.
public function delete(User $user, Paciente $paciente) { if($user->permisos->contains('slug','Paciente.borrar')){ return true; }elseif($user->permisos->contains('slug','borrar.Paciente')){ return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }", "public function can_delete () {\r\n\r\n return ...
[ "0.78115165", "0.7799225", "0.77931285", "0.7774248", "0.7762861", "0.772955", "0.7658145", "0.76024574", "0.75723165", "0.7447689", "0.741027", "0.7360865", "0.7339668", "0.73045045", "0.7292303", "0.7275476", "0.72221464", "0.7194365", "0.7111255", "0.710949", "0.70957327",...
0.0
-1
Determine whether the user can restore the model.
public function restore(User $user, Paciente $paciente) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function can_restore() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'restore' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "public function restore($user, $model)\n {\n\n if( $user->h...
[ "0.8035043", "0.73696864", "0.7163435", "0.6989848", "0.6810561", "0.6790965", "0.67768496", "0.6649942", "0.6633892", "0.65875465", "0.6574493", "0.6452826", "0.64325875", "0.6387501", "0.6362594", "0.6316961", "0.6275875", "0.6255632", "0.6227469", "0.6227429", "0.62272346"...
0.0
-1
Determine whether the user can permanently delete the model.
public function forceDelete(User $user, Paciente $paciente) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }", "public function delete(): bool\n {\n return $this->i...
[ "0.7541273", "0.7426929", "0.7391456", "0.7386837", "0.73789275", "0.7325759", "0.72253746", "0.71528107", "0.7121572", "0.71149886", "0.7112128", "0.70739293", "0.7054756", "0.70251435", "0.70234054", "0.7015319", "0.69836354", "0.69265026", "0.6918295", "0.6872948", "0.6853...
0.0
-1
A basic test example.
public function testLoginUser() { $this->artisan('db:seed'); $this->visit('/login') ->type('administrator@gmail.com', 'email') ->type('123456', 'password') ->press('Login') ->seePageIs('/home'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n }", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "public function testBasicExample()\n {\n $this->assertTrue(true);\n }", "public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }", "functio...
[ "0.7977854", "0.77753335", "0.76435244", "0.7610687", "0.754975", "0.75405073", "0.75393844", "0.74867696", "0.74400353", "0.7432722", "0.7412231", "0.73547494", "0.73383486", "0.7337478", "0.7308627", "0.7305436", "0.72681046", "0.7260569", "0.72460294", "0.7215908", "0.7195...
0.0
-1
Creates a form to delete a GrabData entity.
private function createDeleteForm(GrabRule $grabDatum) { return $this->createFormBuilder() ->setAction($this->generateUrl('admin_sa_grab-data_delete', array('id' => $grabDatum->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteForm()\n\t{\n\t\t$form = new \\IPS\\Helpers\\Form( 'form', 'delete' );\n\t\t$form->addMessage( 'node_delete_blurb_no_content' );\n\t\t\n\t\treturn $form;\n\t}", "private function createDeleteForm ( Maileguak $maileguak )\n {\n return $this->createFormBuilder()\n ...
[ "0.6796001", "0.6518372", "0.64857924", "0.6419978", "0.64066726", "0.637552", "0.6363311", "0.6347952", "0.6329355", "0.6320336", "0.6317296", "0.6304899", "0.6270608", "0.6239076", "0.6237239", "0.6220017", "0.6208971", "0.6202587", "0.6201817", "0.6193901", "0.61895883", ...
0.7199301
0
Run the database seeds.
public function run() { DB::table('pets')->insert([ 'name' => "Lolo", //Cambiar id en caso de error 'species' => "dog", 'race' => "Labrador", 'owner_id' => "3", 'sex' => "masculine", 'age' => "5", 'commentary' => "Es muy lindo", 'personality' => "calm", 'size' => "tiny", ]); }
{ "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
Display a single summary
function cbDisplaySummary($number) { global $EDIT_SUMMARY_URL; cbTrace("DISPLAYING " . $number); $heftRow = cbFindHeftRow($number) or cbTrace(mysql_error()); $numRows = mysql_numrows($heftRow); $title = mysql_result($heftRow, 0, "title"); $author = mysql_result($heftRow, 0, "author"); $summaryRow = cbFindSummaryRow($number); $summaryCount = mysql_numrows($summaryRow); $url = sprintf("http://perry-kotlin.app.heroku/api/covers/%d", $number); $date = null; if ($summaryCount > 0) { $summary = mysql_result($summaryRow, 0, "summary"); $englishTitle = mysql_result($summaryRow, 0, "english_title"); $date = mysql_result($summaryRow, 0, "date"); $authorName = mysql_result($summaryRow, 0, "author_name"); if ($date == null) $date = ''; } cbGenHtml($number, $title, $englishTitle, $author, $summary, $summaryCount, $url, $authorName, $date); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display_summary() {\n // FIXME\n }", "public function summary();", "public function getSummary();", "public function getSummary(): string;", "function get_summary() {\n return $this->summary;\n }", "public function getSummary(): string\n {\n return $this->sum...
[ "0.8464724", "0.8124023", "0.78381956", "0.75764513", "0.7574754", "0.74134326", "0.7402533", "0.7402533", "0.74022454", "0.74022454", "0.74022454", "0.74022454", "0.74022454", "0.74022454", "0.74022454", "0.73995876", "0.73995876", "0.73995876", "0.7377782", "0.7312386", "0....
0.68596494
35
displaySummary Generate a link to the image cover
function cbGenCover($url, $align) { return '<a href="' . $url . '">' . '<img style="padding: 10px;" align="' . $align . '" border="0" width="200" height="250"' . 'src="' . $url . '" />' . '</a>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function RenderImages_withLink_andSummary() {\n\t$htTitle = $this->NameString();\n\t$htStatus = $this->RenderCatalogSummary_HTML();\n\t$qStock = $this->QtyInStock();\n\t$htStock = \"$qStock in stock\";\n\t$htPopup = \"&ldquo;$htTitle&rdquo;%attr%\\n$htStatus\\n$htStock\";\n\t$htImgs = $this->RenderImages_fo...
[ "0.7493668", "0.6927356", "0.69032794", "0.6735994", "0.6732984", "0.6632519", "0.6328679", "0.6265372", "0.621118", "0.6185384", "0.61649746", "0.614992", "0.61335355", "0.61061037", "0.6096102", "0.6072653", "0.6058839", "0.6028207", "0.60166925", "0.59910464", "0.5974214",...
0.6236638
8
Generate the HTML content for this summary.
function cbGenHtml($number, $title, $englishTitle, $author, $summary, $summaryCount, $url, $authorName, $date) { echo '<p align="center">' . "<p align='center'>" . cbGenSpan("number", $number) . ' - ' . cbGenSpan("german-title", $title) . "<br>" . cbGenSpan("english-title", $englishTitle) . "<br>" . cbGenSpan("author", $author) . "<hr width='20%'/>" . "</p>" . "<htr>" . "<table><tr><td>" ; if ($summaryCount > 0) { echo cbGenSpan("text", $summary); echo '</td>' . '<td valign="top">' . cbGenCover($url, "right") . '</td></tr></table>' ; } else { global $MAIN_URL, $EDIT_SUMMARY_URL; echo '</table>' . '<p align="center">' . cbGenCover($url, "center") . '<br>' . 'No summary was found for this issue.<br> You can <a href="' . $EDIT_SUMMARY_URL . '?number=' . $number . '">submit one</a> or return to the ' . '<a href="' . $MAIN_URL . '">main page</a></p>'; } echo '<p align="right">' . (is_null($authorName) ? "" : cbGenSpanSmall("author", $authorName)) . (is_null($date) ? "" : " " . cbGenSpanSmall("date", $date)) . '</p>' ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function generateHtml()\n\t{\n\t}", "abstract public function generateHtml();", "public function getContent()\n {\n $this->_html = '<h2>' . $this->displayName . '</h2>';\n if (Tools::isSubmit('btnSubmit')) {\n $this->updateConfiguration();\n }\n $this->showCo...
[ "0.6869113", "0.6850675", "0.68029463", "0.6791693", "0.6688932", "0.6621305", "0.66144556", "0.65741944", "0.65344363", "0.65276474", "0.6504967", "0.64910567", "0.6471083", "0.6460833", "0.64495164", "0.6430129", "0.6430129", "0.64215016", "0.63996667", "0.63976926", "0.639...
0.61672544
58
SHOW TEAM LIST Show players in sub team $game_id $team_id $team_sub_id $league_id $allowed_player_id $mode= 1 league ID isn't known = 2 league ID is known
function ShowTeamShowPlayers($team_id,$team_sub_id,$game_id,$mode = 1,$allowed_player_id = 0){ global $db_league_players,$db_admin,$db_admin_guids,$db_clan_games; if ($mode == 2){ $admin_guids = ""; $sub_team = ""; } else { $res_game = mysql_query("SELECT clan_games_game FROM $db_clan_games WHERE clan_games_id = ".(integer)$game_id) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $ar_game = mysql_fetch_array($res_game); $sub_team = "<tr style=\"background: #DCE3F1;\">\n"; $sub_team .= " <td colspan=\"5\" class=\"eden_title_middle\">Sub Team - ".$ar_game['clan_games_game']."</td>\n"; $sub_team .= "</tr>\n"; } $output = $sub_team; $res_player = mysql_query(" SELECT a.admin_id, a.admin_nick, a.admin_team_own_id, ag.admin_guid_guid, lp.league_player_id, lp.league_player_position_captain, lp.league_player_position_assistant, lp.league_player_position_player FROM $db_league_players AS lp JOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id LEFT JOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_game_id=".(integer)$game_id." WHERE lp.league_player_team_id=".(integer)$team_id." AND lp.league_player_game_id=".(integer)$game_id) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $num = mysql_num_rows($res_player); $output .= "<tr style=\"background: #ff8080;\">\n"; if ($num > 0){ $output .= " <td width=\"120\" valign=\"middle\" class=\"eden_title_middle\">ID</td>\n"; $output .= " <td align=\"left\" valign=\"top\" class=\"eden_title_middle\">"._LEAGUE_PLAYER_NICK."</td>\n"; $output .= " <td align=\"left\" valign=\"top\" class=\"eden_title_middle\">"._LEAGUE_PLAYER_POSITION."</td>\n"; $output .= " <td align=\"left\" valign=\"top\" class=\"eden_title_middle\">"._LEAGUE_GUID."</td>\n"; $output .= " <td align=\"left\" valign=\"top\" class=\"eden_title_middle\"></td>\n"; } else { $output .= " <td colspan=\"5\" class=\"eden_title_middle\">"._LEAGUE_TEAM_NO_PLAYER_IN_SUB."</td>\n"; } $output .= "</tr>\n"; $cislo = 0; while ($ar_player = mysql_fetch_array($res_player)){ if ($cislo % 2 == 0){ $cat_class = "cat_level2_even";} else { $cat_class = "cat_level2_odd";} $output .= "<tr class=\"".$cat_class."\">\n"; $output .= " <td align=\"left\" valign=\"top\">".$ar_player['admin_id']."</td>\n"; $output .= " <td width=\"120\" valign=\"middle\">"; if ($mode == 2){ $output .= "<img src=\"./images/sys_"; if (in_array($ar_player['league_player_id'],$allowed_player_id)){ $output .= "yes"; $alt = _LEAGUE_PLAYER_PLAY; } else { $output .= "no"; $alt = _LEAGUE_PLAYER_NO_PLAY; } $output .= ".gif\" width=\"15\" height=\"15\" alt=\"".$alt."\" title=\"".$alt."\"> "; } $output .= "<strong>".stripslashes($ar_player['admin_nick'])."</strong>"; $output .= " </td>\n"; $output .= " <td align=\"left\" valign=\"top\">"; if (LeagueCheckPrivileges("O",$ar_player['admin_id'],$team_id,"") == $team_id){$output .= _LEAGUE_PLAYER_POSITION_O; $comma = ", ";} else {$comma = "";} if (LeagueCheckPrivileges("C",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_C;} if (LeagueCheckPrivileges("A",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_A;} if (LeagueCheckPrivileges("P",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_P;} $output .= " </td>\n"; $output .= " <td align=\"left\" valign=\"top\">"; if ($ar_player['admin_guid_guid'] != ""){ $output .= stripslashes($ar_player['admin_guid_guid']);} else {$output .= "<span class=\"red\">"._LEAGUE_PLAYER_NO_GUID."</span>";} $output .= "</td>\n"; $output .= " <td align=\"left\" valign=\"top\"></td>\n"; $output .= "</tr>\n"; $cislo++; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListAllowedPlayers(){\n\t\n\tglobal $db_admin,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_teams_sub_leagues,$db_league_leagues,$db_league_players,$db_clan_games,$db_league_seasons_round_allowed_players;\n\t\n\tif ($_GET['mode'] != \"league\"){\n\t\t\n\t\techo Menu();\n\t\t\n\t\tKillUs...
[ "0.72173315", "0.6366328", "0.62107897", "0.5962764", "0.59562147", "0.58814335", "0.5831519", "0.58178693", "0.5812512", "0.5761344", "0.57304186", "0.5712501", "0.56841695", "0.5677066", "0.5673284", "0.56380284", "0.56097174", "0.56029207", "0.5587503", "0.55863094", "0.55...
0.84685683
0
ZOBRAZENI SEZNAMU HRACU SPLNUJICICH PODMINKY LIGY $_GET['id'] = Mod zobrazeni prazdna normalni (zobrazi se jen kapitanem povoleni hraci a jejich giudy atd) id normalni (zobrazi se jen kapitanem povoleni hraci jen jejich giudy) all Zobrazi se i kapitanem nepovoleni hraci, jejich nicky atd allid Zobrazi se i kapitanem nepovoleni hraci jen jejich GUIDY
function ListAllowedPlayers(){ global $db_admin,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_teams_sub_leagues,$db_league_leagues,$db_league_players,$db_clan_games,$db_league_seasons_round_allowed_players; if ($_GET['mode'] != "league"){ echo Menu(); KillUse($_SESSION['loginid']); } echo "<table width=\"857\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; if ($_GET['lid'] == 0){ echo " <tr>\n"; echo " <td>"._LEAGUE_NO_LEAGUE_ID."</td>\n"; echo " </tr>\n"; } else { echo " <tr>\n"; if ($_GET['show'] != "id" && $_GET['show'] != "season_players_all_guid"){ echo " <td width=\"30\" valign=\"middle\" class=\"eden_title\">ID</td>\n"; echo " <td align=\"left\" valign=\"top\" class=\"eden_title\">"._LEAGUE_TEAM."</td>\n"; echo " <td align=\"left\" valign=\"top\" class=\"eden_title\">"._LEAGUE_PLAYER_NICK."</td>\n"; } echo " <td align=\"left\" valign=\"top\" class=\"eden_title\">"._LEAGUE_GUID."</td>\n"; echo " </tr>\n"; //$msg = LeagueGenerateListAllowedPlayers((float)$_GET['lid'],(float)$_GET['sid'],(float)$_GET['rid']); switch ($_GET['show']){ case "id": $colspan = 1; $res_round = mysql_query(" SELECT league_season_round_allowed_player_guid FROM $db_league_seasons_round_allowed_players WHERE league_season_round_allowed_player_season_round_id=".(float)$_GET['rid']." ORDER BY league_season_round_allowed_player_guid") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); break; case "season_players_all": $colspan = 4; break; case "season_players_all_guid": $colspan = 1; break; default: $colspan = 4; $res_round = mysql_query(" SELECT a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, ll.league_league_id, ll.league_league_game_id, lsrap.league_season_round_allowed_player_guid FROM $db_league_seasons_round_allowed_players AS lsrap JOIN $db_league_leagues AS ll ON ll.league_league_id=lsrap.league_season_round_allowed_player_league_id JOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id JOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id WHERE lsrap.league_season_round_allowed_player_season_round_id=".(float)$_GET['rid']." ORDER BY lsrap.league_season_round_allowed_player_team_sub_id ASC, a.admin_nick ASC") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $_GET['show'] = "all"; } $cislo = 0; // pro zobrazeni povolenych hracu if ($_GET['show'] == "id" || $_GET['show'] == "all"){ while ($ar_round = mysql_fetch_array($res_round)){ if ($cislo % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} echo "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; if ($_GET['show'] != "id"){ echo " <td width=\"30\" align=\"right\" valign=\"top\">".$ar_round['admin_id']."</td>\n"; echo " <td width=\"150\" align=\"left\" valign=\"top\">".stripslashes($ar_round['league_team_name'])."</td>\n"; echo " <td valign=\"middle\"><strong>".stripslashes($ar_round['admin_nick'])."</strong></td>\n"; } echo " <td align=\"left\" valign=\"top\">"; if (empty($ar_round['league_season_round_allowed_player_guid'])){echo "<span class=\"red\">"._LEAGUE_PLAYER_NO_GUID."</span>";} else {echo stripslashes($ar_round['league_season_round_allowed_player_guid']);} echo "</td>\n"; echo " </tr>\n"; $cislo++; } unset($ar_round); } // pro zobrazeni vsech hracu if ($_GET['show'] == "season_players_all" || $_GET['show'] == "season_players_all_guid"){ $res_team = mysql_query(" SELECT lt.league_team_id, lt.league_team_name, ltsl.league_teams_sub_league_team_sub_id, ltsl.league_teams_sub_league_league_id FROM $db_league_teams_sub_leagues AS ltsl JOIN $db_league_teams AS lt ON lt.league_team_id=ltsl.league_teams_sub_league_team_id WHERE ltsl.league_teams_sub_league_league_id=".(integer)$_GET['lid']) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); while ($ar_team = mysql_fetch_array($res_team)){ $res_player = mysql_query(" SELECT a.admin_id, a.admin_nick, ag.admin_guid_guid, lp.league_player_id FROM $db_league_players AS lp JOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id JOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_league_guid_id=".(integer)$ar_team['league_teams_sub_league_league_id']." AND ag.admin_guid_guid != '' WHERE lp.league_player_team_sub_id=".(integer)$ar_team['league_teams_sub_league_team_sub_id']) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $i=1; while ($ar_player = mysql_fetch_array($res_player)){ if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} echo "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; if ($_GET['show'] != "season_players_all_guid"){ echo " <td width=\"30\" align=\"right\" valign=\"top\">".$ar_player['admin_id']."</td>\n"; echo " <td width=\"150\" align=\"left\" valign=\"top\">".stripslashes($ar_team['league_team_name'])."</td>\n"; echo " <td valign=\"middle\"><strong>".stripslashes($ar_player['admin_nick'])."</strong></td>\n"; } echo " <td align=\"left\" valign=\"top\">".stripslashes($ar_player['admin_guid_guid'])."</td>\n"; echo " </tr>\n"; $i++; } } } } echo "</table>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ler_id($id) {\n $x = (int)$id;\n if($x >= $this->bd[0][0] || $x <= 0) {return false;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->...
[ "0.6838743", "0.66630006", "0.6554232", "0.65217537", "0.63153213", "0.63109624", "0.6306744", "0.6271408", "0.62578475", "0.62436444", "0.62272656", "0.6146567", "0.6133375", "0.611305", "0.60886914", "0.60808235", "0.6077351", "0.60739017", "0.6058133", "0.6054362", "0.6044...
0.0
-1
LeagueSeasonTeamsResults Je i v /cfg/eden_league.php Zobrazeni vysledku tymu v sezone
function LeagueSeasonTeamsResults(){ global $db_league_leagues,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_teams,$db_league_awards; global $db_country,$db_league_seasons_rounds; global $eden_cfg; global $url_flags,$url_league_awards; $result = ""; $result .= "<table style=\"width:400px;\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; $result .= " <tr>\n"; $result .= " <td class=\"eden_title\" style=\"width:40px;\">"._LEAGUE_SEASON_ROUND_POSITION."</td>\n"; $result .= " <td class=\"eden_title\" style=\"width:60px;text-align:center;\">"._LEAGUE_SEASON_ROUND_POINTS."</td>\n"; $result .= " <td class=\"eden_title\" style=\"width:50px;\">"._CMN_COUNTRY."</td>\n"; $result .= " <td class=\"eden_title\">"._LEAGUE_TEAM."</td>\n"; $result .= " </tr>\n"; $res_results_teams = mysql_query(" SELECT lt.league_team_id, lt.league_team_name, lsrt.league_season_result_team_team_sub_id, lsrt.league_season_result_team_points, c.country_shortname, c.country_name, ls.league_season_end FROM $db_league_seasons_results_teams AS lsrt JOIN $db_league_teams AS lt ON lt.league_team_id = lsrt.league_season_result_team_team_id JOIN $db_country AS c ON c.country_id = lt.league_team_country_id JOIN $db_league_seasons AS ls ON ls.league_season_id = ".(integer)$_GET['sid']." WHERE lsrt.league_season_result_team_season_id = ".(integer)$_GET['sid']." ORDER BY lsrt.league_season_result_team_points DESC LIMIT 10") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $i = 1; while ($ar_results_teams = mysql_fetch_array($res_results_teams)){ // Call function $ar_award = LeagueCheckAwards(2,(integer)$_GET['sid'],0,(integer)$ar_results_teams['league_season_result_team_team_sub_id']); if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} $result .= " <tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; $result .= " <td align=\"right\" valign=\"top\">"; if($ar_award['league_award_place']){$result .= "<img src=\"".$url_league_awards.$ar_award['league_award_img']."\" alt=\"".stripslashes($ar_award['league_award_name'])."\" title=\"".stripslashes($ar_award['league_award_name'])."\" />";} else { $result .= "<strong>".$i."</strong>";} $result .= "</td>\n"; $result .= " <td valign=\"top\" align=\"right\">".$ar_results_teams['league_season_result_team_points']."</td>\n"; $result .= " <td valign=\"top\" align=\"center\"><img src=\"".$url_flags.$ar_results_teams['country_shortname'].".gif\" alt=\"".stripslashes($ar_results_teams['country_name'])."\" title=\"".stripslashes($ar_results_teams['country_name'])."\" /></td>\n"; $result .= " <td valign=\"top\"><a href=\"".$eden_cfg['url']."index.php?action=league_team&mode=team_home&ltid=".$ar_results_teams['league_team_id']."&lang=".$_GET['lang']."&filter=".$_GET['filter']."\" target=\"_self\">".stripslashes($ar_results_teams['league_team_name'])."</a></td>\n"; $result .= " </tr>\n"; $i++; } // Show button for setting awards only if season is over if ($ar_results_teams['league_season_end'] < date("Y-m-d H:i:s")){ $result .= " <tr>\n"; $result .= " <td colspan=\"5\"><br /><form action=\"sys_save.php?action=league_awards_give_to_teams&sid=".$_GET['sid']."\" method=\"post\" name=\"form1\" enctype=\"multipart/form-data\">\n"; $result .= " <input type=\"hidden\" name=\"sid\" value=\"".$_GET['sid']."\">\n"; $result .= " <input type=\"hidden\" name=\"confirm\" value=\"true\">\n"; $result .= " <input type=\"hidden\" name=\"project\" value=\"".$_SESSION['project']."\">\n"; $result .= " <input type=\"submit\" value=\""._LEAGUE_AWARD_SUBMIT_TEAM."\" class=\"eden_button\">\n"; $result .= " </form>\n"; $result .= " </td>\n"; $result .= " </tr>\n"; } $result .= "</table>\n"; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LeagueSeasonPlayersResults(){\n\t\n\tglobal $db_admin,$db_admin_contact,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_players;\n\tglobal $db_country,$db_league_seasons_rounds,$db_league_players,$db_league_awards;\n\tglobal $eden_cfg;\n\tglobal $url_fla...
[ "0.7644486", "0.70751536", "0.67354023", "0.66878366", "0.64946383", "0.637977", "0.6371251", "0.63671374", "0.6346919", "0.63450265", "0.6328256", "0.6295237", "0.61552304", "0.60882163", "0.6080508", "0.6077736", "0.6074801", "0.60459584", "0.6023377", "0.59755325", "0.5968...
0.81306845
0
LeagueSeasonPlayersResults Je i v /cfg/eden_league.php Zobrazeni vysledku hracu v sezone
function LeagueSeasonPlayersResults(){ global $db_admin,$db_admin_contact,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_players; global $db_country,$db_league_seasons_rounds,$db_league_players,$db_league_awards; global $eden_cfg; global $url_flags,$url_league_awards; $result = ""; $result .= "<table style=\"width:500px;\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; $result .= " <tr>"; $result .= " <td class=\"eden_title\" style=\"width:40px;\">"._LEAGUE_SEASON_ROUND_POSITION."</td>"; $result .= " <td class=\"eden_title\" style=\"width:60px;\">"._LEAGUE_SEASON_ROUND_POINTS."</td>"; $result .= " <td class=\"eden_title\">"._CMN_COUNTRY."</td>"; $result .= " <td class=\"eden_title\">"._LEAGUE_PLAYER_NICK."</td>"; $result .= " <td class=\"eden_title\">"._LEAGUE_GUID."</td>"; $result .= " <td class=\"eden_title\">"._LEAGUE_TEAM."</td>"; $result .= " </tr>"; $res_results_players = mysql_query(" SELECT lsrp.league_season_result_player_player_id, a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, lsrp.league_season_result_player_points, c.country_shortname, c.country_name, agid.admin_guid_guid FROM $db_league_seasons_results_players AS lsrp JOIN $db_league_players AS lp ON lp.league_player_id = lsrp.league_season_result_player_player_id JOIN $db_admin AS a ON a.admin_id = lp.league_player_admin_id JOIN $db_admin_contact AS ac ON ac.aid = a.admin_id JOIN $db_admin_guids AS agid ON agid.aid = a.admin_id AND agid.admin_guid_game_id = lp.league_player_game_id JOIN $db_league_teams AS lt ON lt.league_team_id = lp.league_player_team_id JOIN $db_country AS c ON c.country_id = ac.admin_contact_country WHERE lsrp.league_season_result_player_season_id = ".(integer)$_GET['sid']." ORDER BY lsrp.league_season_result_player_points DESC LIMIT 10") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $i = 1; while ($ar_results_players = mysql_fetch_array($res_results_players)){ // Call function $ar_award = LeagueCheckAwards(1,(integer)$_GET['sid'],(integer)$ar_results_players['league_season_result_player_player_id'],0); if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} $result .= "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; $result .= " <td align=\"right\" valign=\"top\">"; if($ar_award['league_award_place']){$result .= "<img src=\"".$url_league_awards.$ar_award['league_award_img']."\" alt=\"".stripslashes($ar_award['league_award_name'])."\" title=\"".stripslashes($ar_award['league_award_name'])."\" />";} else {$result .= "<strong>".$i."</strong>";} $result .= "</td>"; $result .= " <td align=\"left\" valign=\"top\">".$ar_results_players['league_season_result_player_points']."</td>"; $result .= " <td valign=\"top\"><img src=\"".$url_flags.$ar_results_players['country_shortname'].".gif\" alt=\"".stripslashes($ar_results_players['country_name'])."\" title=\"".stripslashes($ar_results_players['country_name'])."\" /></td>"; $result .= " <td valign=\"top\"><a href=\"".$eden_cfg['url']."index.php?action=player&amp;mode=player_acc&amp;id=".$ar_results_players['admin_id']."&amp;lang=".$_GET['lang']."&amp;filter=".$_GET['filter']."\" target=\"_self\">".stripslashes($ar_results_players['admin_nick'])."</a></td>"; $result .= " <td valign=\"top\">".$ar_results_players['admin_guid_guid']."</td>"; $result .= " <td valign=\"top\"><a href=\"".$eden_cfg['url']."index.php?action=league_team&amp;mode=team_home&amp;ltid=".$ar_results_players['league_team_id']."&amp;lang=".$_GET['lang']."&amp;filter=".$_GET['filter']."\" target=\"_self\">".stripslashes($ar_results_players['league_team_name'])."</a></td>"; $result .= "</tr>"; $i++; } $result .= " <tr>\n"; $result .= " <td colspan=\"5\"><br /><form action=\"sys_save.php?action=league_awards_give_to_players&sid=".$_GET['sid']."\" method=\"post\" name=\"form1\" enctype=\"multipart/form-data\">\n"; $result .= " <input type=\"hidden\" name=\"sid\" value=\"".$_GET['sid']."\">\n"; $result .= " <input type=\"hidden\" name=\"confirm\" value=\"true\">\n"; $result .= " <input type=\"hidden\" name=\"project\" value=\"".$_SESSION['project']."\">\n"; $result .= " <input type=\"submit\" value=\""._LEAGUE_AWARD_SUBMIT_PLAYER."\" class=\"eden_button\">\n"; $result .= " </form>\n"; $result .= " </td>\n"; $result .= " </tr>\n"; $result .= "</table>\n"; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LeagueSeasonTeamsResults(){\n\t\n\tglobal $db_league_leagues,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_teams,$db_league_awards;\n\tglobal $db_country,$db_league_seasons_rounds;\n\tglobal $eden_cfg;\n\tglobal $url_flags,$url_league_awards;\n\t\n\t$result = \"\";\n\...
[ "0.78913397", "0.74179655", "0.67957884", "0.6563778", "0.6428345", "0.6420337", "0.6350053", "0.6269324", "0.62174594", "0.62074333", "0.61606354", "0.6091576", "0.6075755", "0.6038162", "0.59723884", "0.59410155", "0.59332544", "0.58928007", "0.585586", "0.580125", "0.57740...
0.80964524
0
Add Results Zadavani vysledku kola $rid= Round ID $mode= add/edit
function AddResults($rid){ global $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players; global $db_admin,$db_admin_contact,$db_country,$db_league_seasons_rounds_results_players,$db_league_teams; global $url_flags; // CHECK PRIVILEGIES if ($_GET['action'] == "results_add" || $_GET['action'] == "results_show"){ if (CheckPriv("groups_league_season_add") <> 1) { echo _NOTENOUGHPRIV;exit;} } else { echo _NOTENOUGHPRIV;exit; } $res_rounds = mysql_query("SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id, c.country_shortname,c.country_name FROM $db_league_seasons_rounds_results_players AS lsrrp JOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=".(float)$rid." JOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id JOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id LEFT JOIN $db_admin_contact AS ac ON ac.aid=a.admin_id LEFT JOIN $db_country AS c ON c.country_id=ac.admin_contact_country WHERE lsrrp.league_season_round_result_player_round_id=".(float)$rid." ORDER BY lsrrp.league_season_round_result_player_place ASC") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); switch ($_GET['action']){ case "results_add": $res_round = mysql_query("SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name FROM $db_league_seasons_rounds AS lsr JOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id JOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id WHERE lsr.league_season_round_id=".(float)$rid) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $nick = ""; $team = ""; $table_width = "857"; echo Menu(); break; case "results_show": $res_round = mysql_query("SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name FROM $db_league_seasons_rounds AS lsr JOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id JOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id WHERE lsr.league_season_round_id=".(float)$rid) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $flag = " <td width=\"20\" align=\"left\" class=\"eden_title\">"._CMN_COUNTRY."</td>\n"; $nick = " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_PLAYER_NICK."</td>\n"; $team = " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_TEAM."</td>\n"; $table_width = "600"; break; default: echo ""; } $ar_round = mysql_fetch_array($res_round); $league_name = stripslashes($ar_round['league_league_name']); $season_id = $ar_round['league_season_round_season_id']; $season_name = stripslashes($ar_round['league_season_name']); $round_num = $ar_round['league_season_round_num']; echo "<table width=\"".$table_width."\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; echo " <tr>\n"; echo " <td colspan=\"3\" align=\"left\">"; if ($_GET['action'] == "results_add"){echo "<h5 style=\"margin:20px 0px 0px 0px;\">".$league_name." > <a href=\"modul_league.php?action=rounds&sid=".$season_id."&project=".$_SESSION['project']."\" target=\"_self\">".$season_name."</a> > "._LEAGUE_SEASON_ROUND." ".$round_num."</h5>";} if ($_GET['action'] == "results_add"){echo "<form action=\"sys_save.php?action=results_add&rid=".$rid."sid=".$season_id."\" method=\"post\" enctype=\"multipart/form-data\">";} echo " </td>\n"; echo " </tr>\n"; echo " <tr style=\"background-color:#dce3f1;\">\n"; echo " <td width=\"50\" align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_ROUND_POSITION."</td>\n"; echo " <td align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_ROUND_POINTS."</td>\n"; echo $flag; echo $nick; echo " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_ROUND_GUID."</td>\n"; echo $team; echo " </tr>\n"; switch ($_GET['action']){ case "results_add": $i=1; while ($ar_round['league_season_round_classified'] >= $i){ $ar_rounds = mysql_fetch_array($res_rounds); if ($ar_rounds['league_season_round_result_player_player_id']){ $guid = $ar_rounds['league_season_round_allowed_player_guid']." (PID ".$ar_rounds['league_season_round_result_player_player_id'].")";} else {$guid ="";} echo "<tr align=\"left\" valign=\"top\" onmouseover=\"this.style.backgroundColor='FFDEDF'\" onmouseout=\"this.style.backgroundColor='FFFFFF'\" style=\"background-color: #FFFFFF;\">\n"; echo " <td width=\"50\" align=\"right\" valign=\"middle\">"; echo " <input type=\"hidden\" name=\"round_player_num\" value=\"".$i."\">"; echo " <input type=\"hidden\" name=\"round_player_data[".$i."_place]\" value=\"".$i."\">"; echo " ".$i.""; echo " </td>\n"; echo " <td align=\"left\">"; echo " <input name=\"round_player_data[".$i."_points]\" size=\"5\" value=\"".$ar_rounds['league_season_round_result_player_points']."\">"; echo " </td>\n"; echo " <td width=\"200\" align=\"left\">"; echo " <input type=\"text\" name=\"round_player_data[".$i."_player_guid]\" size=\"25\" value=\"".$guid."\" autocomplete=\"off\" onkeyup=\"ajax_showOptions(this,'getAllowedPlayerGuidByLetters=1&rid=".$rid."&project=".$_SESSION['project']."',event)\">"; echo " </td>\n"; echo "</tr>\n"; $i++; } echo " <tr align=\"left\" valign=\"top\">\n"; echo " <td align=\"left\" colspan=\"3\"><br />\n"; echo " <input type=\"hidden\" name=\"round\" value=\"".$round_num."\">\n"; echo " <input type=\"hidden\" name=\"rid\" value=\"".$rid."\">\n"; echo " <input type=\"hidden\" name=\"sid\" value=\"".$season_id."\">\n"; echo " <input type=\"submit\" value=\""._LEAGUE_SEASON_ROUND_RESULTS_SAVE."\" class=\"eden_button\">\n"; echo " <input type=\"hidden\" name=\"confirm\" value=\"true\">\n"; echo " <input type=\"hidden\" name=\"project\" value=\"".$_SESSION['project']."\">\n"; if ($ar_rounds){echo " <input type=\"hidden\" name=\"results_mode\" value=\"edit\">\n";} echo " </form>\n"; echo " </td>\n"; echo " </tr>\n"; break; case "results_show": $i=1; while ($ar_rounds = mysql_fetch_array($res_rounds)){ echo " <tr "; if ($i % 2 == 0){echo "class=\"suda\"";} else {echo "class=\"licha\"";} echo ">\n"; echo " <td width=\"50\" align=\"right\" valign=\"middle\">".$i."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_season_round_result_player_points']."</td>\n"; echo " <td valign=\"top\"><img src=\"".$url_flags.$ar_rounds['country_shortname'].".gif\" alt=\"".stripslashes($ar_rounds['country_name'])."\" title=\"".stripslashes($ar_rounds['country_name'])."\" /></td>"; echo " <td align=\"left\">".$ar_rounds['admin_nick']."</td>\n"; echo " <td width=\"200\" align=\"left\">".$ar_rounds['league_season_round_allowed_player_guid']."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_team_name']."</td>\n"; echo "</tr>\n"; $i++; } break; default; echo ""; } echo "</table>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addmatch()\n\t{\n\t\t$option = JFactory::getApplication()->input->getCmd('option');\n\t\t$app = JFactory::getApplication();\n\t\t$post = JFactory::getApplication()->input->post->getArray(array());\n\t\t$post['project_id'] = $app->getUserState( \"$option.pid\", '0' );\n\t\t$post['round_id'] = $app->getUser...
[ "0.57428235", "0.5709192", "0.56578064", "0.5487106", "0.54536265", "0.5443193", "0.54367644", "0.5353914", "0.53331846", "0.53331846", "0.53323746", "0.53142905", "0.5299736", "0.5238555", "0.52384204", "0.5219647", "0.5190561", "0.51560086", "0.51444936", "0.5085695", "0.50...
0.6760309
0
Season Results Zobrazeni vysledku sezony $sid= Season ID $mode= p (players) t (teams)
function SeasonResults($sid = 0,$mode = "p"){ global $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players; global $db_admin,$db_league_seasons_rounds_results_players,$db_league_teams; $res_rounds = mysql_query("SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id FROM $db_league_seasons_rounds_results_players AS lsrrp JOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=".(float)$rid." JOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id JOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id WHERE lsrrp.league_season_round_result_player_round_id=".(float)$rid." ORDER BY lsrrp.league_season_round_result_player_place ASC") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); switch ($mode){ case "p": $res_round = mysql_query("SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name FROM $db_league_seasons_rounds AS lsr JOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id JOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id WHERE lsr.league_season_round_id=".(float)$rid) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $nick = " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_PLAYER_NICK."</td>\n"; $guid = " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_ROUND_GUID."</td>\n"; $table_width = "600"; echo Menu(); break; case "t": $res_round = mysql_query("SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name FROM $db_league_seasons_rounds AS lsr JOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id JOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id WHERE lsr.league_season_round_id=".(float)$rid) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $nick = ""; $guid = ""; $table_width = "400"; break; default: echo ""; } $ar_round = mysql_fetch_array($res_round); $league_name = stripslashes($ar_round['league_league_name']); $season_id = $ar_round['league_season_round_season_id']; $season_name = stripslashes($ar_round['league_season_name']); $round_num = $ar_round['league_season_round_num']; echo "<table width=\"".$table_wifth."\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; echo " <tr>\n"; echo " <td colspan=\"3\" align=\"left\">"; if ($_GET['action'] == "results_add"){echo "<h5 style=\"margin:20px 0px 0px 0px;\">".$league_name." > <a href=\"modul_league.php?action=rounds&sid=".$season_id."&project=".$_SESSION['project']."\" target=\"_self\">".$season_name."</a> > "._LEAGUE_SEASON_ROUND." ".$round_num."</h5>";} if ($_GET['action'] == "results_add"){echo "<form action=\"sys_save.php?action=results_add&rid=".$rid."sid=".$season_id."\" method=\"post\" enctype=\"multipart/form-data\">";} echo " </td>\n"; echo " </tr>\n"; echo " <tr style=\"background-color:#dce3f1;\">\n"; echo " <td width=\"50\" align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_POSITION."</td>\n"; echo " <td align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_POINTS."</td>\n"; echo $nick; echo $guid; echo " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_TEAM."</td>\n"; echo " </tr>\n"; switch ($mode){ case "p": $i=1; while ($ar_rounds = mysql_fetch_array($res_rounds)){ if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} echo "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; echo " <td width=\"50\" align=\"right\" valign=\"middle\">".$i."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_season_round_result_player_points']."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_team_name']."</td>\n"; echo "</tr>\n"; $i++; } break; case "t": $i=1; while ($ar_rounds = mysql_fetch_array($res_rounds)){ if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} echo "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; echo " <td width=\"50\" align=\"right\" valign=\"middle\">".$i."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_season_round_result_player_points']."</td>\n"; echo " <td align=\"left\">".$ar_rounds['admin_nick']."</td>\n"; echo " <td width=\"200\" align=\"left\">".$ar_rounds['league_season_round_allowed_player_guid']."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_team_name']."</td>\n"; echo "</tr>\n"; $i++; } break; default; echo ""; } echo "</table>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LeagueSeasonTeamsResults(){\n\t\n\tglobal $db_league_leagues,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_teams,$db_league_awards;\n\tglobal $db_country,$db_league_seasons_rounds;\n\tglobal $eden_cfg;\n\tglobal $url_flags,$url_league_awards;\n\t\n\t$result = \"\";\n\...
[ "0.65013796", "0.64354765", "0.596145", "0.5950508", "0.5843987", "0.5732962", "0.57239294", "0.56512773", "0.5606506", "0.5581604", "0.5528315", "0.55240315", "0.5465417", "0.546038", "0.53826463", "0.5326893", "0.53207844", "0.5304753", "0.5302938", "0.5300947", "0.5270942"...
0.7893726
0
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($cl...
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0....
0.0
-1
Generates the password hash.
public function hashPassword($password) { return crypt($password, $this->generateSalt()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateHash (string $password): string;", "private function generate_pass()\n {\n echo password_hash('admin', PASSWORD_BCRYPT);\n }", "public function pwgen()\n\t{\n\t\t// $timetarget = 0.05;\n\t\t// $cost = 8;\n\t\t// do {\n\t\t// \t$cost++;\n\t\t// \t$start = microtime(true);\n\...
[ "0.7827893", "0.7688143", "0.7620867", "0.74186283", "0.732633", "0.731628", "0.72858495", "0.72858495", "0.7278988", "0.7139249", "0.7129045", "0.70919985", "0.7082377", "0.7027825", "0.70250845", "0.70067877", "0.6996234", "0.69781065", "0.69382405", "0.69306505", "0.693025...
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('username',$this->username,true); $criteria->compare('password',$this->password,true); $criteria->compare('email',$this->email,true); $criteria->compare('profile',$this->profile,true); $criteria->compare('fio',$this->fio,true); $criteria->compare('about',$this->about,true); $criteria->compare('dob',$this->dob,true); $criteria->compare('profession',$this->profession,true); $criteria->compare('image_name',$this->image_name,true); $criteria->compare('image_thumb',$this->image_thumb,true); $criteria->compare('user_status',$this->user_status,true); $criteria->compare('create_time',$this->create_time,true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('w...
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.597930...
0.0
-1
Au pire changer BDD et mettre tag dans produit
public function getById($id) { $sql = "SELECT produit.*, artiste.nom as auteur, tag.nom as theme FROM produit, produit_artiste, artiste, produit_tag, tag WHERE produit.id = ? AND produit_artiste.id_produit = ? AND produit_artiste.id_artiste = artiste.id AND produit_tag.id_produit = ? AND produit_tag.id_tag = tag.id"; $pdo = $this->getPDO()->prepare($sql); $pdo->execute([$id, $id, $id]); $produit = $pdo->fetchAll(PDO::FETCH_ASSOC); $theme = []; foreach ($produit as $p) { $theme[] = $p["theme"]; } $theme = implode(" ", $theme); $product = call_user_func_array("array_merge", $produit); $product["theme"] = $theme; return $product; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddOrderTag()\n {\n }", "public function test_detachTagRequest() {\n\n }", "public function test_getReplenishmentProcessTags() {\n\n }", "public function testAddReplenishmentTag()\n {\n }", "public function test_addReplenishmentProcessTag() {\n\n }", "public funct...
[ "0.6227458", "0.6175804", "0.61684805", "0.61051464", "0.6064148", "0.6038669", "0.59423625", "0.5894972", "0.5832576", "0.5813255", "0.579089", "0.5781856", "0.56795704", "0.5673445", "0.56663877", "0.56636375", "0.5660746", "0.56462187", "0.56305146", "0.5607749", "0.558509...
0.0
-1
"Attaching event listeners by event name fails if preceded by detachment of all listeners for that type." Test contains 4 steps: assigning event manager to dummy service with single log event listener attached attaching second log listener detaching all log listeners attaching different listener
public function testBug1331() { $di = new Phalcon\Di; $di->set('componentX', function() use ($di) { $component = new LeDummyComponent(); $eventsManager = new Phalcon\Events\Manager; $eventsManager->attach('log', $di->get('MyFirstWeakrefListener')); $component->setEventsManager($eventsManager); return $component; }); $di->set('firstListener', 'MyFirstWeakrefListener'); $di->set('secondListener', 'MySecondWeakrefListener'); // ----- TESTING STEP 1 - SIGNLE 'LOG' LISTENER ATTACHED $component = $di->get('componentX'); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertInstanceOf('MyFirstWeakrefListener', $logListeners[0]); $this->assertCount(1, $logListeners); // ----- TESTING STEP 2 - SECOND 'LOG' LISTENER ATTACHED $component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener')); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertCount(2, $logListeners); $firstLister = array_shift($logListeners); $secondLister = array_shift($logListeners); $this->assertInstanceOf('MyFirstWeakrefListener', $firstLister); $this->assertInstanceOf('MySecondWeakrefListener', $secondLister); // ----- TESTING STEP 3 - ALL 'LOG' LISTENER DETACHED $component->getEventsManager()->detachAll('log'); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertEmpty($logListeners); // ----- TESTING STEP 4 - SINGLE 'LOG' LISTENER ATTACHED SECOND TIME $component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener')); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertInstanceOf('MySecondWeakrefListener', $logListeners[0]); $this->assertCount(1, $logListeners); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testBug1331BackwardCompatibility()\n\t{\n\t\t$di = new Phalcon\\Di;\n\t\t$di->set('componentX', function() use ($di) {\n\t\t\t$component = new LeDummyComponent();\n\t\t\t$eventsManager = new Phalcon\\Events\\Manager;\n\t\t\t$eventsManager->attach('log', $di->get('MyFirstWeakrefListener'));\n\t\t\t$...
[ "0.69945896", "0.67635643", "0.6375402", "0.6313861", "0.62157464", "0.60791045", "0.60077304", "0.596841", "0.5953877", "0.58550787", "0.5840508", "0.58236134", "0.57880807", "0.57793", "0.57509434", "0.57075226", "0.570751", "0.56983125", "0.5659151", "0.5617767", "0.557779...
0.70835644
0
"Attaching event listeners by event name fails if preceded by detachment of all listeners for that type." Test contains 4 steps: assigning event manager to dummy service with single log event listener attached attaching second log listener detaching all log listeners attaching different listener NOTE: This test looks the same as above but it checks dettachAll() instead of detachAll() method. To be DELETED when dettachAll() will not supported any more.
public function testBug1331BackwardCompatibility() { $di = new Phalcon\Di; $di->set('componentX', function() use ($di) { $component = new LeDummyComponent(); $eventsManager = new Phalcon\Events\Manager; $eventsManager->attach('log', $di->get('MyFirstWeakrefListener')); $component->setEventsManager($eventsManager); return $component; }); $di->set('firstListener', 'MyFirstWeakrefListener'); $di->set('secondListener', 'MySecondWeakrefListener'); // ----- TESTING STEP 1 - SIGNLE 'LOG' LISTENER ATTACHED $component = $di->get('componentX'); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertInstanceOf('MyFirstWeakrefListener', $logListeners[0]); $this->assertCount(1, $logListeners); // ----- TESTING STEP 2 - SECOND 'LOG' LISTENER ATTACHED $component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener')); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertCount(2, $logListeners); $firstLister = array_shift($logListeners); $secondLister = array_shift($logListeners); $this->assertInstanceOf('MyFirstWeakrefListener', $firstLister); $this->assertInstanceOf('MySecondWeakrefListener', $secondLister); // ----- TESTING STEP 3 - ALL 'LOG' LISTENER DETACHED $oldErrorLevel = error_reporting(E_ALL & ~E_DEPRECATED); @$component->getEventsManager()->dettachAll('log'); error_reporting($oldErrorLevel); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertEmpty($logListeners); // ----- TESTING STEP 4 - SINGLE 'LOG' LISTENER ATTACHED SECOND TIME $component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener')); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertInstanceOf('MySecondWeakrefListener', $logListeners[0]); $this->assertCount(1, $logListeners); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testBug1331()\n\t{\n\t\t$di = new Phalcon\\Di;\n\t\t$di->set('componentX', function() use ($di) {\n\t\t\t$component = new LeDummyComponent();\n\t\t\t$eventsManager = new Phalcon\\Events\\Manager;\n\t\t\t$eventsManager->attach('log', $di->get('MyFirstWeakrefListener'));\n\t\t\t$component->setEventsM...
[ "0.7127162", "0.6781595", "0.63583195", "0.6212212", "0.59697783", "0.58513314", "0.58121955", "0.58090234", "0.57643217", "0.57622194", "0.5736965", "0.571459", "0.5603445", "0.55999464", "0.559756", "0.5580654", "0.55109173", "0.55109173", "0.5507117", "0.5504725", "0.54952...
0.7113836
1
protected $_orderby = array('coupon_id' => 'DESC', 'order_amount' => 'DESC');
public function _format_row($row) { $row['config'] = !empty($row['config']) ? unserialize($row['config']) : array();// 活动配置 return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrder()\n {\n return 50;\n }", "public function &getOrderBy();", "public function order();", "function getOrder()\n {\n return 20;\n }", "function getOrder()\n {\n return 20;\n }", "function getOrder()\n {\n return 10;\n }", "function getO...
[ "0.71457356", "0.69236326", "0.6833512", "0.67882466", "0.67882466", "0.67563796", "0.6754603", "0.66720504", "0.6658025", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248...
0.0
-1
Display a listing of the resource.
public function index() { // Return log data. return view('admin.submission_log', [ 'config' => $this->configData, 'adminSections' => $this->adminSections, 'logData' => $this->logData ]); }
{ "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() { // }
{ "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(Request $request) { // }
{ "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) { // }
{ "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) { // }
{ "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