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
Test the Str::words method.
public function testStringCanBeLimitedByWords() { $this->assertEquals('Taylor...', Str::words('Taylor Otwell', 1)); $this->assertEquals('Taylor___', Str::words('Taylor Otwell', 1, '___')); $this->assertEquals('Taylor Otwell', Str::words('Taylor Otwell', 3)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testWords()\n {\n $str = new Str($this->testString);\n $result = $str->words();\n $this->assertTrue(is_array($result));\n $this->assertTrue($result[0] === 'The');\n }", "public function testWordsSplitByLetter()\n {\n $str = new Str($this->testString);\n...
[ "0.89038986", "0.7695834", "0.73315555", "0.6994336", "0.68159896", "0.6677628", "0.65418047", "0.63699687", "0.6306306", "0.62634677", "0.6254097", "0.6239441", "0.6131041", "0.6090806", "0.6044039", "0.6042382", "0.6040891", "0.6029683", "0.60265565", "0.6017956", "0.598955...
0.774362
1
DB::delete('update slider set status=? where id = ?','0',[$id]);
public function delete($id) { // return redirect('/')->with('success', 'Record has been deleted'); $product= new productAndKitsController; $product = productAndKitsModel::find($id); $product->status='0'; $product->save(); return redirect('products'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_slider($slider_id)\n {\n $this->db->update('tbl_slider',$this,array('slider_id'=>$slider_id));\n //echo $this->db->last_query();\n }", "function delete_slider($id_slider)\n\t\t{\n\t\t\t$this->db->where('id_slider',$id_slider);\n\t\t\t$this->db->delete('slider');\n\t\t}", "fu...
[ "0.7750674", "0.689563", "0.6875786", "0.68172723", "0.67058975", "0.6681535", "0.6600205", "0.65790784", "0.6567443", "0.65552187", "0.6488891", "0.64586514", "0.6380654", "0.6356436", "0.63342315", "0.6322304", "0.6308179", "0.62800246", "0.6276944", "0.627491", "0.6245507"...
0.0
-1
Display a listing of the resource.
public function index() { return view('admin.customer',['customers' => User::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() { // }
{ "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
Update the specified resource in storage.
public function update(Request $request, $id) { if(isset($request->firstname)){ $request->name = $request->firstname . ' ' . $request->lastname; } //validation $user = User::find($id); $current_email = $user->email; if ($request->email != $current_email) { $this->validate($request, [ 'email' => 'unique:users', ]); } //update customer $customer = User::find($id); //upload file(photo) if ($request->file('file') != null) { $request->file('file') ->move(public_path('uploads'), $request->file('file') ->getClientOriginalName()); $customer->pic = $request->file('file')->getClientOriginalName(); } $customer->name = $request->name; if ($request->email != $current_email) { $customer->email = $request->email; } else{ $customer->email = $current_email; } $customer->name = $request->name; $customer->mobile = $request->mobile; $customer->address = $request->address; $customer->city = $request->city; $customer->state = $request->state; $customer->country = $request->country; $customer->zip = $request->zip; $customer->ip = $request->ip; $customer->status = $request->status; $customer->save(); return back()->with('success','Customer 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) { //delete customer $customer = User::find($id); $customer->delete(); return redirect()->route('customers.index')->with('success','Customer 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
Constructs new message container and clears its internal state
public function __construct() { $this->reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clear()\n {\n $this->messages = [];\n }", "public function clear(){\r\n\t\t$this->_init_messages();\r\n\t}", "public function clearMessages()\n {\n $this->_messages = array();\n return $this;\n }", "public function clear(): void\n {\n $this->messages...
[ "0.6759655", "0.6694383", "0.6664635", "0.6585841", "0.65726465", "0.65234977", "0.64330304", "0.6162081", "0.6160057", "0.59145373", "0.5856848", "0.58269936", "0.5814096", "0.5718538", "0.5714013", "0.56949586", "0.56226987", "0.55620676", "0.55460143", "0.5533074", "0.5476...
0.0
-1
Clears message values and sets default ones
public function reset() { $this->values[self::SHIPMENTRECEIPTDATE] = null; $this->values[self::ATTORNEY] = null; $this->values[self::ACCEPTEDBY] = null; $this->values[self::RECEIVEDBY] = null; $this->values[self::SIGNER] = null; $this->values[self::ADDITIONALINFO] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reset()\n {\n $this->values[self::MESSAGE] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "public function reset()\n {\n $this->values[self::CONVERSATION] = null;\n $this->values[self::SKMSG] = null;\n $this->values[self::IMAGE] = null;\n $this->values[se...
[ "0.7559812", "0.74739546", "0.72973615", "0.7258333", "0.7185409", "0.71421975", "0.7037741", "0.70338154", "0.70285827", "0.70249987", "0.69918084", "0.697904", "0.6965748", "0.68274975", "0.68267244", "0.6796972", "0.6759827", "0.6743557", "0.67366123", "0.6724516", "0.6717...
0.63534236
62
Sets value of 'ShipmentReceiptDate' property
public function setShipmentReceiptDate($value) { return $this->set(self::SHIPMENTRECEIPTDATE, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _setShipmentDate($shipmentDate) {\n\t\t$this->_shipmentDate = $shipmentDate;\n\t}", "public function setShipmentDate($shipmentDate) {\n\t\t$this->_setShipmentDate($shipmentDate);\n\t\treturn $this;\n\t}", "public function setTransactionDate($value) {\n\t\tself::$_transactionDate = $value;\n\t}"...
[ "0.74200964", "0.6654912", "0.6488629", "0.6466877", "0.6368711", "0.6300263", "0.6219233", "0.6219233", "0.621476", "0.6195307", "0.61938936", "0.61670035", "0.6157223", "0.61491805", "0.6140335", "0.61354905", "0.6111516", "0.6048797", "0.6037445", "0.601876", "0.60152745",...
0.8229721
0
Returns value of 'ShipmentReceiptDate' property
public function getShipmentReceiptDate() { $value = $this->get(self::SHIPMENTRECEIPTDATE); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _getShipmentDate() {\n\t\treturn $this->_shipmentDate;\n\t}", "public function getDeliveryDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->deliveryDate;\r\n\t}", "public function setShipmentReceiptDate($value)\n {\n return $this->set(self::SHIPMENTR...
[ "0.7874261", "0.70397305", "0.6937055", "0.68867874", "0.6860003", "0.6753007", "0.6721134", "0.6721134", "0.67160636", "0.6584148", "0.6581428", "0.65775764", "0.65691787", "0.65584755", "0.65058297", "0.6505754", "0.64890975", "0.64764315", "0.6447651", "0.6447634", "0.6440...
0.8686044
0
Sets value of 'Attorney' property
public function setAttorney(\Diadoc\Api\Proto\Invoicing\Attorney $value=null) { return $this->set(self::ATTORNEY, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAttorney()\n {\n return $this->get(self::ATTORNEY);\n }", "public function attorney()\n {\n if ( ! $this->bean->fetchAs('user')->attorney) $this->bean->attorney = R::dispense('user');\n return $this->bean->attorney;\n }", "public function setReplacementAttorn...
[ "0.62699723", "0.5717297", "0.56175715", "0.55537426", "0.54743093", "0.5403522", "0.53441757", "0.53389025", "0.532787", "0.52432436", "0.5170021", "0.5082601", "0.50810486", "0.50624394", "0.50622815", "0.49975216", "0.49863943", "0.49848792", "0.49135265", "0.48861223", "0...
0.75896424
0
Returns value of 'Attorney' property
public function getAttorney() { return $this->get(self::ATTORNEY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function attorney()\n {\n if ( ! $this->bean->fetchAs('user')->attorney) $this->bean->attorney = R::dispense('user');\n return $this->bean->attorney;\n }", "public function attorneyName()\n {\n return $this->bean->attorney()->name;\n }", "public function attorney(){\r\n ...
[ "0.7705918", "0.7640759", "0.7004984", "0.62172234", "0.6099217", "0.6075296", "0.59137", "0.5896022", "0.5885525", "0.585058", "0.5837561", "0.5730552", "0.5730552", "0.5723511", "0.5711633", "0.56643736", "0.5627584", "0.5595766", "0.5581213", "0.5572989", "0.55626506", "...
0.85214347
0
Sets value of 'AcceptedBy' property
public function setAcceptedBy(\Diadoc\Api\Proto\Invoicing\Official $value=null) { return $this->set(self::ACCEPTEDBY, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAcceptedBy()\n {\n return $this->get(self::ACCEPTEDBY);\n }", "public function setAccepted($accepted)\n {\n $this->accepted = (bool) $accepted;\n }", "function setAccepted( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID...
[ "0.6674386", "0.63769877", "0.6203351", "0.5709533", "0.56969076", "0.56572735", "0.55704564", "0.5513172", "0.5511953", "0.54691905", "0.54689705", "0.54527026", "0.5451261", "0.54320323", "0.53791493", "0.53631514", "0.5314622", "0.5305201", "0.5294099", "0.52705073", "0.52...
0.59824246
3
Returns value of 'AcceptedBy' property
public function getAcceptedBy() { return $this->get(self::ACCEPTEDBY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getApprovedBy()\n {\n return $this->approved_by;\n }", "public function getReceivedBy()\n {\n return $this->get(self::RECEIVEDBY);\n }", "public function getBy() { return $this->by; }", "public function getAccepted();", "function getSubmittedBy() {\n\t\treturn $thi...
[ "0.71323013", "0.6525611", "0.62705785", "0.62088686", "0.61826473", "0.61826473", "0.617463", "0.61732364", "0.6167146", "0.60802245", "0.5981977", "0.5969908", "0.593676", "0.59293336", "0.591506", "0.5890674", "0.58672434", "0.58639985", "0.5854752", "0.5849962", "0.581163...
0.8535156
0
Sets value of 'ReceivedBy' property
public function setReceivedBy(\Diadoc\Api\Proto\Invoicing\Official $value=null) { return $this->set(self::RECEIVEDBY, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReceivedBy()\n {\n return $this->get(self::RECEIVEDBY);\n }", "public function setReceiver(User $receiver)\n {\n $this->user = $receiver;\n }", "public function setReceiver($receiver) {\n $this->_receiver = $receiver;\n }", "public function setReceiver($...
[ "0.6823584", "0.66585255", "0.6544782", "0.64932007", "0.6350518", "0.6278065", "0.6183146", "0.606616", "0.6052428", "0.6008073", "0.6006125", "0.60020643", "0.59871113", "0.59258544", "0.5904417", "0.5880617", "0.58694434", "0.58552265", "0.5844537", "0.58075285", "0.57794"...
0.63060033
5
Returns value of 'ReceivedBy' property
public function getReceivedBy() { return $this->get(self::RECEIVEDBY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReceiver()\n {\n return $this->user;\n }", "public function getSender() {\n\t\treturn $this -> data['sender'];\n\t}", "public function getReceiver(){\n return $this->receiver;\n }", "public function getSender();", "public function getReceiver()\n {\n ...
[ "0.72834724", "0.7045053", "0.69161606", "0.6875164", "0.68699133", "0.68699133", "0.68007773", "0.67879784", "0.67194515", "0.6696369", "0.6640238", "0.6638411", "0.6638411", "0.6638411", "0.6638411", "0.6638411", "0.6638411", "0.66111237", "0.6597769", "0.6587635", "0.65663...
0.9066102
0
Sets value of 'Signer' property
public function setSigner(\Diadoc\Api\Proto\Invoicing\Signer $value=null) { return $this->set(self::SIGNER, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSigner($val)\n {\n $this->_propDict[\"signer\"] = $val;\n return $this;\n }", "function setSign( $value )\r\n {\r\n $this->Sign = $value;\r\n }", "function setSignature($signature)\n {\n $this->_signature = $signature;\n }", "function setAuthSi...
[ "0.7965138", "0.6232488", "0.60674363", "0.6032574", "0.595182", "0.5818963", "0.57612944", "0.57223207", "0.56430495", "0.56430495", "0.5633575", "0.5572085", "0.5533534", "0.5529121", "0.5460281", "0.5455594", "0.5455594", "0.5454494", "0.5361629", "0.52838343", "0.52694994...
0.74499846
1
Returns value of 'Signer' property
public function getSigner() { return $this->get(self::SIGNER); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSigner()\n {\n if (array_key_exists(\"signer\", $this->_propDict)) {\n return $this->_propDict[\"signer\"];\n } else {\n return null;\n }\n }", "function getSignature()\n {\n return $this->_signature;\n }", "public function getSig...
[ "0.8192158", "0.67831016", "0.6732796", "0.6732796", "0.6732796", "0.6732796", "0.6732796", "0.6697558", "0.6686506", "0.663176", "0.66071093", "0.66071093", "0.6485891", "0.6478548", "0.6394605", "0.6346488", "0.6139838", "0.6132627", "0.6096516", "0.6045992", "0.6024215", ...
0.8148116
1
Sets value of 'AdditionalInfo' property
public function setAdditionalInfo($value) { return $this->set(self::ADDITIONALINFO, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAdditionalInformation(?string $value): void {\n $this->getBackingStore()->set('additionalInformation', $value);\n }", "public function setExtraInfo(array $info)\n {\n $this->extraInfo = $info;\n }", "public function setAdditionalInformation($val)\n {\n $this-...
[ "0.69864225", "0.6979639", "0.68375194", "0.6357125", "0.63409376", "0.6339925", "0.6321244", "0.62204796", "0.62204796", "0.6220195", "0.6220195", "0.6220195", "0.62189466", "0.62189466", "0.62189466", "0.62189466", "0.6200131", "0.61768895", "0.61123496", "0.60899776", "0.5...
0.7534656
0
Returns value of 'AdditionalInfo' property
public function getAdditionalInfo() { $value = $this->get(self::ADDITIONALINFO); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAdditionalInformation()\n {\n return $this->additionalInformation;\n }", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "pub...
[ "0.84661686", "0.8365695", "0.8365695", "0.8364446", "0.8364446", "0.8364446", "0.8364343", "0.8364343", "0.8364343", "0.8364343", "0.83239156", "0.8258973", "0.8108962", "0.7840693", "0.76823896", "0.76316845", "0.7611364", "0.75756484", "0.75314486", "0.7492032", "0.7475470...
0.88274384
0
Call the CI_Model constructor
public function __construct() { parent::__construct(); $this->cart_items = $this->session->userdata('cart_items'); if(!$this->cart_items) { $this->session->set_userdata('cart_items',NULL); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n // Call the CI_Model constructor\n parent::__construct();\n }", "public function __construct()\n {\n // Call the CI_Model constructor\n parent::__construct();\n }", "function __construct...
[ "0.8478336", "0.8478336", "0.81615126", "0.8117826", "0.8117826", "0.80994266", "0.8051992", "0.8007743", "0.79728657", "0.7956983", "0.7944228", "0.7944228", "0.7944228", "0.7944228", "0.7891693", "0.7883193", "0.7849891", "0.7808865", "0.7793594", "0.7751989", "0.773839", ...
0.0
-1
fonction permettant de traiter les erreurs et de les archiver dans un fichier log
function error($type, $msg, $file, $line) { // on lit les principales variables d'environnement // pour ecrire leur contenu dans le log global $HTTP_HOST, $HTTP_USER_AGENT, $REMOTE_ADDR, $REQUEST_URI; // on donne un nom au fichier d'erreur $errorLog = URL_BASE ."erreur.log"; // construction du contenu du fichier d'erreur $errorString = "Date: " . date("d-m-Y H:i:s") . "\n"; $errorString .= "Type d'erreur: $type\n"; $errorString .= "Message d'erreur: $msg\n"; $errorString .= "Fichier: $file($line)\n"; $errorString .= "Host: $HTTP_HOST\n"; $errorString .= "Client: $HTTP_USER_AGENT\n"; $errorString .= "Client IP: $REMOTE_ADDR\n"; $errorString .= "Request URI: $REQUEST_URI\n\n"; // ecriture du log dans le fichier erreur.log $fp = fopen($errorLog, "a+"); fwrite($fp, $errorString); fclose($fp); // n'affiche que if ($type == E_ERROR || $type == E_WARNING ){ // display error message echo "<h4>Erreur (<small>$msg</small>)</h4>"; echo "Nous sommes désolés, mais cette page ne peut être affichée à cause d'une erreur interne. <br /> Cette erreur a été enregistrée et sera corrigée dès que possible. <br /><br/> <a href=# onClick='history.go(-1)'>Cliquer ici pour revenir au menu précédent.</a>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function grabLog(){\n $logDir = Mage::getBaseDir('log') . DS;\n\n // archived directory where we will move them after storing on db\n\t\t$archivedDir = $logDir . $this->_archived . DS;\n\n // create archived directory if not exists\n Mage::getConfig()->getOptions()->createDirIfNo...
[ "0.6389477", "0.63679147", "0.61752146", "0.60900766", "0.5960028", "0.59313244", "0.5916383", "0.5903278", "0.5855573", "0.58471465", "0.58174115", "0.5790787", "0.5728374", "0.56963986", "0.5675502", "0.5621629", "0.5616361", "0.5612194", "0.56072235", "0.55855197", "0.5570...
0.5198117
62
Run the database seeds.
public function run() { $confirmation_code = str_random(30); User::create(array( 'id' => null, 'name' => "nevdk", 'password' => Hash::make("114948"), 'email' => "mrblond.rivz@yandex.ru", 'avatar' => "http://s1.cdnnz.net/var/news/2012/11/22/51906_dzhejk-dzhillenxol_or_jake.jpg", 'confirmation_code' => $confirmation_code, 'fio' => "Дмитрий Кухарчук", 'about' => "пёрсын" )); /*$faker = Faker\Factory::create('ru_RU'); $faker->addProvider(new Faker\Provider\ru_RU\Person($faker)); $faker->addProvider(new Faker\Provider\ru_RU\Internet($faker)); $faker->addProvider(new Faker\Provider\Image($faker)); $faker->addProvider(new Faker\Provider\ru_RU\Text($faker)); DB::table('users')->truncate(); for($i=0;$i<=20;$i++){ User::create(array( 'id' => null, 'name' => $faker->userName, 'password' => $faker->password, 'email' => $faker->email, 'avatar' => $faker->imageUrl(100, 100, 'people'), 'fio' => $faker->firstName." ".$faker->lastName, 'about' => $faker->realText(200) )); }*/ }
{ "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
Bootstrap the application constant.
public function boot() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function boot()\n {\n if(config('app.env') === 'production') {\n \\URL::forceScheme('https'); \n }\n define('EMAIL_FONT', 'Verdana');\n define('SITE_URL', url('/'));\n define('SECONDARY_COLOR', '#294a8e');\n define('SITE_LOGO', url('assets/image...
[ "0.6974324", "0.66127264", "0.6603766", "0.65575427", "0.6554018", "0.6549074", "0.6485486", "0.64707696", "0.64488536", "0.64386415", "0.64062744", "0.63909155", "0.63842285", "0.6375339", "0.63709974", "0.6352027", "0.6352027", "0.6337727", "0.6323101", "0.6283241", "0.6267...
0.0
-1
Register the service provider.
public function register() { $this->app->singleton('command.laravel.make.generator', function ($app) { return new MakeResource($app['files']); }); $this->commands([ 'command.laravel.make.generator', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->a...
[ "0.71774215", "0.7054453", "0.6968271", "0.69677705", "0.6952019", "0.6931252", "0.6926226", "0.6918423", "0.6899592", "0.6895726", "0.6894278", "0.68906504", "0.68906504", "0.6883112", "0.6872877", "0.6865099", "0.68640506", "0.68627584", "0.68624485", "0.68491566", "0.68236...
0.0
-1
Retrieve a configuration value.
public static function get(string $key): mixed { if (!isset(static::$config[$key])) { throw new Exception( sprintf( 'Configuration with key %s not found!', $key ) ); } return static::$config[$key]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get($key)\r\n {\r\n return $this->config[$key];\r\n }", "public function getConfigValue($key)\n {\n return $this->config[$key];\n }", "static function getValue($name) {\r\n if (isset(self::$config[$name])) \r\n return self::$config[$name];\r\n ...
[ "0.7307334", "0.7182838", "0.71592605", "0.7103857", "0.70909715", "0.7019382", "0.70160884", "0.7011554", "0.691592", "0.6902715", "0.687079", "0.6840477", "0.68054175", "0.6803031", "0.6784207", "0.6777952", "0.6777952", "0.6775613", "0.67420775", "0.67310256", "0.6718981",...
0.6202111
79
Set a configuration entry.
public static function set(string $key, mixed $value) { static::$config[$key] = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setConfig($key, $value);", "public function set(string $name, $entry): void;", "public abstract function setConfig($key, $value);", "public static function set( $entry, $value ) {\r\n if ( !property_exists( 'Registry', $entry ) )\r\n throw new LibraryException('Registry entr...
[ "0.70663667", "0.67675793", "0.67285955", "0.6406907", "0.6346483", "0.6307474", "0.62672573", "0.6248922", "0.6164027", "0.6146954", "0.6123163", "0.6122358", "0.6108149", "0.6091098", "0.60199714", "0.6004676", "0.5956158", "0.5951871", "0.5945465", "0.5944834", "0.591178",...
0.5956318
16
Load prices data for a list of product ids and a given store.
public function loadPriceData($storeId, $productIds) { $websiteId = $this->getStore($storeId)->getWebsiteId(); // check if entities data exist in price index table $select = $this->getConnection()->select() ->from(['p' => $this->getTable('catalog_product_index_price')]) ->where('p.customer_group_id = ?', 0) // for all customers ->where('p.website_id = ?', $websiteId) ->where('p.entity_id IN (?)', $productIds); $result = $this->getConnection()->fetchAll($select); return $result; if ($this->limiter > 3) { return $result; } // new added product prices may not be populated into price index table in some reason, // try to force reindex for unprocessed entities $processedIds = []; foreach ($result as $priceData) { $processedIds[] = $priceData['entity_id']; } $diffIds = array_diff($productIds, $processedIds); if (!empty($diffIds)) { $this->getPriceIndexer()->executeList($diffIds); $this->limiter += 1; $this->loadPriceData($storeId, $productIds); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadProductDataCollection($productIds, $storeId = null)\n {\n $collection = $this->productCollectionFactory->create();\n try {\n $store = $this->_storeModelStoreManagerInterface->getStore($storeId);\n } catch (\\Exception $e) {\n $this->_searchHelperDat...
[ "0.6377902", "0.6286178", "0.6254009", "0.5885216", "0.5794441", "0.57587296", "0.5700745", "0.56779045", "0.56328", "0.5610376", "0.5544135", "0.5502267", "0.5482036", "0.53766614", "0.53558075", "0.534285", "0.53397644", "0.5302919", "0.52895576", "0.5261725", "0.5240733", ...
0.71015054
0
Gets query for [[Reservations]].
public function getReservations() { return $this->hasMany(Reservation::className(), ['service_id' => 'id']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReservations(array $query = []): Response\n {\n return $this->get('reservations', $query);\n }", "public function reservations() {\n return $this->hasMany('App\\Reservation')->getResults();\n }", "public function reservations()\n {\n return $this->hasMany(Reser...
[ "0.7292927", "0.719451", "0.6754986", "0.6753897", "0.66162133", "0.65637815", "0.65264463", "0.6490856", "0.6485142", "0.641531", "0.63514847", "0.6326581", "0.61961174", "0.60966027", "0.60914516", "0.6080957", "0.5988641", "0.5876879", "0.5834394", "0.5825535", "0.5821079"...
0.70258766
2
$name serves as a namespace for the session keys
abstract public function __construct(string $name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSession($name);", "public static function getCurrentName($name) {\n return Session::put(Privilege::SESSION_NAME_NAME);\n }", "public function getName()\n {\n return 'session';\n }", "private function setName($name)\n {\n $session = new Zend_Session_Name...
[ "0.70582324", "0.6970325", "0.69551665", "0.6870411", "0.6846554", "0.6813603", "0.6679995", "0.66612285", "0.6646659", "0.6584326", "0.65836036", "0.65539825", "0.6528358", "0.65055376", "0.6442608", "0.64423215", "0.6437564", "0.64023703", "0.63870275", "0.63614535", "0.634...
0.0
-1
Close the session and release the lock
public function close() { $this->sessionClosed = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function unlock_session() {\n \\core\\session\\manager::write_close();\n ignore_user_abort(true);\n }", "function close () {\n\n # create database object if not create\n self::_connect();\n\n $this->link->direct('SELECT RELEASE_LOCK(\"'.$this->session_lock.'\")');\...
[ "0.8162429", "0.7985942", "0.7335534", "0.731751", "0.7297254", "0.72207665", "0.6990429", "0.6941734", "0.68420285", "0.681307", "0.6752454", "0.6674101", "0.665993", "0.6646683", "0.65924126", "0.6590808", "0.65864384", "0.6555097", "0.65355855", "0.64999765", "0.64740115",...
0.7412623
2
Get card details request
public function getCardDetails($parameters = array()) { return $this->createRequest('TopBetta\Services\Accounting\Gateways\Message\RapidDirectGetCardRequest', $parameters); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function card_details(Request $request) {\n\n $cards = Card::select('user_id as id','id as card_id','customer_id',\n 'last_four', 'card_token', 'is_default', \n \\DB::raw('DATE_FORMAT(created_at , \"%e %b %y\") as created_date'))\n ->where('user_id', $request->id)...
[ "0.7329979", "0.7292767", "0.7267805", "0.7259959", "0.7195169", "0.6851935", "0.6775561", "0.6733595", "0.6702249", "0.6688055", "0.66441643", "0.64680374", "0.64126635", "0.6390764", "0.6261462", "0.6248112", "0.62083733", "0.6135064", "0.6135064", "0.6135064", "0.6135064",...
0.7026273
5
/$result = MessageCode::query() >where(MessageCode::FIELD_MOBILE,$mobile) >where(MessageCode::FIELD_CODE,$code) >where(MessageCode::FIELD_UPDATED_AT,'first(); return $result;
public static function getEffectMessageCode($mobile,$code) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_email_from_code(){\n\n $query = $this->db->get_where('tbl_doctor');\n }", "public static function findByCode($code) {\n return self::find()->where(['code' => $code])->one();\n }", "public static function getAllMessages($sender, $receiver)\n{\n $messages = DB::select('select global_...
[ "0.60037595", "0.5944128", "0.5866501", "0.5804676", "0.57873625", "0.57540077", "0.5613337", "0.5598674", "0.5583254", "0.55679345", "0.55558574", "0.55174726", "0.5517319", "0.5459041", "0.5441171", "0.5441171", "0.5441171", "0.5412617", "0.5396176", "0.5396176", "0.5396176...
0.0
-1
Set the route class
public function __construct(array $values = array()) { parent::__construct($values); $this['route_class'] = 'Synapse\\Route'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function & SetRouteClass ($routerClass);", "public function set_class($class)\n\t{\n\t\t$this->route_stack[self::SEG_CLASS] = str_replace(array('/', '.'), '', $class);\n\t}", "public function & SetRouterClass ($routerClass);", "protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route))...
[ "0.8070008", "0.782589", "0.72941405", "0.7226074", "0.7109683", "0.6798517", "0.67389774", "0.6604988", "0.6563212", "0.6527538", "0.6465704", "0.64335763", "0.6425324", "0.6397005", "0.6382114", "0.6340753", "0.6313975", "0.6287683", "0.627938", "0.62666017", "0.6236395", ...
0.0
-1
Override Pimple's offsetGet to add support for initializers
public function offsetGet($id) { $value = parent::offsetGet($id); if (is_object($value)) { $this->initialize($value); } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function offsetGet($offset) {}", "public function offsetGet($offset) {}", "public function offsetGet($offset) {}", "function offsetGet(/*. mixed .*/ $offset){}", "public function offsetGet($offset)\n {\n }", "public function offsetGet($offset);", "public function offsetGet($offset);", "p...
[ "0.6929383", "0.6929383", "0.6926884", "0.6899008", "0.6745722", "0.65956503", "0.65956503", "0.65891385", "0.63396484", "0.6289008", "0.62109786", "0.61604637", "0.6155545", "0.6144535", "0.6144535", "0.6144535", "0.6144535", "0.6144535", "0.6144535", "0.6144535", "0.6144535...
0.0
-1
Add a command to $this['console'] (Symfony's console component)
public function command($command) { if (! $command instanceof Command) { $command = $this[$command]; } $this['console']->add($command); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addCommand($command);", "public function add(Command $command);", "private function registerConsoleCommands()\n {\n // Console Commands\n }", "private function registerConsoleCommands()\n {\n // Console Commands\n }", "public function registerArtisanCommand()\n\t{\...
[ "0.7304341", "0.6926484", "0.68666756", "0.68666756", "0.66503364", "0.6634797", "0.65980995", "0.6595667", "0.6585102", "0.65645355", "0.65317327", "0.6519502", "0.6513228", "0.6480323", "0.64171803", "0.6401555", "0.64002836", "0.63780975", "0.63765", "0.6351101", "0.632373...
0.7712684
0
Set the implementation that should be used for a given pattern name. This can be a class name or an object.
public function setImplementation(string $name, $implementation): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setNamingPattern($pattern ='/([a-zA-Z1-9]+)(Function|Block)$/') {\n\t\t //\"/([a-zA-Z1-9]+)Function$/\";\n\t\t $this->_namingPattern = $pattern;\n\t}", "public function setPattern($pattern) {}", "public function setPattern($pattern) {\n if ($pattern instanceof PanelsPatternInterface) {\n ...
[ "0.6213045", "0.6005729", "0.59967476", "0.59144324", "0.5570548", "0.5485691", "0.5462404", "0.53771013", "0.53156143", "0.5288449", "0.5222408", "0.5217453", "0.5212749", "0.52102244", "0.51750135", "0.51701534", "0.51332945", "0.5117826", "0.5101714", "0.50942975", "0.5092...
0.65185994
0
Adds a pattern to the configuration. It can be added to an alias or as a subpattern, choosing where to place it. This method uses a fluent interface and is followed by `ToAliasOrParent` Example: $configuration >add('strong') >toAlias('inline') >last(); $configuration >add('strong') >toParent('italic') >first();
public function add(string $name): ToAliasOrParent;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPattern($pattern) {\n if ($pattern instanceof PanelsPatternInterface) {\n $this->pattern = $pattern;\n $this->configuration['pattern'] = $pattern->getPluginId();\n }\n elseif (is_string($pattern)) {\n $this->pattern = NULL;\n $this->configuration['pattern'] = $patter...
[ "0.5556643", "0.53016084", "0.5290629", "0.5248685", "0.51410633", "0.5137805", "0.51126206", "0.5085655", "0.5074957", "0.5061189", "0.50297666", "0.50270134", "0.4989072", "0.4967302", "0.4967302", "0.49197653", "0.49001226", "0.48807308", "0.48541895", "0.47041908", "0.469...
0.522914
4
Get the validation rules that apply to the request.
public function rules() { if ($this->isMethod('PATCH')) { return $this->filterWithModelConfiguration(I18nLang::class, I18nLang::getPatchRules()); } elseif ($this->isMethod('PUT')) { return $this->filterWithModelConfiguration(I18nLang::class, I18nLang::getPutRules()); } else { // @fixme Api documentation generator method "GET" for update... return PUT method rules return $this->filterWithModelConfiguration(I18nLang::class, I18nLang::getPutRules()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.76830...
0.0
-1
Retrieve tracking url for the order
public static function getTrackingUrl($orderToken) { return Configs::TRACKING_URL . "#/{$orderToken}"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTrackerUrl($trackingCode, $orderId=null);", "public function get_transaction_url( $order ) {\r\n \r\n $this->view_transaction_url = MDL_COINCHECK_API_BASE. '?cmd=_view-a-trans&id=%s';\r\n \r\n return parent::get_transaction_url( $order );\r\n }", "public function g...
[ "0.718123", "0.6810285", "0.6649919", "0.6514836", "0.6507937", "0.6397123", "0.639575", "0.6339237", "0.63327515", "0.6320452", "0.6300426", "0.62978387", "0.6282804", "0.6278921", "0.62649673", "0.6262171", "0.6246346", "0.6204483", "0.61827457", "0.61535615", "0.6149346", ...
0.7669723
0
Retrieve the print invoice for the order
public static function getPrintInvoice($orderId, $orderToken) { return Configs::URL . "order/{$orderId}/print?token={$orderToken}"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function print_invoice() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n $data['user_org'] = $this->payments_model->get_user_org_details($userid);\n $data['invoice'] = $this->payments_model->get_invoice_details($data['clsid'], $data['crsid'],...
[ "0.77063274", "0.75562555", "0.7248353", "0.6983601", "0.67693925", "0.66512096", "0.66322625", "0.6613494", "0.6580078", "0.65775543", "0.6507405", "0.6497683", "0.64966655", "0.6470866", "0.64156246", "0.63896483", "0.63861483", "0.63789815", "0.63775706", "0.63391715", "0....
0.6570188
10
Retrieve the application configuration array
public static function getAppConfig() { $curl = curl_init(); curl_setopt_array($curl, self::getCurlOptions("config")); return self::getApiResponse($curl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function lazy_get_config(): array\n\t{\n\t\treturn array_merge_recursive($this->configs['app'], $this->construct_options);\n\t}", "public function getConfiguration()\n {\n return self::$config_array;\n }", "public function getConfigArray() {}", "static public function getConfig() {\n ...
[ "0.7990026", "0.79844946", "0.790076", "0.77063787", "0.7671714", "0.7628399", "0.76238364", "0.76238364", "0.76128036", "0.76128036", "0.75476295", "0.7547383", "0.75032234", "0.73868716", "0.73776174", "0.73676825", "0.7366576", "0.7349639", "0.73223424", "0.72953165", "0.7...
0.7100204
35
Retrieve the full path of the uploaded signature
public static function getSignaturePath($relativePath) { return Configs::URL . $relativePath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_signature_path($name) {\n return $this->get_file_path($name) . '.sign';\n }", "protected function getFullPathToUploadFile()\n {\n return $this->fullPathToUploadFile;\n }", "public function get_full_uploaded_file_path()\n {\n return $this->full_uploaded_file_path;\...
[ "0.7191419", "0.68589747", "0.67963266", "0.67591107", "0.675871", "0.67541957", "0.67541957", "0.66949755", "0.6667064", "0.6647249", "0.6627544", "0.6619361", "0.6608753", "0.6608753", "0.6608753", "0.6608753", "0.6608753", "0.66014403", "0.6600791", "0.6532506", "0.6526758...
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->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) { $confirmed = false; $comment = $request->comment; $approval = $request->approval; $documentId = $request->documentId; $id = Auth::id(); $date = date("Y-m-d H:i:s"); if($approval === 'on'){ $confirmed = true; } if($comment == null){ $comment = ""; } $review = Review::create(['user_id'=>$id, 'document_id'=>$documentId, 'comment'=>$comment, 'date'=>$date, 'confirmed'=>$confirmed]); //Find the people that already validated this document. $confirmedReviews = Review::where('document_id', $documentId)->where( function($query){$query->where('confirmed', true);})->get(); //Find people that should validate this document. $userdoc = DocumentUser::where('doc_id', $documentId)->get(); $doc = Document::findOrfail($documentId); if($confirmedReviews->count() === $userdoc->count()){ $doc->status = "REVIEWED"; }else{ $doc->status = "NOT_REVIEWED"; } $doc->save(); $msg = ""; if($confirmed){ $msg = Auth::user()->name." has approved your document"; }else{ $msg = Auth::user()->name." mentioned some changes he want you to include on this document"; } $note = Notification::create(['sender'=>Auth::id(), 'recipient'=>$doc->owner_id, 'doc_id'=>$doc->id, 'version'=>$doc->version, 'is_read'=>false, 'datetime'=>date('Y-m-d H:i:s'), 'message'=>$msg]); if($confirmed){ return redirect()->action('DocumentController@index'); } return redirect()->action('DocumentController@show', ['id'=>$doc->id]); }
{ "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) { //Hand it to me and i will take care of it }
{ "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(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "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
convert from degrees to radians
function haversine( $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 3963.1676) { $latFrom = deg2rad($latitudeFrom); $lonFrom = deg2rad($longitudeFrom); $latTo = deg2rad($latitudeTo); $lonTo = deg2rad($longitudeTo); $latDelta = $latTo - $latFrom; $lonDelta = $lonTo - $lonFrom; $angle = 2. * asin(sqrt(pow(sin($latDelta / 2.), 2) + cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2.), 2))); return $angle * $earthRadius; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deg2rad2($deg) {\n return ($deg * pi() / 180.0);\n}", "function radToDeg() { # :: Num -> Float\n return new Num\\Float(rad2deg($this->value));\n }", "public function deg2rad() : self\n {\n return $this->map('deg2rad');\n }", "function degree_to_radian($input)\n {\n ...
[ "0.7715345", "0.7611772", "0.7577923", "0.751843", "0.7498324", "0.7478634", "0.74290746", "0.7303316", "0.6922596", "0.63312334", "0.62803537", "0.61912686", "0.60792875", "0.60720044", "0.6032732", "0.6026371", "0.60155135", "0.5968277", "0.59225774", "0.5921811", "0.59119"...
0.0
-1
Generate a sym link. The salt is important in order to remove the deterministic side of the address.
private function create(Photo $photo, string $sizeVariant, string $salt) { // in case of video and raw we always need to use the field 'thumbUrl' for anything which is not the original size $originalFieldName = ($sizeVariant != Photo::VARIANT_ORIGINAL && ($photo->isVideo() || $photo->type == 'raw')) ? self::VARIANT_2_ORIGINAL_FILENAME_FIELD[Photo::VARIANT_THUMB] : self::VARIANT_2_ORIGINAL_FILENAME_FIELD[$sizeVariant]; $originalFileName = (substr($sizeVariant, -2, 2) == '2x') ? Helpers::ex2x($photo->$originalFieldName) : $photo->$originalFieldName; if ($photo->type == 'raw' && $sizeVariant == Photo::VARIANT_ORIGINAL) { $originalPath = Storage::path('raw/' . $originalFileName); } else { $originalPath = Storage::path(Photo::VARIANT_2_PATH_PREFIX[$sizeVariant] . '/' . $originalFileName); } $extension = Helpers::getExtension($originalPath); $symFilename = hash('sha256', $salt . '|' . $originalPath) . $extension; $symPath = Storage::drive('symbolic')->path($symFilename); try { // in theory we should be safe... symlink($originalPath, $symPath); } catch (Exception $exception) { unlink($symPath); symlink($originalPath, $symPath); } $this->{self::VARIANT_2_SYM_PATH_FIELD[$sizeVariant]} = $symFilename; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function generateShareLink()\n {\n $strong = true;\n $appearance = 'sha256';\n return hash($appearance, openssl_random_pseudo_bytes(128, $strong), false);\n }", "public function CreatePublicSymLink()\n {\n $filemanager = $this->getFileManager();\n\n $fullPath = PATH_OUT...
[ "0.6883757", "0.618923", "0.6167013", "0.59339654", "0.5887604", "0.58627725", "0.55396116", "0.550641", "0.54027855", "0.5371698", "0.5366054", "0.5366054", "0.53569615", "0.5349974", "0.532327", "0.5282112", "0.52752346", "0.52659595", "0.52330947", "0.52269167", "0.5207658...
0.0
-1
Set up a link.
public function set(Photo $photo) { $this->photo_id = $photo->id; $this->timestamps = false; // we set up the created_at $now = now(); $this->created_at = $now; $this->updated_at = $now; foreach (self::VARIANT_2_INDICATOR_FIELD as $variant => $indicator_field) { if ($photo->{$indicator_field} !== null && $photo->{$indicator_field} !== 0 && $photo->{$indicator_field} !== '') { $this->create($photo, $variant, strval($now)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLink($url)\n\t{\n\t\t$this->link = $url;\n\t}", "public function setLink($link);", "function link() {\n $this->title = \"link\";\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "function ...
[ "0.7007", "0.694338", "0.68851596", "0.68474627", "0.68474627", "0.67268974", "0.66713977", "0.66247606", "0.6618927", "0.6618785", "0.66085356", "0.6606036", "0.66001076", "0.6581856", "0.648033", "0.6409177", "0.6338342", "0.62993383", "0.6297729", "0.62602365", "0.62349397...
0.0
-1
Given the return array of a photo, override the link provided.
public function override(array &$return) { foreach (self::VARIANT_2_SYM_PATH_FIELD as $variant => $field) { if ($this->$field != '') { // TODO: This could be avoided, if the original variant was also serialized into the sub-array 'sizeVariants', see comment in PhotoCast#toReturnArray if ($variant == Photo::VARIANT_ORIGINAL) { $return['url'] = Storage::drive('symbolic')->url($this->$field); } else { $return['sizeVariants'][$variant]['url'] = Storage::drive('symbolic')->url($this->$field); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPhotoLinkAttribute()\n {\n return $this->attributes['photo_link'] = ($this->photo)?Storage::disk('public')->url($this->photo):config('values.noPhoto');\n }", "public function get_image_link()\n {\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "public funct...
[ "0.6520268", "0.62386245", "0.6188613", "0.6099768", "0.60065246", "0.58699924", "0.56690764", "0.56276137", "0.56235313", "0.56205916", "0.56147367", "0.55549306", "0.5525815", "0.55023104", "0.54522115", "0.5444897", "0.5418164", "0.54179925", "0.54162186", "0.5410759", "0....
0.59698683
5
Given the return array of a photo, override the link provided.
public function overrideFullUrl(array &$return) { foreach (self::VARIANT_2_SYM_PATH_FIELD as $variant => $field) { if ($this->$field != '') { // TODO: This could be avoided, if the original variant was also serialized into the sub-array 'sizeVariants', see comment in PhotoCast#toReturnArray if ($variant == Photo::VARIANT_ORIGINAL) { $return['full_url'] = Storage::drive('symbolic')->url($this->$field); } else { $return['sizeVariants'][$variant]['full_url'] = Storage::drive('symbolic')->url($this->$field); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPhotoLinkAttribute()\n {\n return $this->attributes['photo_link'] = ($this->photo)?Storage::disk('public')->url($this->photo):config('values.noPhoto');\n }", "public function get_image_link()\n {\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "public funct...
[ "0.6520268", "0.62386245", "0.6188613", "0.60065246", "0.59698683", "0.58699924", "0.56690764", "0.56276137", "0.56235313", "0.56205916", "0.56147367", "0.55549306", "0.5525815", "0.55023104", "0.54522115", "0.5444897", "0.5418164", "0.54179925", "0.54162186", "0.5410759", "0...
0.6099768
3
Returns the relative symlinked path of a particular size variant, if it exists.
public function get(string $sizeVariant): string { $field = self::VARIANT_2_SYM_PATH_FIELD[$sizeVariant]; if ($this->$field != '') { return Storage::drive('symbolic')->url($this->$field); } else { return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPath($size){\n\n\t\tif($size=='full'){\n\t\t\treturn $this->getFilePath();\n\t\t}else {\n\n\t\t\tif (array_key_exists($size, Config::get('image.sizes'))) {\n\n\t\t\t\t$parts = explode('.', $this->value);\n\t\t\t\tarray_pop($parts);\n\n\t\t\t\treturn static::getMediaPath() . '/' . implode('.', $p...
[ "0.60312146", "0.593279", "0.58525705", "0.5756368", "0.57476443", "0.5717517", "0.5674111", "0.5475384", "0.53238875", "0.5280697", "0.5252688", "0.52259266", "0.5221644", "0.5147773", "0.5071334", "0.5054699", "0.49727762", "0.49698547", "0.4946099", "0.49257994", "0.487945...
0.6841231
0
before deleting we actually unlink the symlinks.
public function delete() { foreach (self::VARIANT_2_SYM_PATH_FIELD as $variant => $field) { if ($this->$field != '') { $path = Storage::drive('symbolic')->path($this->$field); try { unlink($path); } catch (Exception $e) { Logs::error(__METHOD__, __LINE__, 'could not unlink ' . $path); } } } return parent::delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeleteDirectoryWithLinksAndSymlinks()\n {\n if ( !function_exists( 'link' ) || !function_exists( 'symlink' ) )\n {\n $this->markTestSkipped( 'Missing \"link\" or \"symlink\" function.' );\n return;\n }\n\n $this->createTestDirectories( array(...
[ "0.6682299", "0.66008157", "0.6587069", "0.65488595", "0.6521325", "0.6501601", "0.64481765", "0.6368464", "0.6368171", "0.6267687", "0.6225504", "0.62104803", "0.6163554", "0.6140713", "0.60702455", "0.60550785", "0.6033885", "0.6022012", "0.6015648", "0.60112", "0.6006856",...
0.0
-1
Find the country for an IP address. Always returns a string (parent method may return array) To return the code only, pass in true for the $codeOnly parameter.
public static function ip2country($address, $codeOnly = false) { $results1 = null; $results2 = null; if (isset($_SERVER['HTTP_CF_IPCOUNTRY'])) { $results2 = $_SERVER['HTTP_CF_IPCOUNTRY']; } else { $results1 = parent::ip2country($address); } $returnValue = $results2 ?: $results1; if ($codeOnly) { if (is_array($returnValue)) { return $returnValue['code']; } return $returnValue; } $name = parent::countryCode2name($returnValue); return [ 'code' => $returnValue, 'name' => $name, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function visitor_country()\n {\n $code = null;\n if (Director::isDev()) {\n if (isset($_GET['countryfortestingonly'])) {\n $code = $_GET['countryfortestingonly'];\n Controller::curr()->getRequest()->getSession()->set('countryfortestingonly', $...
[ "0.71452796", "0.71019566", "0.69386697", "0.690375", "0.681859", "0.68109745", "0.65917224", "0.65023303", "0.64344203", "0.6433007", "0.6417532", "0.6405281", "0.6395851", "0.63250035", "0.63166034", "0.6299794", "0.6294193", "0.6262607", "0.62503624", "0.6237037", "0.62235...
0.7044808
2
Returns the country code, for the current visitor.
public static function visitor_country() { $code = null; if (Director::isDev()) { if (isset($_GET['countryfortestingonly'])) { $code = $_GET['countryfortestingonly']; Controller::curr()->getRequest()->getSession()->set('countryfortestingonly', $code); } if ($code = Controller::curr()->getRequest()->getSession()->get('countryfortestingonly')) { Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code); } } if (! $code) { if (isset($_SERVER['HTTP_CF_IPCOUNTRY']) && $_SERVER['HTTP_CF_IPCOUNTRY']) { return $_SERVER['HTTP_CF_IPCOUNTRY']; } $code = Controller::curr()->getRequest()->getSession()->get('MyCloudFlareCountry'); if (! $code) { $address = self::get_remote_address(); if (strlen($address) > 3) { $code = CloudFlareGeoIP::ip2country($address, true); } if (! $code) { $code = self::get_default_country_code(); } if ('' === $code) { $code = Config::inst()->get('CloudFlareGeoip', 'default_country_code'); } Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code); } } return $code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_visitor_country() {\n\t\treturn $this->get_country_code($this->get_visitor_ip_address());\n\t}", "protected static function country_code(): mixed\n\t{\n\t\treturn self::$query->country_code;\n\t}", "public function countryCode();", "public static function country()\n\t{\n\t\treturn static...
[ "0.86774015", "0.7877117", "0.77712077", "0.77142596", "0.7645294", "0.75600326", "0.75285864", "0.74842864", "0.74761164", "0.74761164", "0.74761164", "0.7330843", "0.7325794", "0.7325794", "0.7325794", "0.73137426", "0.73134124", "0.7311447", "0.73039615", "0.72930354", "0....
0.83939046
1
Returns true or false based on form success Set in hooks.raven.php > process()
public function success() { return Session::getFlash('raven:success'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function formSubmitted() {\n return $_SERVER[\"REQUEST_METHOD\"] == 'POST';\n }", "private function processForm()\n {\n //Validate the form passed The Curator's safety procedures.\n if(!$this->Form->validate())\n {\n array_push($this->Form->...
[ "0.69721645", "0.69304556", "0.6874654", "0.6865524", "0.67941236", "0.66425264", "0.65642124", "0.65415466", "0.65379703", "0.6517871", "0.64882517", "0.6430404", "0.6417659", "0.6401707", "0.6399473", "0.63909507", "0.63558567", "0.63370854", "0.6318661", "0.62679195", "0.6...
0.0
-1
Returns an array if errors are present, false if not Set in hooks.raven.php > process()
public function errors() { if ($errors = Session::getFlash('raven')) { return Parse::template($this->content, $errors); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasErrors();", "public function getErrors()\n {\n return $this->processerrors;\n }", "public function get_errors() {\n\t\treturn empty( $this->errors ) ? false : $this->errors;\n\t}", "function hasErrors()\n\t{\n\t\treturn $this->bool_hasErrors;\n\t}", "public function hasError...
[ "0.6748236", "0.67011833", "0.6588821", "0.6565944", "0.65657294", "0.65572774", "0.6445504", "0.64079434", "0.63633114", "0.63633114", "0.63633114", "0.63114154", "0.6255876", "0.6249589", "0.62379557", "0.6230407", "0.62259984", "0.61628133", "0.61529183", "0.61377263", "0....
0.59686005
46
Call the Model constructor
function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "function __construct()\n {\n // 呼叫模型(Model)的建構函數\n parent::__construct();\n \n }", "function __construc()...
[ "0.8196736", "0.8080118", "0.8054001", "0.7839992", "0.78184336", "0.78158236", "0.7770901", "0.773286", "0.7704549", "0.7701882", "0.7701882", "0.7701882", "0.7701882", "0.76811564", "0.76426494", "0.75779855", "0.75710344", "0.75621206", "0.7518676", "0.75171185", "0.751711...
0.0
-1
rescatar los nombre del formulario y asociarlos a las variables de arriba
public function __construct() { $this->nombre = $_POST['nombre']; $this->edad = $_POST['edad']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateFormConstantes()\n {\n $inputs = array();\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Seuil de Calcul Prime fichier',\n 'name' => 'co_seuil_prime_fichier',\n 'desc' => 'Montant du seuil de calcul de la prime',\n ...
[ "0.64029264", "0.6207173", "0.6113303", "0.6057076", "0.6051551", "0.6029386", "0.601214", "0.5936789", "0.5917821", "0.5832835", "0.58186036", "0.58098", "0.58042717", "0.5802802", "0.5800592", "0.5800592", "0.57874703", "0.5774952", "0.5760843", "0.57544863", "0.574601", ...
0.0
-1
Notification Envoyer les identifiants
private function renderMAIL_9_HTML($mod) { $aff = '<div id="search-wrap">'; $aff .= '<div class="slide">'; $aff .= '<img src="../../include/images/1.png" border="0"/> <a class="btn-slide-mail-9" href="#">Notification Envoyer les identifiants</a>'; $aff .= '</div>'; $aff .= '<div id="mail-9-panel" style="display: none;">'; $aff .= ' <table width="100%" border="1">'; $aff .= ' <tr>'; $aff .= ' <td width="120" valign="top">Adresse emetteur</td>'; $aff .= ' <td><input type="text" style="width: 100%" name="MailFrom_9" value="' . stripslashes ( $this->myMail_9->getMailFrom () ) . '"/></td>'; $aff .= ' </tr>'; $aff .= ' <tr>'; $aff .= ' <td width="120" valign="top">Sujet / Objet</td>'; $aff .= ' <td><input type="text" style="width: 100%" name="MailSubject_9" value="' . stripslashes ( $this->myMail_9->getMailSubject () ) . '" /></td>'; $aff .= ' </tr>'; $aff .= ' <tr>'; $aff .= ' <td width="120" valign="top">Entete</td>'; $aff .= ' <td>'; include_once ("../../../../include/js/fckeditor/fckeditor.php"); $oFCKeditor = new FCKeditor ( 'MailHeader_9' ); $oFCKeditor->BasePath = "../../../../include/js/fckeditor/"; $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "200"; // $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Value = stripslashes ( $this->myMail_9->getMailHeader () ); $aff .= $oFCKeditor->CreateHtml (); $aff .= '</td>'; $aff .= ' </tr>'; $aff .= ' <tr>'; $aff .= ' <td width="120" valign="top">Pied</td>'; $aff .= ' <td>'; include_once ("../../../../include/js/fckeditor/fckeditor.php"); $oFCKeditor = new FCKeditor ( 'MailFooter_9' ); $oFCKeditor->BasePath = "../../../../include/js/fckeditor/"; $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "200"; // $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Value = stripslashes ( $this->myMail_9->getMailFooter () ); $aff .= $oFCKeditor->CreateHtml (); $aff .= '</td>'; $aff .= '</tr>'; $aff .= ' </table>'; $aff .= '</div>'; $aff .= '</div>'; return $aff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function track_identity()\n {\n }", "public function getIdentificacao();", "public function getIdentifiers();", "public function getAllIdentifiers() {}", "public function identificacionegresado(){\n \treturn $this->embedsOne('encuestas\\identificacionEgresado');\n }", "public f...
[ "0.6605985", "0.6417686", "0.6006635", "0.59828424", "0.59376496", "0.5912661", "0.58113474", "0.57518643", "0.57021564", "0.56763685", "0.5639466", "0.56240064", "0.55523497", "0.55523497", "0.55523497", "0.55523497", "0.55523497", "0.55523497", "0.55523497", "0.55523497", "...
0.0
-1
Notification Envoyer Relance Satisfaction
private function renderMAIL_10_HTML($mod) { $aff = '<div id="search-wrap">'; $aff .= '<div class="slide">'; $aff .= '<img src="../../include/images/1.png" border="0"/> <a class="btn-slide-mail-10" href="#">Phase Satisfaction - Relance Questionnaire</a>'; $aff .= '</div>'; $aff .= '<div id="mail-10-panel" style="display: none;">'; $aff .= ' <table width="100%" border="1">'; $aff .= ' <tr>'; $aff .= ' <td width="120" valign="top">Adresse emetteur</td>'; $aff .= ' <td><input type="text" style="width: 100%" name="MailFrom_10" value="' . stripslashes ( $this->myMail_10->getMailFrom () ) . '"/></td>'; $aff .= ' </tr>'; $aff .= ' <tr>'; $aff .= ' <td width="120" valign="top">Sujet / Objet</td>'; $aff .= ' <td><input type="text" style="width: 100%" name="MailSubject_10" value="' . stripslashes ( $this->myMail_10->getMailSubject () ) . '" /></td>'; $aff .= ' </tr>'; $aff .= ' <tr>'; $aff .= ' <td width="120" valign="top">Entete</td>'; $aff .= ' <td>'; include_once ("../../../../include/js/fckeditor/fckeditor.php"); $oFCKeditor = new FCKeditor ( 'MailHeader_10' ); $oFCKeditor->BasePath = "../../../../include/js/fckeditor/"; $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "200"; // $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Value = stripslashes ( $this->myMail_10->getMailHeader () ); $aff .= $oFCKeditor->CreateHtml (); $aff .= '</td>'; $aff .= ' </tr>'; $aff .= ' <tr>'; $aff .= ' <td width="120" valign="top">Pied</td>'; $aff .= ' <td>'; include_once ("../../../../include/js/fckeditor/fckeditor.php"); $oFCKeditor = new FCKeditor ( 'MailFooter_10' ); $oFCKeditor->BasePath = "../../../../include/js/fckeditor/"; $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "200"; // $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Value = stripslashes ( $this->myMail_10->getMailFooter () ); $aff .= $oFCKeditor->CreateHtml (); $aff .= '</td>'; $aff .= '</tr>'; $aff .= ' </table>'; $aff .= '</div>'; $aff .= '</div>'; return $aff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notify() {\n if ($this->active_invoice->isLoaded()) {\n if ($this->active_invoice->canResendEmail($this->logged_user)) {\n $company = $this->active_invoice->getCompany();\n if(!($company instanceof Company)) {\n $this->response->operationFailed();\n } // i...
[ "0.62606436", "0.6180774", "0.61513406", "0.61246234", "0.61131275", "0.6094431", "0.6070978", "0.60619646", "0.59795547", "0.59488064", "0.59305984", "0.5912467", "0.5911151", "0.5906732", "0.58812636", "0.5874269", "0.5858785", "0.58436203", "0.58351886", "0.582706", "0.582...
0.0
-1
Show item inner page
public function indexAction() { // Get item information from database $item = DB::select('catalog.*', array('brands.name', 'brand_name'), array('brands.alias', 'brand_alias'), array('models.name', 'model_name'), array('catalog_tree.name', 'parent_name')) ->from('catalog') ->join('catalog_tree', 'LEFT')->on('catalog.parent_id', '=', 'catalog_tree.id') ->join('brands', 'LEFT')->on('catalog.brand_id', '=', 'brands.id')->on('brands.status', '=', DB::expr('1')) ->join('models', 'LEFT')->on('catalog.model_id', '=', 'models.id')->on('models.status', '=', DB::expr('1')) ->where('catalog.status', '=', 1) ->where('catalog.alias', '=', Route::param('alias')) ->as_object()->execute()->current(); if( !$item ) { return Config::error(); } Route::factory()->setParam('id', $item->id); Route::factory()->setParam('group', $item->parent_id); // Add to cookie viewed list Catalog::factory()->addViewed($item->id); // Add plus one to views DB::update('catalog')->set(array('views' => (int) $item->views + 1))->where('id', '=', $item->id)->execute(); // Seo $this->setSeoForItem($item); // Get images $images = DB::select('image')->from('catalog_images')->where('catalog_id', '=', $item->id)->order_by('sort')->as_object()->execute(); // Get item sizes $sizes = DB::select('sizes.*')->from('sizes') ->join('catalog_sizes', 'LEFT')->on('catalog_sizes.size_id', '=', 'sizes.id') ->where('catalog_sizes.catalog_id', '=', $item->id) ->where('sizes.status', '=', 1) ->order_by('sizes.name') ->as_object()->execute(); // Get current item specifications list $specifications = DB::select('specifications.*')->from('specifications') ->join('catalog_tree_specifications', 'LEFT')->on('catalog_tree_specifications.specification_id', '=', 'specifications.id') ->where('catalog_tree_specifications.catalog_tree_id', '=', $item->parent_id) ->where('specifications.status', '=', 1) ->order_by('specifications.name') ->as_object()->execute(); $res = DB::select()->from('specifications_values') ->join('catalog_specifications_values', 'LEFT')->on('catalog_specifications_values.specification_value_id', '=', 'specifications_values.id') ->where('catalog_specifications_values.catalog_id', '=', $item->id) ->where('status', '=', 1) ->where('catalog_specifications_values.specification_value_id', '!=', 0) ->as_object()->execute(); $specValues = array(); foreach( $res AS $obj ) { $specValues[$obj->specification_id][] = $obj; } $spec = array(); foreach ($specifications as $obj) { if( isset($specValues[$obj->id]) AND is_array($specValues[$obj->id]) AND count($specValues[$obj->id]) ) { if( $obj->type_id == 3 ) { $spec[$obj->name] = ''; foreach($specValues[$obj->id] AS $o) { $spec[$obj->name] .= $o->name.', '; } $spec[$obj->name] = substr($spec[$obj->name], 0, -2); } else { $spec[$obj->name] = $specValues[$obj->id][0]->name; } } } // Render template $this->_content = View::tpl( array('obj' => $item, 'images' => $images, 'sizes' => $sizes, 'specifications' => $spec), 'Catalog/Item' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show() {\n $this->buildPage();\n echo $this->_page;\n }", "public function show(Item $item)\n {\n \n }", "public function show(Item $item)\n {\n //\n }", "public function show(Item $item)\n {\n //\n }", "public function show(Item $item)\n {\n...
[ "0.6770058", "0.6717506", "0.6716902", "0.6716902", "0.6634721", "0.6580484", "0.6391374", "0.6342621", "0.6319756", "0.6319161", "0.63163567", "0.6315422", "0.63134056", "0.6297786", "0.6296814", "0.62957454", "0.6286146", "0.6286146", "0.6286146", "0.6281663", "0.627638", ...
0.0
-1
Set seo tags from template for items
public function setSeoForItem($page) { $tpl = DB::select()->from('seo')->where('id', '=', 2)->as_object()->execute()->current(); $from = array('{{name}}', '{{group}}', '{{brand}}', '{{model}}'); $to = array($page->name, $page->parent_name, $page->brand_name, $page->model_name); $this->_seo['h1'] = str_replace($from, $to, $tpl->h1); $this->_seo['title'] = str_replace($from, $to, $tpl->title); $this->_seo['keywords'] = str_replace($from, $to, $tpl->keywords); $this->_seo['description'] = str_replace($from, $to, $tpl->description); $this->setBreadcrumbs( 'Каталог', '/catalog' ); $this->generateParentBreadcrumbs( $page->parent_id, 'catalog_tree', 'parent_id', '/catalog/' ); $this->setBreadcrumbs( $page->name ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function do_tags()\n\t{\n\t\tforeach ($this->values as $id => $block)\n\t\t{\n\t\t\tforeach ($block as $name => $replace)\n\t\t\t{\n\t\t\t\t$find = \"{:$name}\";\n\t\t\t\t$this->merged[$id] = str_replace($find, $replace, $this->merged[$id]);\n\t\t\t}\n\t\t}\n\n\t}", "function editTags($item, $_options = f...
[ "0.63040787", "0.61946654", "0.61777127", "0.5997532", "0.5960643", "0.59487075", "0.5889107", "0.5859916", "0.57587415", "0.57409716", "0.56129956", "0.55561256", "0.55524826", "0.55466986", "0.55391574", "0.5537851", "0.5536989", "0.55143684", "0.55099845", "0.54984707", "0...
0.5937885
6
Get query source of dataTable.
public function query(Automobile $model) { return $model->newQuery()->with('category')->with('company'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchDataTableSource()\n { \n $dataTableConfig = [\n 'searchable' => [\n 'title' \n ]\n ];\n\n return SpecificationPreset::with([\n 'presetItem' => function($query) {\n ...
[ "0.6895125", "0.6753405", "0.6509491", "0.64851296", "0.6465343", "0.64154166", "0.63834846", "0.6268942", "0.6261598", "0.6261598", "0.6227419", "0.6218134", "0.62151456", "0.61885744", "0.6168129", "0.6070435", "0.60309273", "0.60120887", "0.59311485", "0.5923787", "0.59018...
0.0
-1
Optional method if you want to use html builder.
public function html() { return $this->builder() ->setTableId('automobile-table') ->columns($this->getColumns()) ->minifiedAjax() ->dom('frtip') ->orderBy(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function html() {}", "public function html();", "protected function generateHtml()\n\t{\n\t}", "abstract public function generateHtml();", "public function renderHTML()\n {\n }", "public abstract function asHTML();", "public static function html() {\n\n\t\treturn new BF_HTML_Generator;\n\t...
[ "0.8223474", "0.7832399", "0.77049524", "0.7642871", "0.75216883", "0.74815524", "0.7403877", "0.73037547", "0.72794753", "0.7205899", "0.7202348", "0.7202348", "0.7194561", "0.71864444", "0.7173879", "0.71675974", "0.716523", "0.716523", "0.716523", "0.71432114", "0.71009815...
0.0
-1
Get filename for export.
protected function filename() { return 'Automobile_' . date('YmdHis'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function filename()\n {\n return 'Export_' . date('YmdHis');\n }", "protected function filename () : string {\n return sprintf('%s/%s.csv', $this->instanceDirectory(), $this->guessName());\n }", "public function getFileName()\n {\n $fileName = $this->getInfo('fileName...
[ "0.8196528", "0.80591613", "0.7949222", "0.7926228", "0.76592237", "0.7587201", "0.7587201", "0.7554733", "0.75451165", "0.750201", "0.750201", "0.7494168", "0.74720484", "0.7440598", "0.7438713", "0.74358875", "0.7431382", "0.7413326", "0.7389984", "0.735199", "0.7335797", ...
0.0
-1
Creates a new login page flow
public function __construct( private Templating $templates, private Flow $flow, private Sessions $sessions, private Signed $signed, ) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function logInPage() {\n $view = new View('login');\n $view->generate();\n }", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "public f...
[ "0.6779202", "0.67596084", "0.66695094", "0.65603447", "0.6458298", "0.6301873", "0.6299629", "0.62882304", "0.62091136", "0.6206878", "0.6197248", "0.61839783", "0.61629814", "0.6145641", "0.611917", "0.60974234", "0.6089907", "0.60892135", "0.6061534", "0.6060114", "0.60585...
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "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
Show the application dashboard.
public function index(){ $Income = DB::table('cats')->where('type',1)->get()->sum('balance'); $Exp = DB::table('cats')->where('type',0)->get()->sum('balance'); $Expense = DB::table('expenses')->get()->sum('amount'); $Doctor = DB::table('users')->where('role',2)->get('id'); $Employee = DB::table('users')->where('role',7)->get('id'); $Appointment = DB::table('appointments')->latest()->take(5)->get()->sortByDesc('id'); $Services = DB::table('services')->latest()->take(5)->get()->sortByDesc('id'); $Appointments = DB::table('appointments') ->where('doctor_id','!=',null) ->where('status', 1) ->where('doctor_id', Auth()->user()->id) ->where('date' ,'=', Carbon::today()) ->get(); switch (Auth()->user()->role) { case '1': return view('Admin.Dashboard') ->with('Services',$Services) ->with('Doctor',$Doctor) ->with('Expense',$Expense) ->with('Employee',$Employee) ->with('Appointment',$Appointment); break; case '2': return view('Doctor.Dashboard') ->with('Appointments',$Appointments) ->with('Tests',Test::all()); break; case '3': $App = DB::table('appointments') ->where('doctor_id','!=',null) ->where('status', 2) ->get(); $TestInfo = DB::table('test_infos')->get(); return view('Laboratory.Dashboard') ->with('Appointments',$App) ->with('Tests',Test::all()) ->with('TestInfo',$TestInfo); break; case '4': $App = DB::table('appointments') ->where('doctor_id','!=',null) ->where('status', 4) ->get(); $diagnos = DB::table('diagnos')->get(); return view('Pharmacy.Dashboard') ->with('Appointments',$App) ->with('Diagnos',$diagnos); break; case '5': $Expenses = DB::table('expenses')->latest()->take(5)->get()->sortByDesc('id'); $Incomes = DB::table('incomes')->latest()->take(5)->get()->sortByDesc('id'); return view('Accounting.Dashboard') ->with('Expense',$Exp) ->with('Income',$Income) ->with('Incomes',$Incomes) ->with('Expenses',$Expenses); break; case '6': $Appoint= DB::table('appointments') ->where('status' ,'!=', 5) ->where('date' ,'=', Carbon::today()) ->get()->sortByDesc('created_at'); $DoneAppointment = DB::table('appointments')->where('status' , 5)->get(); $ServiceInfo = DB::table('service_infos')->get(); $Doctor = DB::table('users')->where('role',2)->get(); return view('Reception.Dashboard') ->with('Doctor',$Doctor) ->with('DoneAppointment',$DoneAppointment) ->with('Appointments',$Appoint) ->with('Service',Service::all()) ->with('ServiceInfo',$ServiceInfo); break; default: return view('/home'); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n ...
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", ...
0.0
-1
Callback function to render the CDN URL field in the options.
public function render_settings_field( $args ) { echo "<input aria-describedby='cdn-description' name='cdn_url' class='regular-text code' type='text' id='" . $args[0] . "' value='" . $args[1] . "'/>"; echo "<p id='cdn-description' class='description'>Input the url of the CDN, starting with https://, to use with this site or leave this field blank to bypass the CDN."; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function render_field() {\n\t\t// Get hostname of current site.\n\t\t$hostname = wp_parse_url( site_url(), PHP_URL_HOST );\n\n\t\t// Get current CDN URL.\n\t\t$cdn_url = get_site_option( 'css_js_url_rewriter_cdn_url' );\n\n\t\t?>\n\t\t<label for=\"css_js_url_rewriter_cdn_url\">\n\t\t\t<input type=\"t...
[ "0.6844422", "0.6784253", "0.63851154", "0.6297831", "0.6280108", "0.6234", "0.6209538", "0.6071348", "0.6034757", "0.6023877", "0.59781516", "0.5963266", "0.5903067", "0.58463186", "0.5783909", "0.57728815", "0.5761286", "0.57458043", "0.57237655", "0.5703305", "0.5690845", ...
0.6390001
2
This function removes the description box from the post columns.
public function remove_post_tag_columns( $columns ) { if ( isset( $columns['description']) ) { unset( $columns['description'] ); } return $columns; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_description_taxonomy( $columns ) {\n\n if( isset( $columns['description'] ) )\n unset( $columns['description'] );\n\n return $columns;\n}", "public function column_desc($post)\n {\n }", "function column_description( $item ) {\r\n\t\treturn esc_textarea( $item->post_co...
[ "0.736274", "0.65961874", "0.65634054", "0.6537477", "0.6525034", "0.6520288", "0.63983405", "0.63830006", "0.6341841", "0.6320486", "0.6189335", "0.61568725", "0.6150043", "0.6078403", "0.60531354", "0.6034847", "0.6015341", "0.6013556", "0.59744555", "0.59548175", "0.593562...
0.67448777
1
This function manages visibility of different parts of the Admin view.
public function manage_admin_menu_options() { global $submenu; remove_meta_box("dashboard_primary", "dashboard", "side"); // WordPress.com blog remove_meta_box("dashboard_secondary", "dashboard", "side"); // Other WordPress news add_post_type_support('prompts', 'comments'); remove_menu_page('index.php'); // Remove the dashboard link from the Wordpress sidebar. remove_menu_page('edit.php'); // remove default post type. remove_menu_page('edit.php?post_type=page'); // remove default page type. remove_menu_page('upload.php'); // remove default post type. add_menu_page('artworks', 'Artworks', 'manage_options', 'edit-tags.php?taxonomy=artworks&post_type=prompts', '', 'dashicons-format-image', 5); if ( !current_user_can( 'administrator' ) ) { if ( isset( $submenu['themes.php']) ) { foreach ($submenu['themes.php'] as $key => $menu_item ) { if ( in_array('Customize', $menu_item ) ) { unset( $submenu['themes.php'][$key] ); } if ( in_array('Themes', $menu_item ) ) { unset( $submenu['themes.php'][$key] ); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAdminPanelVisible() {}", "function visible () {\n\t\treturn isadmin();\n\t}", "function visible_to_admin_user()\n\t{\n\t\treturn true;\n\t}", "public function setupVisibility();", "public function displayAdminPanel() {}", "function is_visible() {\n\t\tif ($this->visibility=='hidden') re...
[ "0.7315768", "0.71258456", "0.7008198", "0.6878531", "0.6796061", "0.67022", "0.65499794", "0.65172553", "0.6506929", "0.64387506", "0.64338845", "0.64132166", "0.6391504", "0.63882697", "0.63812035", "0.6355856", "0.6355856", "0.63440967", "0.6327233", "0.62243503", "0.62203...
0.0
-1
Additional ACF options pages can be registered here.
public function add_options_pages() { if ( function_exists('acf_add_options_page') ) { acf_add_options_page(array( "page_title" => "Explanatory Text", "capability" => "edit_posts", "position" => 50, "icon_url" => "dashicons-format-aside" )); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function acf_options_page() { \n\n\t\t\t// Check ACF Admin OK\n\t\t\tif ( ! $this->admin_acf_active() ) { return; }\n\n\t\t\t// Check Options Page OK \n\t\t\tif ( ! function_exists('acf_add_options_page') ) { return; }\n\t\t\t\n\t\t\t// Add Options Page\n\t\t\t$parent = acf_add_options_page( [ \n\t\...
[ "0.83883166", "0.8345072", "0.82871836", "0.79288965", "0.7922873", "0.7890327", "0.7818423", "0.7816526", "0.77912223", "0.76465905", "0.76435196", "0.76419646", "0.7636485", "0.760936", "0.7524652", "0.75212675", "0.7429484", "0.7429062", "0.73888874", "0.73676383", "0.7359...
0.84878016
0
Removes comments icon from the admin bar.
public function remove_admin_bar_items() { global $wp_admin_bar; $wp_admin_bar->remove_menu("comments"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gwt_disable_comments_admin_bar() {\r\n if (is_admin_bar_showing()) {\r\n remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);\r\n }\r\n}", "function df_disable_comments_admin_bar()\r\n\t{\r\n\t\tif (is_admin_bar_showing()) {\r\n\t\t\tremove_action('admin_bar_menu', 'wp_admin_b...
[ "0.78403044", "0.77598006", "0.7736252", "0.76799655", "0.76010615", "0.7386835", "0.7361903", "0.7250317", "0.72267354", "0.7222358", "0.7222358", "0.71916944", "0.71463954", "0.71463954", "0.7060903", "0.7050019", "0.70280534", "0.70223075", "0.70223075", "0.69836855", "0.6...
0.7861123
0
remove admin menu home page widgets
public function remove_dashboard_widgets() { remove_meta_box("dashboard_primary", "dashboard", "side"); // WordPress.com blog remove_meta_box("dashboard_secondary", "dashboard", "side"); // Other WordPress news global $wp_meta_boxes; unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_admin() {\n\tremove_menu_page('link-manager.php');\n\tremove_menu_page('edit-comments.php');\n\tremove_menu_page('upload.php');\n}", "function clean_admin_bar() {\n global $wp_admin_bar;\n /* Remove their stuff */\n $wp_admin_bar->remove_menu('wp-logo');\n $wp_admin_ba...
[ "0.7730001", "0.770985", "0.76792914", "0.75577825", "0.7529583", "0.75214356", "0.7463486", "0.7458044", "0.7457555", "0.74502224", "0.74107575", "0.7399816", "0.7398108", "0.7360523", "0.73506224", "0.7346158", "0.73318833", "0.73039687", "0.7277889", "0.7262905", "0.726082...
0.0
-1
Gets the logged in user
public function getLoggedInUser() { return elgg_get_logged_in_user_entity(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLoggedInUser() {\n return $this->_user->getLoggedInUser();\n }", "public function get_user() {\n\t\treturn ($this->logged_in()) ? $this->session->get($this->config['session_key'], null) : null;\n\t}", "public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}", "public fun...
[ "0.8618283", "0.85606086", "0.8316347", "0.83053005", "0.83018947", "0.8301516", "0.8301516", "0.82967776", "0.8270742", "0.8168932", "0.8168555", "0.8164507", "0.81431246", "0.812115", "0.8120799", "0.8101653", "0.80943346", "0.80841225", "0.8063729", "0.8049042", "0.8045049...
0.8445958
2
Return the current logged in user by guid
public function getLoggedInUserGuid() { $user = $this->getLoggedInUser(); return $user ? $user->guid : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCurrentUserId();", "public function get_user_id();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "...
[ "0.70025533", "0.6975075", "0.6959903", "0.6959903", "0.6959903", "0.6959903", "0.6959903", "0.6959903", "0.6959903", "0.6959903", "0.6959903", "0.69145393", "0.6890618", "0.6876107", "0.6861477", "0.68164146", "0.6786929", "0.6785448", "0.6785448", "0.6785448", "0.6773178", ...
0.73542225
0
Returns whether or not the viewer is currently logged in and an admin user
public function isAdminLoggedIn() { $user = $this->getLoggedInUser(); return $user && $user->isAdmin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAdmin() {\n //FIXME: This needs to (eventually) evaluate that the user is both logged in *and* has admin credentials.\n //Change to false to see nav and detail buttons auto-magically disappear.\n return true;\n}", "function is_admin()\n {\n //is a user logged in?\n\n //if so,...
[ "0.8149701", "0.8120138", "0.80907434", "0.8067327", "0.80663544", "0.8008301", "0.79916245", "0.79512244", "0.79316497", "0.7920257", "0.7903536", "0.7879554", "0.78785425", "0.7875852", "0.785753", "0.7857081", "0.7851301", "0.7825202", "0.782349", "0.7812325", "0.78090227"...
0.80428535
5
Returns whether or not the user is currently logged in
public function isLoggedIn() { return (bool) $this->getLoggedInUser(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isLoggedIn()\n {\n return (bool)Users::getCurrentUser();\n }", "public function isLoggedIn()\n {\n return ($this->userInfo->userid ? true : false);\n }", "public function isUserLoggedIn()\n {\n return $this->user_is_logged_in;\n }", "public functi...
[ "0.8876293", "0.88636667", "0.8750611", "0.8654105", "0.86281836", "0.8573027", "0.85722136", "0.85702586", "0.85643643", "0.8562636", "0.85463905", "0.85175234", "0.85167813", "0.84852666", "0.84636617", "0.8454894", "0.84546053", "0.8451479", "0.84406024", "0.84401214", "0....
0.8657391
3
Get current ignore access setting
public function getIgnoreAccess() { return elgg_get_ignore_access(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImportIgnore() {\n return $this->getThirdPartySetting('config_import_ignore', 'import_ignore', $this->import_ignore);\n }", "public function getIgnore()\n {\n return $this->ignore;\n }", "public static function get_allowed_settings()\n {\n }", "public functio...
[ "0.71325946", "0.6565561", "0.6179892", "0.61780983", "0.61391526", "0.6031406", "0.6016636", "0.5997274", "0.5991056", "0.59624046", "0.59275246", "0.59275246", "0.5904087", "0.58565366", "0.58426017", "0.580923", "0.57551706", "0.57441086", "0.5730593", "0.5713319", "0.5698...
0.752403
0
/ Initialize action controller here
public function init() { include("Url.php"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init()\n {\n /* Initialize action controller here */\n }", "public function init()\n {\n /* Initialize action controller here */\n }", "protected function initializeController() {}", "protected function initializeAction() {}", "protected function initializeAction()...
[ "0.89566046", "0.89566046", "0.82057846", "0.80040884", "0.80040884", "0.8004028", "0.7928566", "0.7802862", "0.7750365", "0.7750365", "0.7750365", "0.7750365", "0.7750365", "0.7741994", "0.76497424", "0.7542271", "0.7541656", "0.7458589", "0.7430627", "0.7382884", "0.7349326...
0.0
-1
/ page mobilisateur/addmobilisateur Ajout d'une mobilisateur
public function addmobilisateurindexAction() { $sessionmcnp = new Zend_Session_Namespace('mcnp'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmc'); if (isset($_POST['ok']) && $_POST['ok'] == "ok") { if (isset($_POST['code_membre']) && $_POST['code_membre'] != "") { $request = $this->getRequest(); if ($request->isPost ()) { $db = Zend_Db_Table::getDefaultAdapter(); $db->beginTransaction(); try { /////////////////////////////////////controle code membre if(isset($_POST['code_membre']) && $_POST['code_membre']!=""){ if(strlen($_POST['code_membre']) != 20) { $db->rollback(); $sessionmcnp->error = "Le Code Membre est erroné. Vérifiez bien le nombre de caractères du Code Membre. Merci..."; //$this->_redirect('/mobilisateur/addmobilisateurindex'); return; }else{ if(substr($_POST['code_membre'], -1, 1) == 'P'){ $membre = new Application_Model_EuMembre(); $membre_mapper = new Application_Model_EuMembreMapper(); $membre_mapper->find($_POST['code_membre'], $membre); if(count($membre) == 0){ $db->rollback(); $sessionmcnp->error = "Le Code Membre est erroné. Veuillez bien saisir le Code Membre PP ..."; //$this->_redirect('/mobilisateur/addmobilisateurindex'); return; } }else if(substr($_POST['code_membre'], -1, 1) == 'M'){ $membremorale = new Application_Model_EuMembreMorale(); $membremorale_mapper = new Application_Model_EuMembreMoraleMapper(); $membremorale_mapper->find($_POST['code_membre'], $membremorale); if(count($membremorale) == 0){ $db->rollback(); $sessionmcnp->error = "Le Code Membre est erroné. Veuillez bien saisir le Code Membre PM ..."; //$this->_redirect('/mobilisateur/addmobilisateurindex'); return; } } } $date_id = new Zend_Date(Zend_Date::ISO_8601); $mobilisateur = new Application_Model_EuMobilisateur(); $m_mobilisateur = new Application_Model_EuMobilisateurMapper(); $id_mobilisateur = $m_mobilisateur->findConuter() + 1; $mobilisateur->setId_mobilisateur($id_mobilisateur); $mobilisateur->setCode_membre($_POST['code_membre']); $mobilisateur->setDatecreat($date_id->toString('yyyy-MM-dd HH:mm:ss')); $mobilisateur->setId_utilisateur(0); $mobilisateur->setEtat(1); $m_mobilisateur->save($mobilisateur); //////////////////////////////////////////////////////////////////////////////// $db->commit(); $sessionmcnp->error = "Operation bien effectuee ..."; $this->_redirect('/mobilisateur/addmobilisateurindex'); }else{ $db->rollback(); $sessionmcnp->error = "Veuillez renseigner le Code Membre ..."; } } catch (Exception $exc) { $db->rollback(); $sessionmcnp->error = $exc->getMessage() . ': ' . $exc->getTraceAsString(); return; } } } else { $sessionmcnp->error = "Champs * obligatoire"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addmobilisateurAction() {\n\n $sessionmembre = new Zend_Session_Namespace('membre');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n if (!isset($sessionmembre->code_membre)) {\n $this->_redirect('/');\n }\n\n\n ...
[ "0.73490244", "0.6996486", "0.67863035", "0.67594904", "0.6687043", "0.6593787", "0.65594697", "0.6516573", "0.6493912", "0.64913505", "0.6476363", "0.64708674", "0.6396816", "0.63368696", "0.6277763", "0.6256368", "0.6238567", "0.6175691", "0.6147944", "0.6109554", "0.610717...
0.63455445
13
/ page mobilisateur/addmobilisateurintegrateur Ajout d'une mobilisateur
public function addmobilisateurintegrateurAction() { $sessionmembreasso = new Zend_Session_Namespace('membreasso'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcint'); if (!isset($sessionmembreasso->login)) {$this->_redirect('/integrateur/login');} if (isset($_POST['ok']) && $_POST['ok'] == "ok") { if (isset($_POST['code_membre']) && $_POST['code_membre'] != "" && isset($_POST['id_utilisateur']) && $_POST['id_utilisateur'] != "") { $request = $this->getRequest(); if ($request->isPost ()) { $db = Zend_Db_Table::getDefaultAdapter(); $db->beginTransaction(); try { /////////////////////////////////////controle code membre if(isset($_POST['code_membre']) && $_POST['code_membre']!=""){ if(strlen($_POST['code_membre']) != 20) { $db->rollback(); $sessionmembreasso->error = "Le Code Membre est erroné. Vérifiez bien le nombre de caractères du Code Membre. Merci..."; //$this->_redirect('/mobilisateur/addmobilisateurintegrateur'); return; }else{ if(substr($_POST['code_membre'], -1, 1) == 'P'){ $membre = new Application_Model_EuMembre(); $membre_mapper = new Application_Model_EuMembreMapper(); $membre_mapper->find($_POST['code_membre'], $membre); if(count($membre) == 0){ $db->rollback(); $sessionmembreasso->error = "Le Code Membre est erroné. Veuillez bien saisir le Code Membre PP ..."; //$this->_redirect('/mobilisateur/addmobilisateurintegrateur'); return; } }else if(substr($_POST['code_membre'], -1, 1) == 'M'){ $membremorale = new Application_Model_EuMembreMorale(); $membremorale_mapper = new Application_Model_EuMembreMoraleMapper(); $membremorale_mapper->find($_POST['code_membre'], $membremorale); if(count($membremorale) == 0){ $db->rollback(); $sessionmembreasso->error = "Le Code Membre est erroné. Veuillez bien saisir le Code Membre PM ..."; //$this->_redirect('/mobilisateur/addmobilisateurintegrateur'); return; } } } $date_id = new Zend_Date(Zend_Date::ISO_8601); $mobilisateur = new Application_Model_EuMobilisateur(); $m_mobilisateur = new Application_Model_EuMobilisateurMapper(); $id_mobilisateur = $m_mobilisateur->findConuter() + 1; $mobilisateur->setId_mobilisateur($id_mobilisateur); $mobilisateur->setCode_membre($_POST['code_membre']); $mobilisateur->setDatecreat($date_id->toString('yyyy-MM-dd HH:mm:ss')); $mobilisateur->setId_utilisateur($_POST['id_utilisateur']); $mobilisateur->setEtat(1); $m_mobilisateur->save($mobilisateur); //////////////////////////////////////////////////////////////////////////////// $db->commit(); $sessionmembreasso->error = "Operation bien effectuee ..."; $this->_redirect('/mobilisateur/addmobilisateurintegrateur'); }else{ $db->rollback(); $sessionmembreasso->error = "Veuillez renseigner le Code Membre ..."; } } catch (Exception $exc) { $db->rollback(); $sessionmembreasso->error = $exc->getMessage() . ': ' . $exc->getTraceAsString(); return; } } } else { $sessionmembreasso->error = "Champs * obligatoire"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addmobilisateurAction() {\n\n $sessionmembre = new Zend_Session_Namespace('membre');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n if (!isset($sessionmembre->code_membre)) {\n $this->_redirect('/');\n }\n\n\n ...
[ "0.66522086", "0.6312662", "0.6301799", "0.624737", "0.6217515", "0.61687094", "0.6107106", "0.6038897", "0.6025775", "0.59778976", "0.59043247", "0.58878046", "0.58420146", "0.5832781", "0.58291453", "0.5824512", "0.5820897", "0.581881", "0.5770557", "0.5766486", "0.5765413"...
0.6849948
0
/ page mobilisateur/addmobilisateur Ajout d'une mobilisateur
public function addmobilisateurAction() { $sessionmembre = new Zend_Session_Namespace('membre'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcperso'); if (!isset($sessionmembre->code_membre)) { $this->_redirect('/'); } if (isset($_POST['ok']) && $_POST['ok'] == "ok") { if (isset($_POST['code_membre']) && $_POST['code_membre'] != "" && isset($_POST['id_utilisateur']) && $_POST['id_utilisateur'] != "") { $request = $this->getRequest(); if ($request->isPost ()) { $db = Zend_Db_Table::getDefaultAdapter(); $db->beginTransaction(); try { $date_id = new Zend_Date(Zend_Date::ISO_8601); $mobilisateur = new Application_Model_EuMobilisateur(); $m_mobilisateur = new Application_Model_EuMobilisateurMapper(); $id_mobilisateur = $m_mobilisateur->findConuter() + 1; $mobilisateur->setId_mobilisateur($id_mobilisateur); $mobilisateur->setCode_membre($_POST['code_membre']); $mobilisateur->setDatecreat($date_id->toString('yyyy-MM-dd HH:mm:ss')); $mobilisateur->setId_utilisateur($_POST['id_utilisateur']); $mobilisateur->setEtat(1); $m_mobilisateur->save($mobilisateur); //////////////////////////////////////////////////////////////////////////////// $db->commit(); $sessionmembre->error = "Operation bien effectuee ..."; $this->_redirect('/mobilisateur/listmobilisateur'); } catch (Exception $exc) { $db->rollback(); $this->view->message = $exc->getMessage() . ': ' . $exc->getTraceAsString(); return; } } } else { $this->view->error = "Champs * obligatoire"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function etatmobilisateurAction()\n {\n\n $sessionmembre = new Zend_Session_Namespace('membre');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n if (!isset($sessionmembre->code_membre)) {\n $this->_redirect('/');\n }\n\n...
[ "0.6996486", "0.67863035", "0.67594904", "0.6687043", "0.6593787", "0.65594697", "0.6516573", "0.6493912", "0.64913505", "0.6476363", "0.64708674", "0.6396816", "0.63455445", "0.63368696", "0.6277763", "0.6256368", "0.6238567", "0.6175691", "0.6147944", "0.6109554", "0.610717...
0.73490244
0
/ page mobilisateur/addmobilisateur Ajout d'une mobilisateur
public function editmobilisateurAction() { $sessionmembre = new Zend_Session_Namespace('membre'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcperso'); if (!isset($sessionmembre->code_membre)) { $this->_redirect('/'); } if (isset($_POST['ok']) && $_POST['ok'] == "ok") { if (isset($_POST['code_membre']) && $_POST['code_membre'] != "" && isset($_POST['id_utilisateur']) && $_POST['id_utilisateur'] != "") { $request = $this->getRequest(); if ($request->isPost ()) { $db = Zend_Db_Table::getDefaultAdapter(); $db->beginTransaction(); try { $date_id = new Zend_Date(Zend_Date::ISO_8601); $mobilisateur = new Application_Model_EuMobilisateur(); $m_mobilisateur = new Application_Model_EuMobilisateurMapper(); $m_mobilisateur->find($_POST['id_mobilisateur'], $mobilisateur); //$mobilisateur->setId_mobilisateur($id_mobilisateur); $mobilisateur->setCode_membre($_POST['code_membre']); //$mobilisateur->setDatecreat($date_id->toString('yyyy-MM-dd HH:mm:ss')); $$mobilisateur->setId_utilisateur($_POST['id_utilisateur']); //$mobilisateur->setEtat(0); $m_mobilisateur->update($mobilisateur); //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// $db->commit(); $sessionmembre->error = "Operation bien effectuee ..."; $this->_redirect('/mobilisateur/listmobilisateur'); } catch (Exception $exc) { $db->rollback(); $this->view->message = $exc->getMessage() . ': ' . $exc->getTraceAsString(); return; } } } else { $sessionmembre->error = "Champs * obligatoire"; $id = (int)$this->_request->getParam('id'); if($id != 0) { $mobilisateur = new Application_Model_EuMobilisateur(); $mmobilisateur = new Application_Model_EuMobilisateurMapper(); $mmobilisateur->find($id,$mobilisateur); $this->view->mobilisateur = $mobilisateur; } } } else { $id = (int)$this->_request->getParam('id'); if($id != 0) { $mobilisateur = new Application_Model_EuMobilisateur(); $mmobilisateur = new Application_Model_EuMobilisateurMapper(); $mmobilisateur->find($id,$mobilisateur); $this->view->mobilisateur = $mobilisateur; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addmobilisateurAction() {\n\n $sessionmembre = new Zend_Session_Namespace('membre');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n if (!isset($sessionmembre->code_membre)) {\n $this->_redirect('/');\n }\n\n\n ...
[ "0.73490244", "0.6996486", "0.67863035", "0.67594904", "0.6687043", "0.6593787", "0.65594697", "0.6516573", "0.6493912", "0.64913505", "0.6476363", "0.64708674", "0.6396816", "0.63455445", "0.63368696", "0.6277763", "0.6256368", "0.6238567", "0.6175691", "0.6147944", "0.61095...
0.0
-1
/ page mobilisateur/listmobilisateur liste des mobilisateurs
public function listmobilisateurAction() { $sessionmembre = new Zend_Session_Namespace('membre'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcperso'); if (!isset($sessionmembre->code_membre)) { $this->_redirect('/'); } $mobilisateur = new Application_Model_EuMobilisateurMapper(); $this->view->entries = $mobilisateur->fetchAllByMembre($sessionmembre->code_membre); $this->view->tabletri = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listmobilisateuradminAction() {\n\n $sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcadmin');\n \n if (!isset($sessionutilisateur->login)) {$this->_redirect('/administrat...
[ "0.74364346", "0.6760778", "0.66017264", "0.64315945", "0.63633835", "0.6343412", "0.6278696", "0.62405926", "0.62229973", "0.620715", "0.61971295", "0.61780566", "0.616878", "0.6152387", "0.6104882", "0.61015016", "0.6100804", "0.608719", "0.60731655", "0.6067534", "0.602231...
0.8546509
0
/ page mobilisateur/etatmobilisateur Etat une mobilisateur
public function etatmobilisateurAction() { $sessionmembre = new Zend_Session_Namespace('membre'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcperso'); if (!isset($sessionmembre->code_membre)) { $this->_redirect('/'); } $id = (int) $this->_request->getParam('id'); if (isset($id) && $id != 0) { $mobilisateur = new Application_Model_EuMobilisateur(); $mobilisateurM = new Application_Model_EuMobilisateurMapper(); $mobilisateurM->find($id, $mobilisateur); $mobilisateur->setEtat($this->_request->getParam('etat')); $mobilisateurM->update($mobilisateur); } $this->_redirect('/mobilisateur/listmobilisateur'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listmobilisateurAction() {\n\n $sessionmembre = new Zend_Session_Namespace('membre');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n if (!isset($sessionmembre->code_membre)) {\n $this->_redirect('/');\n }\n\n $...
[ "0.69084173", "0.65400565", "0.6421847", "0.64147466", "0.6007604", "0.5999295", "0.57086396", "0.56602204", "0.5631701", "0.562128", "0.55559045", "0.5512703", "0.5449182", "0.5439828", "0.5439595", "0.54266036", "0.5416764", "0.54119074", "0.53777695", "0.5373076", "0.53597...
0.74121654
0
/ page mobilisateur/suppmobilisateur Suppression d'une mobilisateur
public function suppmobilisateurAction() { $sessionmembre = new Zend_Session_Namespace('membre'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcperso'); if (!isset($sessionmembre->code_membre)) { $this->_redirect('/'); } $id = (int) $this->_request->getParam('id'); if ($id > 0) { $mobilisateurM = new Application_Model_EuMobilisateurMapper(); $mobilisateurM->delete($id); } $this->_redirect('/mobilisateur/listmobilisateur'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function detaliiAction()\r\n {\r\n // $this->_checkFurnizoriGroup();\r\n \r\n /**\r\n * Check if customer has this option available\r\n */\r\n // if (!$this->_getSession()->getCustomer()->getAcOpNotificariEmail()) {\r\n // $this->_redirect('custome...
[ "0.6012983", "0.59206307", "0.5838047", "0.5780838", "0.5762003", "0.5739976", "0.56077456", "0.5574298", "0.5567176", "0.5459834", "0.54563195", "0.5445559", "0.5442986", "0.5439094", "0.5438246", "0.5423301", "0.5420289", "0.53965056", "0.53962356", "0.53917736", "0.5367870...
0.681243
0
/ page mobilisateur/addmobilisateuradmin Ajout d'une mobilisateur
public function addmobilisateuradminAction() { $sessionutilisateur = new Zend_Session_Namespace('utilisateur'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcadmin'); if(!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');} if($sessionutilisateur->confirmation != "") {$this->_redirect('/administration/confirmation');} if(isset($_POST['ok']) && $_POST['ok'] == "ok") { if(isset($_POST['code_membre']) && $_POST['code_membre'] != "" && isset($_POST['id_utilisateur']) && $_POST['id_utilisateur'] != "") { $request = $this->getRequest(); if($request->isPost()) { $db = Zend_Db_Table::getDefaultAdapter(); $db->beginTransaction(); try { /////////////////////////////////////controle code membre if(isset($_POST['code_membre']) && $_POST['code_membre']!=""){ if(strlen($_POST['code_membre']) != 20) { $db->rollback(); $sessionutilisateur->error = "Le Code Membre est erroné. Vérifiez bien le nombre de caractères du Code Membre. Merci..."; //$this->_redirect('/mobilisateur/addmobilisateurintegrateur'); return; } else { if(substr($_POST['code_membre'], -1, 1) == 'P') { $membre = new Application_Model_EuMembre(); $membre_mapper = new Application_Model_EuMembreMapper(); $membre_mapper->find($_POST['code_membre'], $membre); if(count($membre) == 0) { $db->rollback(); $sessionutilisateur->error = "Le Code Membre est erroné. Veuillez bien saisir le Code Membre PP ..."; //$this->_redirect('/mobilisateur/addmobilisateurintegrateur'); return; } } else if(substr($_POST['code_membre'], -1, 1) == 'M') { $membremorale = new Application_Model_EuMembreMorale(); $membremorale_mapper = new Application_Model_EuMembreMoraleMapper(); $membremorale_mapper->find($_POST['code_membre'], $membremorale); if(count($membremorale) == 0) { $db->rollback(); $sessionutilisateur->error = "Le Code Membre est erroné. Veuillez bien saisir le Code Membre PM ..."; //$this->_redirect('/mobilisateur/addmobilisateurintegrateur'); return; } } } $date_id = new Zend_Date(Zend_Date::ISO_8601); $mobilisateur = new Application_Model_EuMobilisateur(); $m_mobilisateur = new Application_Model_EuMobilisateurMapper(); $id_mobilisateur = $m_mobilisateur->findConuter() + 1; $mobilisateur->setId_mobilisateur($id_mobilisateur); $mobilisateur->setCode_membre($_POST['code_membre']); $mobilisateur->setDatecreat($date_id->toString('yyyy-MM-dd HH:mm:ss')); $mobilisateur->setId_utilisateur($_POST['id_utilisateur']); $mobilisateur->setEtat(1); $m_mobilisateur->save($mobilisateur); //////////////////////////////////////////////////////////////////////////////// $db->commit(); $sessionutilisateur->error = "Operation bien effectuee ..."; $this->_redirect('/mobilisateur/addmobilisateuradmin'); } else { $db->rollback(); $sessionutilisateur->error = "Veuillez renseigner le Code Membre ..."; } } catch(Exception $exc) { $db->rollback(); $sessionutilisateur->error = $exc->getMessage() . ': ' . $exc->getTraceAsString(); return; } } } else { $sessionutilisateur->error = "Champs * obligatoire"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function etatmobilisateuradminAction()\n {\n\n $sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcadmin');\n \n if (!isset($sessionutilisateur->login)) {$this->_redirect('/admini...
[ "0.72520816", "0.6916917", "0.6912907", "0.6775734", "0.668698", "0.6587203", "0.6540747", "0.6518672", "0.648188", "0.642208", "0.63547915", "0.63450366", "0.6344053", "0.63303715", "0.63109416", "0.6275563", "0.62674415", "0.6258151", "0.62400585", "0.6233684", "0.62166566"...
0.71627903
1
/ page mobilisateur/addmobilisateur Ajout d'une mobilisateur
public function editmobilisateuradminAction() { $sessionutilisateur = new Zend_Session_Namespace('utilisateur'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcadmin'); if (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');} if($sessionutilisateur->confirmation != ""){$this->_redirect('/administration/confirmation');} if (isset($_POST['ok']) && $_POST['ok'] == "ok") { if (isset($_POST['code_membre']) && $_POST['code_membre'] != "") { $request = $this->getRequest(); if ($request->isPost ()) { $db = Zend_Db_Table::getDefaultAdapter(); $db->beginTransaction(); try { $date_id = new Zend_Date(Zend_Date::ISO_8601); $mobilisateur = new Application_Model_EuMobilisateur(); $m_mobilisateur = new Application_Model_EuMobilisateurMapper(); $m_mobilisateur->find($_POST['id_mobilisateur'], $mobilisateur); //$mobilisateur->setId_mobilisateur($id_mobilisateur); $mobilisateur->setCode_membre($_POST['code_membre']); //$mobilisateur->setDatecreat($date_id->toString('yyyy-MM-dd HH:mm:ss')); //$mobilisateur->setId_utilisateur($_POST['id_utilisateur']); //$mobilisateur->setEtat(0); $m_mobilisateur->update($mobilisateur); //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// $db->commit(); $sessionutilisateur->error = "Operation bien effectuee ..."; $this->_redirect('/mobilisateur/listmobilisateuradmin'); } catch (Exception $exc) { $db->rollback(); $this->view->message = $exc->getMessage() . ': ' . $exc->getTraceAsString(); return; } } } else { $sessionutilisateur->error = "Champs * obligatoire"; $id = (int)$this->_request->getParam('id'); if($id != 0) { $mobilisateur = new Application_Model_EuMobilisateur(); $mmobilisateur = new Application_Model_EuMobilisateurMapper(); $mmobilisateur->find($id,$mobilisateur); $this->view->mobilisateur = $mobilisateur; } } } else { $id = (int)$this->_request->getParam('id'); if($id != 0) { $mobilisateur = new Application_Model_EuMobilisateur(); $mmobilisateur = new Application_Model_EuMobilisateurMapper(); $mmobilisateur->find($id,$mobilisateur); $this->view->mobilisateur = $mobilisateur; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addmobilisateurAction() {\n\n $sessionmembre = new Zend_Session_Namespace('membre');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n if (!isset($sessionmembre->code_membre)) {\n $this->_redirect('/');\n }\n\n\n ...
[ "0.73490244", "0.6996486", "0.67863035", "0.67594904", "0.6687043", "0.6593787", "0.65594697", "0.6516573", "0.6493912", "0.64913505", "0.6476363", "0.64708674", "0.6396816", "0.63455445", "0.63368696", "0.6277763", "0.6256368", "0.6238567", "0.6175691", "0.6147944", "0.61095...
0.0
-1
/ page mobilisateur/listmobilisateur liste des mobilisateurs
public function listmobilisateuradminAction() { $sessionutilisateur = new Zend_Session_Namespace('utilisateur'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcadmin'); if (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');} if($sessionutilisateur->confirmation != ""){$this->_redirect('/administration/confirmation');} $mobilisateur = new Application_Model_EuMobilisateurMapper(); //$this->view->entries = $mobilisateur->fetchAllByCanton($sessionutilisateur->id_utilisateur); $this->view->entries = $mobilisateur->fetchAll(); $this->view->tabletri = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listmobilisateurAction() {\n\n $sessionmembre = new Zend_Session_Namespace('membre');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n if (!isset($sessionmembre->code_membre)) {\n $this->_redirect('/');\n }\n\n $...
[ "0.8546509", "0.6760778", "0.66017264", "0.64315945", "0.63633835", "0.6343412", "0.6278696", "0.62405926", "0.62229973", "0.620715", "0.61971295", "0.61780566", "0.616878", "0.6152387", "0.6104882", "0.61015016", "0.6100804", "0.608719", "0.60731655", "0.6067534", "0.6022312...
0.74364346
1
/ page mobilisateur/etatmobilisateur Etat une mobilisateur
public function etatmobilisateuradminAction() { $sessionutilisateur = new Zend_Session_Namespace('utilisateur'); //$this->_helper->layout->disableLayout(); $this->_helper->layout()->setLayout('layoutpublicesmcadmin'); if (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');} if($sessionutilisateur->confirmation != ""){$this->_redirect('/administration/confirmation');} $id = (int) $this->_request->getParam('id'); if (isset($id) && $id != 0) { $mobilisateur = new Application_Model_EuMobilisateur(); $mobilisateurM = new Application_Model_EuMobilisateurMapper(); $mobilisateurM->find($id, $mobilisateur); $mobilisateur->setEtat($this->_request->getParam('etat')); $mobilisateurM->update($mobilisateur); } $this->_redirect('/mobilisateur/listmobilisateuradmin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function etatmobilisateurAction()\n {\n\n $sessionmembre = new Zend_Session_Namespace('membre');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n if (!isset($sessionmembre->code_membre)) {\n $this->_redirect('/');\n }\n\n...
[ "0.74121654", "0.69084173", "0.65400565", "0.64147466", "0.6007604", "0.5999295", "0.57086396", "0.56602204", "0.5631701", "0.562128", "0.55559045", "0.5512703", "0.5449182", "0.5439828", "0.5439595", "0.54266036", "0.5416764", "0.54119074", "0.53777695", "0.5373076", "0.5359...
0.6421847
3
Verificar que esten seteadas las variables para hacer login.
public function run() { if( isset($_POST['session_login']) && isset($_POST['session_pass']) ) { $this->login($_POST['session_login'],$_POST['session_pass']); } //Validar que el login se haya hecho correctamente. if( $this->isLogged() ) { switch($_GET['act']) { case "insert" : { //Solo administradores y empleados pueden hacer inserciones de Registros de Eventos. if( !$this->isClient() ) { //Comprobamos que el $_POST no esté vacío, si lo está se mostrará la vista con el formulario para insertar. if(empty($_POST)) { //Cargamos el formulario $view = file_get_contents("View/EventRegistryForm.html"); $header = file_get_contents("View/header.html"); $footer = file_get_contents("View/footer.html"); //Traer el idEvent, la condicion es 0=0 para que los traiga todos (crear funcion en modelo) $result = $this -> model -> getEvents("0=0"); //Obtengo la posicion donde se van a insertar los option $row_start = strrpos($view,'{event-options-start}') + 21; $row_end= strrpos($view,'{event-options-end}'); //Hacer copia de la fila donde se va a reemplazar el contenido $base_row = substr($view,$row_start,$row_end-$row_start); //Acceder al resultado y crear el diccionario //Revisar que el nombre de los campos coincida con los de la base de datos $rows = ''; foreach ($result as $row) { $new_row = $base_row; $dictionary = array( '{id-event}' => $row['idEvent'], '{event}' => $row['Event'] ); $new_row = strtr($new_row,$dictionary); $rows .= $new_row; } //Reemplazar en la vista la fila base por los option creados y eliminar inicio y fin del option $view = str_replace($base_row, $rows, $view); $view = str_replace('{event-options-start}', '', $view); $view = str_replace('{event-options-end}', '', $view); //Creamos el diccionario //Para el insert los campos van vacios y los input estan activos $dictionary = array( '{value-idEventRegistry}' => '', '{value-idVehicle}' => '', //'{value-idEvent}' => '', '{value-Reason}' => '', '{active}' => '', '{action}' => 'insert' ); //Sustituir los valores en la plantilla $view = strtr($view,$dictionary); //Sustituir el usuario en el header $dictionary = array( '{user-name}' => $_SESSION['user'], '{log-link}' => 'index.php?ctl=logout', '{log-type}' => 'Logout' ); $header = strtr($header,$dictionary); //Agregamos el header y el footer a la vista $view = $header.$view.$footer; //Mostramos la vista echo $view; //require_once("View/Formulario.html"); } else { //Limpiamos los datos. //Obtenemos la llave primaria require_once("Model/PKGenerator.php"); $idEventRegistry = PKGenerator::getPK('EventRegistry','idEventRegistry'); $idVehicle = $this->cleanInt($_POST['idVehicle']); $idUser = $_SESSION['id_user']; //Se pone el id del usuario que está logeado $idEvent = $this->cleanInt($_POST['idEvent']); $date_array = getdate(); $Date = $date_array['year']."-".$date_array['mon']."-".$date_array['mday']; $Reason = $this->cleanText($_POST['Reason']); //Recogemos el resultado de la inserción e imprimimos un mensaje //en base a este resultado. if($result = $this->model->insert($idEventRegistry,$idVehicle,$idUser,$idEvent,$Date,$Reason)) { //Cargamos el formulario $view = file_get_contents("View/EventRegistryForm.html"); $header = file_get_contents("View/header.html"); $footer = file_get_contents("View/footer.html"); //Traer el idEvent insertado, ahora si se pone condicion en el comando $result = $this -> model -> getEvents("idEvent=".$idEvent); //Obtengo la posicion donde se van a insertar los option $row_start = strrpos($view,'{event-options-start}') + 21; $row_end= strrpos($view,'{event-options-end}'); //Hacer copia de la fila donde se va a reemplazar el contenido $base_row = substr($view,$row_start,$row_end-$row_start); //Acceder al resultado y crear el diccionario //Revisar que el nombre de los campos coincida con los de la base de datos $rows = ''; foreach ($result as $row) { $new_row = $base_row; $dictionary = array( '{id-event}' => $row['idEvent'], '{event}' => $row['Event'] ); $new_row = strtr($new_row,$dictionary); $rows .= $new_row; } //Reemplazar en la vista la fila base por los option creados y eliminar inicio y fin del option $view = str_replace($base_row, $rows, $view); $view = str_replace('{event-options-start}', '', $view); $view = str_replace('{event-options-end}', '', $view); //Creamos el diccionario //Despues de insertar los campos van con la info insertada y los input estan inactivos $dictionary = array( '{value-idEventRegistry}' => $idEventRegistry, '{value-idVehicle}' => $_POST['idVehicle'], //'{value-idEvent}' => $_POST['idEvent'], '{value-Reason}' => $_POST['Reason'], '{active}' => 'disabled', '{action}' => 'insert' ); //Sustituir los valores en la plantilla $view = strtr($view,$dictionary); //Sustituir el usuario en el header $dictionary = array( '{user-name}' => $_SESSION['user'], '{log-link}' => 'index.php?ctl=logout', '{log-type}' => 'Logout' ); $header = strtr($header,$dictionary); //Agregamos el header y el footer $view = $header.$view.$footer; echo $view; //require_once("View/ShowUser.php"); //Enviamos el correo de que se ha añadido un Registro de Evento. require_once("Controller/mail.php"); //Mandamos como parámetro el asunto, cuerpo y tipo de destinatario*. $subject = "Alta de Registro de Evento"; $body = "El Registro de Evento con los siguientes datos se ha añadido:". "\nId : ". $idEventRegistry. "\nIdVehicle : ". $idVehicle. "\nIdUser : ". $idUser. "\nIdEvent : ". $idEvent. "\nFecha: ". $Date. "\nReason : ". $Reason; //Manadamos el correo solo a administradores y empleados - 6 if(Mailer::sendMail($subject, $body, 6)) { //echo "<br>Correo enviado con éxito."; } else { /*$error = "<br>Error al enviar el correo."; $this -> showErrorView($error);*/ } } else { $error = "Error al insertar el nuevo registro de evento"; $this -> showErrorView($error); } } } else { $error = "No tiene permisos para realizar esta acción"; $this -> showErrorView($error); } break; } case "update" : { //Solo administradores y empleados pueden actualizar los Registros de Eventos. if( !$this->isClient() ) { //Comprobamos que el $_POST no esté vacío, si lo está se mostrará la vista con el formulario para actualizar la información. if(empty($_POST)) { //Se envia como parametro el controlador, la accion, el campo como nos lo va a regresar ne $_POST y el texto a mostrar en el label del input $this -> showGetIdView("eventregistry","update","idEventRegistry","Id RegistroEvento:"); } else { //Comprobamos que el id esté seteado. if(isset($_POST['idEventRegistry'])) { //Limpiamos el id. $idEventRegistry = $this->cleanInt($_POST['idEventRegistry']); //Primero mostramos el id que se quire modificar. //Comprobamos si están seteadas las variables en el POST if(isset($_POST['idVehicle']) && isset($_POST['idEvent']) && isset($_POST['Reason'])) { //La modificación se realizará en base al id. $idVehicle = $this->cleanInt($_POST['idVehicle']); $idUser = $_SESSION['id_user']; //Se pone el id del usuario logueado $idEvent = $this->cleanInt($_POST['idEvent']); $date_array = getdate(); $Date = $date_array['year']."-".$date_array['mon']."-".$date_array['mday']; $Reason = $this->cleanText($_POST['Reason']); //Se llama a la función de modificación. //Se recoge el resultado y en base a este resultado //se imprime un mensaje. if($this->model->update($idEventRegistry,$idVehicle,$idUser,$idEvent,$Reason)) { //Cargamos el formulario $view = file_get_contents("View/EventRegistryForm.html"); $header = file_get_contents("View/header.html"); $footer = file_get_contents("View/footer.html"); //Traer el idEvent insertado, ahora si se pone condicion en el comando $result = $this -> model -> getEvents("idEvent=".$idEvent); //Obtengo la posicion donde se van a insertar los option $row_start = strrpos($view,'{event-options-start}') + 21; $row_end= strrpos($view,'{event-options-end}'); //Hacer copia de la fila donde se va a reemplazar el contenido $base_row = substr($view,$row_start,$row_end-$row_start); //Acceder al resultado y crear el diccionario //Revisar que el nombre de los campos coincida con los de la base de datos $rows = ''; foreach ($result as $row) { $new_row = $base_row; $dictionary = array( '{id-event}' => $row['idEvent'], '{event}' => $row['Event'] ); $new_row = strtr($new_row,$dictionary); $rows .= $new_row; } //Reemplazar en la vista la fila base por los option creados y eliminar inicio y fin del option $view = str_replace($base_row, $rows, $view); $view = str_replace('{event-options-start}', '', $view); $view = str_replace('{event-options-end}', '', $view); //Creamos el diccionario //Despues de insertar los campos van con la info insertada y los input estan inactivos $dictionary = array( '{value-idEventRegistry}' => $idEventRegistry, '{value-idVehicle}' => $idVehicle, //'{value-idEvent}' => $idEvent, '{value-Reason}' => $Reason, '{active}' => 'disabled', '{action}' => 'update' ); //Sustituir los valores en la plantilla $view = strtr($view,$dictionary); //Sustituir el usuario en el header $dictionary = array( '{user-name}' => $_SESSION['user'], '{log-link}' => 'index.php?ctl=logout', '{log-type}' => 'Logout' ); $header = strtr($header,$dictionary); //Agregamos el header y el footer $view = $header.$view.$footer; echo $view; //require_once("View/UpdateUserShow.php"); //Enviamos el correo de que se ha modificado un Registro de Evento. require_once("Controller/mail.php"); //Mandamos como parámetro el asunto, cuerpo y tipo de destinatario*. $subject = "Modificación de Registro de Evento"; $body = "El Registro de Evento con los siguientes datos se ha modificado:". "\nId : ". $idEventRegistry. "\nIdVehicle : ". $idVehicle. "\nIdUser : ". $idUser. "\nIdEvent : ". $idEvent. "\nDate: ". $Date. "\nReason : ". $Reason; //Manadamos el correo solo a administradores y empleados - 6 if(Mailer::sendMail($subject, $body, 6)) { //echo "<br>Correo enviado con éxito."; } else { /*$error = "Error al enviar el correo."; $this -> showErrorView($error);*/ } } else { $error = "Error al modificar el registro de evento."; $this -> showErrorView($error); } } //Si no estan seteadas mostramos la info para actualizar else { if(($result = $this->model->select($idEventRegistry)) != null) { //Cargamos el formulario $view = file_get_contents("View/EventRegistryForm.html"); $header = file_get_contents("View/header.html"); $footer = file_get_contents("View/footer.html"); //Creamos el diccionario //Despues de insertar los campos van con la info insertada y los input estan inactivos $dictionary = array( '{value-idEventRegistry}' => $result[0]['idEventRegistry'], '{value-idVehicle}' => $result[0]['idVehicle'], //'{value-idEvent}' => $result[0]['idEvent'], '{value-Reason}' => $result[0]['Reason'], '{active}' => '', '{action}' => 'update' ); //Sustituir los valores en la plantilla $view = strtr($view,$dictionary); //Poner despues de sustituir los demas datos para no perder la información del select //Para actualizar no se pone condicion, para que esten todas las opciones disponibles $result = $this -> model -> getEvents("0=0"); //Obtengo la posicion donde se van a insertar los option $row_start = strrpos($view,'{event-options-start}') + 21; $row_end= strrpos($view,'{event-options-end}'); //Hacer copia de la fila donde se va a reemplazar el contenido $base_row = substr($view,$row_start,$row_end-$row_start); //Acceder al resultado y crear el diccionario //Revisar que el nombre de los campos coincida con los de la base de datos $rows = ''; foreach ($result as $row) { $new_row = $base_row; $dictionary = array( '{id-event}' => $row['idEvent'], '{event}' => $row['Event'] ); $new_row = strtr($new_row,$dictionary); $rows .= $new_row; } //Reemplazar en la vista la fila base por los option creados y eliminar inicio y fin del option $view = str_replace($base_row, $rows, $view); $view = str_replace('{event-options-start}', '', $view); $view = str_replace('{event-options-end}', '', $view); //Sustituir el usuario en el header $dictionary = array( '{user-name}' => $_SESSION['user'], '{log-link}' => 'index.php?ctl=logout', '{log-type}' => 'Logout' ); $header = strtr($header,$dictionary); //Agregamos el header y el footer $view = $header.$view.$footer; echo $view; } //Si el resultado no contiene información, mostramos el error. else { $error = "Error al traer la información para modificar."; $this -> showErrorView($error); } } } //Sino está seteado, imprimimos el mensaje y se mostrará la vista con el formulario para actualizar la información. else { $error = "Error al tratar de modificar el registro, el id no está seteado."; $this -> showErrorView($error); } } } else { $error = "No tiene permisos para realizar esta acción"; $this -> showErrorView($error); } break; } case "select" : { //Solo administradores y empleados pueden ver los Resgistros de Eventos. if( !$this->isClient() ) { //Comprobamos que el $_POST no esté vacío, si lo está se mostrará la vista con el formulario para hacer select. if(empty($_POST)) { //Si el post está vacio cargamos la vista para solicitar el id a consultar //Se envia como parametro el controlador, la accion, el campo como nos lo va a regresar ne $_POST y el texto a mostrar en el label del input $this -> showGetIdView("eventregistry","select","idEventRegistry","Id RegistroEvento:"); } else { //Comprobamos que el id esté seteado. if(isset($_POST['idEventRegistry'])) { //Limpiamos el id. $idEventRegistry = $this->cleanInt($_POST['idEventRegistry']); //Recogemos el resultado y si contiene información, la mostramos. if(($result = $this->model->select($idEventRegistry)) != null) { //Cargamos el formulario $view = file_get_contents("View/EventRegistryForm.html"); $header = file_get_contents("View/header.html"); $footer = file_get_contents("View/footer.html"); //Acceder al resultado y crear el diccionario //Revisar que el nombre de los campos coincida con los de la base de datos $dictionary = array( '{value-idEventRegistry}' => $result[0]['idEventRegistry'], '{value-idVehicle}' => $result[0]['idVehicle'], //'{value-idEvent}' => $result[0]['idEvent'], '{value-Reason}' => $result[0]['Reason'], '{active}' => 'disabled', '{action}' => 'select' ); //Sustituir los valores en la plantilla $view = strtr($view,$dictionary); //Poner despues de sustituir los demas datos para no perder la información del select //Para actualizar no se pone condicion, para que esten todas las opciones disponibles //Traer el idEvent, ahora si se pone condicion en el comando $result = $this -> model -> getEvents("idEvent=".$result[0]['idEvent']); //Obtengo la posicion donde se van a insertar los option $row_start = strrpos($view,'{event-options-start}') + 21; $row_end= strrpos($view,'{event-options-end}'); //Hacer copia de la fila donde se va a reemplazar el contenido $base_row = substr($view,$row_start,$row_end-$row_start); //Acceder al resultado y crear el diccionario //Revisar que el nombre de los campos coincida con los de la base de datos $rows = ''; foreach ($result as $row) { $new_row = $base_row; $dictionary = array( '{id-event}' => $row['idEvent'], '{event}' => $row['Event'] ); $new_row = strtr($new_row,$dictionary); $rows .= $new_row; } //Reemplazar en la vista la fila base por los option creados y eliminar inicio y fin del option $view = str_replace($base_row, $rows, $view); $view = str_replace('{event-options-start}', '', $view); $view = str_replace('{event-options-end}', '', $view); //Sustituir el usuario en el header $dictionary = array( '{user-name}' => $_SESSION['user'], '{log-link}' => 'index.php?ctl=logout', '{log-type}' => 'Logout' ); $header = strtr($header,$dictionary); //Agregamos el header y el footer $view = $header.$view.$footer; echo $view; } //Si el resultado no contiene información, mostramos el error. else { $error = "Error al tratar de mostrar el registro."; $this -> showErrorView($error); } } //Si el ID no está seteado, se marcará el error y se mostrará la vista con el formulario para hacer select. else { $error = "Error al mostrar el registro, el id no está seteado."; $this -> showErrorView($error); } } } else { $error = "No tiene permisos para realizar esta acción"; $this -> showErrorView($error); } break; } case "delete" : { //Solo administradores y empleados pueden eliminar Registros de Eventos. if( !$this -> isClient() ) { //Comprobamos que el $_POST no esté vacío, si lo está se mostrará la vista con el formulario para eliminar un Registro de Evento. if(empty($_POST)) { //Si el post está vacio cargamos la vista para solicitar el id a eliminar //Se envia como parametro el controlador, la accion, el campo como nos lo va a regresar de $_POST y el texto a mostrar en el label del input $this -> showGetIdView("eventregistry","delete","idEventRegistry","Id RegistroEvento:"); } else { //Comprobamos que el id esté seteado. if(isset($_POST['idEventRegistry'])) { //Limpiamos el id. $idEventRegistry = $this->cleanInt($_POST['idEventRegistry']); //Recogemos el resultado de la eliminación. $result = $this->model->delete($idEventRegistry); //Si la eliminación fue exitosa, mostramos el mensaje. if($result) { //Muestra la vista de que la eliminación se realizó con éxito $this -> showDeleteView(); //Enviamos el correo de que se ha eliminado un Registro de Evento. require_once("Controller/mail.php"); //Mandamos como parámetro el asunto, cuerpo y tipo de destinatario*. $subject = "Eliminación de Registro de Evento"; $body = "El Registro de Evento con los siguientes datos se ha eliminado:". "\nId : ". $idEventRegistry. "\nIdVehicle : ". $idVehicle. "\nIdUser : ". $idUser. "\nIdEvent : ". $idEvent. "\nDate: ". $Date. "\nReason : ". $Reason; //Manadamos el correo solo a administradores y empleados - 6 if(Mailer::sendMail($subject, $body, 6)) { //echo "<br>Correo enviado con éxito."; } else { /*$error = "<br>Error al enviar el correo."; $this -> showErrorView($error);*/ } } //Si no pudimos eliminar, señalamos el error. else { $error = "Error al elimiar el registro de eventos."; $this -> showErrorView($error); } } //Si el id no está seteado, marcamos el error. else { $error = 'No se ha especificado el ID del registro a eliminar'; $this -> showErrorView($error); } } } else { $error = "No tiene permisos para realizar esta acción"; require_once("View/Error.php"); } break; } case "list" : { //Solo si es empleado o administrador puede consultar la lista de eventos if(!$this -> isClient()) { //Revisar si hay un filtro, sino hay se queda el filtro po default $filter = "0=0"; if(isset($_POST['filter_condition'])){ //Creamos la condicion con el campo seleccionadoo y el filtro $filter = $_POST['filter_select']." = '".$_POST['filter_condition']."';"; } //Ejecutamos el query y guardamos el resultado. $result = $this -> model -> getList($filter); if($result !== FALSE) { //Cargamos el formulario $view = file_get_contents("View/EventRegistryTable.html"); $header = file_get_contents("View/header.html"); $footer = file_get_contents("View/footer.html"); //Obtengo la posicion donde va a insertar los registros $row_start = strrpos($view,'{row-start}') + 11; $row_end = strrpos($view,'{row-end}'); //Hacer copia de la fila donde se va a reemplazar el contenido $base_row = substr($view,$row_start,$row_end-$row_start); //Acceder al resultado y crear el diccionario //Revisar que el nombre de los campos coincida con los de la base de datos $rows = ''; foreach ($result as $row) { $new_row = $base_row; $dictionary = array( '{value-idEventRegistry}' => $row['idEventRegistry'], '{value-idVehicle}' => $row['idVehicle'], '{value-idUser}' => $row['User'], '{value-idEvent}' => $row['Event'], '{value-Date}' => $row['Date'], '{value-Reason}' => $row['Reason'], '{active}' => 'disabled' ); $new_row = strtr($new_row,$dictionary); $rows .= $new_row; } //Reemplazar en la vista la fila base por las filas creadas $view = str_replace($base_row, $rows, $view); $view = str_replace('{row-start}', '', $view); $view = str_replace('{row-end}', '', $view); //Sustituir el usuario en el header $dictionary = array( '{user-name}' => $_SESSION['user'], '{log-link}' => 'index.php?ctl=logout', '{log-type}' => 'Logout' ); $header = strtr($header,$dictionary); //Agregamos el header y el footer $view = $header.$view.$footer; echo $view; } else { $error = "No hay registros para mostrar."; $this -> showErrorView($error); } } else { $error = "No tiene permisos para ver esta lista"; $this -> showErrorView($error); } break; } } /* fin switch */ //El logout se hace cuando se especifica //$this -> logout(); } else { //Si no ha iniciado sesion mostrar la vista para hacer login $this -> showLoginView($_GET['ctl'],$_GET['act']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateLogin(){\n // store fieldnames inside the $fieldnames variable\n $fieldnames = ['email', 'password'];\n\n // initialize $error variable and set it as FALSE\n $error = FALSE;\n\n // for each $fieldname, check if its set or empty, if the fieldname is not set...
[ "0.710454", "0.7102176", "0.69470865", "0.6922485", "0.6915077", "0.6901938", "0.6896418", "0.68641335", "0.68511534", "0.6723897", "0.67125744", "0.6653238", "0.65974015", "0.65683866", "0.65583843", "0.6530389", "0.6523095", "0.6516168", "0.65094244", "0.6491059", "0.646387...
0.0
-1