query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Job Apply mail template
function job_apply_templates_callback() { ?> <div class="wrap"> <p><h3>Job Apply Mail Template</h3></p> <?php if(isset($_GET['settings-updated'])){ ?> <div class="updated settings-error notice is-dismissible" id="setting-error-settings_updated"> <p> <strong>Settings saved.</strong> </p> <button class="notice-dismiss" type="button"> <span class="screen-reader-text">Dismiss this notice.</span> </button> </div> <?php } ?> <form method="post" action="options.php"> <?php settings_fields('job_apply'); $job_apply = get_option('job_apply'); $argss = array( 'textarea_name' => 'job_apply[job_apply_template]', ); $contents = isset($job_apply['job_apply_template']) ? $job_apply['job_apply_template'] : ''; ?> <table class="form-table"> <tr> <th><label for="subject">Subject</label></th> <td><textarea style="width:100%" name="job_apply[job_apply_subject]" id="subject"><?php echo $job_apply['job_apply_subject']; ?></textarea></td> </tr> <tr> <th><label>Mail Editor</label></th> <td><?php wp_editor( $contents, 'job_apply_template', $argss); ?></td> </tr> </table><?php submit_button(); ?> </form> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendmailwithtemplateAction() {\r\n $Emaillist = $this->getEmailappTable()->searchBy($_REQUEST); \r\n $iddata = $_POST['maillist']; \r\n $idlist = explode(',', $iddata); \r\n foreach ($idlist as $id) {\r\n $iddatum = $this->getEmailappTable()->getMailContent($id); \r\n $to_name = $iddatum['name'];\r\n $to_email = $iddatum['email'];\r\n $email_template = $_POST['body'];\r\n $email_template = str_replace('{user}', $iddatum['name'], $email_template);\r\n $email_template = str_replace('{table_content}', $iddatum['content'], $email_template);\r\n $triggerMail = new EmailAlert(array());\r\n $mail_send = $triggerMail->sendBulkEmail($to_email,$to_name,$email_template);\r\n $updateDate = $this->getEmailappTable()->UpdateEmailapp($iddatum['id']); \r\n }\r\n $this->flashMessenger()->addSuccessMessage('Mail Sent successfully');\r\n return $this->redirect()->toRoute('emailapp');\r\n }", "public function MailApplyOnline($data)\r\n\t{\r\n\t\t$mailer = $this->getConfiguredMailer();\r\n\t\t\r\n\t\t$replace = array(\r\n\t\t\t'JOB_TITLE' => $data['job_title'],\r\n\t\t\t'SITE_NAME' => SITE_NAME,\r\n\t\t\t'JOB_URL' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''\r\n\t\t);\r\n\t\t$email_data = $this->getEmailData('email_ApplyOnline', $replace);\r\n\t\t\r\n\t\t$subject = $email_data['subject'];\r\n\t\t$msg = $data['apply_msg'] . \"\\n\" . $email_data['message'];\r\n\t\t\r\n \t$mailer->SetFrom($data['apply_email'], $data['apply_name']);\r\n \t$mailer->AddAddress($data['company_email'], $data['company_name']);\r\n \t$mailer->Subject = $subject;\r\n \t$mailer->Body = $this->nl2br($msg);\r\n \t$mailer->AltBody = $msg;\r\n \t\r\n\t\tif ($data['attachment_filename'] != '')\r\n\t\t{\r\n \t\t$mailer->AddAttachment($data['attachment_path'], $data['attachment_filename']);\r\n\t\t}\r\n\r\n\t\tif ($mailer->Send())\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function process()\n\t{\t\n\t\t $lstVars = phpfox::getService('emailsystem.vars')->get();\n $editor= $this->getParam('idEditor');\n if($editor == null)\n {\n $editor = \"template_content\";\n }\n $this->template()->assign(\n array(\n 'lstVars' => $lstVars,\n 'editor' =>$editor,\n )\n );\n\t}", "public function applyForJob()\n {\n $this->validateRequest($this->request);\n $applicantObject = $this->request->only('coverLetter', 'cvLink');\n\n $applicantObject['jobId'] = $this->request->id;\n $applicantObject['applicantId'] = $this->request->user()->id;\n try {\n $application = new ApplicantService();\n $result = $application->create( $applicantObject);\n if ($result) {\n return $this->success('You have Successfully Applied', $result, 201);\n }\n } catch (Exception $ex) {\n return $this->error('Server Error Occured', 500);\n }\n }", "function emails($args, &$request) {\n\t\t$this->validate();\n\t\t$this->setupTemplate($request, true);\n\n\t\t$templateMgr =& TemplateManager::getManager($request);\n\t\t$templateMgr->assign('pageHierarchy', array(array($request->url(null, 'manager'), 'manager.journalManagement')));\n\t\t$templateMgr->assign('helpTopicId','journal.managementPages.emails');\n\t\t$templateMgr->display('manager/emails/emails.tpl');\n\t}", "function thank_job_apply_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Thank You Job Apply Mail Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('thank_job_apply');\n\t\t\t\t\t$thank_job_apply = get_option('thank_job_apply');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'thank_job_apply[thank_job_apply_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($thank_job_apply['thank_job_apply_template']) ? $thank_job_apply['thank_job_apply_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"thank_job_apply[thank_job_apply_subject]\" id=\"subject\"><?php echo $thank_job_apply['thank_job_apply_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'thank_job_apply_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function sendMail($template_id, $to_email, $varKeywordContent, $varKeywordValueContent, $varCC = \"\", $varBCC = \"\", $varSenderName = \"\", $varSenderEmail = \"\",$varAttachement = \"\",$mailSubject = \"\")\n {\n\t\t$result_set = self::getMailContent($template_id);\n\t\t//echo '<pre>';print_r($result_set);exit();\n $message = '';\n $message .= '<style type=\"text/css\">\n\t\ta { color: #006567;}\n\t\ta:hover { color: #F93; }\n\t\t</style>';\n $message .= '<table style=\"padding-left:15px;\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t<tr>\n\t\t<td style=\"border-bottom:1px solid #35d3ed; margin-top:30px; padding-bottom:30px; float:left;\" width=\"100%\">';\n $result_set = self::getMailContent($template_id);\n if($mailSubject!=''){\n $subject = $mailSubject;\n }else {\n $subject = $result_set['emailSubject'];\n }\n\t \n //echo '<pre>';print_r($result_set);exit();\n $message .= $result_set['emailContent'];\n $from = isset($varSenderName) && $varSenderName != '' ? $varSenderName : $result_set['emailFromName'];\n $fromEmail = isset($varSenderEmail) && $varSenderEmail != '' ? $varSenderEmail : $result_set['emailFromEmail'];\n $message = str_replace($varKeywordContent, $varKeywordValueContent, $message);\n $message .= '</td></tr></table>';\n $varMailTo = trim($to_email);\n //$file_path=Yii::app()->getBaseUrl(true).'/img/delivery-order1.pdf';\n //mailing\n //echo '<pre>';print_r($message);exit();\n $params = array('myMail' => $message);\n Yii::$app->mailer->compose()\n ->setFrom($fromEmail)\n ->setTo($varMailTo)\n ->setSubject($subject)\n ->setHtmlBody($message)\n ->send();\n return true;\n }", "function sendEmailWithTemplate($data) {\n $email_tpl_raw = App\\Models\\EmailTemplateModuleTemplate::with(['emailTemplate'])->where('email_template_module_id', $data['email_template_module_id'])->first();\n if(is_null($email_tpl_raw))\n return false;//jika tidak memiliki email template pada module tersebut\n \n $email_tpl = $email_tpl_raw->emailTemplate;\n $data['subject'] = $email_tpl->subject;\n $data['cc'] = explode(',', trim($email_tpl_raw->cc));\n if(isset($data['init_bcc']))\n $data['cc'] = array_merge($data['init_bcc'], $data['cc']);\n \n $data['reply_to'] = [];\n\n $message = $email_tpl->body;\n $send_message = nl2br($message); \n foreach($data['replace_vars'] as $key => $val){\n $send_message = str_replace($key, $val, $send_message);\n }\n\n Mail::send(['html' => 'emails.blank'], ['message_text' => $send_message], function($message) use ($data) {\n $message->to($data['to'])->subject($data['subject']);\n if(count($data['reply_to']))\n $message->setReplyTo($data['reply_to']);\n if(count($data['cc']))\n $message->setBcc($data['cc']);\n });\n\n if( count(Mail::failures()) > 0 ) {\n return false;\n } else {\n return true;\n }\n}", "public function work()\n {\n $this->queue->watch($this->queueName)->ignore('default');\n\n\n echo \"Working next job in the 'emails\" . ZEND_ENV . \"' queue\" . PHP_EOL;\n\n $job = $this->queue->reserve();\n echo \"Email job received! Job Id is \" . $job->getId() . PHP_EOL;\n\n $email = json_decode($job->getData(), true);\n\n if (!isset($email['message']) || !isset($email['templateName']) || !isset($email['templateContent'])) {\n // Email Incomplete\n echo \"Email incomplete!\" . PHP_EOL;\n\n $this->queue->delete($job);\n }\n\n if ($email['test'] === true) {\n $mandrill = new \\Mandrill(getenv('MANDRILL_TEST'));\n } else {\n $mandrill = new \\Mandrill(getenv('MANDRILL'));\n }\n\n try {\n $mandrill->messages->sendTemplate($email['templateName'], $email['templateContent'], $email['message']);\n echo \"Email sent!\" . PHP_EOL;\n $this->queue->delete($job);\n } catch (\\Mandrill_Error $e) {\n echo \"Error!\" . PHP_EOL;\n\n $jobsStats = $this->queue->statsJob($job);\n\n if ($jobsStats->releases > $this->tries) {\n echo \"Burrying job!\" . PHP_EOL;\n $this->buryJob($job, $this->queue);\n } else {\n echo \"retrying in 60 seconds!\" . PHP_EOL;\n $this->queue->release($job, PheanstalkInterface::DEFAULT_PRIORITY, 60);\n }\n\n }\n\n }", "public function sendEmail_bak($mail_info=array()){\r\n\r\n\t\t$emailTemplate = Mage::getModel('core/email_template')->loadDefault('socialshare_email_template');\r\n\t\t//Create an array of variables to assign to template\r\n\t\t$emailTemplateVariables = array();\r\n\t\t$emailTemplateVariables['name'] = $mail_info['name'];\r\n\t\t$emailTemplateVariables['product_name'] = $mail_info['product_name'];\r\n\t\t$emailTemplateVariables['message'] = $mail_info['message'];\r\n\t\t$emailTemplateVariables['subject'] = $mail_info['subject'];\r\n\t\t/**\r\n\t\t * The best part <img src=\"http://inchoo.net/wp-includes/images/smilies/icon_smile.gif\" alt=\":)\" class=\"wp-smiley\">\r\n\t\t * Opens the activecodeline_custom_email1.html, throws in the variable array\r\n\t\t * and returns the 'parsed' content that you can use as body of email\r\n\t\t */\r\n\t\t$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);\r\n\t\t/*\r\n\t\t * Or you can send the email directly,\r\n\t\t * note getProcessedTemplate is called inside send()\r\n\t\t */\r\n\t\t$emailTemplate->send($mail_info['to'],'', $emailTemplateVariables);\r\n\t\t\t\r\n\t }", "public function run()\n {\n $translation = [\n 'key' => 'email',\n 'value' => 'Email'\n ];\n\n $this->dispatch(new CreateTranslationJob(Language::first(), Group::first(), $translation));\n }", "public function createJobPost(){\n $pageName = \"CreateJob\";\n include_once SYSTEM_PATH.'/view/header.tpl';\n include_once SYSTEM_PATH.'/view/createJobPost.tpl';\n\tinclude_once SYSTEM_PATH.'/view/footer.tpl';\n }", "private function _sendEmailMpesaInstructions($data) {\r\n $mailTemplate = Mage::getModel('core/email_template')->loadDefault('cba_mpesa_instructions');\r\n\r\n $mailTemplateVariables = array();\r\n $mailTemplateVariables['custFirstName'] = $data['firstName'];\r\n $mailTemplateVariables['payBill'] = Mage::helper('Boonagel_Cba')->payBill();\r\n $mailTemplateVariables['orderIncrementId'] = $data['orderIncrementId'];\r\n $mailTemplateVariables['currencyCode'] = Mage::helper('Boonagel_Cba')->getCurrentCurrency();\r\n $mailTemplateVariables['grandTotal'] = $data['grandTotal'];\r\n $mailTemplateVariables['logoSource'] = Mage::helper('Boonagel_Cba')->logoSource();\r\n\r\n //get the processed template\r\n $mailTemplate->getProcessedTemplate($mailTemplateVariables);\r\n\r\n $storeId = Mage::helper('Boonagel_Cba')->storeId();\r\n\r\n $mailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n $mailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n\r\n\r\n //send the processed template\r\n $mailTemplate->send($data['billingEmail'], $data['biilingFirstName'], $mailTemplateVariables);\r\n }", "protected function execute($arguments = array(), $options = array())\n {\n $databaseManager = new sfDatabaseManager($this->configuration);\n $connection = $databaseManager->getDatabase($options['connection'])->getConnection();\n\n // add your code here\n require_once(dirname(__FILE__).'/../../config/ProjectConfiguration.class.php');\n $configuration = ProjectConfiguration::getApplicationConfiguration('administration', $options['env'], true);\n\n // Remove the following lines if you don't use the database layer\n //$databaseManager = new sfDatabaseManager($configuration);\n sfContext::createInstance($configuration);\n $cetObjet = sfContext::getInstance();\n /*\n $message = sfContext::getInstance()->getMailer()->compose();\n $message->setSubject('complex email');\n $message->setTo('to@example.com');\n $message->setFrom('from@example.com');\n\n $html = sfContext::getInstance()->getController()->getAction('action', 'actionName')->getPartial('module/email_partial');\n $message->setBody($html, 'text/html');\n sfContext::getInstance()->getMailer()->send($message);\n * \n */\n \n //log de début de batch\n $this->logBlock('Batch Mail sur alerte - debut de traitement', 'INFO');\n \n //compteur servant à compter le nombre de cas traités\n $cmpTrairement = 0;\n $compteurMailEnvoye = 0; //compteur pour les mails envoyés\n \n //récupération de la date du jour\n //$dateDuJour = now();\n $now = date(\"Y-m-d H:i:s\");\n \n //récupération des demandes de MER du jour - 15jours et non deja éxécutées (non loggée)\n $alertes = Doctrine::getTable('TrajetAlerte')->getListeAlerteTrajetDuJour();\n \n //pour chaque alerte\n // -> verification si existence depot trajet ce jour et si oui\n // -> envoi mail\n // -> ecriture d'une action\n // -> log en table log_site\n \n foreach ($alertes as $i => $alerte) {\n \n\n //envoi du mail si le covoituruer possede un mail\n \n if($alerte->getCdMail() != '' || !is_null($alerte->getCdMail()) || $alerte->getTaMailUtilisateur() != '' || !is_null($alerte->getTaMailUtilisateur())){\n \n $mailCovoitureur = '';\n if($alerte->getTaMailUtilisateur() != '' || !is_null($alerte->getTaMailUtilisateur())){\n $mailCovoitureur = $alerte->getTaMailUtilisateur();\n }elseif($alerte->getCdMail() != '' || !is_null($alerte->getCdMail())){\n $mailCovoitureur = $alerte->getCdMail();\n }\n \n //verification de l'existence de trajets déposés ce jour\n $trajets = Doctrine::getTable('Trajet')->getListeTrajetDuJour($villeDepart,$villeDestination);\n \n //réalisation des étapes suivantes uniquement si des trajets sont déposés\n if($trajets->count() != 0){\n \n //tableau des trajet pour le mail\n $tabTrajet = array();\n $cmptTrajet = 0;\n foreach ($trajets as $i => $trajet) {\n $tabTrajet[$cmptTrajet] = array($trajet->getIdTrajet(),$trajet->getDepartVille(),$trajet->getDestinationVille());\n }\n \n \n //préparation du mail\n $params['subject'] = sfConfig::get('sf_batch_alerte_trajet_objet');\n $params['to'] = $mailCovoitureur;\n $params['from'] = sfConfig::get('sf_mail_cp_contact_trajet');\n $params[\"message\"] = \"Traitement batch realise\";\n $params[\"trajets\"] = $tabTrajet;\n \n\n //envoi mail\n $outil = New Util();\n $outil->envoiMailBatch( $cetObjet,\"BatchMailAlerteTrajet\", $params);\n\n //ecriture de l'action\n $actionCv = new CpActionCv();\n $actionCv->setCpActionCvDetail(sfConfig::get('sf_batch_alerte_trajet_action_detail'));\n $actionCv->setCpActionCvDateCreation($now);\n $actionCv->setCpActionCvDateModification($now);\n $actionCv->setCpActionCvDateEcheance($now);\n $actionCv->setCpActionCvCpTypeActionId(sfConfig::get('sf_batch_alerte_trajet_type_prov'));\n $actionCv->setCpActionCvCovoitureurId($alerte->getCdIdUtilisateur());\n $actionCv->setCpActionCvUserId(sfConfig::get('sf_batch_suivi_mer_user'));\n $actionCv->save();\n\n //ecriture du log\n $enregLog = new LogSite();\n $enregLog->setIdProvenance($alerte->getTaIdTrajetAlerte()); // provenance du log => id_mer\n $enregLog->setIdLogTypeProvenance(sfConfig::get('sf_batch_alerte_trajet_type_prov')); //type de la provenance\n $enregLog->setCreated($now);\n $enregLog->setIdSite(sfConfig::get('sf_id_site_client'));\n $enregLog->setIdUser(sfConfig::get('sf_batch_suivi_mer_user'));\n $enregLog->setMessage(sfConfig::get('sf_batch_alerte_trajet_action_detail'));\n $enregLog->save();\n\n $compteurMailEnvoye ++;\n }\n \n \n }\n \n //incrémentation du compteur\n $cmpTrairement ++;\n \n //echo \"IdMER : \".$Mer->getIdMer();\n \n }\n \n \n //echo \"test\";\n \n $this->logBlock('nombre de traitements realise : '.$cmpTrairement, 'INFO');\n \n $this->logBlock('nombre de mail envoye : '.$compteurMailEnvoye, 'INFO');\n \n $this->logBlock('Batch Mail sur alerte - FIN de traitement', 'INFO');\n \n }", "function mandrill_template_email($template_name, $template_content, $to, $subject, $from_email = FALSE, $from_name = FALSE)\n {\n try {\n if(!is_array($to)) {\n $to = array(array(\"email\" => $to, \"name\" => \"User\"));\n }\n\n $template_name = $template_name;\n $template_content = $template_content;\n // array(\n // array(\n // 'name' => 'example name',\n // 'content' => 'example content'\n // )\n // );\n $message = array(\n 'html' => '',\n 'text' => '',\n 'subject' => $subject,\n 'from_email' => (!$from_email) ? $this->default_from_email : $from_email,\n 'from_name' => (!$from_name) ? $this->default_from_name : $from_name,\n 'to' => $to,\n 'headers' => array('Reply-To' => $this->reply_to),\n 'auto_text' => true,\n );\n $async = false;\n $ip_pool = ''; // 'Main Pool';\n $send_at = ''; // 'example send_at';\n $result = $this->inst_mandrill->messages->sendTemplate($template_name, $template_content, $message, $async);\n return $result;\n /* Sample Return\n Array\n (\n [0] => Array\n (\n [email] => recipient.email@example.com\n [status] => sent\n [reject_reason] => hard-bounce\n [_id] => abc123abc123abc123abc123abc123\n )\n \n ) */\n } catch(Mandrill_Error $e) {\n return $e->getMessage();\n return 'A mandrill error occurred: ' . get_class($e) . ' - ' . $e->getMessage();\n throw $e;\n }\n }", "function main($content, $conf) {\n\t\t$this->conf = $conf;\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t\t$this->init();\n\t\t$template = $this->cObj->fileResource($this->conf['templateFile']);\n\t\t//t3lib_utility_Debug::debug($this->conf);\n\t\t\n\t\t$thisurl = \"http://\".$_SERVER['HTTP_HOST'].\"/\";\n\t\t$thanks = $this->pi_getPageLink($this->conf['pidThanks']);\n\t\t$thaturl = $thisurl . $thanks;\n\t\t\t\n\t\tif($this->piVars['submit']){\n\t\t\t$templateEmail = $this->cObj->getSubpart($template, '###EMAIL###');\n\t\t\t$templateEmailEntry = $this->cObj->getSubpart($template, '###EMAIL_ENTRY###');\n\t\t\t\n\t\t\tforeach($this->piVars as $key=>$value){\n\t\t\t\tif($key != 'submit'){\n\t\t\t\t\t$singleMark['###KEY###'] = $key;\n\t\t\t\t\t$singleMark['###VALUE###'] = $value;\n\t\t\t\t\t$emailEntry .= $this->cObj->substituteMarkerArrayCached($templateEmailEntry, $singleMark, $multiMark, array());\n\t\t\t\t}\n\t\t\t}\n\t\t\t$multiMark['###EMAIL_ENTRY###'] = $emailEntry;\n\t\t\t$emailBody = $this->cObj->substituteMarkerArrayCached($templateEmail, $singleMark, $multiMark, array());\n\t\t\t$singleMark['###NAME###'] = $this->piVars['name'];\n\t\t\t$singleMark['###EMAIL###'] = $this->piVars['email'];\n\t\t\t$emailsubject = $this->cObj->substituteMarkerArrayCached($this->conf['subject'], $singleMark, $multiMark, array());\n\t\t\t$this->sendEmail($this->conf['fromName'],$this->conf['fromEmail'],$this->conf['toName'],$this->conf['toEmail'],$emailsubject,$emailBody);\n\t\t\t$this->insertEntry($emailsubject, $emailBody);\n\t\t\tif($this->conf['sendToUser']){\n\t\t\t\t$emailBody = $this->cObj->substituteMarkerArrayCached($this->cObj->getSubpart($template, '###EMAIL_USER###'), $singleMark, $multiMark, array());\n\t\t\t\t$emailsubject = $this->cObj->substituteMarkerArrayCached($this->conf['subjectUser'], $singleMark, $multiMark, array());\n\t\t\t\t$this->sendEmail($this->conf['fromName'],$this->conf['fromEmail'],$this->conf['toName'],$this->conf['toEmail'],$emailsubject,$emailBody);\n\t\t\t}\n\t\t\tif($this->conf['pidThanks']){\n\t\t\t\t\n\t\t\t\t$GLOBALS['TSFE']->pSetup['headerData.']['98'] = 'TEXT';\n\t\t\t\t$GLOBALS['TSFE']->pSetup['headerData.']['98.']['value'] = '<script type=\"text/javascript\">top.location.href = \"'.$thaturl.'\";</script>';\n\t\t\t\treturn '';\n\t\t\t}else{\n\t\t\t\treturn $this->cObj->getSubpart($template, '###EMAIL_TENX###');\n\t\t\t}\n\t\t}\n\t\t$singleMark['###LEGAL_URL###'] = $this->pi_getPageLink($this->conf['pidLegal'],$target='',$urlParameters=array());\n\t\treturn $this->cObj->substituteMarkerArrayCached($this->cObj->getSubpart($template, '###MAIN###'), $singleMark, $multiMark, array());\n\t}", "function xMailTxt($_Email, $_Subject, $_TemplateName, $_AssignArray = array(), $html = false){\r\n\t\r\n\tif(!$_Email)return 0;\r\n\t$mailSmarty = new ViewSC();\r\n\tforeach ($_AssignArray as $_var=>$_val){\r\n\t\t\r\n\t\t$mailSmarty->assign($_var, $_val);\r\n\t}\r\n\t$_t = $mailSmarty->fetch('email/'.$_TemplateName);\r\n\tss_mail($_Email, $_Subject, $_t, true);\r\n}", "function faq_therapist_scheduling(){\n\t\t\t$this->output = $this->build_template($this->get_template(\"faq_therapist_scheduling\"));\n\t\t}", "protected function compile()\n\t{\n\n $postingTemplate = new \\FrontendTemplate($this->simplejobs_postingtemplate);\n\n $jobPostingModel = SimpleJobsPostingModel::findByIdOrAlias($this->simplejobs_posting);\n\n if (null === $jobPostingModel)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n $jobPosting = new JobPosting($jobPostingModel);\n\n if ($this->simplejobs_addstructureddata) {\n $structuredData = new StructuredJobPostingData($jobPosting);\n $GLOBALS['TL_HEAD']['JOB-POSTING'] = '<script type=\"application/ld+json\">' . $structuredData->getJson() . '</script>';\n }\n\n\n $postingTemplate->setData($jobPosting->getTemplateData());\n\n $this->Template->posting = $postingTemplate->parse();\n\n }", "function eyerecruit_jobseeker_mail_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Mail template Jobseeker Admin</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('founder_options_jobseeker');\n\t\t\t\t\t$founder_options_jobseeker = get_option('founder_options_jobseeker');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'founder_options_jobseeker[jobseeker_mail_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($founder_options_jobseeker['jobseeker_mail_template']) ? $founder_options_jobseeker['jobseeker_mail_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"founder_options_jobseeker[jobseeker_subject]\" id=\"subject\"><?php echo $founder_options_jobseeker['jobseeker_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Admin mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'jobseeker_mail_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function __construct(Job $job)\n {\n $adminemail = config('app.admin_email');\n $adminSenderEmail = config('app.admin_sender_email');\n $this->job = $job;\n\n $user = $job->user()->get()->first();\n\n $canclee = $job->status == 'pending' ? 'translator' : 'customer';\n $translator = Job::getJobsAssignedTranslatorDetail($job);\n if( $canclee == 'customer'){\n $name = @$user->name;\n } else {\n $name = @$translator->name;\n }\n\n\n Mail::send('emails.job-cancel-admin', ['user' => $user , 'job' => $job, 'canclee' => $canclee , 'name' => $name ], function ($m) use ($user, $job, $adminSenderEmail, $adminemail) {\n $m->from($adminSenderEmail, 'DigitalTolk');\n $m->to($adminemail, 'Admin')->subject('Avbokning av bokningsnr: #' . $job->id . '');\n });\n\n \n //cancel by customer\n if ($job->status == 'pending') {\n\n Mail::send('emails.job-cancel-user', ['user' => $user, 'job' => $job], function ($m) use ($user, $job, $adminSenderEmail) {\n $m->from($adminSenderEmail, 'DigitalTolk');\n if( !empty( $job->user_email ) ){\n $m->to($job->user_email, $user->name)->subject('Avbokning av bokningsnr: #' . $job->id . '');\n } else {\n $m->to($user->email, $user->name)->subject('Avbokning av bokningsnr: #' . $job->id . '');\n }\n });\n\n } else {\n $translator = Job::getJobsAssignedTranslatorDetail($job);\n if( $translator ){\n Mail::send('emails.job-cancel-translator', ['user' => $translator, 'job' => $job], function ($m) use ($translator, $job, $adminSenderEmail) {\n $m->from($adminSenderEmail, 'DigitalTolk');\n $m->to($translator->email, $translator->name)->subject('Avbokning av bokningsnr: #' . $job->id . '');\n });\n }\n }\n\n\n }", "public function sendEmail(){\n\t\t//InitialDocumentation\n\t\t$idCat=ProcessCatalog::where('name','InitialDocumentation')\n\t\t\t\t\t\t\t\t->first()\n\t\t\t\t\t\t\t\t->id;\n\t\t$processID=ProcessEntry::where('procedure_entry_id',$this->procedure_entry_id)\n\t\t\t\t\t\t\t\t\t->where('state','finished')\n\t\t\t\t\t\t\t\t\t->where('process_catalog_id', $idCat)\n\t\t\t\t\t\t\t\t\t->first()\n\t\t\t\t\t\t\t\t\t->id;\n\t\t$pd=RequestPolicyData::where('process_id',$processID)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t$plan=Plan::find($pd->plan_id);\n\t\t$agente=Agente::find($pd->agente_id);\n\n\t\t//get email template of InsuranceCompany to which the process is related \n\t\t$emailComp=InsuranceCompanyEmail::\n\t\t\t\t\t\t\twhere('insurance_company_id',$plan->insurance_company_id)\n\t\t\t\t\t\t\t->where('reason',$this->email_template_reason)\n\t\t\t\t\t\t\t->first();\n\n\t\tif($emailComp==null){\n\t\t\tthrow new \n\t\t\t\t\\Exception(\"Email configuration for insurance company not found\", 1);\n\t\t}\n\n\t\t$to['address']=trim($emailComp->email);\n\t\t$to['name']=$emailComp->contact_name;\n\t\t$param['template']=$emailComp->template;\n\t\t$param['subject']=$emailComp->subject;\n\n\t\t//copy to the agent that sold the policy and copy to the user that is doing the process\n\t\t$user = JWTAuth::parseToken()->authenticate();\n\t\t$param['cc'][]=array($user->email,$agente->email);\n\n\t\t$param[\"variables\"]['AGENT_NAME']=$agente->getFullNameAttribute();\n\n\t\t$param[\"variables\"]['TRAMITE_ID']=$this->procedure_entry_id;\n\t\t$param[\"variables\"]['CUSTOMER']=$pd->customer_fullname;\n\t\t$param[\"variables\"]['CUSTOMER_ID']=$pd->customer_identity;\n\t\t$param[\"variables\"]['PLAN']=$plan->name;\n\n\t\t//get Attach Files\n\t\t$attachments = FileEntry::where('table_type','procedure_entry')\n\t\t\t\t\t\t\t\t->where('table_id',$procedureId)\n\t\t\t\t\t\t\t\t->select('complete_path as pathToFile',\n\t\t\t\t\t\t\t\t\t'mime',\n\t\t\t\t\t\t\t\t\t'original_filename as display',\n\t\t\t\t\t\t\t\t\t'filename')\n\t\t\t\t\t\t\t\t->where('description','cheque_pago_poliza')\n\t\t\t\t\t\t\t\t->get()\n\t\t\t\t\t\t\t\t->toArray();\n\n\t\t$param[\"attachments\"]=$attachments;\n\n\t\t$emailUtils=new EmailUtils();\n\t\t//the reason 'requestPolicyInsuranceCompany' is a generic template that is used to send the email where teh broker ask for the policy to the insuranceCompany\n\t\t$emailUtils->sendEmilProcess(\n\t\t\t\t$this->email_template_reason,\n\t\t\t\t$to,\n\t\t\t\t$param);\n\t}", "public function MailPublishToAdmin($data)\r\n\t{\r\n\t\t$mailer = $this->getConfiguredMailer();\r\n\t\t\r\n\t\t$replace = array(\r\n\t\t\t'JOB_TITLE' => $data['title'],\r\n\t\t\t'SITE_NAME' => SITE_NAME,\r\n\t\t\t'JOB_URL' => BASE_URL . URL_JOB .'/' . $data['id'] . '/' . $data['url_title'] . '/',\r\n\t\t\t'JOB_TITLE' => $data['title'],\r\n\t\t\t'JOB_COMPANY' => $data['company'],\r\n\t\t\t'JOB_DESCRIPTION' => $data['description'],\r\n\t\t\t'JOB_POSTER_EMAIL' => $data['poster_email'],\r\n\t\t\t'JOB_EDIT_URL' => BASE_URL . 'post/' . $data['id'] . '/' . $data['auth'] . '/',\r\n\t\t\t'JOB_DEACTIVATE_URL' => BASE_URL . 'deactivate/' . $data['id'] . '/' . $data['auth'] . '/',\r\n\t\t\t'JOB_POSTER_IP' => $_SERVER['REMOTE_ADDR'],\r\n\t\t\t'JOB_POST_DATE' => $data['created_on']\r\n\t\t);\r\n\t\t\r\n\t\tif ($data['postRequiresModeration'])\r\n\t\t{\r\n\t\t\t$email_data = $this->getEmailData('email_PublishToAdmin_firstPost', $replace);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$email_data = $this->getEmailData('email_PublishToAdmin', $replace);\r\n\t\t}\r\n\t\t\r\n\t\t$subject = $email_data['subject'];\r\n\t\t$msg = $email_data['message'];\r\n\t\t\r\n\t\t$mailer->SetFrom(NOTIFY_EMAIL, SITE_NAME);\r\n \t$mailer->AddAddress(NOTIFY_EMAIL);\r\n\t\t$mailer->Subject = $subject;\r\n\t\t$mailer->Body = $this->nl2br($msg);\r\n\t\t$mailer->AltBody = $msg;\r\n\t\t\r\n\t\tif ($mailer->Send())\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function email_template_setting() {\r\n\t\t\t$email_template = get_option( 'cp_failure_email_template' );\r\n\t\t\t$email_template_sbj = get_option( 'cp_failure_email_subject' );\r\n\r\n\t\t\tif ( isset( $email_template_sbj ) && '' !== $email_template_sbj ) {\r\n\t\t\t\t$subject = $email_template_sbj;\r\n\t\t\t} else {\r\n\t\t\t\t/* translators: %s Product name */\r\n\t\t\t\t$subject = sprintf( __( 'Important Notification! - [SITE_NAME] - %s [MAILER_SERVICE_NAME] configuration error', 'convertpro-addon' ), CPRO_BRANDING_NAME );\r\n\t\t\t}\r\n\r\n\t\t\tif ( isset( $email_template ) && '' !== $email_template ) {\r\n\t\t\t\t$template = $email_template;\r\n\t\t\t} else {\r\n\t\t\t\t$template = 'The design <strong>[DESIGN_NAME]</strong> integrated with <strong>[MAILER_SERVICE_NAME]</strong> is not working! The following error occured when a user tried to subscribe - \\n\\n[ERROR_MESSAGE]\\n\\nPlease check <a href=\"[DESIGN_LINK]\" target=\"_blank\" rel=\"noopener\">configuration</a> settings ASAP.\\n\\n ----- \\n\\n The details of the subscriber are given below.\\n\\n [FORM_SUBMISSION_DATA] \\n\\n ----- \\n\\n [ [SITE_NAME] - [SITE_URL] ]';\r\n\t\t\t\t$template = str_replace( '\\n', \"\\n\", $template );\r\n\t\t\t}\r\n\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t<h3 class=\"cp-gen-set-title cp-error-services-title\"><?php esc_html_e( 'Error Notification', 'convertpro-addon' ); ?></h3>\r\n\t\t\t<p>\r\n\t\t\t<?php\r\n\t\t\tesc_html_e( 'This is an email that will be sent to you every time a user subscribes through a form and some error is encountered. You can customize the email subject and body in the fields below. ', 'convertpro-addon' );\r\n\t\t\t?>\r\n\t\t\t<strong>Note:</strong>\r\n\t\t\t<?php\r\n\t\t\tesc_html_e( 'This is applicable when you integrate with some mailer service.', 'convertpro-addon' );\r\n\t\t\t?>\r\n\t\t\t</p>\r\n\t\t\t<table class=\"cp-postbox-table form-table\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t\t<label for=\"option-admin-menu-subject-page\"><?php esc_html_e( 'Template Subject', 'convertpro-addon' ); ?></label>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input type=\"text\" id=\"cp_failure_email_subject\" name=\"cp_failure_email_subject\" value=\"<?php echo esc_html( stripslashes( $subject ) ); ?>\" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t\t<label for=\"option-admin-menu-template-page\"><?php esc_html_e( 'Template', 'convertpro-addon' ); ?></label>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<textarea id=\"cp_failure_email_template\" name=\"cp_failure_email_template\" rows=\"10\" cols=\"50\" ><?php echo esc_textarea( ( stripslashes( $template ) ) ); ?></textarea>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t<?php\r\n\t\t\techo ob_get_clean(); //PHPCS:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\r\n\t\t}", "public function admin_email_send() {\n add_action( 'neh_cron_hook', 'neh_cron_execution' );\n }", "function forward_job_templates_callback() {\n\t?>\n\t\t<div class=\"wrap\">\n\t\t\n\t\t\t<p><h3>Forward Job Template</h3></p> \n\t\t\t\n\t\t\t<?php \n\t\t\t\tif(isset($_GET['settings-updated'])){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated settings-error notice is-dismissible\" id=\"setting-error-settings_updated\"> \n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>Settings saved.</strong>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<button class=\"notice-dismiss\" type=\"button\">\n\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\">Dismiss this notice.</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php \n\t\t\t\t}\n\t\t\t?>\n\n\t\t\t<form method=\"post\" action=\"options.php\">\n\n\t\t\t\t<?php \n\t\t\t\t\tsettings_fields('forward_job');\n\t\t\t\t\t$forward_job = get_option('forward_job');\n\n\t\t\t\t\t$argss = array(\n\t\t\t\t\t\t\t'textarea_name' => 'forward_job[forward_job_template]',\n\t\t\t\t\t\t);\n\t\t\t\t\t$contents = isset($forward_job['forward_job_template']) ? $forward_job['forward_job_template'] : '';\n\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label for=\"subject\">Subject</label></th>\n\t\t\t\t\t\t\t<td><textarea style=\"width:100%\" name=\"forward_job[forward_job_subject]\" id=\"subject\"><?php echo $forward_job['forward_job_subject']; ?></textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><label>Mail Editor</label></th>\n\t\t\t\t\t\t\t<td><?php wp_editor( $contents, 'forward_job_template', $argss); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table><?php \n\t\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\n\t<?php \n}", "public function cancel_job() {\n\n $cancel_date = date(\"Y-m-d\");\n\n $session_data = $this->session->userdata('logged_in');\n //$email = 'HomeBidPro';\n $id=$this->input->get('job_id'); \n $bidder = $this->jobs_model->findbidder($id);\n $admin = $this->login_model->admin_email_get();\n $merged_arr = array_merge($admin,$bidder);\n $this->db->where('id',$id); \n $this->db->update(\"hbp_jobs\",array(\"status\"=>\"3\",\"cancel_date\"=>$cancel_date));\n $template_name = \"Cancel Project\";\n $message = $this->email_model->email_get_by_type($template_name);\n $s = $message['emails'];\n $message = str_replace(\"(Email)\",adminEmail,$s);\n $message = str_replace(\"(Phone number)\", adminPhoneNumber,$message); \n $message = str_replace(\"(Address)\",adminAddress, $message);\n\n //echo $message;die;\n\n $this->email->set_newline(\"\\r\\n\");\n foreach($merged_arr as $data){\n \n $this->email->set_mailtype(\"html\");\n $this->email->from(adminEmail);\n $this->email->to($data->email);\n $this->email->subject('Cancel Job');\n $this->email->message($message);\n $this->email->send();\n\n }\n\n $this->session->set_flashdata('homeownerFlash', 'You have successfully cancel a job. you can resubmit a job from dashboard below '); \n redirect('homeowner/dashboard'); \n }", "function send_template_mail ($template_slug, $to, $args = array()) {\n\n $template = get_page_by_path($template_slug, OBJECT, 'post');\n $template_id = get_the_subtitle($template);\n\n if (!$template || !$template_id) {\n error_log('Email template not found: ' . $template_slug);\n return false;\n }\n\n\t$headers = new SendGrid\\Email();\n $headers->setTemplateId($template_id);\n\n\tforeach ($args as $key => $value) {\n\t\t$headers->addSubstitution('[%' . $key . '%]', array($value));\n }\n\n $result = wp_mail($to, '', '', $headers);\n\n\tif ($result) {\n\t\terror_log('[Bingo] Template email \"' . $template_slug . '\" sent to ' . $to . ' ' . json_encode($args));\n\t} else {\n\t\terror_log('Email sent fail, to: ' . $to . ', header was: ' . json_encode($headers, JSON_UNESCAPED_UNICODE));\n }\n\n\treturn $result;\n}", "public function index()\n {\n $when = Carbon::now()->addMinutes(1);\n\n// Mail::to(\"714355794@qq.com\")->queue(new SendTestMail(\"simon\"));\n Mail::to(\"714355794@qq.com\")->later($when, new SendTestMail(\"simon\"));\n// $name = 'simonwang';\n// dispatch((new SendEmailJob($name))->delay(Carbon::now()->addMinutes(1)));\n }", "function apply() {\n // complies template\n $s = $this->template;\n // for blocks\n // FIXME: the correct tpl block end tag should be smartly guessed\n $s = preg_replace_callback('/<tpl for=\"(.+?)\">(.+?)<\\/tpl>/s', array($this, \"_applyfor\"), $s);\n // if blocks\n $s = preg_replace_callback('/<tpl if=\"(.+?)\">(.+?)<\\/tpl>/s', array($this, \"_applyif\"), $s);\n // variables\n $s = preg_replace_callback('/{([^\\s{}]+?)}/', array($this, \"_applyvar\"), $s);\n // processes compiled template\n $file = $this->tmpdir.uniqid('xtpl_', true).'.tplc';\n file_put_contents($file, $s);\n ob_start();\n //print file_get_contents($file);\n require($file);\n $s = ob_get_contents();\n ob_end_clean();\n unlink($file);\n return ($s);\n }" ]
[ "0.6376655", "0.62890697", "0.61130524", "0.5922528", "0.58498526", "0.58463883", "0.5811566", "0.579281", "0.57722867", "0.57508135", "0.572957", "0.57036436", "0.5688127", "0.567594", "0.5642034", "0.5624832", "0.56102777", "0.56078196", "0.55985886", "0.5572888", "0.5571653", "0.5562803", "0.556046", "0.5553007", "0.5552624", "0.55523014", "0.5541275", "0.5513035", "0.5507566", "0.54759586" ]
0.6317247
1
Cleansing translation cache The method is called after updating values in the model
public function afterUpdate() { $this->deleteTranslateCache(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cache_reset() {\n $this->translations = array();\n // Ensure a possible persistent cache of this object is cleared too.\n cache_clear_all($this->get_cid(), 'cache', TRUE);\n }", "public function cache_reset() {\n $this->strings = array();\n $this->string_format = array();\n\n // Reset the persistent caches.\n cache_clear_all('i18n:string:tgroup:' . $this->textgroup , 'cache', TRUE);\n // Reset the complete string object cache too.\n cache_clear_all('i18n:string:obj:', 'cache', TRUE);\n }", "public function cache_reset() {\n // Reset the persistent caches.\n cache_clear_all('i18n:string:tgroup:' . $this->textgroup , 'cache', TRUE);\n // Reset the complete string object cache too. This will affect string\n // objects of other textgroups as well.\n cache_clear_all('i18n:string:obj:', 'cache', TRUE);\n\n return parent::cache_reset();\n }", "public static function clearCache()\n {\n foreach (LaravelLocalization::getSupportedLanguagesKeys() as $locale) {\n Cache::forget(\"localizationStrings.{$locale}\");\n }\n }", "public static function resetSubstCache()\n {\n self::$substCacheEnabled = null;\n }", "public function purgeCache()\n {\n foreach ($this->getLocales() as $locale) {\n Cache::forget($this->treeCacheKey($locale));\n Cache::forget($this->mapCacheKey($locale));\n }\n }", "public static function reset()\n {\n self::getTranslator()->reset();\n }", "function removeTextI18nCache()\n { \n $file=mfConfig::get('mf_cache_dir').\"/sites/\".$this->getSite()->getHost().\"/frontend/\".mfConfig::get('mf_environment').\n \"/i18n/\".$this->get('lang').\"/emails/\".$this->get('module').\"/\".$this->get('key').\"/messages.csv\"; \n // $file=mfConfig::get('mf_site_app_cache_dir').\"/i18n/\".$this->get('lang').\"/emails/\".$this->get('module').\"/\".$this->get('key').\"/messages.csv\"; \n if (is_readable($file))\n unlink($file); \n }", "public function deleteTranslation(){\n try{\n Language::getByTag($this->tag)->removeTranslations(array(\n $this->plugin => array($this->key)\n ));\n App::logger()->info('A translation has been reset : ' . $this->plugin . '.' . $this->key);\n }\n catch(Exception $e){\n App::logger()->error('An error occured while reseting the language key ' . $this->plugin . '.' . $this->key);\n }\n }", "public function cacheClear(): void {\n $this->initUliCMS();\n CacheUtil::clearCache();\n }", "public function clean()\n\t{\n\t\t$this->storage->clean([Cache::ALL => TRUE]);\n\t}", "public function restore_cache_invalidation()\n {\n }", "public static function cleanCache() {\n\n static::$onlyOneGift = [];\n }", "public static function refreshLanguages()\n {\n TagDependency::invalidate(Yii::$app->commonCache, self::getCacheTag());\n }", "public function cleanCache()\n {\n $this->load->library('Cachedobjectmanager');\n $this->cachedobjectmanager->cleanup($this->getCacheCollectionName());\n }", "function lt_clear_lang_meta() {\n\n $prefix = LT_META_PREFIX;\n\n //get order id\n $order_id = lt_get_order_cookie();\n \n //clear translate to order meta\n update_post_meta( $order_id, $prefix . 'tran_to', '' );\n \n}", "public function clearLanguageCache()\n\t{\n\t\tglobal $mod_strings;\n\n\t\tif($this->show_output) echo \"<h3>{$mod_strings['LBL_QR_CLEARLANG']}</h3>\";\n\t\t//clear cache using the list $module_list_from_cache\n\t\tif ( !empty($this->module_list) && is_array($this->module_list) ) {\n if( in_array(translate('LBL_ALL_MODULES'), $this->module_list))\n {\n LanguageManager::clearLanguageCache();\n }\n else { //use the modules selected thrut the select list.\n foreach($this->module_list as $module_name)\n LanguageManager::clearLanguageCache($module_name);\n }\n }\n // Clear app* cache values too\n if(!empty($GLOBALS['sugar_config']['languages'])) {\n $languages = $GLOBALS['sugar_config']['languages'];\n } else {\n $languages = array($GLOBALS['current_language'] => $GLOBALS['current_language']);\n }\n foreach(array_keys($languages) as $language) {\n \tsugar_cache_clear('app_strings.'.$language);\n \tsugar_cache_clear('app_list_strings.'.$language);\n }\n\n\t}", "public function clearCache()\n {\n unset($this->domains);\n parent::clearCache();\n }", "public function clearI18nTranslator() {\n\t\t$this->i18nTranslator = null;\n\t}", "private function clearCache($language)\n {\n Cache::flush();\n }", "protected function cleanCache()\n {\n if ($this->cleanCount < 1) {\n ++$this->cleanCount;\n if (is_object($this->pageCache)) {\n $this->pageCache->clean();\n }\n }\n }", "public function cleanRoleModelCache() {\n\t\tif(isset($this->roleModel)) {\n\t\t\tunset($this->roleModel);\n\t\t}\n\t\tif(isset($this->roleScope)) {\n\t\t\tunset($this->roleScope);\n\t\t}\n\t\tif(isset($this->rolesGlobal)) {\n\t\t\tunset($this->rolesGlobal);\n\t\t}\n\t}", "public function clearCompiledValues()\n {\n $this->compiled_values = [];\n }", "public function clean()\n\t{\n\t\treturn wincache_ucache_clear();\n\t}", "public static function flush_transients() {\n\t\tdelete_transient( '_suru_libs_google_fonts' );\n\t}", "function shoestrap_text_css_cache_reset() {\n delete_transient( 'shoestrap_text_css' );\n shoestrap_text_css_cache();\n}", "public function __destruct() {\n // Reduce size to cache by removing NULL values.\n $this->strings = array_filter($this->strings);\n\n\n $strings_to_cache = array();\n // Store the persistent caches. We just store the metadata the translations\n // are stored by the string object itself. However storing the metadata\n // reduces the number of DB queries executed during runtime.\n $cache_data = array();\n foreach ($this->strings as $context => $i18n_string_object) {\n $cache_data[$context] = $context;\n $strings_to_cache[$context] = $i18n_string_object;\n }\n cache_set('i18n:string:tgroup:' . $this->textgroup . ':strings', $cache_data, 'cache', $this->caching_time);\n\n $cache_data = array();\n foreach ($this->cache_multiple as $pattern => $strings) {\n foreach ($strings as $context => $i18n_string_object) {\n $cache_data[$pattern][$context] = $context;\n $strings_to_cache[$context] = $i18n_string_object;\n }\n }\n cache_set('i18n:string:tgroup:' . $this->textgroup . ':cache_multiple', $cache_data, 'cache', $this->caching_time);\n\n // Cache the string objects related to this textgroup.\n // Store only the public visible data into the persistent cache.\n foreach ($strings_to_cache as $i18n_string_object) {\n // If this isn't an object it's an unprocessed cache item and doesn't need\n // to be stored again.\n if (is_object($i18n_string_object)) {\n cache_set($i18n_string_object->get_cid(), get_object_vars($i18n_string_object), 'cache', $this->caching_time);\n }\n }\n }", "public function cleanCache()\n {\n event(new RepositoryCleanEvent($this));\n }", "public function clear_cache ()\n {\n $this->_cache = array ();\n }", "public function invalidateCache() {\n\t\t\t// Call parent invalidator\n\t\t\t$this->flash__invalidate_cache();\n\t\t}" ]
[ "0.7752052", "0.7095123", "0.6790117", "0.6760821", "0.638263", "0.6366748", "0.6324414", "0.63167", "0.6297143", "0.6200435", "0.61686367", "0.61659783", "0.6107885", "0.6092822", "0.60913694", "0.60883003", "0.6075396", "0.6075002", "0.60610056", "0.6033592", "0.59819084", "0.5951174", "0.589199", "0.58625466", "0.58560205", "0.5840905", "0.5840367", "0.58302146", "0.58260983", "0.5812413" ]
0.7270436
1
/ Returns an DB_DataObject Object containing document data. Checks if the file exists and the user has read perms.
function getDocument($assetId) { $document = DB_DataObject::factory($this->conf['table']['document']); $document->get($assetId); // check if user has rights for the category the file is in. $category = new SGL_Category(); $category->load($document->category_id); if (!$category->hasPerms()) { return SGL::raiseError( 'You do not have read permissions for this file', SGL_ERROR_INVALIDAUTH); } $fileName = SGL_UPLOAD_DIR . '/' . $document->name; if (!@is_file($fileName)) { return SGL::raiseError( 'The specified file does not appear to exist', SGL_ERROR_NOFILE); } return $document; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function read(Document $document);", "public function get_document($entry, $options = array()) {\n try {\n $cm = $this->get_cm('data', $entry->dataid, $entry->course);\n $context = \\context_module::instance($cm->id);\n } catch (\\dml_missing_record_exception $ex) {\n // Notify it as we run here as admin, we should see everything.\n debugging('Error retrieving mod_data ' . $entry->id . ' document, not all required data is available: ' .\n $ex->getMessage(), DEBUG_DEVELOPER);\n return false;\n } catch (\\dml_exception $ex) {\n // Notify it as we run here as admin, we should see everything.\n debugging('Error retrieving mod_data' . $entry->id . ' document: ' . $ex->getMessage(), DEBUG_DEVELOPER);\n return false;\n }\n\n // Prepare associative array with data from DB.\n $doc = \\core_search\\document_factory::instance($entry->id, $this->componentname, $this->areaname);\n $doc->set('contextid', $context->id);\n $doc->set('courseid', $entry->course);\n $doc->set('userid', $entry->userid);\n if ($entry->groupid > 0) {\n $doc->set('groupid', $entry->groupid);\n }\n $doc->set('owneruserid', \\core_search\\manager::NO_OWNER_ID);\n $doc->set('modified', $entry->timemodified);\n\n $indexfields = $this->get_fields_for_entries($entry);\n\n if (count($indexfields) < 2) {\n return false;\n }\n\n // All fields should be already returned as plain text by data_field_base::get_content_value.\n $doc->set('title', $indexfields[0]);\n $doc->set('content', $indexfields[1]);\n\n if (isset($indexfields[2])) {\n $doc->set('description1', $indexfields[2]);\n }\n\n if (isset($indexfields[3])) {\n $doc->set('description2', $indexfields[3]);\n }\n\n return $doc;\n }", "public function get($fileId) {\n\t\ttry {\n\t\t\tif (\\is_numeric($fileId)) {\n\t\t\t\t// parse fileId pointing to file\n\t\t\t\t$fileId = (int) $fileId;\n\t\t\t} else {\n\t\t\t\treturn $this->responseError($this->l10n->t('Invalid request parameters'));\n\t\t\t}\n\n\t\t\t// Normal editing or share by user/group\n\t\t\t$docinfo = $this->documentService->getDocumentByUserId($this->getCurrentUserUID(), $fileId, null);\n\t\t\tif (!$docinfo) {\n\t\t\t\t$this->logger->warning(\"Cannot retrieve document with fileid {fileid}\", [\"fileid\" => $fileId]);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Get document discovery\n\t\t\t$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);\n\t\t\tif (!$wopiSrc) {\n\t\t\t\t$this->logger->error(\"Cannot retrieve discovery for document\", []);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Restrict filesize\n\t\t\t$maxUploadFilesize = \\OCP\\Util::maxUploadFilesize(\"/\");\n\n\t\t\t// Get wopi token\n\t\t\t$wopiAccessInfo = $this->createWopiSessionForAuthUser($docinfo);\n\n\t\t\t// Create document index\n\t\t\t$docRetVal = [\n\t\t\t\t'uploadMaxFilesize' => $maxUploadFilesize,\n\t\t\t\t'uploadMaxHumanFilesize' => \\OCP\\Util::humanFileSize($maxUploadFilesize),\n\t\t\t\t'title' => $docinfo['name'],\n\t\t\t\t'fileId' => $docinfo['fileid'],\n\t\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t\t'locale' => $this->getLocale(),\n\t\t\t\t'version' => \\strval($docinfo['version']),\n\t\t\t\t'sessionId' => $wopiAccessInfo['sessionid'],\n\t\t\t\t'access_token' => $wopiAccessInfo['access_token'],\n\t\t\t\t'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],\n\t\t\t\t'urlsrc' => $wopiSrc['urlsrc'],\n\t\t\t\t'default_action' => $wopiSrc['action'],\n\t\t\t\t'path' => $docinfo['path']\n\t\t\t];\n\t\t\treturn new JSONResponse($docRetVal);\n\t\t} catch (\\Exception $e) {\n\t\t\treturn new JSONResponse([\n\t\t\t\t'status' => 'error',\n\t\t\t\t'message' => 'Document index could not be found'\n\t\t\t], Http::STATUS_BAD_REQUEST);\n\t\t}\n\t}", "function getDocument($id){\n\n $dbq = db_query(\"SELECT * FROM \" . Document::TABLE . \" WHERE document_vorlage=1 AND uid=:uid AND id=:id AND team_id=:team_id\",[\n ':uid' => $this->getAccount()->getUid(),\n ':team_id' => $this->getTeam()->getId(),\n ':id' => $id,\n ]);\n\n $data = $dbq -> fetchObject();\n if(!$data){\n return false;\n }\n\n $this -> document = new Document((array)$data);\n return $this -> document;\n }", "public function get_document($record, $options = array()) {\n\n try {\n $cm = $this->get_cm($this->get_module_name(), $record->id, $record->course);\n $context = \\context_module::instance($cm->id);\n } catch (\\dml_missing_record_exception $ex) {\n // Notify it as we run here as admin, we should see everything.\n debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document, not all required data is available: ' .\n $ex->getMessage(), DEBUG_DEVELOPER);\n return false;\n } catch (\\dml_exception $ex) {\n // Notify it as we run here as admin, we should see everything.\n debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document: ' . $ex->getMessage(), DEBUG_DEVELOPER);\n return false;\n }\n\n // Prepare associative array with data from DB.\n $doc = \\core_search\\document_factory::instance($record->id, $this->componentname, $this->areaname);\n $doc->set('title', content_to_text($record->name, false));\n $doc->set('content', content_to_text($record->content, $record->contentformat));\n $doc->set('contextid', $context->id);\n $doc->set('courseid', $record->course);\n $doc->set('owneruserid', \\core_search\\manager::NO_OWNER_ID);\n $doc->set('modified', $record->timemodified);\n $doc->set('description1', content_to_text($record->intro, $record->introformat));\n\n return $doc;\n }", "public function read()\n {\n if ($this->exists())\n return json_decode(file_get_contents($this->path_default . $this->_file), true);\n else\n return false;\n }", "public function getDocument()\n {\n return $this->get(self::DOCUMENT);\n }", "public function getObjectFromDB() {\r\n if($this->error == false) {\r\n //Throw an error if a file doesn't exist\r\n //VIEWER\r\n //check to see if krpano viewer file exists\r\n if(!file_exists(trailingslashit($this->krpanoFolderPath) . $this->krpanoSWF)) {\r\n $this->errmsg = $this->krpanoSWF .' file not found in ' . $this->krpanoFolder;\r\n $this->error = true;\r\n }\r\n //check to see if Skin file exists\r\n elseif(!file_exists($this->viewerTemplatePath)) {\r\n $this->errmsg = 'Template file '. $this->viewerTemplate .' not found';\r\n $this->error = true;\r\n }\r\n //check to see if pano correctly build\r\n elseif(!$this->exists()) {\r\n $this->errmsg = 'Panorama not found';\r\n $this->error = true;\r\n }\r\n }\r\n \r\n if($this->error == false) {\r\n //load pano information from database\r\n $this->loadFromDB();\r\n return $this;\r\n\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "public function read()\n {\n \treturn Util_File::Read($this->_storage);\n }", "public function get_document($record, $options = array()) {\n try {\n $cm = $this->get_cm('wiki', $record->wikiid, $record->courseid);\n $context = \\context_module::instance($cm->id);\n } catch (\\dml_missing_record_exception $ex) {\n // Notify it as we run here as admin, we should see everything.\n debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document, not all required data is available: ' .\n $ex->getMessage(), DEBUG_DEVELOPER);\n return false;\n } catch (\\dml_exception $ex) {\n // Notify it as we run here as admin, we should see everything.\n debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document: ' . $ex->getMessage(), DEBUG_DEVELOPER);\n return false;\n }\n\n // Make a page object without extra fields.\n $page = clone $record;\n unset($page->courseid);\n unset($page->wikiid);\n\n // Conversion based wiki_print_page_content().\n // Check if we have passed the cache time.\n if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {\n $content = wiki_refresh_cachedcontent($page);\n $page = $content['page'];\n }\n // Convert to text.\n $content = content_to_text($page->cachedcontent, FORMAT_MOODLE);\n\n // Prepare associative array with data from DB.\n $doc = \\core_search\\document_factory::instance($record->id, $this->componentname, $this->areaname);\n $doc->set('title', content_to_text($record->title, false));\n $doc->set('content', $content);\n $doc->set('contextid', $context->id);\n $doc->set('courseid', $record->courseid);\n if ($record->groupid > 0) {\n $doc->set('groupid', $record->groupid);\n }\n $doc->set('owneruserid', \\core_search\\manager::NO_OWNER_ID);\n $doc->set('modified', $record->timemodified);\n\n // Check if this document should be considered new.\n if (isset($options['lastindexedtime']) && ($options['lastindexedtime'] < $record->timecreated)) {\n // If the document was created after the last index time, it must be new.\n $doc->set_is_new(true);\n }\n\n return $doc;\n }", "public function getDocument($document);", "function getDocument() \n {\n return $this->_doc;\n }", "public function getDocument()\n\t{\n\t\treturn $this->_document;\n\t}", "abstract public function getDocument($id);", "public function getDocument() {\n return $this->_document;\n }", "public function read() {\n\n\t\t$result = parent::read();\n\n\t\tif ($result) {\n\t\t\t$data = $this->data;\n\n\t\t\tif (property_exists($data, 'maDb')) {\n\t\t\t\tif ($data->maDb > $this->version) {\n\t\t\t\t\tapi::quit(__CLASS__ . ': Nelze zpracovat databázy. Databáze byla vytvořena novější verzí frameworku než je tento.');\n\t\t\t\t}\n\t\t\t\t$this->data = $data->records;\n\t\t\t}\n\t\t\telse if (property_exists($data, 'jsonDb')) { //older version with jsonDb header //DEPRECATED\n\t\t\t\t$this->data = $data->records;\n\t\t\t} //else: older version that did not have the 'records' property and data were saved as simple object\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function document($id) {\n if(!$this->current_user->can('download_contract'))\n return $this->prepareResponse('NOT_AUTHORIZED');\n\n $type = ContractType::where('name', '=', 'DOCUMENT')->first();\n $contract = Contract::find($id);\n\n if($contract->contract_type_id != $type->id)\n\t\t\treturn $this->prepareResponse('contracts.OBJECT_NOT_CONTRACT');\n\n\n if($contract->user_id != $this->current_user->id)\n // if the current user is not authorized to download a document of other users.\n if(!$this->current_user->can('super_download_contract'))\n return $this->prepareResponse('NOT_AUTHORIZED');\n\n// $transaction_user = false;\n// if($contract->transaction_id) {\n// $transaction = Transaction::find($contract->transaction_id);\n// $users = $transaction->users();\n// foreach($users as $user) {\n// if($this->current_user->id == $user->id)\n// $transaction_user = true;\n// }\n// }\n\n// if(!$transaction_user)\n// return $this->prepareResponse('NOT_AUTHORIZED');\n\n $file = public_path() . $this->document_path . $contract->path;\n $headers = array('Content-Type: application/pdf',);\n\n return response()->download($file, $contract->name, $headers);\n }", "function getDocument($we_editmode=\"0\",$baseHref=\"0\",$we_transaction=\"\") {\n\t\treturn $this->i_getDocument();\n\t}", "public function getDocument($id);", "public function read()\n {\n $result = FALSE;\n if (file_exists($this->fn)) {\n $result = unserialize(file_get_contents($this->fn));\n }\n return $result;\n }", "public function getDocument()\n\t\t{\n\t\t\treturn $this->document;\n\t\t}", "private function getFileObject()\n {\n return $this->fileObject;\n }", "private function _getManageDocument()\n {\n $oHTML = CDependency::getComponentByName('display');\n $oDB = CDependency::getComponentByName('database');\n $oLogin = CDependency::getComponentByName('login');\n $bAdmin = $oLogin->isAdmin();\n\n $oPage = CDependency::getComponentByName('page');\n $oPage->addCssFile($this->getResourcePath().'css/sharedspace.css');\n\n $sHTML = $oHTML->getTitleLine('Manage Shared Documents', $this->getResourcePath().'/pictures/component.png');\n $sHTML.= $oHTML->getCarriageReturn();\n\n $nCurrentUserPk = $oLogin->getUserPk();\n $asUser = $oLogin->getUserList();\n\n if($bAdmin)\n {\n $sQuery = 'SELECT count(sd.shared_documentpk) as nCount FROM `shared_document` as sd ';\n $sQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sQuery.= ' WHERE parentfk = 0 ';\n }\n else\n {\n $sQuery = 'SELECT count(sd.shared_documentpk) as nCount FROM `shared_document` as sd ';\n $sQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sQuery.= ' WHERE parentfk = 0 AND (sd.is_edit_public = 1 OR sd.creatorfk = '.$nCurrentUserPk.' OR sde.userfk = '.$nCurrentUserPk.') ';\n }\n\n $oResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oResult->readFirst();\n $nNbDoc = $oResult->getFieldValue('nCount', CONST_PHP_VARTYPE_INT);\n\n if(!$bRead || $nNbDoc == 0 )\n {\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_ADD, CONST_SS_TYPE_DOCUMENT);\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'notice2'));\n $sHTML.= $oHTML->getText('No shared document available. Upload ');\n $sHTML.= $oHTML->getLink('our first document', $sUrl);\n $sHTML.= $oHTML->getText(' now.');\n $sHTML.= $oHTML->getBlocEnd();\n return $sHTML;\n }\n\n $oPager = CDependency::getComponentByName('pager');\n $oPagerComponent = CDependency::getComponentUidByName('pager');\n if(!empty($oPagerComponent))\n $oPager->initPager();\n\n //Select the last revision of all documents\n if($bAdmin)\n {\n $sMainQuery = 'SELECT sd.*, sd1.file_name as rev_name FROM `shared_document` as sd ';\n $sMainQuery.= ' LEFT JOIN `shared_document` as sd1 ON (sd1.shared_documentpk = sd.parentfk AND sd1.date_creation = sd.date_update) ';\n $sMainQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sMainQuery.= ' WHERE sd.parentfk = 0 GROUP BY shared_documentpk ' ;\n }\n else\n {\n $sMainQuery = 'SELECT sd.*, sd1.file_name as rev_name FROM `shared_document` as sd ';\n $sMainQuery.= ' LEFT JOIN `shared_document` as sd1 ON (sd1.shared_documentpk = sd.parentfk AND sd1.date_creation = sd.date_update) ';\n $sMainQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sMainQuery.= ' WHERE sd.parentfk = 0 AND (sd.is_edit_public = 1 OR sd.creatorfk = '.$nCurrentUserPk.' OR sde.userfk = '.$nCurrentUserPk.') ';\n $sMainQuery.= ' GROUP BY shared_documentpk ' ;\n }\n\n $sMainQuery.= ' ORDER BY sd.date_update DESC LIMIT '.$oPager->getSqlOffset().','.$oPager->getLimit();\n $oDbResult = $oDB->ExecuteQuery($sMainQuery);\n $bRead = $oDbResult->readFirst();\n $asDocuments = array();\n\n if($bRead)\n {\n while($bRead)\n {\n $asDocuments[$oDbResult->getFieldValue('shared_documentpk')] = $oDbResult->getData();\n $bRead = $oDbResult->readNext();\n }\n }\n\n //Select the Revisions of the previous docs\n $sQuery = 'SELECT sd.* FROM `shared_document` as sd ';\n $sQuery.= ' WHERE parentfk IN ('.implode(',', array_keys($asDocuments)).') ORDER BY date_creation DESC';\n $oResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oResult->readFirst();\n\n $asRevisions = array();\n while($bRead)\n {\n $asRevisions[$oResult->getFieldValue('parentfk', CONST_PHP_VARTYPE_INT)][] = $oResult->getData();\n $bRead = $oResult->readNext();\n }\n\n $sHTML.= $oHTML->getBlocStart('', array('class'=>'homePageContainer','style' =>'padding: 0px;background-color:#FFFFFF;width: 100%;'));\n $sHTML.= $oHTML->getListStart('', array('class' => 'ablistContainer'));\n\n $sHTML.= $oHTML->getListItemStart('', array('class' => 'ablistHeader'));\n $sHTML.= $this->_getSharedManageRowHeader();\n $sHTML.= $oHTML->getListItemEnd();\n\n // Just for the header till now.\n\n $pnRow =0;\n foreach($asDocuments as $asDocument)\n {\n if(($pnRow%2) == 0)\n $sRowClass = '';\n else\n $sRowClass = 'list_row_data_odd';\n\n $nDocumentPk = (int)$asDocument['shared_documentpk'];\n\n $sHTML.= $oHTML->getListItemStart('');\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListRow sharedManageRow '.$sRowClass));\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell ','style' => 'width:110px;'));\n $sHTML.= $oHTML->getNiceTime($asDocument['date_creation']);\n\n if($bAdmin)\n {\n $sHTML.= $oHTML->getCarriageReturn();\n $asUserData = $oLogin->getUserDataByPk((int)$asDocument['creatorfk']);\n $sHTML.= $oHTML->getText('By :'.$oLogin->getUserNameFromData($asUserData), array('style' => 'color: #2A6991;'));\n }\n\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:150px;'));\n $sHTML.= substr($oHTML->getText($asDocument['title']), 0, 20);\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:150px;'));\n $sHTML.= substr($oHTML->getText($asDocument['description']), 0, 20);\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:115px;'));\n if($asDocument['is_public'] == 1)\n $sHTML.= $oHTML->getText('Public');\n else if($asDocument['is_public'] == 0)\n $sHTML.= $oHTML->getText('Private');\n else\n $sHTML.= $oHTML->getText('Restricted access');\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'floatHack'));\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:340px;'));\n\n if(isset($asRevisions[$nDocumentPk]))\n {\n $sHTML.= $oHTML->getBlocStart('revId_'.$nDocumentPk, array('class' => ''));\n\n //Get the number of revisions: nb file -1 (current one)\n $nCount = count($asRevisions[$nDocumentPk]);\n $nKey = 0;\n $bFirst = true;\n\n foreach($asRevisions[$nDocumentPk] as $asRevData)\n {\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, (int)$asRevData['shared_documentpk']);\n\n if($bFirst)\n {\n $sHTML.= $oHTML->getSpanStart();\n $sHTML.= $oHTML->getPicture(CONST_PICTURE_DOWNLOAD, 'Download file', $sUrl, array('style' => 'float: right; margin-right:10px;'));\n $sHTML.= $oHTML->getText('Revision #'.$nCount.': ', array('class' => 'strong'));\n $sHTML.= $oHTML->getSpace(2);\n $sHTML.= $oHTML->getLink($asRevData['file_name'], $sUrl, array('target' => '_blank'));\n $sHTML.= $oHTML->getText(' - '). $oHTML->getNiceTime($asRevData['date_creation']);\n $sHTML.= $oHTML->getCarriageReturn();\n $sHTML.= $oHTML->getSpanEnd();\n }\n else\n {\n //Second line: multiple revisions\n if($nKey == 1)\n {\n $sHTML.= $oHTML->getSpanStart();\n $sHTML.= $oHTML->getLink('Other revisions...', 'javascript:;', array('onclick' => '$(\\'#revId_'.$nDocumentPk.' .rev_hidden\\').fadeToggle(); '));\n $sHTML.= $oHTML->getCarriageReturn();\n $sHTML.= $oHTML->getSpanEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'rev_hidden'));\n }\n\n $sHTML.= $oHTML->getSpanStart();\n $sHTML.= $oHTML->getText('rev. #'.$nCount.': ');\n $sHTML.= $oHTML->getLink($asRevData['file_name'], $sUrl, array('target' => '_blank'));\n $sHTML.= $oHTML->getText(' - '). $oHTML->getNiceTime($asRevData['date_creation']);\n $sHTML.= $oHTML->getCarriageReturn();\n $sHTML.= $oHTML->getSpanEnd();\n }\n\n $nCount--;\n $nKey++;\n $bFirst = false;\n }\n\n $sHTML.= $oHTML->getText('rev. #0: ');\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($asDocument['file_name'], $sUrl, array('target' => '_blank'));\n\n if($nKey >= 1)\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocEnd();\n }\n else\n {\n $sPic = $oHTML->getPicture(CONST_PICTURE_DOWNLOAD, 'Download file', '', array('style' => 'float: right; margin-right:10px;'));\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($sPic.' '.$asDocument['file_name'], $sUrl, array('target' => '_blank'));\n }\n\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:100px; float:right;'));\n $sPic = $oHTML->getPicture(CONST_PICTURE_EDIT, 'Edit document');\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_EDIT, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($sPic, $sUrl);\n $sHTML.= $oHTML->getSpace(2);\n $sUrl = $oPage->getAjaxUrl('sharedspace', CONST_ACTION_DELETE, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sPic = $oHTML->getPicture(CONST_PICTURE_DELETE, 'Delete project');\n $sHTML.= $oHTML->getLink($sPic, $sUrl, array('onclick' => 'if(!window.confirm(\\'Delete this shared document ?\\')){ return false; }'));\n\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getListItemEnd();\n\n $pnRow++;\n }\n\n $sHTML.= $oHTML->getListEnd();\n $sHTML.= $oHTML->getBlocEnd();\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_MANAGE, CONST_SS_TYPE_DOCUMENT);\n $sHTML.= $oPager->getDisplay($nNbDoc, $sUrl);\n\n return $sHTML;\n }", "private function read()\n\t{\n\t\t$this->data = (file_exists($this->database) ? unserialize(gzinflate(base64_decode(substr(file_get_contents($this->database),strlen(PHPPREFIX),-strlen(PHPSUFFIX))))) : array() );\n\t}", "function read_doc_file() {\n \n $f = $this->file;\n if(file_exists($f))\n {\n if(($fh = fopen($f, 'r')) !== false ) \n {\n $headers = fread($fh, 0xA00);\n\n // 1 = (ord(n)*1) ; Document has from 0 to 255 characters\n $n1 = ( ord($headers[0x21C]) - 1 );\n\n // 1 = ((ord(n)-8)*256) ; Document has from 256 to 63743 characters\n $n2 = ( ( ord($headers[0x21D]) - 8 ) * 256 );\n\n // 1 = ((ord(n)*256)*256) ; Document has from 63744 to 16775423 characters\n $n3 = ( ( ord($headers[0x21E]) * 256 ) * 256 );\n\n // 1 = (((ord(n)*256)*256)*256) ; Document has from 16775424 to 4294965504 characters\n $n4 = ( ( ( ord($headers[0x21F]) * 256 ) * 256 ) * 256 );\n\n // Total length of text in the document\n $textLength = ($n1 + $n2 + $n3 + $n4);\n\n $extracted_plaintext = fread($fh, $textLength);\n $extracted_plaintext = mb_convert_encoding($extracted_plaintext,'UTF-8');\n // simple print character stream without new lines\n //echo $extracted_plaintext;\n\n // if you want to see your paragraphs in a new line, do this\n return nl2br($extracted_plaintext);\n // need more spacing after each paragraph use another nl2br\n }\n }\n }", "public function getDocument()\n {\n return $this->document;\n }", "public function getDocument()\n {\n return $this->document;\n }", "public function getDocument()\n {\n return $this->document;\n }", "public function getDocument()\n {\n return $this->document;\n }", "public function getDocument()\n {\n return $this->document;\n }" ]
[ "0.60803366", "0.602959", "0.59181195", "0.5901187", "0.57868475", "0.5694719", "0.56872696", "0.56698406", "0.5564075", "0.55410635", "0.5536074", "0.54878795", "0.5465483", "0.5450121", "0.5448274", "0.54229444", "0.5419618", "0.539394", "0.53936756", "0.5379856", "0.5379602", "0.5377497", "0.5377039", "0.53689826", "0.5352705", "0.5347739", "0.5347739", "0.5347739", "0.5347739", "0.5347739" ]
0.61572707
0
Builds the instance template from scratch
public function build(): void { // check if building is enabled $url = $this->config()->templateUrl(); if (is_string($url) !== true) { throw new Exception('The template URL that is required for building is not configured'); } // prevent that new instances are created // while the template is being rebuilt $this->lock()->acquireExclusiveLock(); // recursively delete the whole old template directory Dir::remove($this->config()->templateRoot()); // initialize the template from ZIP $root = $this->config()->templateRoot(); $this->downloadZip( Str::before($url, '#'), Str::after($url, '#'), $root ); // run the post-build hook if defined $this->runHook($root, 'build:after', $this); // delete all prepared instances (they are now outdated) foreach ($this->instances()->all('ipHash IS NULL') as $instance) { $instance->delete(); } // instances can now be created again $this->lock()->releaseLock(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildTemplate()\n {\n $this->t_wrap->del('rows');\n $this->t_wrap->appendHtml('rows', '{rows}');\n\n for ($row = 1; $row <= $this->rows; ++$row) {\n $this->t_row->del('column');\n\n for ($col = 1; $col <= $this->columns; ++$col) {\n $this->t_col->set('Content', '{$r' . $row . 'c' . $col . '}');\n\n $this->t_row->appendHtml('column', $this->t_col->render());\n }\n\n $this->t_wrap->appendHtml('rows', $this->t_row->render());\n }\n $this->t_wrap->appendHtml('rows', '{/rows}');\n $tmp = new Template($this->t_wrap->render());\n\n // TODO replace later, the only use of direct template property access\n $t = $this;\n \\Closure::bind(function () use ($t, $tmp) {\n $t->template->template['rows#0'] = $tmp->template['rows#0'];\n $t->template->rebuildTagsIndex();\n }, null, Template::class)();\n\n $this->addClass($this->words[$this->columns] . ' column');\n }", "protected function buildTemplateBuilder()\n {\n $this->templateBuilder = (new RootLeaguePlatesTemplateBuilder())\n ->init();\n return $this;\n }", "function build() {\n $this->smarty->display($this->template);\n }", "public function buildTemplate() {\n\n // The node's default renderis is its content.\n\n $tpl = array();\n $tpl_level = 0;\n\n // a template in the same directory has always priority.\n if (is_file($this->node->getPath() . '/tpl.html')) {\n $this->setData('tpl_file', $this->node->getPath() . '/tpl.html');\n }\n else {\n $lineages = $this->node->getLineage();\n foreach ($lineages as $lineage) {\n\n $tpl_level++;\n\n // If tpl^.html exists - template applies to all sublevels of the node.\n if (is_file($lineage->path . '/tpl^.html')) {\n $this->setData('tpl_file', $lineage->path . '/tpl^.html');\n }\n else {\n $min = '';\n // We support 5 levels of sub-level templates for now.\n // level 0 = tpl.html\n // level 1 = tpl-.html\n // level 2 = tpl--.html\n // etc...\n\n for ($i = 1; $i <= 6; $i++) {\n $min .= '-';\n $file = $lineage->path . '/tpl' . $min . '.html';\n if (file_exists($file)) {\n $tpl[$tpl_level + $i] = $file;\n }\n }\n }\n }\n\n // check if there is a sub-level template.\n if (isset($tpl[$tpl_level])) {\n $this->setData('tpl_file', $tpl[$tpl_level]);\n }\n }\n\n // Set the template.\n $this->html = (!empty($this->getData('tpl_file'))) ? file_get_contents($this->getData('tpl_file')) : $this->node->getBody();\n\n }", "public function template() {}", "abstract function build($template, AbstractConfig $config);", "public function newInstance()\n {\n // This method just provides a convenient way for us to generate fresh template\n // instances of this current template. It is particularly useful during the\n // hydration of new objects.\n return new static;\n }", "public function template() {\n }", "public function build()\n {\n // It's the way to use a Smarty template.\n $this->setLayout('home/home.tpl');\n\n // If you need a model, first of all you shoul get the object. It's forbidden the use of \"$a = new ClassName();\"\n $home_model = $this->getClass('HomeHomeModel');\n $content_documents = $home_model->getContentDocuments();\n\n // To assign variables to Smarty template you should use the method \"assign\".\n $this->assign('content_documents_smarty_variable', $content_documents);\n\n // To catch GET/POST variable you should use the Filter class.\n if (Filter::getString('test')) {\n $this->assign('sended_variable', Filter::getString('test'));\n }\n }", "public function __construct(){\n\t\t$this->_builder = AisisCore_Factory_Pattern::create('AisisCore_Template_Builder');\n\t\t\n\t\tif(is_category()){\n\t\t\techo $this->build_category_function();\n\t\t}elseif(is_tag()){\n\t\t\techo $this->build_tag_function();\n\t\t}elseif(is_author()){\n\t\t\techo $this->build_author_function();\n\t\t}\n\t\t\n\t\t$this->init();\n\t}", "abstract public function build();", "abstract public function build();", "static function getTemplate(){\n if (self::$instant == NULL){\n self::$instant = new self;\n }\n return self::$instant;\n }", "function buildTemplate($submit='') {\n\n // if $submit is set, convert html entities to allow >, etc\n if ($submit != '') {\n $submit = htmlspecialchars($submit);\n }\n\n // clean\n $template = '';\n\n // if this is NOT a ftl, it's a bad form. if badFormMessage is set,\n // use that as a header\n if (!$this->ftl && isset($this->directive['badFormMessage'])) {\n $this->header .= \"<span class=\\\"\".$this->directive['errorMsgClass'].\"\\\">\".$this->directive['badFormMessage'].\"</span>\";\n }\n\n // add header if we've got one\n if ($this->header != '')\n $template .= $this->header;\n\n // loop through by group\n foreach ($this->groupList as $groupName => $entList) {\n foreach ($entList as $ent) {\n\n // get info from entity objects for display\n\n $wrapClass = '';\n $customClass = (isset($ent->inputEntity->directive['wrapClass'])) ?\n ($ent->inputEntity->directive['wrapClass'].' ') :\n '';\n $errClass = ($ent->inputEntity->isValid) ? '' : (' '.$this->directive['errorClass']);\n $reqClass = (($ent->required) ? $this->directive['requiredClass'] :\n $this->directive['optionalClass']);\n $wrapClass = $customClass.$reqClass.$errClass;\n\n $template .= \"<div id='\".$ent->varName.'_wrap'.\"' class='\".$wrapClass.\"'>\";\n $template .= str_replace('___VARNAME___', $ent->varName, $ent->template);\n $template .= \"</div>\\n\";\n\n }\n }\n\n ///////////////////////////////////////////////////////////////////\n // bottom of table, after form entities\n\n\n // add footer if we've got one\n if ($this->footer != '')\n $template .= $this->footer;\n\n\n // submit button\n if ($this->directive['resetButton'] != '') {\n\n if ($submit != '')\n $template .= '<sm type=\"sf\" data=\"submit\" title=\"'.\"$submit\\\">\";\n $template .= '<sm type=\"sf\" data=\"reset\" title=\"'.$this->directive['resetButton'].'\">';\n\n }\n else {\n if ($submit != '')\n $template .= '<sm type=\"sf\" data=\"submit\" title=\"'.\"$submit\\\">\";\n }\n\n // create a new template, set it's template data to the template we just made\n $this->template = new SM_layoutTemplate();\n $this->template->addDirective('SF', array('parentForm' => $this));\n $this->template->setTemplateData($template);\n\n\n }", "public abstract function build();", "public function build() {\n\n\t\t/* Names\n\t\t */\n\t\t$controllerName = $this->getControllerName();\n\t\t$methodName = $this->getControllerMethod();\n\n\t\t$viewName = $this->getViewName();\n\t\t$viewMethod = $this->getViewMethod();\n\n\t\t/* Create and execute controller and view methods\n\t\t */\n\t\t$controller = new $controllerName($this->getRouter()->getRequest());\n\n\t\tif (method_exists($controller, $methodName)) {\n\t\t\t$controller->setData($controller->$methodName());\n\t\t}\n\n\t\t/* Set up view\n\t\t */\n\t\t$view = new $viewName($controller->getData(), $this->getTemplate());\n\n\t\tif (method_exists($view, $viewMethod)) {\n\t\t\t$view->$viewMethod();\n\t\t}\n\n\t\t$this->setView($view);\n\t}", "public function initCurrentTemplate()\n {\n self::$templates[$this->getCurrentTemplate()] = array(\n 'source' => null,\n 'compilation' => null,\n );\n\n return $this;\n }", "public function create() {\n\t\t$this->initForm();\n\t\t$this->getStandardValues();\n\t\t$this->tpl->setContent($this->form->getHTML());\n\t}", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build()\n {\n $this->header->generate();\n $this->contents->generate();\n $this->footer->generate();\n }", "public function buildViewFromTemplate($template);", "public function build( )\n {\n\n $id = $this->getId();\n $resizeable = $this->resizable\n ? ' resizable=\"resizable\" ' : '';\n $movable = $this->movable\n ? ' movable=\"movable\" ' : '';\n $planet = $this->planet\n ? ' planet=\"'.$this->planet.'\" ' : '';\n\n $editAble = $this->editAble\n ? '' : ' editable=\"false\" ';\n\n $title = $this->title\n ? '<title>'.$this->title.'</title>':'';\n $subtitle = $this->subtitle\n ? '<subtitle>'.$this->subtitle.'</subtitle>':'';\n $statusBar = $this->statusBar\n ? '<status>'.$this->statusBar.'</status>':'';\n\n $events = '';\n if( $this->events )\n {\n $events = '<events>';\n\n foreach( $this->events as $type => $subEvents )\n {\n foreach( $subEvents as $name => $code )\n {\n $events .= '<event type=\"'.$type.'\" name=\"'.$name.'\" ><![CDATA['.$code.']]></event>'.NL;\n }\n }\n\n $events .= '</events>';\n }\n\n $bookmark = $this->bookmark\n ? '<bookmark title=\"'.$this->bookmark['title'].'\" url=\"'.urlencode($this->bookmark['url']).'\" role=\"'.$this->bookmark['role'].'\" />'\n : '';\n\n\n\n $buttons = $this->buildButtons();\n $content = $this->includeTemplate( $this->template );\n\n $jsCode = '';\n if( $this->jsCode )\n {\n\n $this->assembledJsCode = '';\n\n foreach( $this->jsCode as $jsCode )\n {\n if( is_object($jsCode) )\n $this->assembledJsCode .= $jsCode->getJsCode();\n else\n $this->assembledJsCode .= $jsCode;\n }\n\n $jsCode = '<script><![CDATA['.NL.$this->assembledJsCode.']]></script>'.NL;\n }\n\n\n return <<<CODE\n\n <window $resizeable $movable id=\"{$id}\" {$planet} {$editAble} >\n <dimensions width=\"{$this->width}\" height=\"{$this->height}\" min-width=\"{$this->minWidth}\" min-height=\"{$this->minHeight}\" />\n {$title}\n {$subtitle}\n {$statusBar}\n {$buttons}\n {$bookmark}\n {$events}\n <content><![CDATA[{$content}]]></content>\n {$jsCode}\n </window>\n\nCODE;\n\n }", "public static function build($params)\n {\n $params = self::prepareParams($params);\n $post_type = new Template(\n $params['theme-path'] . '/core/post-types',\n 'post-type',\n [\n '{KEY}' => $params['key'],\n '{GENERAL_NAME}' => $params['general-name'],\n '{SINGULAR_NAME}' => $params['singular-name'],\n '{DESCRIPTION}' => $params['description'],\n '{REWRITE}' => $params['rewrite'] ?: 'false',\n '{TEXT_DOMAIN}' => $params['text-domain'],\n '{CAPABILITY_TYPE}' => $params['capability-type'],\n '{PUBLIC}' => $params['public'] ? 'true' : 'false',\n '{HIERARCHICAL}' => $params['hierarchical'] ? 'true' : 'false',\n '{HAS_ARCHIVE}' => $params['has-archive'] ? 'true' : 'false',\n '{ICON}' => $params['icon'],\n '{SUPPORTS}' => $params['supports']\n ]\n );\n $post_type->save($params['filename'], $params['override']);\n\n Config::set($params['config-path'], [\n 'entity' => $params['entity-name'],\n 'has-archive' => (bool) $params['has-archive']\n ]);\n\n Schema::add($params['theme'], 'post-type', [\n 'key' => $params['key'],\n 'general-name' => $params['general-name'],\n 'singular-name' => $params['singular-name'],\n 'capability-type' => $params['capability-type'],\n 'public' => $params['public'],\n 'has-archive' => $params['has-archive'],\n 'hierarchical' => $params['hierarchical'],\n 'icon' => $params['icon'],\n 'description' => $params['description']\n ]);\n\n EntityBuilder::build([\n 'name' => $params['entity-name'],\n 'theme' => $params['theme'],\n 'override' => $params['override']\n ]);\n\n DTOBuilder::build([\n 'entity-name' => $params['entity-name'],\n 'theme' => $params['theme'],\n 'override' => $params['override']\n ]);\n\n RepositoryBuilder::build([\n 'post-type' => $params['key'],\n 'entity-name' => $params['entity-name'],\n 'theme' => $params['theme'],\n 'override' => $params['override']\n ]);\n\n if ($params['public']) {\n SingleBuilder::build([\n 'post-type' => $params['key'],\n 'entity-name' => $params['entity-name'],\n 'theme' => $params['theme'],\n 'override' => $params['override']\n ]);\n\n if ($params['has-archive']) {\n ArchiveBuilder::build([\n 'post-type' => $params['key'],\n 'theme' => $params['theme'],\n 'override' => $params['override']\n ]);\n }\n }\n }" ]
[ "0.6611248", "0.6490492", "0.6403197", "0.6312011", "0.627641", "0.62599856", "0.6118746", "0.6087629", "0.6075819", "0.6042951", "0.6015938", "0.6015938", "0.6013658", "0.59882724", "0.5986691", "0.5946641", "0.5939587", "0.5936635", "0.5922634", "0.5922634", "0.5922634", "0.5922634", "0.5922634", "0.5922634", "0.5922634", "0.5922634", "0.59214437", "0.59150064", "0.589831", "0.5898183" ]
0.659462
1
Cleans up all expired instances and executes the cleanup hook of the template
public function cleanup(): void { $expired = $this->instances()->all()->filterBy('hasExpired', '==', true); foreach ($expired as $instance) { $instance->delete(); } $this->runHook($this->config()->templateRoot(), 'cleanup', $this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanUpGarbage()\n\t{\n\t\t$phptalCacheFilesExpire = time() - $this->getCacheLifetime() * 3600 * 24;\n\t\t$upperLimit = $this->getPhpCodeDestination() . 'tpl_' . $phptalCacheFilesExpire . '_';\n\t\t$lowerLimit = $this->getPhpCodeDestination() . 'tpl_0_';\n\t\t$phptalCacheFiles = glob($this->getPhpCodeDestination() . 'tpl_*.' . $this->getPhpCodeExtension() . '*');\n\n\t\tif ($phptalCacheFiles)\n\t\t{\n\t\t\tforeach($phptalCacheFiles as $index => $file)\n\t {\n\t\t\t\tif ($file > $upperLimit && substr($file,0,strlen($lowerLimit)) !== $lowerLimit)\n\t\t\t\t{\n\t\t\t\t unset($phptalCacheFiles[$index]);\n\t\t\t\t}\n\t }\n\t foreach($phptalCacheFiles as $file)\n\t {\n\t $time = filemtime($file);\n\t if ($time && $time < $phptalCacheFilesExpire) @unlink($file);\t\t\t \n\t\t }\n\t }\n\t}", "public function __destruct() {\r\n\t\t$this->onExpire();\r\n\t}", "public function cleanUpTemporary()\r\n {\r\n $this->container->destroy();\r\n }", "public function cleanup();", "public function cleanup();", "public function __destruct()\n {\n $this->_invalidateExpired();\n }", "public function purge() {\r\n\r\n $this->where('created_at <', date('Y-m-d H:i:s', time() - $this->expiration_time))->delete_many_by();\r\n }", "protected function GarbageCollector() {\n\n // @TODO: walk thru all records and delete items expired by TTL\n }", "protected function _gc() {\n\t\t$expires = ($this->_lifetime)\n\t\t\t? $this->_lifetime\t// Expire sessions when their lifetime is up\n\t\t\t: Date::MONTH; \t\t// Expire sessions after one month\n\n\t\t// Delete all sessions that have expired\n\t\tDB_ORM::delete($this->_table)\n\t\t\t->where($this->_columns['last_active'], DB_SQL_Operator::_LESS_THAN_, time() - $expires)\n\t\t\t->execute();\n\t}", "public function deleteAllExpired() {\n\t}", "public function removeExpired();", "public function removeExpired();", "public function cleanup(){\n\n $model = $this->_p->Model('AccessKey');\n\n $this->_p->db->query($this->_p->db->getQueryBuilder($model->getModelStorage())->compileDelete($model, array('where' => array('expired' => array('op' => '<', 'value' => $this->_p->getTime())))), $model->getModelStorage());\n\n }", "public function cleanup()\n\t{\n\n\t}", "public function cleanup()\n {\n }", "public function cleanup()\n {\n }", "public function cleanup()\n {\n }", "public function _cleanup()\n\t{\n\t\t$where = array();\n\t\t$where['created <'] = now() - 30*24*60*60;\n\t\t\n\t\t$this->del_rule($where);\n\t}", "public static function remove_expired() {\r\n\t\t$impl = self::get_implementation();\r\n\t\t$impl->remove_expired();\r\n\t}", "public static function cleanupUnusedTemplate()\n {\n }", "protected function gc() {\n\t\t$this->getDbConnection()->createCommand('DELETE FROM '.$this->tableName.' WHERE expire>0 AND expire<'.time())->execute();\n\t}", "function __destruct() {\n $this->_template->render();\n }", "public function cleanup()\n {\n $iTimeFrame = oxRegistry::getConfig()->getRequestParameter(\"timeframe\");\n $dNow = time();\n $iTimestamp = mktime(\n date(\"H\", $dNow),\n date(\"i\", $dNow),\n date(\"s\", $dNow),\n date(\"m\", $dNow),\n date(\"d\", $dNow) - $iTimeFrame,\n date(\"Y\", $dNow)\n );\n $sDeleteFrom = date(\"Y-m-d H:i:s\", $iTimestamp);\n\n $oDb = oxDb::getDb();\n $oDb->Execute(\"delete from oxlogs where oxtime < \" . $oDb->quote($sDeleteFrom));\n }", "abstract public function cleanup();", "protected function run_cleanup() {\n\t\t$this->cleaner->clean( 10 * $this->get_time_limit() );\n\t}", "protected function destroy() {\n\t}", "protected function afterCleanup() {\n\t}", "public function finalize()\n\t{\n\t\t$tag = $this->getTag();\n\n\t\tif (!isset($tag->template))\n\t\t{\n\t\t\t$tag->template = $this->getTemplate();\n\t\t}\n\t}", "public function cleanUp();", "function cleanUp() {\n\t\t$threeDaysAgo = date('Y-m-d H:i:s', mktime(0, 0, 0, date('m'), date('d') - 3, date('Y')));\n\n\t\t$delete_condition = \"Cart.created < '$threeDaysAgo'\";\n\t\t$this -> deleteAll($delete_condition, false);\n\t}" ]
[ "0.6743329", "0.66931474", "0.66736114", "0.6667251", "0.6667251", "0.6620647", "0.6595874", "0.65852135", "0.6582892", "0.65598816", "0.65489644", "0.65489644", "0.65349096", "0.65220195", "0.6521177", "0.6521177", "0.6521177", "0.6446087", "0.6421119", "0.64190364", "0.64111423", "0.6402447", "0.63850313", "0.6352942", "0.6333685", "0.63029104", "0.6292089", "0.6251486", "0.6239171", "0.62063104" ]
0.89211154
0
Checks if given HTML string is valid by running it trough callback function.
private function runValidityChecker(string $html): void { if (!$this->isFunction($this->htmlCheckerFunction)) { return; } if (!$this->callFunction($this->htmlCheckerFunction, new Crawly($html))) { throw new ScrapeException('Page html validation failed.', 400); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wponion_is_valid_html( $string ) {\n\t\treturn ( strip_tags( $string ) !== $string );\n\t}", "static function validateHTML($html, $min_length = false) {\n if ($html) {\n // strip (excluding specified tags)\n $html = (string) strip_tags($html, '<div><img><a>');\n\n // remove non ascii characters\n //$html = preg_replace('/[^(\\x20-\\x7F)]*/', '', $html);\n\n // trim the html\n $html = (string) trim($html);\n\n if ($min_length) {\n return strlen_utf($html) >= $min_length;\n } else {\n return (boolean) $html;\n } // if\n } else {\n return false;\n } // if\n }", "function is_html($string)\n {\n return strcasecmp($string, strip_tags($string)) !== 0;\n }", "public static function containsHtml($string) {\n return (preg_match('/(<[a-z][^>]*>|&(?:[a-z]+|#\\d+);)/i', $string)) ? TRUE : FALSE;\n }", "public static function isHTML($string) {\n\t\t//return self::secureStripTagsContent($string) == '' ? true : false;\n\t\treturn preg_match('/<html.*>/', $string) ? true : false;\n\t}", "function validateHtml($str)\r\n{\r\n\t$oldstr = \"\";\r\n\twhile($str != $oldstr) // Loop until it got no more effect\r\n\t{\r\n\t\t$oldstr = $str;\r\n\t\t//nuke script and header tags and anything inbetween\r\n\t\t$str = preg_replace(\"'<script[^>]*?>.*?</script>'si\", \"&nbsp;&nbsp;comments modified&nbsp;&nbsp;\\n\", $str);\r\n\t\t$str = preg_replace(\"'<head[^>]*?>.*?</head>'si\", \"&nbsp;&nbsp;comments modified&nbsp;&nbsp;\\n\", $str);\r\n\r\n\t\t//listed of tags that will not be striped but whose attributes will be\r\n\t\t$allowed = \"b|i|p|u|a|center|hr\";\r\n\t\t//start nuking those suckers. don you just love MS Word's HTML?\r\n\t\t$str = preg_replace(\"/<((?!\\/?($allowed)\\b)[^>]*>)/xis\", \"&nbsp;*X*&nbsp;\\n\", $str);\r\n\t\t$str = preg_replace(\"/<($allowed).*?>/i\", \"<\\\\1>\", $str);\r\n\t}\r\nreturn $str;\r\n}", "public static function validate( $string );", "function check($text, $is_html = false)\n {\n // convert to plain text\n if ($is_html) {\n $this->content = $this->html2text($text);\n }\n else {\n $this->content = $text;\n }\n\n if ($this->backend) {\n $this->matches = $this->backend->check($this->content);\n }\n\n return $this->found() == 0;\n }", "function isHTML($a_text)\n\t{\n\t\tif (preg_match(\"/<[^>]*?>/\", $a_text))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE; \n\t\t}\n\t}", "public static function isCleanHtml($html, $allow_iframe = false)\n {\n $events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange';\n $events .= '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend';\n $events .= '|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus|onbeforepaste|onbeforeprint|onbeforeunload|onbeforeupdate|onmove';\n $events .= '|onbounce|oncellchange|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavailable|ondatasetchanged|ondatasetcomplete|ondeactivate|ondrag|ondragend|ondragenter|onmousewheel';\n $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart';\n $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange';\n $events .= '|onselectstart|onstart|onstop';\n\n if (preg_match('/<[\\s]*script/ims', $html) || preg_match('/('.$events.')[\\s]*=/ims', $html) || preg_match('/.*script\\:/ims', $html))\n return false;\n\n if (!$allow_iframe && preg_match('/<[\\s]*(i?frame|form|input|embed|object)/ims', $html))\n return false;\n\n return true;\n }", "function xhtml_validate($text)\n{\n\ttry\n\t{\n\t\tglobal $_xhtml_error, $root_path;\n\n\t\t$text = '<' . _XHTML_ROOT . '>' . $text . '</' . _XHTML_ROOT . '>';\n\t\t$text = sprintf('<?xml version=\"1.0\" standalone=\"no\" ?>\n\t\t\t<!DOCTYPE %s SYSTEM \"%s\">\n\t\t\t', _XHTML_ROOT, \n\t\t\t$root_path . 'contents/' . _XHTML_ROOT . '.dtd') . $text;\n\t\t$_xhtml_error = NULL;\n\t\tset_error_handler('_xhtml_error_handler');\n\n\t\t$doc = new DOMDocument;\n\t\t$doc->strictErrorChecking = FALSE;\n\t\t// setting $new->strictErrorChecking to TRUE seems not to work on my system\n\n\t\t$doc->encoding = \"utf-8\";\n\t\t$doc->validateOnParse = TRUE;\n\t\tif (!$doc->loadXML($text, LIBXML_DTDVALID))\n\t\t\tthrow new Exc_xhtml(__('invalid document'));\n\n\t\t$list = $doc->getElementsByTagName(_XHTML_ROOT);\n\t\tif ($list->length > 1)\n\t\t\tthrow new Exc_xhtml(__('disallowed tag: %s', _XHTML_ROOT));\n\n\t\t$list = $doc->getElementsByTagName('a');\n\t\t$str_js = 'javascript:';\n\t\tfor ($i = 0; $i < $list->length; $i ++)\n\t\t{\n\t\t\t$attr = $list->item($i)->attributes;\n\t\t\tif (!is_null($attr))\n\t\t\t{\n\t\t\t\t$val = $attr->getNamedItem('href');\n\t\t\t\tif (!is_null($val))\n\t\t\t\t{\n\t\t\t\t\t$val = html_entity_decode($val->nodeValue);\n\t\t\t\t\t$val = strtolower($val);\n\t\t\t\t\t$tp = 0;\n\t\t\t\t\tfor ($j = 0; $j < strlen($val) && $tp < strlen($str_js); $j ++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$ch = $val[$j];\n\t\t\t\t\t\tif (ctype_alpha($ch) || $ch == ':')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($ch != $str_js[$tp])\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t$tp ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($tp == strlen($str_js))\n\t\t\t\t\t\tthrow new Exc_xhtml(__('javascript is not allowed'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tcatch (Exc_xhtml $e)\n\t{\n\t\trestore_error_handler();\n\t\tthrow $e;\n\t}\n\trestore_error_handler();\n}", "public static function is_html($string)\n {\n return strlen(strip_tags($string)) < strlen($string);\n }", "public static function isHTML(string $string) : bool\n {\n return $string !== strip_tags($string);\n }", "public static function isHtml(string $str): bool\n {\n return BaseStringy::create($str)->isHtml();\n }", "function checkFormForHTML($content) {\n $regex = \"/<.*>/\";\n foreach ($content as $k => $v) { if(preg_match($regex, $v))return false; }\n\n $regex = \"/http:/\";\n foreach ($content as $k => $v) { if(preg_match($regex, $v))return false; }\n\n return true;\n}", "public function is_valid($xmlStr, $ignoreHtml = true)\n {\n $xmlStr = trim($xmlStr);\n\n if ('' === $xmlStr) {\n return false;\n }\n\n if ($ignoreHtml && false !== stripos($xmlStr, '<!DOCTYPE html>')) {\n return false;\n }\n\n libxml_use_internal_errors(true);\n\n simplexml_load_string($xmlStr);\n\n $errors = libxml_get_errors();\n\n libxml_clear_errors();\n\n return empty($errors);\n }", "function check($xhtml) {\n $xhtml = str_replace('&nbsp;', ' ', $xhtml);\n $xhtml = str_replace('&ldquo;','\"', $xhtml);\n $xhtml = str_replace('&rdquo;','\"', $xhtml);\n //$xhtml = str_replace('&#x2018;','\"', $xhtml);\n //$xhtml = str_replace('&#x2019;','\"', $xhtml);\n $xhtml = str_replace('&rsquo;','\\'', $xhtml); \n // Open comments are dangerous\n $xhtml = str_replace('<!--', '', $xhtml);\n // So is CDATA\n $xhtml = str_replace('<![CDATA[', '', $xhtml);\n // And processing directives\n $xhtml = str_replace('<?', '', $xhtml);\n // And script elements require double checking just to be sure\n $xhtml = preg_replace('/<script/i', '', $xhtml);\n if (!xml_parse($this->parser, $xhtml)) {\n $b=xml_get_current_byte_index($this->parser);\n $str=' near text \"'.self::clean('string',substr($xhtml,$b,50)).'\" ';\n $this->errors[] = 'XHTML is not well-formed : '.xml_error_string(xml_get_error_code($this->parser)).$str;\n }\n }", "private function clean_html($html) {\n libxml_use_internal_errors(true);\n $html = \"<div>\". $html . \"</div>\"; // Wrap it in a div (seems to help libxml)\n $doc = new DOMDocument;\n if ($doc->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD)) {\n return $doc->saveHTML();\n } else {\n $message = \"Errors in HTML\\n<br />\";\n foreach (libxml_get_errors() as $error) {\n $message .= \"Line {$error->line} column {$error->line}: {$error->code}\\n<br />\";\n }\n libxml_clear_errors();\n $message .= \"\\n<br />\" + $html;\n return $message;\n }\n }", "function test3() {\r\n global $doc, $html;\r\n $doc = parseHtml($html);\r\n return check_test(is_array($doc), true, \"parseHtml could not fully parse html\");\r\n}", "function _valid_XHTML($input)\n {\n if (!is_string($input) || strlen($input) > _XWL_TEXT_MAXLEN) return false;\n else return XWL::_test_xml($input);\n }", "public function isValid($value) {\n\t\t$this->errors = array();\n\t\t\n\t\t$strippedValue = strip_tags($value);\n\t\t\n\t\tif(strlen($value) > strlen($strippedValue)) {\n\t\t\t$this->addError('HTML tags are not allowed.', 1316198501);\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function html($string);", "function tags_is_valid($tag) {\n $len = strlen($tag);\n return ($len > 2 && $len < 40 && strpos($tag, '>')===false && strpos($tag, '<')===false && strpos($tag, '/')===false && strpos($tag, '#')===false);\n}", "function _valid_XHTML($input)\n {\n if (!is_string($input) || strlen($input) > _XWL_MEDIUMTEXT_MAXLEN) return false;\n else return XWL::_test_xml($input);\n }", "abstract public function parseHtml();", "public function html($html);", "public static function validateXMLString($input, &$error='')\n\t{\n\t\t$val = libxml_use_internal_errors(true);\n\t\tlibxml_clear_errors();\n\t\t$dom = new DOMDocument();\n\t\tif (!@$dom->loadXML($input)) {\n\t\t\t$errors = libxml_get_errors();\n\t\t\tforeach ($errors as $e) {\n\t\t\t\t$error .= $e->message;\n\t\t\t}\n\n\t\t\tlibxml_use_internal_errors($val);\n\t\t\treturn false;\n\t\t}\n\n\t\tlibxml_use_internal_errors($val);\n\t\treturn true;\n\t}", "function isOKtext($element) {\r\n\treturn !preg_match (\"/[^A-z0-9-_,.@#$%&*=+:;<>?)('\\\" ]/\", $element);\r\n}", "function valid() {}", "function is_html_response($response){\n\t\tif((substr($response,0,5) == '<html') || (substr($response,0,9) == '<!DOCTYPE')){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.66325694", "0.6036852", "0.59409195", "0.59009016", "0.5854424", "0.5817811", "0.5738442", "0.57258177", "0.5638474", "0.56150675", "0.5606015", "0.55859786", "0.55055034", "0.5497091", "0.5460106", "0.5344196", "0.53413576", "0.5327814", "0.53052133", "0.5284241", "0.52669305", "0.52383757", "0.52360415", "0.5227529", "0.52108127", "0.51757354", "0.5148921", "0.5135125", "0.5133108", "0.5132654" ]
0.6623713
1
Passes given Crawly crawler trough available parsers.
private function runParsers(Crawly $crawly): array { $result = []; foreach ($this->parsers as $parser) { $crawly->reset(); $result = $parser->process($crawly, $result, $this->params); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function parse(Crawler $crawler);", "public function scrape()\n {\n $crawler = $this->client->request('GET', $this->config['endPoint']);\n $this->checkRequestStatus();\n $result = [];\n\n $result = $crawler->filter($this->config['domNodes']['itemNodes'])->each(function ($node) {\n $itemLink = $node->filter($this->config['domNodes']['jumpLink'])->attr('href');\n $itemCrawler = $this->client->request('GET', $itemLink);\n $this->checkRequestStatus();\n $item = [];\n\n foreach ($this->config['domNodes']['itemAttributes'] as $attr => $attrData) {\n if (!empty($attrData['path'])) {\n $item[$attr] = $itemCrawler->filter($attrData['path'])->text();\n }\n\n if (!empty($attrData['processor']) && method_exists($this, $attrData['processor'])) {\n $attrProcessor = $attrData['processor'];\n $item[$attr] = $this->$attrProcessor();\n }\n }\n\n return $item;\n });\n\n if (method_exists($this, $this->config['domNodes']['processor'])) {\n $resultProcessor = $this->config['domNodes']['processor'];\n $result = $this->$resultProcessor($result);\n }\n\n return $result;\n }", "public function crawl(){\n\t\t\t$seedUrls = $this->getSeedUrls();\n\t\t\tforeach($seedUrls as $url) {\n\t\t\t\t$this->collectUrls($url);\n\t\t\t}\n\t\t}", "public function scrape(): array\n {\n try {\n $this->html = $this->reader()->read();\n $this->runValidityChecker($this->html);\n\n return $this->runParsers(new Crawly($this->html));\n } catch (Exception|Error $e) {\n throw new ScrapeException($e->getMessage(), $e->getCode());\n }\n }", "public function scrape(string $url);", "public function execute() : array\n {\n $links = [];\n foreach ($this->crawler->filter('#special > h1 > a') as $domElement)\n $links[] = $domElement->getAttribute('href');\n\n\n // main story\n $links[] = $this->crawler->filter('#main_story > h1 > a')->attr('href');\n\n foreach ($this->crawler->filter('.news_loop > h2 > a') as $domElement)\n $links[] = $domElement->getAttribute('href');\n\n\n foreach ($links as $item)\n (new SingleNews($item, $this->config))->execute();\n }", "private function parseUrls()\n\t{\n\t\tforeach ($this->urls as $url) {\n\t\t\t$urlEntity = $url->url;\n\t\t\tif ($urlEntity['isIndex'] && !$urlEntity['hideInSitemap'] && !empty($this->localesWebsites[$urlEntity['locale']])) {\n\t\t\t\t$entity = $url->entity;\n\t\t\t\t$entityObject = $url->entityObject;\n\t\t\t\t$interface = $url->interface;\n\t\t\t\tif (!empty($interface['classname']) && $interface['classname'] === Page::class && !$entity['isIndex']) {\n\t\t\t\t\t$this->setPage($entity, $url);\n\t\t\t\t} elseif (!empty($interface['classname']) && $interface['classname'] !== Page::class) {\n\t\t\t\t\t$this->setAsCard($entity, $entityObject, $interface, $url);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function __construct()\n { \n // Create uniqid for this crawlerinstance\n $this->crawler_uniqid = getmypid().time();\n \n // Include needed class-files\n $classpath = dirname(__FILE__);\n \n // Utils-class\n if (!class_exists(\"PHPCrawlerUtils\")) include_once($classpath.\"/PHPCrawlerUtils.class.php\");\n \n // URL-Cache-classes\n if (!class_exists(\"PHPCrawlerURLCacheBase\")) include_once($classpath.\"/UrlCache/PHPCrawlerURLCacheBase.class.php\");\n if (!class_exists(\"PHPCrawlerMemoryURLCache\")) include_once($classpath.\"/UrlCache/PHPCrawlerMemoryURLCache.class.php\");\n if (!class_exists(\"PHPCrawlerSQLiteURLCache\")) include_once($classpath.\"/UrlCache/PHPCrawlerSQLiteURLCache.class.php\");\n \n // PageRequest-class\n if (!class_exists(\"PHPCrawlerHTTPRequest\")) include_once($classpath.\"/PHPCrawlerHTTPRequest.class.php\");\n $this->PageRequest = new PHPCrawlerHTTPRequest();\n $this->PageRequest->setHeaderCheckCallbackFunction($this, \"handleHeaderInfo\");\n \n // Cookie-Cache-class\n if (!class_exists(\"PHPCrawlerCookieCacheBase\")) include_once($classpath.\"/CookieCache/PHPCrawlerCookieCacheBase.class.php\");\n if (!class_exists(\"PHPCrawlerMemoryCookieCache\")) include_once($classpath.\"/CookieCache/PHPCrawlerMemoryCookieCache.class.php\");\n if (!class_exists(\"PHPCrawlerSQLiteCookieCache\")) include_once($classpath.\"/CookieCache/PHPCrawlerSQLiteCookieCache.class.php\");\n \n // URL-filter-class\n if (!class_exists(\"PHPCrawlerURLFilter\")) include_once($classpath.\"/PHPCrawlerURLFilter.class.php\");\n $this->UrlFilter = new PHPCrawlerURLFilter();\n \n // RobotsTxtParser-class\n if (!class_exists(\"PHPCrawlerRobotsTxtParser\")) include_once($classpath.\"/PHPCrawlerRobotsTxtParser.class.php\");\n $this->RobotsTxtParser = new PHPCrawlerRobotsTxtParser();\n \n // ProcessReport-class\n if (!class_exists(\"PHPCrawlerProcessReport\")) include_once($classpath.\"/PHPCrawlerProcessReport.class.php\");\n \n // UserSendDataCache-class\n if (!class_exists(\"PHPCrawlerUserSendDataCache\")) include_once($classpath.\"/PHPCrawlerUserSendDataCache.class.php\");\n $this->UserSendDataCache = new PHPCrawlerUserSendDataCache();\n \n // URLDescriptor-class\n if (!class_exists(\"PHPCrawlerURLDescriptor\")) include_once($classpath.\"/PHPCrawlerURLDescriptor.class.php\");\n \n // PageInfo-class\n if (!class_exists(\"PHPCrawlerDocumentInfo\")) include_once($classpath.\"/PHPCrawlerDocumentInfo.class.php\");\n \n // Benchmark-class\n if (!class_exists(\"PHPCrawlerBenchmark\")) include_once($classpath.\"/PHPCrawlerBenchmark.class.php\");\n \n // URLDescriptor-class\n if (!class_exists(\"PHPCrawlerUrlPartsDescriptor\")) include_once($classpath.\"/PHPCrawlerUrlPartsDescriptor.class.php\");\n \n // CrawlerStatus-class\n if (!class_exists(\"PHPCrawlerStatus\")) include_once($classpath.\"/PHPCrawlerStatus.class.php\");\n \n // AbortReasons-class\n if (!class_exists(\"PHPCrawlerAbortReasons\")) include_once($classpath.\"/Enums/PHPCrawlerAbortReasons.class.php\");\n \n // RequestErrors-class\n if (!class_exists(\"PHPCrawlerRequestErrors\")) include_once($classpath.\"/Enums/PHPCrawlerRequestErrors.class.php\");\n \n // PHPCrawlerUrlCacheTypes-class\n if (!class_exists(\"PHPCrawlerUrlCacheTypes\")) include_once($classpath.\"/Enums/PHPCrawlerUrlCacheTypes.class.php\");\n \n // PHPCrawlerMultiProcessModes-class\n if (!class_exists(\"PHPCrawlerMultiProcessModes\")) include_once($classpath.\"/Enums/PHPCrawlerMultiProcessModes.class.php\");\n \n // PHPCrawlerProcessHandler-class\n if (!class_exists(\"PHPCrawlerProcessHandler\")) include_once($classpath.\"/ProcessCommunication/PHPCrawlerProcessHandler.class.php\");\n \n // PHPCrawlerStatusHandler-class\n if (!class_exists(\"PHPCrawlerStatusHandler\")) include_once($classpath.\"/ProcessCommunication/PHPCrawlerStatusHandler.class.php\");\n \n // PHPCrawlerDocumentInfoQueue-class\n if (!class_exists(\"PHPCrawlerDocumentInfoQueue\")) include_once($classpath.\"/ProcessCommunication/PHPCrawlerDocumentInfoQueue.class.php\");\n \n // Set default temp-dir\n $this->working_base_directory = PHPCrawlerUtils::getSystemTempDir();\n }", "public function parse($url);", "public function __construct(){\n $this->crawler=new Crawler();\n }", "private function _initSpider()\n {\n $result = \"<p>Searching: <b>\" . $this->keyword . \"</b> and Looking for: <b>\" . $this->website . \"</b></p>\";\n //echo str_repeat(\" \", 256);\n $i = 10;\n $c = 1;\n while ($c <= 10) {\n $result .= \"<ul><li><b>Searching in Page: $c</b></li>\";\n //flush();ob_flush();\n $records = $this->_getRecordsAsArray($this->url);\n $count = count($records);\n $result .= \"<ul>\";\n for ($k = 0; $k < $count; $k++) {\n $j = $k + 1;\n $link = $records[$k][2];\n $link = strip_tags($link);\n $link = str_replace(\"http://www.\", \"\", $link);\n $link = str_replace(\"http://\", \"\", $link);\n $link = str_replace(\"www.\", \"\", $link);\n $pos = strpos($link, \"/\");\n $link = trim(substr($link, 0, $pos));\n\n if ($this->website == $link) {\n $domain = $this->website;\n $result .= \"<li><h1>Result was found in Page: $c and Record: $j</h1></li>\";\n $result .= \"<div>Congrats, We searched google's top 10 page for <b>\\\"\" . $this->keyword . \"</b>\\\", we found your domain <b>\\\"$domain\\\"</b> listed on page: $c at $j place </div>\";\n $result .= \"</ul></ul>\";\n\n return $result;\n } else {\n $result .= \"<li>Result not found on Page: $c and Record: $j</li>\";\n }\n }\n $result .= \"</ul></ul>\";\n $c++;\n $this->_updateUrl($this->keyword, $i);\n }\n $result .= \"Crawled through all 10 page.\";\n\n if ($this->page == false) {\n $domain = $this->website;\n $keyword = $this->keyword;\n $result .= \"<div>Sorry, We searched google's top 10 page for <b>\\\"$keyword\\\"</b>, but was unable to find your domain <b>\\\"$domain\\\"</b> listed anywhere. </div>\";\n } else {\n $page = $this->page;\n $records = $this->records;\n $domain = $this->website;\n $keyword = $this->keyword;\n $result .= \"<div>Congrats, We searched google's top 10 page for <b>\\\"$keyword\\\"</b>, we found your domain <b>\\\"$domain\\\"</b> listed on page: $page at $record place </div>\";\n }\n\n return $result;\n }", "public function __construct($cities, $searchString, $link)\n {\n $searchString = preg_replace('/\\s+/', '+', $searchString);\n if (strlen($searchString) != 0) {\n // Create get requests for each URL\n $mh = curl_multi_init();\n //$searchString = preg_replace('/\\s+/', '+', $searchString);\n foreach ($cities as $i => $url) {\n if (empty($link)) {\n $ch[$i] = curl_init(\"https://$url.craigslist.org/search/cta?query=$searchString&sort=rel&format=rss&postedToday=1\");\n } else {\n $ch[$i] = curl_init(\"https://$url.craigslist.org/search/cta?query=$searchString&sort=rel&format=rss&postedToday=1&$link\");\n }\n\n curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch[$i], CURLOPT_HEADER, 0);\n\n curl_multi_add_handle($mh, $ch[$i]);\n }\n\n // Start performing the request\n do {\n $execReturnValue = curl_multi_exec($mh, $runningHandles);\n } while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\n\n // Loop and continue processing the request\n while ($runningHandles && $execReturnValue == CURLM_OK) {\n // !!!!! changed this if and the next do-while !!!!!\n\n if (curl_multi_select($mh) != -1) {\n usleep(100);\n }\n\n do {\n $execReturnValue = curl_multi_exec($mh, $runningHandles);\n } while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);\n }\n\n // Check for any errors\n if ($execReturnValue != CURLM_OK) {\n trigger_error(\"Curl multi read error $execReturnValue\\n\", E_USER_WARNING);\n }\n\n // Extract the content\n foreach ($cities as $i => $url) {\n // Check for errors\n $curlError = curl_error($ch[$i]);\n\n if ($curlError == \"\") {\n $responseContent = curl_multi_getcontent($ch[$i]);\n //echo count($responseContent);\n $res[$i] = new SimpleXMLElement($responseContent, LIBXML_NOCDATA);\n\n } else {\n print \"Curl error on handle $i: $curlError\\n\";\n }\n // Remove and close the handle\n curl_multi_remove_handle($mh, $ch[$i]);\n curl_close($ch[$i]);\n }\n\n // Clean up the curl_multi handle\n curl_multi_close($mh);\n\n $data = array();\n\n foreach ($res as $key => $value) {\n\n $value = $value->item;\n foreach ($value as $k => $v) {\n $image_url = $v->xpath('enc:enclosure/@resource');\n $data[] = array(\n 'title' => $v->title,\n 'link' => $v->link,\n 'image' => $image_url,\n );\n }\n }\n\n $json_string = json_encode($data);\n $result_array = json_decode($json_string, true);\n\n printTable($result_array);\n }\n }", "private function prepareCrawler() {\n $findAndReplacesForFirstLoad = $this->getSetting(SettingKey::POST_FIND_REPLACE_FIRST_LOAD);\n\n // Make initial replacements\n $this->crawler = $this->makeInitialReplacements($this->crawler, $findAndReplacesForFirstLoad, true);\n\n // Apply HTML manipulations\n $this->applyFindAndReplaceInElementAttributes($this->crawler, SettingKey::POST_FIND_REPLACE_ELEMENT_ATTRIBUTES);\n $this->applyExchangeElementAttributeValues($this->crawler, SettingKey::POST_EXCHANGE_ELEMENT_ATTRIBUTES);\n $this->applyRemoveElementAttributes($this->crawler, SettingKey::POST_REMOVE_ELEMENT_ATTRIBUTES);\n $this->applyFindAndReplaceInElementHTML($this->crawler, SettingKey::POST_FIND_REPLACE_ELEMENT_HTML);\n\n // Resolve relative URLs\n $this->resolveRelativeUrls($this->crawler, $this->getPostUrl());\n return $this;\n }", "public static function crawl($url){\n\t\t\t// set current crawling url\n\t\t\tDatabase::db()->rows_update(CFG::get('DB_PRFX').'crawlers',(object)array('id'=>self::$instance,'current_url'=>$url,'current_time'=>time()),'id');\n\t\t\t// get base url and domain from crawl url\n\t\t\t$base_url=self::_url_get_base($url);\n\t\t\t$base_dom=self::_url_get_domain($url);\n\t\t\t// download html content\n\t\t\t$html=Connect::get($url);\n\t\t\txlog('crawler','download',$url,strlen($html));\n\t\t\t// load content into domdocument\n\t\t\tErrors::hide_errors();\n\t\t\t$dom=new DOMDocument();\n\t\t\t@$dom->loadHTML($html);\n\t\t\tErrors::show_errors();\n\t\t\t// find all links\n\t\t\t$xpath=new DOMXPath($dom);\n\t\t\t$hrefs=$xpath->evaluate(\"/html/body//a\");\n\t\t\tfor($i=0; $i<$hrefs->length; $i++){\n\t\t\t\t// get url from anchor and normalize it\n\t\t\t\t$href=self::_url_normalize($base_dom,$base_url,$hrefs->item($i)->getAttribute('href'));\n\t\t\t\t// if the protocol is supported, process link\n\t\t\t\tif(in_array(self::_url_get_proto($href),self::$protocols))\n\t\t\t\t\tif(self::add($href))\n\t\t\t\t\t\tself::link($base_dom,self::_url_get_domain($href));\n\t\t\t}\n\t\t}", "function follow_links($url){\n global $crawled;\n global $crawling;\n global $value;\n if(!in_array($url,$crawled)){\n if(!in_array($url,$crawling)){\n $crawled[] = $url;\n }\n }\n $doc = new DOMDocument();\n @$doc->loadHTML(@file_get_contents($url));\n $value = details($url);\n $linklist = $doc->getElementsByTagName(\"a\");\n foreach($linklist as $link){\n $l = $link->getAttribute(\"href\");\n if (!in_array($l, $crawled)) {\n if(!in_array($l,$crawling)){\n $crawling[] = $l;\n }\n }\n }\n $value = details($url);\n echo \"Title:\".$value[0].\"\\n\"; // print title\n echo \"Description:\".$value[1].\"\\n\"; // print Description\n echo \"keywords\".$value[2].\"\\n\"; // print keywords if any\n echo \"URL:\".$value[3].\"\\n\"; // print URL of crawled \n echo \"<hr/> \\n\"; // hr tag to remove cluttering\n }", "public function crawl() {\n\t\ttry {\n\t\t\t/** @var array $storesInfo */\n\t\t\t$storesInfo = $this->getStoresInfo();\n\t\t\t$dfUrlCount = 0;\n\t\t\t$dfMaxUrlCount = 20;\n\t\t\tforeach ($storesInfo as $info) {\n\t\t\t\t$options\t= array(CURLOPT_USERAGENT => self::USER_AGENT);\n\t\t\t\t$storeId\t= $info['store_id'];\n\t\t\t\tif (!Mage::app()->getStore($storeId)->getConfig(self::XML_PATH_CRAWLER_ENABLED)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$threads = (int)Mage::app()->getStore($storeId)->getConfig(self::XML_PATH_CRAWLER_THREADS);\n\t\t\t\tif (!$threads) {\n\t\t\t\t\t$threads = 1;\n\t\t\t\t}\n\t\t\t\t$stmt = $this->getResource()->getUrlStmt($storeId);\n\t\t\t\t$baseUrl = $info['base_url'];\n\t\t\t\tif (!empty($info['cookie'])) {\n\t\t\t\t\t$options[CURLOPT_COOKIE] = $info['cookie'];\n\t\t\t\t}\n\t\t\t\t$urls = array();\n\t\t\t\t$urlsCount = 0;\n\t\t\t\t$totalCount = 0;\n\t\t\t\t$this->request(array($baseUrl), $options);\n\t\t\t\twhile (true) {\n\t\t\t\t\t$row = $stmt->fetch();\n\t\t\t\t\tif (!$row) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$urls[]= df_concat($baseUrl, $this->encodeUrlPath($row['request_path']));\n\t\t\t\t\t$urlsCount++;\n\t\t\t\t\t$totalCount++;\n\t\t\t\t\tif ($urlsCount==$threads) {\n\t\t\t\t\t\t$this->request($urls, $options);\n\t\t\t\t\t\t$dfUrlCount += count($urls);\n\t\t\t\t\t\tif ($dfUrlCount > $dfMaxUrlCount) {\n\t\t\t\t\t\t\t//break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$urlsCount = 0;\n\t\t\t\t\t\t$urls = array();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!empty($urls)) {\n\t\t\t\t\t$this->request($urls, $options);\n\t\t\t\t\t$dfUrlCount += count($urls);\n\t\t\t\t\tif ($dfUrlCount > $dfMaxUrlCount) {\n\t\t\t\t\t\t//break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcatch(Exception $e) {\n\t\t\tdf_handle_entry_point_exception($e);\n\t\t}\n\t\treturn $this;\n\t}", "public function crawl()\n {\n $response = Client::request($this->link);\n\n $callback = function (DomCrawler $node)\n {\n $url = 'https://news.abs-cbn.com';\n\n return $url . $node->attr('href');\n };\n\n $crawler = new DomCrawler((string) $response);\n\n $news = $crawler->filter('#latest-news li > p > a');\n\n $news = $this->verify($news->each($callback));\n\n return array_reverse(array_filter((array) $news));\n }", "private function spider($url, $maxDepth)\n {\n try {\n\n $this->links[$url] = [\n 'status_code' => 0,\n 'url' => $url,\n 'visited' => false,\n 'is_external' => false,\n ];\n\n // Create a client and send out a request to a url\n $client = new Client();\n $crawler = $client->request('GET', $url);\n\n // get the content of the request result\n $html = $crawler->getBody()->getContents();\n // lets also get the status code\n $statusCode = $crawler->getStatusCode();\n\n // Set the status code\n $this->links[$url]['status_code'] = $statusCode;\n if ($statusCode == 200) {\n\n // Make sure the page is html\n $contentType = $crawler->getHeader('Content-Type');\n if (strpos($contentType[0], 'text/html') !== false) {\n\n // collect the links within the page\n $pageLinks = [];\n if (@$this->links[$url]['is_external'] == false) {\n $pageLinks = $this->extractLinks($html, $url);\n $emails = $this->extractEmails($html);\n foreach ($emails as $email) {\n if (! isset($this->emailAddresses[$email])) {\n $this->emailAddresses[$email]['page'] = $url;\n }\n }\n }\n\n // mark current url as visited\n $this->links[$url]['visited'] = true;\n // spawn spiders for the child links, marking the depth as decreasing, or send out the soldiers\n $this->spawn($pageLinks, $maxDepth - 1);\n }\n }\n } catch (\\Exception $ex) {\n $this->links[$url]['status_code'] = '404';\n }\n }", "public function parseContent($url, $itemContent = null)\n {\n // we use default parser\n $customParser = new Parser\\DefaultParser($url, $itemContent);\n\n // or try to find a custom one\n if (null !== $this->feed) {\n // I don't know why I have to use the *full* path to test if the class exists\n // even if the current classe \"use\" j0k3r\\FeedBundle\\Parser ...\n $name = Inflector::classify(str_replace('.', '-', $this->feed->getHost()));\n $customMethod = 'j0k3r\\FeedBundle\\Parser\\\\'.$name.'Parser';\n\n if (class_exists($customMethod)) {\n $customParser = new $customMethod($url, $itemContent);\n }\n }\n\n // retrieve custom url ?\n $this->url = $customParser->retrieveUrl();\n\n $parserMethod = 'use'.Inflector::camelize($this->choosenParser).'Parser';\n\n if (is_callable(array($this, $parserMethod))) {\n $this->content = $this->$parserMethod($this->url);\n }\n\n // if we allow all parser to be tested to get content, loop through all of them\n if (false === $this->content && true === $this->allowAllParser) {\n foreach ($this->availableParsers as $method) {\n // don't try the previous parser, which fails\n if (Inflector::camelize($this->choosenParser) == $method) {\n continue;\n }\n\n $parserMethod = 'use'.Inflector::camelize($method).'Parser';\n $this->content = $this->$parserMethod($this->url);\n\n // once one parser succeed, we stop\n if (false !== $this->content) {\n break;\n }\n }\n }\n\n // do something when readabled content failed\n if (!$this->content) {\n $this->content = $itemContent;\n $this->useDefault = true;\n } else {\n // update readable content with something ?\n $this->content = $customParser->updateContent($this->content);\n }\n\n return $this;\n }", "public function crawlUrls()\n {\n if (! $this->countActive()) {\n $this->execute();\n }\n }", "function follow_links($url) {\n\n global $already_crawled; // access to crawl list.\n global $crawling; // access to crawl list.\n $context = stream_context_create(array('http'=>array('method'=>\"GET\", 'headers'=>\"User-Agent: kekBot/0.2\\n\"))); //give Useragent Context\n\n $doc = new DOMDocument(); // new Dom Object\n\n @$doc->loadHTML(@file_get_contents($url, false, $context)); // Download the page\n\n $linklist = $doc->getElementsByTagName(\"a\"); // Array for all elements with an a tag.\n\n foreach ($linklist as $link) { // Loop through collected links.\n $l = $link->getAttribute(\"href\");\n // Process all kinds of link implementation.\n if (substr($l, 0, 1) == \"/\" && substr($l, 0, 2) != \"//\") {\n $l = parse_url($url)[\"scheme\"].\"://\".parse_url($url)[\"host\"].$l;\n } else if (substr($l, 0, 2) == \"//\") {\n $l = parse_url($url)[\"scheme\"].\":\".$l;\n } else if (substr($l, 0, 2) == \"./\") {\n $l = parse_url($url)[\"scheme\"].\"://\".parse_url($url)[\"host\"].dirname(parse_url($url)[\"path\"]).substr($l, 1);\n } else if (substr($l, 0, 1) == \"#\") {\n $l = parse_url($url)[\"scheme\"].\"://\".parse_url($url)[\"host\"].parse_url($url)[\"path\"].$l;\n } else if (substr($l, 0, 3) == \"../\") {\n $l = parse_url($url)[\"scheme\"].\"://\".parse_url($url)[\"host\"].\"/\".$l;\n } else if (substr($l, 0, 11) == \"javascript:\") {\n continue;\n } else if (substr($l, 0, 5) != \"https\" && substr($l, 0, 4) != \"http\") {\n $l = parse_url($url)[\"scheme\"].\"://\".parse_url($url)[\"host\"].\"/\".$l;\n }\n\n if (!in_array($l, $already_crawled)) { // Checks if the link is already crawled.\n $already_crawled[] = $l;\n $crawling[] = $l;\n echo get_details($l).\"\\n\"; // Output for title, descriptions, keywords, url.\n }\n\n }\n array_shift($crawling); // Arrayshift to remove crawled page.\n foreach ($crawling as $site) {\n follow_links($site);\n }\n\n}", "protected function parse(Crawler $crawler)\n {\n $crawler->filter('hx')->each(function (Crawler $crawler) {\n echo 'RANK:: ' . $crawler->text() . PHP_EOL;\n });\n }", "public function parsenodes($parse_url);", "static function Workopolis($html)\r\n{\r\n $handle = fopen(\"jobs.html\", \"a\"); //open output file in append mode\r\n fwrite($handle, '<!DOCTYPE html><html><head>');\r\n fwrite($handle, '<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />');\r\n fwrite($handle, '</head><body>');\r\n \r\n \r\n $crawler = new Crawler($html);\r\n \r\n //capter toutes les balises a qui contiennent un lien vers une page d'offre d'emploi\r\n $crawler = $crawler->filter('tr > td > a');\r\n dump($crawler);\r\n\r\n //looper au travers de toutes les offres dans le courriel\r\n foreach ($crawler as $domElement) \r\n {\r\n //aller chercher URL de la page de l'offre d'emploi\r\n $href = $domElement->getAttribute('href'); \r\n dump($href);\r\n \r\n //ouvrir flux de lecture sur la page de l'offre d'emploi\r\n $handlejobadd = fopen($href, \"r\");\r\n \r\n //jobdesc contient tout le contenu de l'offre\r\n $jobdesc = '';\r\n \r\n //lire le contenu de la page de l'offre et\r\n //placer le contenu dans $jobdesc\r\n while (!feof($handlejobadd)) \r\n {\r\n //ajouter a la variable output le contenu de la page d'offre \r\n $jobdesc .= fread($handlejobadd, 8192); \r\n } \r\n \r\n //creer nouveau crawler pour le titre de l'offre\r\n $crawler_jobtitle = new Crawler($html);\r\n $crawler_jobtitle = $crawler_jobtitle->filter('h1');\r\n \r\n foreach ($crawler_jobtitle as $domElement) \r\n {\r\n $jobtitle = trim($domElement->nodeValue);\r\n }\r\n \r\n fwrite($handle, '<h1>' . $jobtitle . '</h1>');\r\n fwrite($handle, $jobdesc);\r\n fwrite($handle, '<br><br>');\r\n \r\n }\r\n \r\n //fermer le flux sur cette page d'offre\r\n fclose($handle);\r\n// fwrite($handle, '</body></html>');\r\n \r\n \r\n}", "function FindParsedResultsBySiteUrl($siteUrl)\n\t{\n\t}", "public function parse()\n {\n if ($this->isParsed()) {\n return;\n }\n\n $this->parsed = true;\n\n // skip parsing for empty useragents or those not containing any letter\n if (empty($this->userAgent) || !preg_match('/([a-z])/i', $this->userAgent)) {\n return;\n }\n\n $this->parseBot();\n if ($this->isBot()) {\n return;\n }\n\n }", "public function parse($callbacks, LocatorInterface $locator);", "public function collectUrls($url) {\n\t\t\t$this->setCurrentCrawlUrl($url);\n\t\t\t$urlToGetData = \"\";\n\t\t\t$newCrawlUrl = $url;\n\t\t\tif (count(self::$crawlXpath) != 0 && self::$dataXpath != \"\") {\n\t\t\t\tforeach(self::$crawlXpath as $xPathExpression) {\n\t\t\t\t\t$page = $this->getPageHtml($newCrawlUrl);\n\t\t\t\t\t$xpath = new DOMXPath($page);\n\t\t\t\t\t$newCrawlUrl = $xpath->query($xPathExpression);\n\t\t\t\t\t// TODO: save this new url to a database\n\t\t\t\t\t$this->addCrawlUrlToDB($newCrawlUrl); // Must impliment this method\n\t\t\t\t\t// After the loop is done, the url that we need to evaulate the\n\t\t\t\t\t// data xPath expression will be set to $urlToGetData.\n\t\t\t\t\t$urlToGetData = $newCrawlUrl;\n\t\t\t\t}\n\t\t\t\t$this->addDataUrlToDB($urlToGetData); // Must impliment this method\n\t\t\t} else if (self::$dataXpath != \"\") {\n\t\t\t\t$this->setCurrentCrawlUrl($url);\n\t\t\t\t$page = $this->getPageHtml($url);\n\t\t\t\t$xpath = new DOMXPath($page);\n\t\t\t\t$newDataUrl = $xpath->query($dataXpath);\n\t\t\t\techo($newDataUrl);\n\t\t\t\t$this->addDataUrlToDB($newDataUrl);\n\t\t\t} else {\n\t\t\t\techo \"Data xPath not provided. Returning.\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public function action_parse() {\n $command = isset($_GET['command']) ? trim($_GET['command']) : null;\n $defaultCommand = isset($_GET['default']) ? trim($_GET['default']) : null;\n if (strlen($command) == 0) {\n $this->redirectTo('/');\n }\n // According to the access log, Yahoo Pipes seems to be bringing the site down. [Jon Aquino 2009-07-03]\n if (strpos($_SERVER['HTTP_USER_AGENT'], 'Yahoo Pipes') > -1) {\n header('HTTP/1.0 403 Forbidden');\n echo 'YubNub is currently blocking Yahoo Pipes. Contact jonathan.aquino@gmail.com for more info.';\n exit;\n }\n $parser = new Parser();\n $this->redirectTo($parser->parse($command, $defaultCommand));\n }", "public function getCrawler() {\n return $this->crawler;\n }" ]
[ "0.7506488", "0.59899825", "0.58805054", "0.5851559", "0.58234507", "0.57359225", "0.5571056", "0.55332565", "0.5532693", "0.55285776", "0.5525626", "0.5524539", "0.5523075", "0.54967326", "0.549531", "0.54208875", "0.53957707", "0.5372889", "0.53635734", "0.53512704", "0.5309953", "0.52560055", "0.52531654", "0.52220654", "0.5202683", "0.51574373", "0.51345897", "0.511777", "0.50902194", "0.5088348" ]
0.6304405
1
Adds specified parser to available parsers array.
public function addParser(IParser $parser): void { $parser->setParams($this->params); $this->parsers[] = $parser; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addParser(ParserInterface $parser)\n {\n $this->parsers[] = $parser;\n }", "public function addParser(AbstractParser $parser) {\n\t\t$this->parsers[$parser->getType()] = $parser;\n\t\treturn $this;\n\t}", "public function registerParser(ParserInterface $parser)\n {\n $this->parsers[$parser->getName()] = $parser;\n }", "public function getAvailableParsers()\n {\n if ($this->parsers !== null) {\n $parsers = $this->parsers;\n } else {\n $parserNames = $this->getParserNames();\n\n foreach ($parserNames as $parserClass) {\n $parserClass = __NAMESPACE__ . '\\\\' . $parserClass;\n\n $parserInstance = $this->getParserInstance($parserClass);\n\n if (!$parserInstance instanceof ParserInterface) {\n throw new InvalidParserException(\n 'Invalid parser loaded, verify that all parsers implement ParserInterface'\n );\n }\n\n $this->parsers[] = $parserInstance;\n }\n\n $parsers = $this->parsers;\n }\n\n return $parsers;\n }", "public function setParser($parser)\n {\n $this->parser = $parser;\n }", "protected function addParserHandler()\n {\n $active = $this->theme->getThemePath();\n $handler = $active.'handler'.DS.'register.php';\n\n if (Dir::is($active.'handler') and file_exists($handler)) {\n require $handler;\n }\n\n // Add Habdler Object From Reborn\n $files = Dir::get(__DIR__.DS.'Handler'.DS.'*.php');\n $namespace = '\\Reborn\\MVC\\View\\Handler\\\\';\n foreach ($files as $file) {\n $name = pathinfo($file, PATHINFO_FILENAME);\n $obj = $namespace.$name;\n $ins = new $obj($this->parser);\n $key = $ins->getKey();\n $this->parser->addHandler($key, $namespace.$name);\n }\n }", "public function setParsers(array $parsers)\n {\n foreach ($parsers as $contentType => $parser) {\n $this->addParser($contentType, $parser);\n }\n\n return $this;\n }", "public function getParsers()\n {\n return $this->parsers;\n }", "static function get_parsers( $format, $container_type ) {\n\t\t$found = array();\n\n\t\t//Retrieve a list of active parsers\n\t\t$manager = blcModuleManager::getInstance();\n\t\t$active_parsers = $manager->get_modules_by_category( 'parser' );\n\n\t\t//Try each one\n\t\tforeach ( $active_parsers as $module_id => $module_data ) {\n\t\t\t$parser = $manager->get_module( $module_id ); //Will autoload if necessary\n\t\t\tif ( ! $parser ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( in_array( $format, $parser->supported_formats ) || in_array( $container_type, $parser->supported_containers ) ) {\n\t\t\t\tarray_push( $found, $parser );\n\t\t\t}\n\t\t}\n\n\t\treturn $found;\n\t}", "public function setParser(ParserInterface $parser)\n {\n $this->parser = $parser;\n }", "public static function initParser($parser)\n {\n $parser->setHook('tab', array(self::instance(), 'hookTab'));\n return true;\n }", "public function provides()\n {\n return ['Parser'];\n }", "protected function registerVersionParser()\n {\n $this->app->singleton(VersionParserManager::class, function ($app) {\n return new VersionParserManager($app);\n });\n\n $this->app->singleton(VersionParser::class, function ($app) {\n return $app->make(VersionParserManager::class)->driver();\n });\n }", "public function hasParsers()\n {\n if (!empty($this->parsers)) {\n return true;\n }\n\n return false;\n }", "public function register(GitHubBookParser $bookParser);", "public function hasParser($name)\n {\n if (array_key_exists($name, $this->parsers)) {\n return true;\n }\n\n return false;\n }", "public function setParser(ParserInterface $parser)\n {\n $this->parser = $parser;\n\n return $this;\n }", "public function addCompiler(string $compiler, callable $parser): static\n {\n $this->_actions[$compiler] = array(\n 'type' => self::INLINE_COMPILER,\n 'parser' => $parser\n );\n return $this;\n }", "public function __construct()\n {\n $this->parsers = $this->getAvailableParsers();\n }", "function findParser($articlePath) {\n\t\tforeach ($this->parsers as $name => $parser) {\n\t\t\tif ($parser->handles($articlePath)) {\n\t\t\t\treturn $parser;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "function setHandlers($a_xml_parser)\n\t{\n\t\techo 'ilSaxParser::setHandlers() must be overwritten';\n\t}", "public function setParser(DataParser $parser) {\n $this->parser = $parser;\n }", "public function push(ResolverInterface $resolver)\n\t{\n\t\tarray_push($this->resolvers, $resolver);\n\t}", "public function getParser(): ParserInterface;", "protected function loadParserConfig(array $config, ContainerBuilder $container)\n {\n foreach ($config as $parserName => $parserConfig) {\n $parserConfigClass = $container->getParameter('kuborgh_csv.configuration.parser.class');\n $parserConfigDef = $this->loadCommonConfig($parserConfig, $parserConfigClass);\n\n // Set implementation\n $implementation = $parserConfig['implementation'];\n $parserClass = $container->getParameter('kuborgh_csv.parser.'.$implementation.'.class');\n $serviceDef = new Definition($parserClass, [$parserConfigDef]);\n\n // Build Service\n $serviceName = 'kuborgh_csv.parser.'.$parserName;\n $container->setDefinition($serviceName, $serviceDef);\n }\n }", "static function setupParserFunctions ( &$parser ) {\n\t\n\t\t// setup #synopsize parser function\n\t\t$parser->setFunctionHook(\n\t\t\t'synopsize', \n\t\t\tarray(\n\t\t\t\t'MeetingMinutes\\Setup',\n\t\t\t\t'renderSynopsizeParserFunction' \n\t\t\t),\n\t\t\tSFH_OBJECT_ARGS\n\t\t);\n\t\t\n\t\t// setup #meetingminutestemplate parser function (just adds module to\n\t\t// meeting minutes and meeting template)\n\t\t$parser->setFunctionHook(\n\t\t\t'meetingminutestemplate', \n\t\t\tarray(\n\t\t\t\t'MeetingMinutes\\Setup',\n\t\t\t\t'renderMeetingMinutesTemplateParserFunction' \n\t\t\t),\n\t\t\tSFH_OBJECT_ARGS\n\t\t);\n\n\t\t// setup #meetingminutesform parser function (just adds module to\n\t\t// meeting minutes form)\n\t\t$parser->setFunctionHook(\n\t\t\t'meetingminutesform', \n\t\t\tarray(\n\t\t\t\t'MeetingMinutes\\Setup',\n\t\t\t\t'renderMeetingMinutesFormParserFunction' \n\t\t\t),\n\t\t\tSFH_OBJECT_ARGS\n\t\t);\n\t\t\n\t\treturn true;\n\n\t}", "public function addProvider($provider)\n {\n if (!is_array($provider)) {\n $provider = [$provider];\n }\n foreach ($provider as $p) {\n $this->providers[] = $p;\n foreach ($this->generators as $generator) {\n $generator->addProvider($p);\n }\n }\n }", "protected function getMarkdown_Parser_ParserManagerService()\n {\n $this->privates['markdown.parser.parser_manager'] = $instance = new \\Knp\\Bundle\\MarkdownBundle\\Parser\\ParserManager();\n\n $instance->addParser(new \\Knp\\Bundle\\MarkdownBundle\\Parser\\Preset\\Min(), 'min');\n $instance->addParser(new \\Knp\\Bundle\\MarkdownBundle\\Parser\\Preset\\Light(), 'light');\n $instance->addParser(new \\Knp\\Bundle\\MarkdownBundle\\Parser\\Preset\\Medium(), 'medium');\n $instance->addParser(($this->services['markdown.parser'] ?? $this->services['markdown.parser'] = new \\Knp\\Bundle\\MarkdownBundle\\Parser\\Preset\\Max()), 'default');\n $instance->addParser(new \\Knp\\Bundle\\MarkdownBundle\\Parser\\Preset\\Flavored(), 'flavored');\n\n return $instance;\n }", "public function addDriver(Driver $driver)\n {\n $this->drivers[] = $driver;\n }", "public function addValidators(array $validators)\n {\n return $this->seeker->addValidators($validators);\n }" ]
[ "0.7650991", "0.66852146", "0.6421304", "0.6208653", "0.591666", "0.57319665", "0.5600127", "0.5505011", "0.5378241", "0.5328386", "0.5222153", "0.5217923", "0.51654357", "0.5164897", "0.50486577", "0.4998307", "0.49577615", "0.49201748", "0.4878488", "0.48138732", "0.479532", "0.47871986", "0.4769939", "0.4749322", "0.47205195", "0.47160682", "0.46834823", "0.46730438", "0.4669774", "0.4666968" ]
0.77268356
0
Parses current template and inits template objects
public function parseTemplate() { // --- Parsing Template Until Ends --- // $currPosition = 0; while ($currPosition = $this->getNextElement($currPosition, $matches)); if (is_array($matches) && isset($matches[3])) { foreach ($matches[3] as $key => $match) { $blockName = $matches[2][$key]; $this->_matches[$blockName] = $match; $this->{$blockName} = new PHP2_UI_RBTEngine($blockName, $this); $this->{$blockName}->loadFromTemplate($match, true); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parseTemplate()\n {\n $content = $this->fileLookup(file_get_contents($this->file));\n \n $this->recursiveParse($content, null, -1);\n $this->initializeVars($content);\n \n //reset the parent to the root node\n $this->parent = substr($this->parent, 0, strpos($this->parent, '.'));\n }", "public function parse()\n\t{\n\n\t\t$this->parsedTags = array();\n\n\t\t// if request contains the template ID (may be set in previous suction)...\n\t\tif (empty($this->renderMode))\n\t\t\t$this->renderMode = 'full';\n\n\n\t\tif ($this->renderMode == 'raw') {\n\n\t\t\t// replace all POSITIONs to DIVs\n\t\t\t$this->parsedTags[\"templateTags\"] = array(\n\t\t\t\t'regexp' => '#<position type=\"([^\"]+)\" name=\"([^\"]+)\" .* \\/>#iU',\n\t\t\t\t'matches' => array(\n\t\t\t\t\t'type' => '',\n\t\t\t\t\t'name' => '',\n\t\t\t\t\t'attribs' => array('renderMode' => 'schematic',\n\t\t\t\t\t\t'showNames' => !empty($this->showNames)\n\t\t\t\t))\n\t\t\t);\n\n\n\t\t\t// replace all IMAGEs to DIVs only tag. no need to replace the params\n\t\t\t$this->parsedTags[\"images\"] = array(\n\t\t\t\t'regexp' => '#<(img)([^>]+)\\/>#iU',\n\t\t\t\t'matches' => array(\n\t\t\t\t\t'type' => '',\n\t\t\t\t\t'name' => '',\n\t\t\t\t\t'attribs' => array())\n\t\t\t);\n\n\t\t\t// Do not parse any placeholder...\n\t\t}\n\n\n\t\tif ($this->renderMode == 'schematic') {\n\n\t\t\t// replace all POSITIONs to DIVs with schematic mode\n\t\t\t$this->parsedTags[\"templateTags\"] = array(\n\t\t\t\t'regexp' => '#<position type=\"([^\"]+)\" name=\"([^\"]+)\" .* \\/>#iU',\n\t\t\t\t'matches' => array(\n\t\t\t\t\t'type' => '',\n\t\t\t\t\t'name' => '',\n\t\t\t\t\t'attribs' => array(\n\t\t\t\t\t\t'renderMode' => 'schematic',\n\t\t\t\t\t\t'showNames' => !empty($this->showNames)\n\t\t\t\t))\n\t\t\t);\n\n\t\t\t// Parse the placeholders...\n\t\t\t$this->parsedTags[\"placeholders\"] = array(\n\t\t\t\t'regexp' => '#\\[([\\w\\s\\.]+)\\]#iU',\n\t\t\t\t'matches' => array(\n\t\t\t\t\t'name' => '',\n\t\t\t\t\t'type' => 'placeholder',\n\t\t\t\t\t'attribs' => array()\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Don't parse any IMG\n\t\t}\n\n\n\t\t// The default behavior. Full parsing...\n\t\tif ($this->renderMode == 'full') {\n\n\t\t\t// replace all POSITIONs to DIVs with default mode\n\t\t\t$this->parsedTags[\"templateTags\"] = array(\n\t\t\t\t'regexp' => '#<position type=\"([^\"]+)\" name=\"([^\"]+)\" .* \\/>#iU',\n\t\t\t\t'matches' => array(\n\t\t\t\t\t'type' => '',\n\t\t\t\t\t'name' => '',\n\t\t\t\t\t'attribs' => array()\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Parse the placeholders...\n\t\t\t$this->parsedTags[\"placeholders\"] = array(\n\t\t\t\t'regexp' => '#\\[([\\w\\s\\.]+)\\]#iU',\n\t\t\t\t'matches' => array(\n\t\t\t\t\t'name' => '',\n\t\t\t\t\t'type' => 'placeholder',\n\t\t\t\t\t'attribs' => array()\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Don't parse any IMG\n\t\t}\n\n\n\t\t$this->_parseTemplate();\n\t\treturn $this->_template->getProperties();\n\t}", "protected function parse()\n {\n // Add trace for debugging\n \\Debug::trace('Parsing template', __FILE__, __LINE__);\n \n // Shorten up the text here\n $l_delim = $this->config['l_delim'];\n $r_delim = $this->config['r_delim'];\n\n // Use the Parser\n $this->parser->set_delimiters($l_delim, $r_delim);\n $this->source = $this->parser->parse($this->source, $this->variables);\n \n // we are done\n return;\n }", "public function init() {\n\t\t\t$this->template();\n\t\t\t$this->template_types();\n\t\t}", "protected function initTemplate()\n {\n $this->template = new PhpTemplate( $this, __DIR__ . '/../fixtures/WorldTemplate.php', null );\n }", "public function parseTemplate() { \n if(!isset($this->parsed_template)) {\n ob_start();\n \n include($this->template_file_path);\n \n $this->parsed_template = ob_get_clean();\n }\n \n return $this->parsed_template;\n }", "private function parseTemplate(string $template)\n {\n $loop = 0;\n $partials = array();\n\n if (!file_exists(DIR_TMPL . \"/$template.phtml\")) {\n echo \"Template $template not found.\";\n exit();\n }\n\n ob_start();\n include(DIR_TMPL . \"/$template.phtml\");\n $content = ob_get_contents();\n ob_end_clean();\n\n // PARTIAL keyword\n $keywords = $this->getKeywords($content, 'PARTIAL');\n while ($keywords && $loop < 5) {\n foreach ($keywords as $keyword) {\n $partial = $keyword ['value'];\n $partialContent = '';\n if (isset($partials [$partial])) {\n $partialContent = $partials [$partial];\n } else {\n $partialContent = $this->partial($partial);\n $partials [$partial] = $partialContent;\n }\n // finally string replace\n $content = str_replace($keyword ['string'], $partialContent, $content);\n }\n\n $loop ++;\n $keywords = $this->getKeywords($content, 'PARTIAL');\n }\n\n // DATE keyword\n $keywords = $this->getKeywords($content, 'DATE');\n if ($keywords) {\n foreach ($keywords as $keyword) {\n $parts = explode(' ', $keyword ['value']);\n $format = $parts [0];\n $date = time();\n if (count($parts) > 1) {\n $date = $parts [1];\n if (!intval($date)) {\n $date = $this->getData($date);\n } else {\n $date = intval($date);\n }\n if (!$date) {\n $date = time();\n }\n }\n $content = str_replace($keyword ['string'], date($format, $date), $content);\n }\n }\n\n // DATA keyword\n // Allows a page to set data values\n $keywords = $this->getKeywords($content, 'DATA');\n if ($keywords) {\n foreach ($keywords as $keyword) {\n // No content alteration, so just remove\n $content = str_replace($keyword ['string'], '', $content);\n // fetch config detail\n $values = explode('=', $keyword['value']);\n if (!is_array($values) || count($values) < 2) {\n break;\n }\n $this->setData($values[0], $values[1]);\n }\n }\n\n // ECHO keyword\n $keywords = $this->getKeywords($content, 'ECHO');\n if ($keywords) {\n foreach ($keywords as $keyword) {\n $value = $this->getData($keyword ['value']);\n if (!is_string($value)) {\n $value = '';\n }\n $content = str_replace($keyword ['string'], $value, $content);\n }\n }\n\n // CONFIG keyword\n // write out a config value\n $keywords = $this->getKeywords($content, 'CONFIG');\n if ($keywords) {\n foreach ($keywords as $keyword) {\n $content = str_replace($keyword['string'], $this->config->get($keyword ['value'], ''), $content);\n }\n }\n\n // META keyword\n // Reserved for Page title and other standard page items\n $keywords = $this->getKeywords($content, 'META');\n if ($keywords) {\n foreach ($keywords as $keyword) {\n $data = false;\n $args = explode(' ', $keyword['value']);\n $term = strtolower($args[0]);\n\n switch ($term) {\n\n // page title\n case 'title':\n $data = $this->config->get('site.title');\n $page_title = $this->getData('page.title');\n if ($page_title) {\n $data = \"$page_title | $data\";\n }\n break;\n\n // page description\n case 'description':\n $data = $this->config->get('site.description');\n $page_desc = $this->getData('page.description');\n if ($page_desc) {\n $data = $page_desc;\n }\n break;\n\n // page url\n case 'url':\n $data = $this->config->get('site.url') . '/';\n $page_url = $this->getData('page.url');\n if ($page_url) {\n $data = $page_url;\n }\n break;\n\n // Post links list\n case 'postlinks':\n $count = 10;\n if (count($args) > 1) {\n $count = intval($args[1]);\n }\n $posts = $this->posts->getList($count);\n foreach ($posts as $post) {\n $data .= '<li><a href=\"'.$post['url'].'\">'.$post['title'].'</a></li>'.\"\\n\";\n }\n break;\n\n // Links list\n case 'links':\n $links = $this->config->get('links');\n foreach ($links as $title => $link) {\n $data .= '<li><a href=\"' . $link . '\" target=\"_blank\">' . $title . '</a></li>'.\"\\n\";\n }\n break;\n\n }\n if (!$data || !is_string($data)) {\n $data = '';\n }\n\n $content = str_replace($keyword ['string'], $data, $content);\n }\n }\n \n // CONTENT keyword for base templates\n $content = str_replace('[CONTENT]', $this->getData('page.content'), $content);\n return $content;\n }", "function initTemplate()\r\n\t{\r\n\t\tob_start();\r\n\t\tinclude('templates/' . $this->mc->config['template'] . '/main.html');\r\n\t\t$this->template = ob_get_contents();\r\n\t\tob_clean();\r\n\t}", "public function initializeTemplate()\n\t{\n\t\t$this->template = $this->app->getServices('template');\n\t}", "function parse(){\n\t\tif (is_null($this->template)){\n\t\t\treturn \"ERROR\";\n\t\t}\n\t\t$this->loginout();\n\t\t$this->incfiles();\n\t\t$this->loginout();\n\t\t//$this->conditions();\n\t\t$this->loop();\n\t\t\n\t\t$this->tags($this->template);\n\t\t\n\t\t$this->template = $this->template->replace('{#', '{$');\n\t\treturn $this->template->toString();\n\t}", "protected function parse()\n {\n $this->regions = [];\n $this->params = [];\n $this->canBeginInstance = false;\n $this->regionNestLevel = 0;\n $this->activeRegion = null;\n $this->canLockRegion = false;\n\n $dwt = $this->getTemplateFile();\n $htmlParser = new HTMLMinify($dwt);\n $this->tokens = $htmlParser->getTokens();\n\n foreach ($this->tokens as $token) {\n $type = $token->getType();\n\n if ($type !== HTMLToken::Comment) {\n $this->handleTemplateContent($token);\n continue;\n }\n\n $comment = $token->getData();\n\n if ($this->canBeginInstance && $this->isInstnaceBegin($comment)) {\n $this->canBeginInstance = false;\n $this->canLockRegion = true;\n continue;\n } elseif ($paramMatch = $this->isParamDef($comment)) {\n $this->addParam(Param::fromArray([\n 'name' => $paramMatch[2],\n 'type' => $paramMatch[3],\n 'value' => $paramMatch[4]\n ]));\n continue;\n } elseif ($regionBegin = $this->isRegionBegin($comment)) {\n $this->handleRegionBegin($regionBegin);\n continue;\n } elseif ($this->isRegionEnd($comment)) {\n $this->handleRegionEnd();\n continue;\n }\n\n // it is a generic comment\n if ($this->activeRegion) {\n $this->activeRegion->setValue($this->activeRegion->getValue() . $comment);\n }\n }\n }", "function initTemplate()\r\n\t{\r\n\t\tinclude('templates/' . $this->mc->config['template'] . '/modules/filemanager/filemanager.html');\r\n\t\t$this->template = ob_get_contents();\r\n\t\tob_clean();\r\n\t}", "private function initSmarty() {\n $zibo = Zibo::getInstance();\n\n $this->parseConfiguration($zibo);\n $this->setResourceHandler();\n\n $request = $zibo->getRequest();\n if ($request === null) {\n return;\n }\n\n $this->set('_baseUrl', $request->getBaseUrl());\n $this->set('_basePath', $request->getBasePath());\n $this->set('_route', $request->getRoute());\n }", "public function initCurrentTemplate()\n {\n self::$templates[$this->getCurrentTemplate()] = array(\n 'source' => null,\n 'compilation' => null,\n );\n\n return $this;\n }", "private function parse()\n {\n $Config = $this->Config->getCurrent();\n\n $Template = AbstractTemplate::factory($Config['template'], $this->customTemplateNamespace);\n\n // If Template is null then we do not have a template for that, but we\n // can still proceed to the end with just the rawdata\n if ($Template instanceof AbstractTemplate) {\n $this->Result->template[$Config['server']] = $Config['template'];\n $this->rawdata = $Template->translateRawData($this->rawdata, $Config);\n try {\n $Template->parse($this->Result, $this->rawdata);\n } catch (RateLimitException $e) {\n $server = $Config['server'];\n if (!in_array($server, $this->rateLimitedServers)) {\n $this->rateLimitedServers[] = $server;\n }\n throw new RateLimitException(\"Rate limit exceeded for server: \". $server);\n }\n \n // set rawdata to Result - this happens here because sometimes we\n // have to fix the rawdata as well in postProcess\n $this->Result->addItem('rawdata', $this->rawdata);\n\n // set registered to Result\n $this->Result->addItem('registered', isset($this->Result->registered) ? $this->Result->registered : false);\n \n if (! isset($this->Result->whoisserver)) {\n $this->Result->addItem('whoisserver', $Config['server']);\n }\n \n // start post processing\n $Template->postProcess($this);\n \n // set name to Result\n if (isset($this->Query->tld) && ! isset($this->Query->fqdn)) {\n $this->Result->addItem('name', $this->Query->tld);\n } elseif (isset($this->Query->ip)) {\n $this->Result->addItem('name', $this->Query->ip);\n } elseif (isset($this->Query->asn)) {\n $this->Result->addItem('name', $this->Query->asn);\n } else {\n $this->Result->addItem('name', $this->Query->fqdn);\n $this->Result->addItem('idnName', $this->Query->idnFqdn);\n }\n } else {\n throw new NoTemplateException('Template '. $Config['template'] .' could not be found');\n }\n }", "public function process()\n\t{\n\t\tglobal $_EREGANSU_TEMPLATE;\n\t\t\n\t\t$__ot = !empty($_EREGANSU_TEMPLATE);\n\t\textract($this->vars, EXTR_REFS);\n\t\t$_EREGANSU_TEMPLATE = true;\n\t\trequire($this->path);\n\t\t$_EREGANSU_TEMPLATE = $__ot;\n\t}", "public function add_template_vars()\n {\n if( !$this->template_engine->assigned( 'pages' ) ) {\n $this->assign('pages', Posts::get( array( 'content_type' => 'page', 'status' => Post::status('published'), 'nolimit' => 1 ) ) );\n }\n if( !$this->template_engine->assigned( 'user' ) ) {\n $this->assign('user', User::identify() );\n }\n if( !$this->template_engine->assigned( 'tags' ) ) {\n $this->assign('tags', Tags::get() );\n }\n if( !$this->template_engine->assigned( 'page' ) ) {\n $this->assign('page', isset( $page ) ? $page : 1 );\n }\n if( !$this->template_engine->assigned( 'feed_alternate' ) ) {\n $matched_rule= URL::get_matched_rule();\n switch ( $matched_rule->name ) {\n case 'display_entry':\n case 'display_page':\n $feed_alternate= URL::get( 'atom_entry', array( 'slug' => Controller::get_var('slug') ) );\n break;\n case 'display_entries_by_tag':\n $feed_alternate= URL::get( 'atom_feed_tag', array( 'tag' => Controller::get_var('tag') ) );\n break;\n case 'display_home':\n default:\n $feed_alternate= URL::get( 'atom_feed', array( 'index' => '1' ) );\n }\n $this->assign('feed_alternate', $feed_alternate);\n }\n // Specify pages you want in your navigation here\n $this->assign('nav_pages', Posts::get( array( 'content_type' => 'page', 'status' => 'published', 'nolimit' => 1 ) ) );\n parent::add_template_vars();\n }", "public function __construct($template) {\n $this->smarty = new Smarty();\n $this->subviews = array();\n $this->template = $template;\n\n $this->initSmarty();\n }", "protected function _loadTemplateInformation()\n {\n // Load Template Name\n if ($this->_char === false) {\n // public default template\n $this->template['name'] = self::DEFAULT_PUBLIC_TEMPLATE;\n } elseif ($this->_char->template) {\n // private template\n $this->template['name'] = $this->_char->template;\n } else {\n // private template not set\n $this->template['name'] = self::DEFAULT_PRIVATE_TEMPLATE;\n }\n\n // Assign the complete Path to the Base-Template\n $this->template['file']\t= \"index_page.tpl\";\n\n // Set the correct Template-Paths inside the Template\n // For Paths that are sent to the Client (relative webbased paths)\n $this->template['mytemplatedir'] = SystemManager::getWebRessourcePath($this->template['name'], true);\n $this->set(\"mytemplatedir\", $this->template['mytemplatedir']);\n $this->template['commontemplatedir'] = SystemManager::getWebRessourcePath(\"common\");\n $this->set(\"commontemplatedir\", $this->template['commontemplatedir']);\n\n // Paths that are handled inside the templategeneration progress (full filepaths)\n $this->template['myfulltemplatedir'] = DIR_WEB . $this->template['name'];\n $this->set(\"myfulltemplatedir\", $this->template['myfulltemplatedir']);\n\n }", "public static function parse(): void\n {\n // get the template\n $tpl = FrontendModel::getContainer()->get('templating');\n\n // logged in\n if (FrontendProfilesAuthentication::isLoggedIn()) {\n // get profile\n $profile = FrontendProfilesAuthentication::getProfile();\n\n // display name set?\n if ($profile->getDisplayName() != '') {\n $tpl->assign('profileDisplayName', $profile->getDisplayName());\n } else {\n // no display name -> use email\n $tpl->assign('profileDisplayName', $profile->getEmail());\n }\n\n // show logged in\n $tpl->assign('isLoggedIn', true);\n }\n\n // ignore these urls in the query string\n $ignoreUrls = [\n FrontendNavigation::getUrlForBlock('Profiles', 'Login'),\n FrontendNavigation::getUrlForBlock('Profiles', 'Register'),\n FrontendNavigation::getUrlForBlock('Profiles', 'ForgotPassword'),\n ];\n\n // query string\n $queryString = FrontendModel::getRequest()->query->has('queryString')\n ? SITE_URL . '/' . urldecode(FrontendModel::getRequest()->query->get('queryString'))\n : SITE_URL . FrontendModel::get('url')->getQueryString();\n\n // check all ignore urls\n foreach ($ignoreUrls as $url) {\n // query string contains a boeboe url\n if (mb_stripos($queryString, $url) !== false) {\n $queryString = '';\n break;\n }\n }\n\n // no need to add this if its empty\n $queryString = ($queryString !== '') ? '?queryString=' . rawurlencode($queryString) : '';\n\n // useful urls\n $tpl->assign('loginUrl', FrontendNavigation::getUrlForBlock('Profiles', 'Login') . $queryString);\n $tpl->assign('registerUrl', FrontendNavigation::getUrlForBlock('Profiles', 'Register'));\n $tpl->assign('forgotPasswordUrl', FrontendNavigation::getUrlForBlock('Profiles', 'ForgotPassword'));\n }", "public function parse($templateData)\n {\n //make sure template files are enabled\n if (ee()->config->item('save_tmpl_files') !== 'y' && ee()->config->item('tmpl_file_basepath')) {\n return $templateData;\n }\n\n //parse embed variables\n if (@preg_match_all('/'. LD .'in:sert:(.*?)'. RD .'/s', $templateData, $matches)) {\n foreach ($matches[1] as $template) {\n $global = '';\n $args = [];\n $argMatches = [];\n\n // Only run preg_match if necessary\n if (strpos($template, ' ') !== false) {\n $argString = trim((preg_match(\"/\\s+.*/s\", $template, $argMatches))) ? $argMatches[0] : '';\n $args = ee()->functions->assign_parameters($argString);\n }\n\n // The tag can contain parameters, so save a reference for replacement later.\n $tag = $template;\n\n // Remove the args from the string to get the template name.\n if (!empty($argMatches)) {\n $template = str_replace($argMatches[0], '', $template);\n }\n\n if (!isset(ee()->config->_global_vars['in:sert:' . $tag])) {\n $pieces = explode('/', $template);\n $groupName = $pieces[0];\n $templateName = (isset($pieces[1])) ? $pieces[1] : 'index';\n\n // Determine if the site name was passed in\n $site = ee()->config->item('site_short_name');\n\n if (strpos($groupName,':') !== false) {\n $pieces = explode(':', $groupName);\n $site = $pieces[0];\n $groupName = $pieces[1];\n }\n\n // Determine the path\n $path = rtrim(ee()->config->item('tmpl_file_basepath'), '/') . '/';\n $path .= $site . '/' . $groupName . '.group/' . $templateName . '.html';\n\n // Get the template contents\n if (file_exists($path)) {\n $global = file_get_contents($path);\n\n // Check if there was an error getting the file contents.\n if ($global === false) {\n ee()->config->_global_vars['in:sert:' . $tag] = '';\n }\n } else {\n ee()->config->_global_vars['in:sert:' . $tag] = '';\n }\n\n // Strip comments and parse segment_x vars\n $global = preg_replace(\"/\\{!--.*?--\\}/s\", '', $global);\n\n // Swap config global vars\n // If there are no curly brackets, no need to parse...\n if (strpos($global, '{') !== false) {\n $global = ee()->TMPL->parse_variables_row($global, ee()->config->_global_vars);\n }\n\n //segment variables\n for ($i = 1; $i < 10; $i++) {\n $global = str_replace(LD . 'segment_' . $i . RD, ee()->uri->segment($i), $global);\n }\n\n // Embed variables\n if (!empty($args)) {\n foreach ($args as $argKey => $argVal) {\n $global = str_replace(LD.'embed:'.$argKey.RD, $argVal, $global);\n }\n }\n\n // Save the variable\n ee()->config->_global_vars['in:sert:' . $tag] = $global;\n }\n\n // Replace the string\n $templateData = str_replace(LD . 'in:sert:' . $tag . RD, $global, $templateData);\n }\n\n if (@preg_match('/' . LD . 'in:sert:(.*?)' . RD . '/', $templateData)) {\n $templateData = $this->parse($templateData);\n }\n }\n\n return $templateData;\n }", "public function template_post_parse($template, $sub, $site_id)\n { \n // play nice with other extensions on this hook\n if (isset($this->EE->extensions->last_call) && $this->EE->extensions->last_call)\n {\n $template = $this->EE->extensions->last_call;\n }\n\n // is this the final template?\n if ($sub == FALSE)\n { \n // check the cache for postponed tags\n if ( ! isset($this->EE->session->cache['stash']['__template_post_parse__']))\n {\n $this->EE->session->cache['stash']['__template_post_parse__'] = array();\n }\n\n // an array of tags needing to be post-parsed\n $cache = $this->EE->session->cache['stash']['__template_post_parse__'];\n\n // are we capturing the final output of the rendered EE host template?\n $save_output = FALSE;\n \n // run any postponed stash tags\n if ( ! empty($cache))\n { \n $context = '';\n \n if ( ! class_exists('Stash'))\n {\n include_once PATH_THIRD . 'stash/mod.stash.php';\n }\n else\n {\n // get static context if it has been set\n $context = Stash::$context;\n }\n\n // save TMPL values for later\n $tagparams = isset($this->EE->TMPL->tagparams) ? $this->EE->TMPL->tagparams : array();\n $tagdata = isset($this->EE->TMPL->tagdata) ? $this->EE->TMPL->tagdata : '';\n\n // reset tagparams so Stash is instantiated with default values\n $this->EE->TMPL->tagparams = array();\n\n // instantiate but don't initialise\n $s = new Stash(TRUE);\n\n // sort by priority\n $cache = $s->sort_by_key($cache, 'priority', 'sort_by_integer');\n\n // loop through, prep the Stash instance, call the postponed tag and replace output into the placeholder\n foreach($cache as $placeholder => $tag)\n { \n // make sure there is a placeholder in the template\n // it may have been removed by advanced conditional processing\n if ( strpos( $template, $placeholder ) !== FALSE)\n {\n $this->EE->TMPL->log_item(\"Stash: post-processing tag: \" . $tag['tagproper'] . \" will be replaced into \" . LD . $placeholder . RD);\n \n $this->EE->TMPL->tagparams = $tag['tagparams'];\n $this->EE->TMPL->tagdata = $tag['tagdata'];\n \n // restore context @ pointer in context parameter\n if (isset($this->EE->TMPL->tagparams['context']) && $this->EE->TMPL->tagparams['context'] == '@')\n {\n $this->EE->TMPL->tagparams['context'] = $context;\n }\n \n // restore context @ pointer if hardcoded in name parameter\n if (isset($this->EE->TMPL->tagparams['name']) \n && strncmp($this->EE->TMPL->tagparams['name'], '@:', 2) == 0)\n {\n $this->EE->TMPL->tagparams['name'] = str_replace('@', $context, $this->EE->TMPL->tagparams['name']);\n }\n \n // restore context @ pointer if hardcoded in file_name parameter\n if (isset($this->EE->TMPL->tagparams['file_name']) \n && strncmp($this->EE->TMPL->tagparams['file_name'], '@:', 2) == 0)\n {\n $this->EE->TMPL->tagparams['file_name'] = str_replace('@', $context, $this->EE->TMPL->tagparams['file_name']);\n }\n\n // has the save_output tag been called?\n if ( $tag['method'] === 'save_output')\n {\n $save_output = $tag;\n $save_output['placeholder'] = $placeholder;\n }\n else\n {\n // initialise Stash with our custom tagparams\n $s->init(TRUE);\n \n $out = $s->{$tag['method']}();\n \n $template = str_replace(LD.$placeholder.RD, $out, $template); \n \n // remove the placeholder from the cache so we don't iterate over it in future calls of this hook\n unset($this->EE->session->cache['stash']['__template_post_parse__'][$placeholder]);\n }\n }\n }\n \n // restore original TMPL values\n $this->EE->TMPL->tagparams = $tagparams;\n $this->EE->TMPL->tagdata = $tagdata;\n }\n\n // cache output to a static file\n if($save_output)\n {\n $this->EE->TMPL->tagparams = $save_output['tagparams'];\n $s->init(TRUE);\n $template = str_replace(LD.$save_output['placeholder'].RD, '', $template); \n $s->{$save_output['method']}($template);\n\n // restore original TMPL values\n $this->EE->TMPL->tagparams = $tagparams;\n }\n\n // cleanup\n unset($cache);\n }\n \n return $template;\n }", "protected function Parse( $template )\n\t{\n\t\tif (!$template) {\n\t\t\tthrow new Exception($this->NotFound());\n\t\t}\n\t\tob_start();\n\t\t\t@include_once $this->tpl_dir.'/'.$template.\".php\";\n\t\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\tif (count($this->vars) > 0)\n\t\t{\n\t\t\tforeach($this->vars as $name=>$value)\n\t\t\t{\n\t\t\t\tif (is_string($value))\n\t\t\t\t{\n\t\t\t\t\t$var = $this->left_delimiter.$name.$this->right_delimiter;\n\t\t\t\t\t$content = str_ireplace($var, $value, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content;\n\t}", "function __construct(){\n $this->loadTemplates();\n }", "public function init() {\n\t\t\t//Template directory uri\n\t\t\t$template_uri = RTPEOPLE_URL;\n\t\t\t\n\t\t\t//filter to include custom templates\n\t\t\tadd_filter( 'template_include', array( $this, 'load_template' ) );\n\t\t\tadd_filter( 'template_include', array( $this, 'load_archive_template' ) );\n\t\t\t\n\t\t\t//loads necessary css files for restaurants and slick slider\n\t\t\tadd_action( 'wp_enqueue_style', 'rtpeople_style', 1 );\n\t\t\twp_enqueue_style( 'rtpeople_style', $template_uri . 'assets/css/style.css' );\n\n\t\t\t//loads custom content template\n\t\t\tadd_action( 'get_template_part_templates/content', array( $this, 'load_content' ) );\n\t\t}", "public static function init( $template )\n\t{\n\t\tnew self;\n\t\treturn $template;\n\t}", "public function __construct($tpl) {\n\t\t$this->templateData = array();\n\t\t$this->varVal = array();\n\n\t\t// Make sure there is nothing after ';}'\n\t\t$chunk = explode(';}', $tpl);\n\t\t$this->template = implode(';}' . \"\\r\\n\", $chunk);\n\n\t\t// Start collecting template data\n\t\t$this->collectTemplateData();\n\n\t}", "public function __construct()\n {\n // Add trace for debugging\n \\Debug::trace('Initializing template class...', __FILE__, __LINE__);\n \n // Define defaults\n $this->config['controller'] = $GLOBALS['controller'];\n $this->config['is_module'] = $GLOBALS['is_module'];\n\n // Load the loader, Session, and Parser classes\n $this->load = load_class('Loader');\n $this->parser = $this->load->library('Parser');\n \n // Set basic headings so they can be modified later!\n $this->append_metadata(\"<!-- Basic Headings -->\")\n ->set_metadata('title', config('site_title'))\n ->set_metadata('keywords', config('meta_keywords'))\n ->set_metadata('description', config('meta_description'))\n ->set_metadata('generator', 'Plexis')\n ->append_metadata(\"\") // Added whitespace\n ->append_metadata(\"<!-- Content type, And cache control -->\")\n ->set_metadata('content-type', 'text/html; charset=UTF-8', 'http-equiv')\n ->set_metadata('cache-control', 'no-cache', 'http-equiv')\n ->set_metadata('expires', '-1', 'http-equiv');\n \n // Add trace for debugging\n \\Debug::trace('Template class initialized successfully', __FILE__, __LINE__);\n }", "function prepareTemplate()\r\n\t{\r\n\t\tif(!$this->headerLoaded)\r\n\t\t\t$this->loadHeader();\r\n\t\tif(!$this->footerLoaded)\r\n\t\t\t$this->loadFooter();\r\n\r\n\t\t$this->applyFilters();\r\n\t\t\t\r\n\t\treturn $this->template;\r\n\t}", "public function buildTemplate() {\n\n // The node's default renderis is its content.\n\n $tpl = array();\n $tpl_level = 0;\n\n // a template in the same directory has always priority.\n if (is_file($this->node->getPath() . '/tpl.html')) {\n $this->setData('tpl_file', $this->node->getPath() . '/tpl.html');\n }\n else {\n $lineages = $this->node->getLineage();\n foreach ($lineages as $lineage) {\n\n $tpl_level++;\n\n // If tpl^.html exists - template applies to all sublevels of the node.\n if (is_file($lineage->path . '/tpl^.html')) {\n $this->setData('tpl_file', $lineage->path . '/tpl^.html');\n }\n else {\n $min = '';\n // We support 5 levels of sub-level templates for now.\n // level 0 = tpl.html\n // level 1 = tpl-.html\n // level 2 = tpl--.html\n // etc...\n\n for ($i = 1; $i <= 6; $i++) {\n $min .= '-';\n $file = $lineage->path . '/tpl' . $min . '.html';\n if (file_exists($file)) {\n $tpl[$tpl_level + $i] = $file;\n }\n }\n }\n }\n\n // check if there is a sub-level template.\n if (isset($tpl[$tpl_level])) {\n $this->setData('tpl_file', $tpl[$tpl_level]);\n }\n }\n\n // Set the template.\n $this->html = (!empty($this->getData('tpl_file'))) ? file_get_contents($this->getData('tpl_file')) : $this->node->getBody();\n\n }" ]
[ "0.7610771", "0.68399954", "0.6826836", "0.6800766", "0.6513303", "0.6474037", "0.6384417", "0.6328197", "0.6319628", "0.6308122", "0.6271953", "0.62281847", "0.62119687", "0.61864626", "0.6121037", "0.61143804", "0.6072077", "0.60020304", "0.59963924", "0.59757555", "0.5916362", "0.5905143", "0.58669025", "0.5847662", "0.58450556", "0.5835278", "0.58340555", "0.5832235", "0.5814254", "0.5810468" ]
0.6962432
1
Clears Render Result Output
public function clearOutput() { $this->_renderResult = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function forceClearOutput()\n {\n $this->_renderResult = '';\n\n foreach ($this->_matches as $tValue => $rValue)\n {\n $this->{$tValue}->forceClearOutput();\n }\n }", "public function clearOutput() {\n $this->output = [];\n }", "protected static function clear(): void{\n ob_end_clean();\n }", "public function & outputClear()\n\t{\n\t\t$this->m_output = '';\n\t\treturn $this;\n\t}", "public function clearStateIfDoneRendering();", "public function clear(): void\n\t{\n\t\t$this->response->write(\"\\033[2J\");\n\t}", "public function clearAllOutput() {\n\t\twhile (ob_get_level() > $this->startingObLevel) {\n\t\t\tob_end_clean();\n\t\t}\n\t\t$this->startOutputBuffer();\n\t}", "public function clear () {}", "public function clear () {}", "public function clear () {}", "public function clear () {}", "public static function renderClear(){\n\t\tself::out(\n\t\t\tself::openTag('div', array(\n\t\t\t\t'class' => 'clear'\n\t\t\t)),\n\t\t\tself::closeTag('div')\n\t\t);\n\t}", "public function clear(){\r\n\t\t\t$this->css_list = $this->js_list = array();\r\n\t\t\t$this->compress_displayed = false;\r\n\t\t}", "protected function clear() {\n\t\t\n\t\t// passthru('clear');\n\t\t\n\t\t$clear = array(27, 91, 72, 27, 91, 50, 74, 0);\n \t$output = '';\n \tforeach ($clear as $char) { $output .= chr($char); }\n \t$this->stdout($output, false);\n\t}", "public function clear() {}", "function clear()\r\n {\r\n unset($results);\r\n unset($usage); \r\n }", "public function afterRender()\n {\n // Clean view output buffer\n OutputBuffer::end(true);\n }", "public function clear() {\n\t\t$this->doClear();\n\t}", "public function clear(): void\n {\n $this->setContent('');\n }", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();" ]
[ "0.80017483", "0.75609136", "0.7488372", "0.7244295", "0.71333903", "0.7100096", "0.70102626", "0.698378", "0.698378", "0.698378", "0.698378", "0.693844", "0.68974924", "0.68851167", "0.6877812", "0.6852012", "0.6847209", "0.683324", "0.6828547", "0.6810032", "0.6810032", "0.6810032", "0.6810032", "0.6810032", "0.6810032", "0.6810032", "0.6810032", "0.6810032", "0.6810032", "0.6810032" ]
0.9008267
0
Force Clears Rendered Result Output
public function forceClearOutput() { $this->_renderResult = ''; foreach ($this->_matches as $tValue => $rValue) { $this->{$tValue}->forceClearOutput(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearOutput()\n {\n $this->_renderResult = '';\n }", "public function clearStateIfDoneRendering();", "protected static function clear(): void{\n ob_end_clean();\n }", "public function & outputClear()\n\t{\n\t\t$this->m_output = '';\n\t\treturn $this;\n\t}", "public function clear(): void\n {\n $this->setContent('');\n }", "public function clearOutput() {\n $this->output = [];\n }", "public function clearAllOutput() {\n\t\twhile (ob_get_level() > $this->startingObLevel) {\n\t\t\tob_end_clean();\n\t\t}\n\t\t$this->startOutputBuffer();\n\t}", "protected function doClear() {\n\t}", "public function clear(): void\n\t{\n\t\t$this->response->write(\"\\033[2J\");\n\t}", "public function afterRender()\n {\n // Clean view output buffer\n OutputBuffer::end(true);\n }", "private function _clearLineBuffer()\n\t{\n\t\t$this->_output_buffer = array();\n\t}", "public static function renderClear(){\n\t\tself::out(\n\t\t\tself::openTag('div', array(\n\t\t\t\t'class' => 'clear'\n\t\t\t)),\n\t\t\tself::closeTag('div')\n\t\t);\n\t}", "public function clear()\n\t{\n\t\treturn $this->write('');\n\t}", "protected function clear() {\n\t\t\n\t\t// passthru('clear');\n\t\t\n\t\t$clear = array(27, 91, 72, 27, 91, 50, 74, 0);\n \t$output = '';\n \tforeach ($clear as $char) { $output .= chr($char); }\n \t$this->stdout($output, false);\n\t}", "public function clear () {}", "public function clear () {}", "public function clear () {}", "public function clear () {}", "public function clear() {\n\t\t$this->doClear();\n\t}", "public function clear(){\r\n\t\t\t$this->css_list = $this->js_list = array();\r\n\t\t\t$this->compress_displayed = false;\r\n\t\t}", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();" ]
[ "0.8629838", "0.72660464", "0.70937693", "0.7030698", "0.6989081", "0.69884515", "0.687777", "0.6786212", "0.6783311", "0.6772234", "0.6719763", "0.6690036", "0.6659976", "0.66430235", "0.6611089", "0.6611089", "0.6611089", "0.6611089", "0.6570787", "0.65619415", "0.655283", "0.655283", "0.655283", "0.655283", "0.655283", "0.655283", "0.655283", "0.655283", "0.655283", "0.655283" ]
0.81568545
1
we're going to just return true or false if the player has liked the app :)~
static function playerLikesApp($playerID) { $facebook = App::make('facebook'); $user = $facebook->getUser(); $likesApp = false; $params = array( 'method' => 'fql.query', 'query' => 'SELECT uid FROM page_fan WHERE page_id = ' . Config::get('facebook.page_id') . ' AND uid = ' . $user ); $userLikes = $facebook->api($params); if($userLikes) { $likesApp = true; $cb = CouchbaseHelper::connect(); $p = new PlayerHelper(); $p = $p->loadPlayer($playerID); $p->liked_game = 1; $p->savePlayer($cb); //log_message('debug', 'Updated player couchbase liked_game = 1 for player ' . $playerID); } else { $likesApp = false; } return $likesApp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userLiked($id_post)\n {\n global $link;\n global $id_user;\n $sql = \"SELECT * FROM rating_info WHERE id_user=$id_user\n AND id_post=$id_post AND rating_action='like'\";\n $result = mysqli_query($link, $sql);\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n }", "public function check_liked(){\n\t\t\t//query\n\t\t\t$query = \"SELECT count(*) FROM \".$this->table.\" WHERE post_id = :post_id and user_id = :user_id\";\n\n\t\t\t//prepate stmt\n\t\t\t$stmt = $this->conn->prepare($query);\n\n\t\t\t//bind params to stmt\n\t\t\t$stmt->bindParam(':post_id', $this->post_id);\n\t\t\t$stmt->bindParam(':user_id', $this->user_id);\n\n\t\t\t//execute stmt\n\t\t\t$stmt->execute();\n\n\t\t\t$result = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t\treturn $result;\n\t\t}", "function userLiked($post_id)\n{\n global $conn;\n global $user_id;\n $sql = \"SELECT * FROM rating_community_info WHERE user_id='$user_id'\n AND b_code='자유게시판' and post_id=$post_id AND rating_action='like'\";\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n return true;\n } else {\n return false;\n }\n}", "public function islikedByUser(User $user ):bool{\n foreach ($this->likes as $like)\n {\n if ($like->getUser() == $user)\n return true;\n }\n return false;\n\n }", "public function getUserLikedStatus () {\n $query = \"SELECT created_by FROM likes WHERE post_id = ? AND created_by = ?\";\n $stmt = $this->db ->prepare($query);\n $stmt ->bind_param(\"ii\",$this->postId, $this->userId);\n $stmt -> execute();\n $result = $stmt -> get_result();\n if ($result -> num_rows === 1)\n return true;\n else\n return false;\n }", "public function isEnabled()\n {\n return Mage::helper('facebook')->isActiveWishlist();\n }", "public function is_user_liked_questionBox()\n {\n\n\n return\n $this->user_likes()\n ->where(AskLikeEnum::USER_ID, Auth::id())\n ->exists();\n\n }", "public function like(User $user){\n if(Auth::check()){\n return true;\n }\n\n return false;\n }", "function userLiked($pid)\n{\n \n $sql = \"SELECT * FROM rating_info WHERE pid=$pid AND rating_action='like'\";\n $result = $db->prepare($sql);\n $result->execute(array($_GET['id']));\n $result->fetchAll(PDO::FETCH_ASSOC);\n $likecount = $result->rowCount();\n if ($likecount > 0) {\n return true;\n }else{\n return false;\n }\n }", "function user_liked_this( $post_id )\n{\n\t$user_hash = aa_get_current_user_hash();\n\t$likes_arr = unserialize( get_post_meta( $post_id, 'likes_container', true ) );\n\tif ( is_array( $likes_arr ) ) {\n\t\t$position = array_search( $user_hash, $likes_arr );\n\n\t\treturn $position !== false;\n\t}\n\n\treturn false;\n}", "function has_liked_by($user1, $user2)\r\n{\r\n $db = db();\r\n $query = $db->query(\"SELECT `id` FROM `liked_by` WHERE `user_id`=$user2 AND `liked_by`=$user1\");\r\n if ($query && $query->num_rows > 0) {\r\n return true;\r\n }\r\n return false;\r\n}", "public function hasPlayed() : bool\n {\n return boolval($this->userTrophyInfo());\n }", "public function like()\n {\n }", "function userLikedThisPost($post_id = '') {\n $result = query(\"SELECT * FROM likes WHERE user_id=\" .loggedInUserId() . \" AND post_id ={$post_id}\");\n return mysqli_num_rows($result) >= 1 ? true : false;\n}", "function userLikedThisPost($post_id){\n\n $result = query(\"SELECT * FROM likes WHERE user_id=\" .loggedInUserId() . \" AND post_id={$post_id}\");\n // echo $result;\n // shorthand if statement\n confirmQuery($result);\n return mysqli_num_rows($result) >= 1 ? true : false;\n}", "function checkLike($actor_id,$username) // vérifie si l'utilisateur actuel a déjà ajouté une mention (\"je recommande / déconseille\")\n{\n\t$db = dbConnect();\n\t$result = $db->prepare('SELECT account.id_user, username, vote.id_user, id_actor, vote \n\t\t\t\t\t\t\tFROM account\n\t\t\t\t\t\t\tINNER JOIN vote\n\t\t\t\t\t\t\tON account.id_user = vote.id_user\n\t\t\t\t\t\t\tWHERE username = :username\n\t\t\t\t\t\t\tAND id_actor = :actor');\n\t$result->execute(array('username' => $username, 'actor' => $actor_id));\n\t$data = $result->fetch();\n\t$result->closeCursor();\n\tif(!$data)\n\t{\n\t\t$like_state = false;\n\t}\n\telse\n\t{\n\t\t$like_state = $data['vote'];\n\t}\n\treturn $like_state;\n}", "function userDisliked($pid)\n{\n \n $sql = \"SELECT * FROM rating_info WHERE \n \t\t pid=$pid AND rating_action='dislike'\";\n $result = $db->prepare($sql);\n $result->execute();\n $result->fetchAll(PDO::FETCH_ASSOC);\n $dislikecount = $result->rowCount();\n if ($dislikecount > 0) {\n \treturn true;\n }else{\n \treturn false;\n }\n}", "public function like(){\n return $this->response_success(['likes' => rand(1,55)]); // Колво лайков под постом \\ комментарием чтобы обновить\n }", "function userDisliked($post_id)\n{\n global $conn;\n global $user_id;\n $sql = \"SELECT * FROM rating_community_info WHERE b_code='자유게시판' and user_id='$user_id'\n AND post_id=$post_id AND rating_action='dislike'\";\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n return true;\n } else {\n return false;\n }\n}", "public function isLiked($user)\n {\n return $user \n ? $this->likes()->where('user_id', $user->id)->exists()\n : false;\n }", "public static function hasUserLiked($chusqer){\n $user = Auth::user();\n $like = Like::where([\n 'chusqer_id' => $chusqer->id,\n 'user_id' => $user->id,\n ])->first();\n\n return $like !== null ? true : false;\n }", "function userDisliked($id_post)\n {\n global $link;\n global $id_user;\n $sql = \"SELECT * FROM rating_info WHERE id_user = $id_user\n AND id_post=$id_post AND rating_action='dislike'\";\n $result = mysqli_query($link, $sql); \n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n }", "function thb_check_already_liked( $id = null ) {\r\n\t\tif ( ! $id ) {\r\n\t\t\t$id = get_the_ID();\r\n\t\t}\r\n\r\n\t\t$cookie_key = 'thb_like_' . $id;\r\n\t\treturn isset( $_COOKIE[$cookie_key] );\r\n\t}", "function bbp_is_favorites()\n{\n}", "function post_like() {\n $inputs = $this->validate_post_like();\n $res = $this->TweetModel->check_like($inputs);\n if ($res['status'] == 1) {\n //dislike\n $this->TweetModel->update_like($inputs, 2);\n $data = array('status' => true, 'message' => 'Unliked', 'liked_status' => 0);\n echo json_encode($data); die;\n } elseif ($res['status'] == 2) {\n //like\n $this->TweetModel->update_like($inputs, 1);\n $data = array('status' => true, 'message' => 'Liked', 'liked_status' => 1);\n echo json_encode($data); die;\n } else {\n //add to like\n $this->TweetModel->post_like($inputs);\n $data = array('status' => true, 'message' => 'Liked', 'liked_status' => 1);\n echo json_encode($data); die;\n }\n }", "public function isLiked($user)\n {\n return $this->likes()->where('user_id', $user->getKey())\n ->exists();\n }", "protected function checkFacebookExternalHit()\n {\n if (stristr($this->_agent, 'FacebookExternalHit')) {\n $this->setRobot(true);\n $this->setFacebook(true);\n return true;\n }\n return false;\n }", "function boolImageLiked($artista,$username,$nomeImmagine){\r\n $myDb= new DbConnector();\r\n $myDb->openDBConnection();\r\n $resArr=array();\r\n if($myDb->connected){\r\n $result = $myDb->doQuery('SELECT Utente FROM likes WHERE opera=\"'.$nomeImmagine.'\" AND Utente=\"'.strtolower($username).'\" AND Creatore=\"'.$artista.'\";');\r\n if($result){\r\n if($result->num_rows==0){//significa che il like non è ancora presente per l'opera\r\n $resArr['Result'] = false; \r\n }else if($result->num_rows==1){//significa che il like è presente\r\n $resArr['Result'] = true;\r\n }\r\n }else{\r\n $resArr['Result'] = \"Errore\";\r\n }\r\n }\r\n else \r\n $resArr['Result'] = \"Connection Error\";\r\n\r\n return $resArr;\r\n $myDb->disconnect();\r\n }", "public function isFavorite();", "public function like()\n {\n return $this->postResponse($this->link['LIKES']);\n }" ]
[ "0.66392744", "0.6558003", "0.65282696", "0.6486656", "0.6427369", "0.6426339", "0.6421352", "0.64208746", "0.64188844", "0.6362694", "0.6286086", "0.626826", "0.6265609", "0.6264809", "0.626031", "0.6224794", "0.61619014", "0.61516684", "0.613495", "0.6134386", "0.61084104", "0.6100857", "0.609945", "0.60735565", "0.6064596", "0.60529286", "0.6031788", "0.6009673", "0.59989125", "0.5997143" ]
0.71837485
0
Log::info("Creating couchbase player with id: " . $playerID);
private function createCouchbasePlayer($playerID) { if ($playerID <= 0) { //Log::error("Couchbase Error: Trying to create a player with an invalid ID: " . $playerID . " UA: " . $_SERVER['HTTP_USER_AGENT'] . " XFWD: " . $_SERVER['HTTP_X_FORWARDED_FOR']); } else { //log_message('debug', 'createCouchbasePlayer() :: Creating player with id: ' . $playerID); // self::data->player_id = $playerID; $cb = CouchbaseHelper::connect(); $this->data->player_id = $playerID; $this->InitUnsetFields(); $this->bLoaded = true; $this->savePlayer($cb); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lk_log_debug($message){\n $log = new DebugLog($message);\n $log ->save();\n}", "function createNewPlayer($playerName) {\n $database = new Database();\n $db = $database->getConnection();\n\n // initialize object\n $player = new Player($db);\n\n // set product property values\n $player->name = $playerName;\n $player->losses = 0;\n $player->draws = 0;\n $player->gamescount = 0;\n $player->elo = 1500;\n $player->color = \"#198754\";\n $player->currentlyPlaying = 0;\n $player->created = date('Y-m-d H:i:s');\n\n // create Player\n if($player->create()){\n // success\n echo \"Player '$playerName' was created<br>\";\n } else {\n // failed\n echo \"Could not create player '$playerName'<br>\";\n }\n}", "function insert_log($type, $details)\n{\n global $cblog;\n $cblog->insert($type, $details);\n}", "public function log() {\n\t\tlogger('dav: auth: channel_name ' . $this->channel_name, LOGGER_DATA);\n\t\tlogger('dav: auth: channel_id ' . $this->channel_id, LOGGER_DATA);\n\t\tlogger('dav: auth: channel_hash ' . $this->channel_hash, LOGGER_DATA);\n\t\tlogger('dav: auth: observer ' . $this->observer, LOGGER_DATA);\n\t\tlogger('dav: auth: owner_id ' . $this->owner_id, LOGGER_DATA);\n\t\tlogger('dav: auth: owner_nick ' . $this->owner_nick, LOGGER_DATA);\n\t}", "function kb_debug() {\n\tstatic $kdb;\n\tif ( !isset( $kdb ) ) $kdb = new KB_Debug();\n\n\t$kdb->log( func_get_args() );\n}", "public function write()\n {\n echo \"database log write\";\n }", "public function run()\n {\n //\n\t\t/*\n\t\t$getip = UserSystemInfoHelper::get_ip();\n\t\t$getbrowser = UserSystemInfoHelper::get_browsers();\n\t\t$getdevice = UserSystemInfoHelper::get_device();\n\t\t$getos = UserSystemInfoHelper::get_os();\n\t\t*/\n\n $log = new Log();\n $log->user_id = 1;\n $log->section = 'Usuarios';\n $log->action = 'Creación';\n $log->feedback = 'self';\n $log->ip = '$getip';\n $log->device = '$getdevice';\n $log->system = '$getos';\n $log->save();\n\n \n }", "function record($event) {\n\tglobal $roles;\n\t\n\tif ($roles['clerk']) say(date('H:i:s: ') . $event, $roles['clerk'], null, false);\n\tlogdata($event, '##');\n}", "function log()\r\n {\r\n }", "function bamobile_mobiconnector_run_update_player_id_with_cron_job(){\r\n\tbamobile_mobiconnector_update_playerid_with_api();\r\n}", "public function debugAction() : string\n {\n // Deal with the action and return a response.\n // return __METHOD__ . \", \\$db is {$this->db}\";\n return \"Debug my game!!\";\n }", "public function log()\n {\n $request = A::getMainApp()->request;\n $response = A::getMainApp()->response;\n\n $log = array(\n 'ip' => CommonHelpers::getIp(),\n 'client_puk' => $request->puk,\n 'query' => $request->fullUri,\n 'module' => $request->module,\n 'action' => $request->action,\n 'params' => serialize($request->params),\n 'response_code' => $response->code,\n 'response_message' => $response->message,\n );\n\n $db = new MainDb();\n return $db->insert('logs', $log);\n }", "function playerTest() {\n global $page_id, $plyr, $error_msgs;\n dbg(\"+\".__FUNCTION__.\"\");\n #post_dump();\n\n# initialize the player form\nrequire(BASE_URI . \"modules/player/player.form.init.php\");\n\n # create a test player\n $plyr->testMember();\n $error_msgs['errorDiv'] = \"Test player created. Press \\\"Add/Update\\\" to add the player.\";\n\n# Show the player form\nrequire(BASE_URI . \"modules/player/player.form.php\");\n\n dbg(\"-\".__FUNCTION__.\"={$plyr->get_member_id()}\");\n\n}", "function _drush_backend_integrate_log($entry) {\n}", "function lk_log_cron($message){\n $log = new DebugLog($message);\n $log -> setCategory('cron');\n $log ->save();\n}", "function log911Action($action) {\n global $pdo;\n global $time;\n global $us_date;\n global $user_id;\n\n $sql_callLogger = \"INSERT INTO 911call_log (call_id, user_id, dispatcher, action, timestamp) VALUES (?,?,?,?,?)\";\n $stmt_callLogger = $pdo->prepare($sql_callLogger);\n $result_callLogger = $stmt_callLogger->execute([$_SESSION['viewingCallID'], $user_id, $_SESSION['identity_name'], $action, $us_date . ' ' . $time]);\n}", "function log($msg=\"\"){ if($this->debug){ echo $msg.\"\\n\"; } }", "public function run()\n {\n DB::table('main.player')->insert([\n 'name' => '1',\n 'hit_points' => 1000,\n 'mana_points' => 0,\n 'experience' => 0,\n 'gold' => 0\n ]);\n }", "public function __construct()\n {\n Log::info(\"intiating IndexVideos Job\");\n }", "private function logToDB()\n {\n\n //insert the info into the database, don't allow logging of any error\n $this->DB->insert(\"logger.logs\",$this->logData,null,1);\n \n }", "function logs(){\n\n\t\t}", "private function _log()\n\t{\n\t\t$log = [\n\t\t\t'url'\t\t\t=> Yii::$app->request->getUrl(),\n\t\t\t'ip'\t\t\t=> Yii::$app->request->getUserIP(),\n\t\t\t'_jsonRequest' \t=> [\n\t\t\t\tself::OBJECT_PARAMS\t=> $this->_jsonRequest,\n\t\t\t\tself::OBJECT_FILES => $this->_filesRequest,\n\t\t\t],\n\t\t\t'_jsonResponse' => $this->_jsonResponse,\n\t\t];\n\n\t\tYii::info($log, 'db_log');\n\t}", "function writeToResourceLog($userid, $resource, $action) {\n\t$stmt = $GLOBALS['db']->prepare(\"INSERT INTO resource_calls (userid, resource, action) VALUES (?, ?, ?)\");\n\t$stmt->bind_param(\"sss\",$userid,$resource,$action);\n\tif( $stmt->execute() ) {\n\t\terror_log(\"Resource call successfully logged.\");\n\t} else {\n\t\terror_log(\"Resource call log failed.\");\n\t}\n\t$stmt->close();\n\t\n\treturn;\n}", "public function __construct() // necessary for the ::log method to work\n {\n }", "private function createPlayer($uid = null, $source = 'facebook')\n {\n //Log::info(\"Create player called wth unique id: \" . $uid .\" FROM source \" . $source);\n switch($source)\n {\n case 'facebook':\n\n //log_message('debug', 'Attempting to create a couchbase player: ' . $uid . ' from source ' . $source);\n $id = DB::table('player')->insertGetId(array('facebook_id' => $uid, 'first_name' => $this->data->first_name, 'last_name' => $this->data->last_name, 'create_date' => date('Y-m-d h:i:s') ));\n $playerID = $id;\n $this->createCouchbasePlayer($id, 'facebook');\n\n break;\n }\n\n return $playerID;\n\n }", "private function _log($message)\n\t{\n\t\tLog::info('Braintree: ' . $message);\n\t}", "public function get_playerid(){return $this->_playerid;}", "public function write( $level ){ /* PHP CODE FOR SAVE LOG MESSAGE */ }", "private function _talkative($text)\n {\n if ($this->_logEnabled) echo 'DataBase | ' . $this->_logCount . ' | ' . $text . \"\\n<br>\";\n $this->_logCount++;\n }", "function log_start($page_name, $udb, $url, $http_get, $http_post)\n{\n \n}" ]
[ "0.54105866", "0.53091055", "0.5300245", "0.5206469", "0.5151932", "0.5107435", "0.50646657", "0.5063957", "0.5027318", "0.5025139", "0.50188476", "0.50163126", "0.5008926", "0.49961033", "0.49794412", "0.4977653", "0.4957059", "0.49483448", "0.49359906", "0.4929894", "0.49249166", "0.49006233", "0.48526666", "0.48415843", "0.48283827", "0.48175028", "0.48096237", "0.48016107", "0.47725564", "0.47677156" ]
0.6333096
0
Return the maximum number of arguments accepted
public function maximum_parameter_count() { return $this->maximumArgumentCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getMinNrOfRequiredArguments()\n {\n return 0;\n }", "protected function getArgumentsCount(): int\n\t{\n\t\treturn 1;\n\t}", "public static function argCount(): int {\n\t\t\treturn 2;\n\t\t}", "public function numArguments() {\n return sizeof($this->arguments);\n }", "public function countArguments(): int\n {\n return \\count($this->arguments);\n }", "public function length(){\n\t\treturn count($this->args);\n\t}", "public function getNumberOfArguments(): int\n {\n return $this->pointer->This->u2->num_args;\n }", "function numArguments()\r\n {\r\n return count($this->_arguments);\r\n }", "protected function getMaxParameter(): int\n {\n return 6;\n }", "public function count_args() {\n\t\treturn (int)($this->arg_count - $this->part_count);\n\t}", "public static function count()\n {\n return \\count(self::$arguments);\n }", "protected function hasArgumentMaximum()\n {\n return !empty($this->arguments['max']);\n }", "public static function maxCount()\n {\n $array = \\func_get_args();\n if (!\\is_array($array)) {\n return 0;\n }\n\n $maxCnt = 0;\n foreach ($array as $item) {\n if (!\\is_array($item)) {\n continue;\n }\n $cnt = \\count($item);\n $maxCnt = $cnt > $maxCnt ? $cnt : $maxCnt;\n }\n\n return $maxCnt;\n }", "public function getMaxLength() : int {\n return $this->params[self::MAX_LENGTH];\n }", "public function required_parameter_count() { return $this->requiredArgumentCount; }", "public function getMaxLength(): int\n {\n return $this->maxLength;\n }", "public static function max( $args ) {\n\t\t$args = func_get_args();\n\t\treturn max( $args );\n\t}", "public function getMaxSize();", "public function getExpectedArgumentCount(): int\n {\n return $this->argument_count ?? $this->argument_count = ConversionSpec::computeExpectedArgumentCount($this->template);\n }", "public function count(): int\n {\n return count($this->parameters);\n }", "public function getMaxLength() { return $this->_maxLength; }", "public function getNumberOfParameters()\n {\n $reflection = new \\ReflectionFunction($this->closure);\n\n return $reflection ->getNumberOfParameters();\n }", "public function getMaxLength()\n {\n return $this->maxLength;\n }", "public function getMaxSignaturesLength()\n {\n return $this->maxSignaturesLength;\n }", "function test()\n{\n echo '参数个数:';\n var_dump(func_get_args());\n var_dump(func_num_args());\n}", "protected function _maxParameters($counter, $type)\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'check max parameters count',\n debug_backtrace(),\n '#004396'\n ));\n }\n\n $error = '';\n $globalArray = '';\n $option = '';\n\n switch ($type) {\n case\"get\":\n $option = 'max_get';\n $globalArray = $_GET;\n $error = 'core_error_5';\n break;\n\n case\"post\":\n $option = 'max_post';\n $globalArray = $_POST;\n $error = 'core_error_7';\n break;\n\n case\"files\":\n $option = 'files_max';\n $globalArray = $_FILES;\n $error = 'core_error_8';\n break;\n }\n\n $option = core_class::options($option);\n if ((bool)$option) {\n if ($counter > $option) {\n\n $inf = count($globalArray) . ' -> ' . $option;\n throw new coreException($error, $inf);\n }\n }\n }", "protected static function countArgument(int $defaultCount = null, int $maxCount = null): string\n {\n $description = '\"Limits number of fetched items.';\n if ($maxCount) {\n $description .= \" Maximum allowed value: {$maxCount}.\";\n }\n\n $description .= \"\\\"\\n\";\n\n $definition = 'first: Int!';\n if ($defaultCount) {\n $definition .= \" = {$defaultCount}\";\n }\n\n return $description . $definition;\n }", "public function count()\n {\n return count($this->parameters);\n }", "public function getMaximumNumberOfCalls()\n {\n return $this->maximumNumberOfCalls;\n }", "public function getDefaultLimit(): int;" ]
[ "0.77778643", "0.7464168", "0.7461929", "0.7442837", "0.7329899", "0.73276305", "0.7277918", "0.7211907", "0.7109376", "0.7055657", "0.6817092", "0.66957337", "0.6591069", "0.6496574", "0.6454205", "0.63121027", "0.6226833", "0.62128884", "0.61514485", "0.6102352", "0.60737455", "0.6059708", "0.60007447", "0.59866714", "0.5979637", "0.59680563", "0.59401727", "0.5905373", "0.5899002", "0.58890706" ]
0.81736094
0
Find and return an Organization's Orders with the given $filterParams
public function search(int $organizationId, array $filterParams = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrdersQueryBuilder($customerId, $filter = null, $orderBy = null)\n {\n /** @var QueryBuilder $builder */\n $builder = $this->getEntityManager()->createQueryBuilder();\n // Select the different entities\n $builder->select([\n 'orders.id as id',\n 'orders.number as orderNumber',\n 'orders.invoiceAmount as invoiceAmount',\n 'orders.orderTime as orderTime',\n 'dispatch.id as dispatchId',\n 'orders.paymentId as paymentId',\n 'orders.status as orderStatusId',\n 'orders.cleared as paymentStatusId',\n ]);\n\n // Join the required tables for the order list\n $builder->from(Order::class, 'orders')\n ->leftJoin('orders.payment', 'payment')\n ->leftJoin('orders.dispatch', 'dispatch')\n ->leftJoin('orders.orderStatus', 'orderStatus')\n ->leftJoin('orders.paymentStatus', 'paymentStatus');\n\n // Filter the displayed columns with the passed filter string\n if (!empty($filter)) {\n $builder->where('orders.customerId = :customerId');\n $builder->andWhere(\n '(\n orders.number LIKE ?1\n OR orders.invoiceAmount LIKE ?3\n OR orders.orderTime LIKE ?2\n OR payment.description LIKE ?1\n OR dispatch.name LIKE ?1\n )'\n )\n ->setParameter(1, $filter . '%')\n ->setParameter(2, '%' . $filter)\n ->setParameter(3, str_replace('.', '_', str_replace(',', '_', $filter)) . '%')\n ->setParameter('customerId', $customerId);\n } else {\n $builder->where('orders.customerId = :customerId')->setParameter('customerId', $customerId);\n }\n $builder->andWhere('orders.status NOT IN (:stati)');\n $builder->setParameter(':stati', [-1, 4], Connection::PARAM_INT_ARRAY);\n\n $this->addOrderBy($builder, $orderBy);\n\n return $builder;\n }", "public function ordersList(array $filter = array(), $page = null, $limit = null)\n {\n $parameters = array();\n\n if (count($filter)) {\n $parameters['filter'] = $filter;\n }\n if (null !== $page) {\n $parameters['page'] = (int) $page;\n }\n if (null !== $limit) {\n $parameters['limit'] = (int) $limit;\n }\n\n return $this->client->makeRequest(\n '/orders',\n RetailcrmHttpClient::METHOD_GET,\n $parameters\n );\n }", "public function listOrders($params = null) {\n return $this->get(\"conexion/v1/orders.json\", $params);\n }", "public function ordersFilter()\n {\n // $filter = \\DataFilter::source($this->order->with('users', 'products'));\n // $filter->add('id', 'ID', 'text');\n // $filter->add('users.name', 'Usuario', 'text');\n // $filter->add('products.name', 'Producto', 'text');\n // $filter->add('size', 'Size', 'text');\n // $filter->add('color', 'Color', 'text');\n // $filter->submit('Buscar');\n // $filter->reset('Reiniciar');\n // $filter->build();\n\n $orders = $this->order->with('users', 'products');\n return $orders;\n }", "public function findOrder($orderId);", "public function search( $params ) {\n\t\t\t$query = OrderModel::find()\n\t\t\t ->alias( 'od' );\n\n\t\t\t$dataProvider = new ActiveDataProvider( [\n\t\t\t\t 'query' => $query,\n\t\t\t\t 'sort' => new Sort( [\n\t\t\t\t\t 'attributes' => [\n\t\t\t\t\t\t 'id',\n\t\t\t\t\t\t 'name',\n\t\t\t\t\t\t 'created_at'\n\t\t\t\t\t ]\n\t\t\t\t ] )\n\t\t\t ] );\n\n\t\t\t$this->load( $params );\n\n\t\t\tif ( ! $this->validate() ) {\n\t\t\t\treturn $dataProvider;\n\t\t\t}\n\n\t\t\tif ( ! empty( $this->startDate ) || ! empty( $this->endDate ) ) {\n\t\t\t\tif ( empty( $this->startDate ) && ! empty( $this->endDate ) ) {\n\t\t\t\t\t$this->startDate = $this->endDate;\n\t\t\t\t}\n\t\t\t\tif ( empty( $this->endDate ) && ! empty( $this->startDate ) ) {\n\t\t\t\t\t$this->endDate = date('d.m.Y');\n\t\t\t\t}\n\t\t\t\t$query->andFilterWhere( [\n\t\t\t\t\t 'and',\n\t\t\t\t\t 'od.created_at<=' . (strtotime( $this->endDate )+86400),\n\t\t\t\t\t 'od.created_at>=' . (strtotime( $this->startDate )+86400)\n\t\t\t\t ] );\n\t\t\t}\n\n\t\t\tif ( ! empty( $this->clientName ) ) {\n\t\t\t\t$query->joinWith( 'orderClientData ocd' )\n\t\t\t\t ->andFilterWhere( [ 'like', 'ocd.name', $this->clientName ] );\n\t\t\t}\n\n\t\t\t$query->andFilterWhere( [ 'od.id' => $this->id ] );\n\n\t\t\treturn $dataProvider;\n\t\t}", "public static function search($params, $accountId)\n {\n $query = self::find();\n $comma = ',';\n $condition = ['accountId' => $accountId, 'isDeleted' => StoreGoods::NOT_DELETED];\n\n if (!empty($params['categoryIds'])) {\n $categorys = explode($comma, $params['categoryIds']);\n $categoryIds = [];\n foreach ($categorys as $category) {\n $categoryIds[] = new \\MongoId($category);\n }\n $categorys = ['$in' => $categoryIds];\n\n $condition['categoryId'] = $categorys;\n }\n\n if (array_key_exists('searchKey', $params) && '' != $params['searchKey']) {\n $key = $params['searchKey'];\n $key = StringUtil::regStrFormat(trim($key));\n $keyReg = new \\MongoRegex(\"/$key/i\");\n $search = [\n '$or' => [\n ['productName' => $keyReg],\n ['sku' => $keyReg],\n ],\n ];\n $condition = array_merge($condition, $search);\n }\n\n if (!empty($params['status'])) {\n $condition['status'] = $params['status'];\n }\n if (!empty($params['storeId'])) {\n $condition['storeId'] = $params['storeId'];\n }\n\n if (isset($params['saleTimeFrom']) && $params['saleTimeFrom'] !== '') {\n $condition['onSaleTime']['$gte'] = new \\MongoDate(TimeUtil::ms2sTime($params['saleTimeFrom']));\n }\n if (isset($params['saleTimeTo']) && $params['saleTimeTo'] !== '') {\n $condition['onSaleTime']['$lte'] = new \\MongoDate(TimeUtil::ms2sTime($params['saleTimeTo']));\n }\n\n if (isset($params['priceFrom']) && $params['priceFrom'] !== '') {\n $condition['price']['$gte'] = floatval($params['priceFrom']);\n }\n if (isset($params['priceTo']) && $params['priceTo'] !== '') {\n $condition['price']['$lte'] = floatval($params['priceTo']);\n }\n\n $query->orderBy(self::normalizeOrderBy($params));\n $query->where($condition);\n\n $searchQuery = ['query' => $query];\n return new ActiveDataProvider($searchQuery);\n }", "public function search($params)\r\n {\r\n $query = Customer::find();\r\n $this->load($params);\r\n if(!$this->validate()){\r\n return $query->where('1=2');\r\n }\r\n $query->andFilterWhere(['like', 'c_customer_name', $this->c_customer_name])\r\n ->andFilterWhere(['like', 'c_customer_cellphone', $this->c_customer_cellphone])\r\n ->andFilterWhere(['like', 'c_customer_id_card', $this->c_customer_id_card]);\r\n\r\n $query->andFilterWhere(['c_customer_province'=>$this->c_customer_province]);\r\n $query->andFilterWhere(['c_customer_city'=>$this->c_customer_city]);\r\n $query->andFilterWhere(['c_customer_county'=>$this->c_customer_county]);\r\n\r\n if(!empty($this->u_id)){\r\n $subQuery = (new yii\\db\\Query())->select(['o_customer_id'])->from(Orders::tableName())->where(['o_user_id'=>$this->u_id])->groupBy('o_customer_id');\r\n $query->andWhere(['c_id'=>$subQuery]);\r\n }\r\n if(self::BORROW_STATUS_FAIL === $this->borrow_status){\r\n $query->andWhere(['c_total_money'=>0]);\r\n }else if(self::BORROW_STATUS_SUCCESS === $this->borrow_status){\r\n $query->andWhere(['>', 'c_total_money', 0]);\r\n }\r\n\r\n return $query;\r\n }", "public function getOrdersQuery($customerId, $filter = null, $orderBy = null, $limit = null, $offset = null)\n {\n $builder = $this->getOrdersQueryBuilder($customerId, $filter, $orderBy);\n if ($limit !== null) {\n $builder->setFirstResult($offset)\n ->setMaxResults($limit);\n }\n\n return $builder->getQuery();\n }", "public function getOrders($params)\n\t{\n\t\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t<packet version=\"1.0.0.0\">\n\t\t\t\t\t<action>get_orders</action>\n\t\t\t\t\t<order_status>'.$params['order_status'].'</order_status>\n\t\t\t\t\t<start_date>'.$params['start_date'].'</start_date>\n\t\t\t\t\t<end_date>'.$params['end_date'].'</end_date>\n\t\t\t\t</packet>';\n\n\t\t$document = simplexml_load_string($this->sendXml($xml));\n\t\t// Get array with the customer orders\n\t\treturn $this->validateAndGetXpath($document, '//orders');\n\t}", "public function search($params)\n {\n $query = Orders::find();\n\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort'=>[\n 'defaultOrder'=>[\n 'id'=>SORT_DESC,\n 'status' => SORT_ASC,\n 'manager'=>SORT_ASC,\n ]\n ]\n ]);\n\n $this->load($params);\n\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // проверим роль пользователя и для КЛИЕНТА выведем только его заказы,\n // а для остальных ролей - все заказы\n $role = Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId());\n\n if(isset($params['fuid'])){\n UserController::actionSetFakeUid($params['fuid']);\n }\n\n // если в GET пришел id клиента, то выберем заказ только этого клиента\n // (работает только для manager+)\n if(isset($params['uid'])){\n $uid = $params['uid'];\n }\n else\n $uid = $this->uid;\n\t\t\n\n if($role['user']){\n $uid = Yii::$app->user->getId();\n }\n\t\t\n\t\t// текущие/история заказов\n\t\tif(isset($params['complete']))\n\t\t\t$status = ['in', 'status', [20, 30]];\n\t\telse\n\t\t\t$status = ['not in', 'status', [20, 30]];\n\n // выбор диапазона дат\n if(isset($params['daterange'])){\n $daterange = trim($params['daterange']);\n if($daterange != ''){\n $arr = explode(' - ', $daterange);\n if(count($arr) == 2){\n $date_start = $arr[0];\n $date_end = $arr[1].' 23:59:59';\n\n $between = ['between', 'order_date', $date_start, $date_end];\n }\n }\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id' => $this->id,\n 'uid' => $uid,\n 'deliv_date' => $this->deliv_date,\n\t\t\t'deliv_name' => $this->deliv_name,\n\t\t\t'deliv_phone' => $this->deliv_phone,\n 'cost' => $this->cost,\n 'payed' => $this->payed,\n //'order_date' => $this->order_date,\n 'update_date' => $this->update_date,\n //'manager' => $manager,\n //'status' => $status //$this->status,\n ]);\n\n //$query->andFilterWhere(['like', 'name', $this->name])\n $query->andFilterWhere(['like', 'filling', $this->filling])\n ->andFilterWhere(['like', 'description', $this->description])\n ->andFilterWhere(['like', 'address', $this->address])\n\t\t\t//->andFilterWhere($status)\n //->andFilterWhere($manager)\n ->andFilterWhere($between ? $between : [$this->order_date]);\n\n // если не задана строка поиска, то выводим только определенный статус\n if(!$params['OrdersSearch']['name']){\n $query->andFilterWhere($status);\n }\n\n /*if($role['user']){\n $query->andFilterWhere([\n 'manager' => $this->manager\n ]);\n }\n else*/\n if($role['manager'] && !isset($params['all'])){\n $query->andFilterWhere(['in', 'manager', [0, Yii::$app->user->getId()]]);\n }\n else{\n $query->andFilterWhere([\n 'manager' => $this->manager\n ]);\n }\n\n /* простой поиск по имени клиента, номеру заказа, названию торта */\n if($params['OrdersSearch']['name']){\n\n // строка поиска\n $search_string = $params['OrdersSearch']['name'];\n\n // дополнительное условие для выборки на основании строки поиска\n $query->andFilterWhere($this->searchByString($search_string));\n }\n /* /простой поиск по имени клиента, номеру заказа, названию торта */\n\n return $dataProvider;\n }", "public static function getActiveEntitiesOrderQuery($params) {\r\n $final_params = array(\r\n \"order_by\" => \"id\",\r\n \"order_direction\" => \"ASC\",\r\n \"limit\" => null,\r\n \"add_translation\" => false,\r\n \"q\" => null,\r\n \"ids\" => null,\r\n \"ids_not\" => null,\r\n \"offset\" => null,\r\n \"site_id\" => null\r\n );\r\n\r\n if(!isset($params[\"order_by\"])){\r\n $params[\"order_by\"] = \"id\";\r\n $params[\"order_direction\"] = \"ASC\";\r\n }\r\n if($params[\"order_by\"] == \"RAND()\"){\r\n $params[\"order_direction\"] = null;\r\n $final_params[\"order_direction\"] = null;\r\n }\r\n\r\n foreach($final_params as $key => $value){\r\n if(isset($params[$key])){\r\n $final_params[$key] = $params[$key];\r\n }\r\n }\r\n\r\n\r\n $query = (isset($final_params[\"q\"]) && !is_null($final_params[\"q\"])) ?\r\n $final_params[\"q\"] :\r\n self::addActiveEntitiesQuery();\r\n\r\n $query_params = $query->getParams();\r\n //Project::prePrint($query_params);\r\n //Project::prePrint($query->());\r\n //Project::prePrint($query->getFlattenedParams());\r\n //Project::prePrint(count($query_params[\"join\"]));\r\n\r\n //if(count($query_params[\"join\"])){\r\n // echo \"c\"; exit;\r\n // Project::prePrint($query_params[\"join\"],1);\r\n //}\r\n //Project::prePrint();\r\n //exit;\r\n\r\n $root_alias = $query->getRootAlias();\r\n\r\n if ($final_params[\"add_translation\"]) {\r\n $query->leftJoin($root_alias.\".Translation atr\");\r\n }\r\n\r\n if(!is_null($final_params[\"offset\"])){\r\n $query->offset($final_params[\"offset\"]);\r\n }\r\n\r\n if(!is_null($final_params[\"ids_not\"])){\r\n $query->andWhereNotIn($root_alias.\".id\", $final_params[\"ids_not\"]);\r\n }\r\n\r\n if(!is_null($final_params[\"ids\"])){\r\n\r\n $final_params_ids = $final_params[\"ids\"];\r\n\r\n if(array_search(-1, $final_params_ids)){\r\n $final_params_ids[] = -1;\r\n }\r\n\r\n $query->andWhereIn($root_alias.\".id\", $final_params[\"ids\"]);\r\n }\r\n if (!is_null($final_params[\"site_id\"])) {\r\n $query->andWhere($root_alias.\".site_id = ?\", $final_params[\"site_id\"]);\r\n }\r\n if (!is_null($final_params[\"limit\"])) {\r\n $query->limit($final_params[\"limit\"]);\r\n }\r\n\r\n if (is_array($final_params[\"order_by\"])) {\r\n /*\r\n if (count($final_params[\"order_by\"]) != count($final_params[\"order_direction\"])) {\r\n $final_params[\"order_direction\"] = 'ASC';\r\n }\r\n\r\n foreach ($final_params[\"order_by\"] as $key => $o_by) {\r\n if (!is_array($final_params[\"order_direction\"])) {\r\n $sort = $final_params[\"order_direction\"];\r\n } else {\r\n $sort = $final_params[\"order_direction\"][$key];\r\n }\r\n if ($key == 0) {\r\n $query->orderBy($o_by . ' ' . $sort);\r\n } else {\r\n $query->addOrderBy($o_by . ' ' . $sort);\r\n }\r\n }\r\n */\r\n } else {\r\n if ($final_params[\"order_by\"] == \"preordered_ids\") {\r\n $query->orderBy(' FIELD(id, ' . implode(',', $final_params[\"ids\"]).')');\r\n } else {\r\n $query->orderBy($final_params[\"order_by\"] . ' ' . $final_params[\"order_direction\"]);\r\n }\r\n }\r\n\r\n return $query;\r\n }", "public function findBy($params);", "static function getOrders($params){\n $con = $params['dbconnection'];\n $where = \"\";\n if($params['search'] != ''){\n $where = \" AND (of.`title` LIKE '%{$params['search']}%' OR\n\t\tou.`name` LIKE '%{$params['search']}%' OR\n\t\to.`id` ='{$params['search']}' OR\n\t\to.`user_id` ='{$params['search']}')\";\n }\n if($params['user_id'] != ''){\n $where .= \" AND o.`user_id` ='{$params['user_id']}'\";\n }\n if($params['start_date'] != \"\" && $params['end_date'] != \"\"){\n $where .= \" AND CAST(o.`created_at` AS DATE) >= '{$params['start_date']}' AND o.`created_at` <= '{$params['end_date']}'\";\n }\n $allOrders = [];\n $allOrdersCount = \"\";\n if($allOrdersCount = $con->query(\"SELECT\n\t\tof.`id`\n\t\tFROM `offers` as of\n\t\tINNER JOIN `outlets` as ou ON(of.`outlet_id`=ou.`id`)\n\t\tINNER JOIN `orders` as o ON(of.`id`=o.`offer_id` )\n\t\tINNER JOIN `users` as u ON(u.`id`=o.`user_id` )\n\t\tLEFT OUTER JOIN `reviews` r ON(r.`order_id`=o.`id`)\n\t\tWHERE of.`id` =of.`id` \".$where.\"\")\n ){\n $allOrdersCount = $allOrdersCount->num_rows;\n }\n $query = \"SELECT\n\t\tof.`id`,\n\t\tof.`outlet_id`,\n\t\tof.`title`,\n\t\tof.`image`,\n\t\tof.`approx_saving`,\n\t\to.`id` as order_id,\n\t\to.`user_id`,\n\t\tu.`name` as user_name,\n\t\tou.`name` as outlet_name,\n\t\tou.`address` as outlet_address,\n\t\to.`created_at` as order_created_at,\n\t\tr.id as review\n\t\tFROM `offers` as of\n\t\tINNER JOIN `outlets` as ou ON(of.`outlet_id`=ou.`id`)\n\t\tINNER JOIN `orders` as o ON(of.`id`=o.`offer_id` )\n\t\tINNER JOIN `users` as u ON(u.`id`=o.`user_id` )\n\t\tLEFT OUTER JOIN `reviews` r ON(r.`order_id`=o.`id`)\n\t\tWHERE of.`id` =of.`id` \".$where.\"\n\t\tORDER BY o.`id` DESC LIMIT \".$params['index'].\",\".$params['index2'].\" \";\n $result = mysqli_query($con, $query);\n if(mysqli_error($con) != ''){\n return \"mysql_Error:-\".mysqli_error($con);\n }\n if(mysqli_num_rows($result) > 0){\n while($row = mysqli_fetch_assoc($result)){\n if($row['review'] == null){\n $row['review'] = 'No';\n }\n else{\n $row['review'] = 'Yes';\n }\n $row['totalsaving'] = DbMethods::totalSaving($params);\n $allOrders[] = $row;\n }\n }\n if($allOrdersCount != ''){\n return [\"allOrders\" => $allOrders, \"allOrdersCount\" => $allOrdersCount];\n }\n else{\n return '';\n }\n }", "public function getOrdersList($params = [], $headers = [])\n {\n $company = $params['company_code'] ?? $headers['company_code'];\n $store = $params['store_code'] ?? $headers['store_code'];\n $limit = ROWS_PER_PAGE;\n $offset = 0;\n $hasBusinessHour = false;\n\n $this->db->select('*')->where([\n 'pos_company_code' => $company,\n 'pos_store_code' => $store,\n 'delete_flg' => UNDELETE_FLAG_VALUE\n ]);\n\n $this->db->where_in('receipt_date', explode(',', trim($params['order_receive'])));\n\n // without getting all\n $isNotGetAll = !isset($params['get_all']) || in_array($params['get_all'], ['false', false]);\n\n if ($isNotGetAll) {\n // check the bussiness hour\n $hasBusinessHour = in_array($params['business_hour'] ?? null, ['true', true], true);\n // only get the orders with resevered (0) or cancelled (5) status\n $this->db->where_in('order_status', [ORDER_STATUS_RESERVED, ORDER_STATUS_CANCELLED]);\n // check the limitation of the returned records\n if (isset($params['order_limit'])) {\n $limit = (int)$params['order_limit'];\n }\n // for paging\n if (isset($params['page'])) {\n $page = (int)$params['page'];\n $offset = $page < 1 ? 0 : ($page - 1) * $limit;\n }\n }\n\n // get the orders list\n $orders = $this->db->limit($limit, $offset)->get($this->table());\n\n // empty\n if ($orders->num_rows() <= 0) {\n return [];\n }\n\n $response = [\n 'list' => [\n 'company_code' => $company,\n 'store_no' => $store,\n 'calendar_date' => $params['order_receive'] ?? '',\n 'request_time' => date('Y-m-d H:i:s'),\n 'orders' => [],\n ],\n ];\n\n if ($hasBusinessHour) {\n $response['list']['business_hour'] = $this->getBusinessHour($company, $store);\n }\n\n // get the currency by store and company\n $currency = $this->_getCurrency($company, $store);\n\n foreach ($orders->result_array() as $order) {\n $response['list']['orders'][] = $this->getResponseFormat($order, $currency);\n }\n\n return $response;\n }", "public function getActivePaymentsQueryBuilder($filter = null, $order = null)\n {\n $builder = $this->createQueryBuilder('p');\n $builder->select(\n [\n 'p.id as id',\n 'p.name as name',\n 'p.description as description',\n 'p.position as position',\n 'p.active as active',\n ]\n );\n $builder->where('p.active = 1');\n\n if ($filter !== null) {\n $builder->addFilter($filter);\n }\n if ($order !== null) {\n $builder->addOrderBy($order);\n }\n\n return $builder;\n }", "public function search($params)\n {\n $query = Orders::find()->joinWith(['employee']);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'sort'=> ['defaultOrder' => ['OrderId' => SORT_DESC]]\n ]);\n\t\t$dataProvider->sort->attributes['EmployeeName'] = [\n\t\t\t'asc' => ['Employee.EmployeeName' => SORT_ASC],\n\t\t\t'desc' => ['Employee.EmployeeName' => SORT_DESC],\n\t\t\t\n\t\t];\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'OrderId' => $this->OrderId,\n 'EmployeeId' => $this->EmployeeId,\n\t\t\t'CompanyId' => $this->CompanyId,\n 'OrderTotalPrice' => $this->OrderTotalPrice,\n 'PaymentType' => $this->PaymentType,\n\t\t\t'MonthlySubscription'=>$this->MonthlySubscription,\n 'DeliveryAddressID' => $this->DeliveryAddressID,\n 'EmiPlanId' => $this->EmiPlanId,\n 'EmiPlanPeriod' => $this->EmiPlanPeriod,\n 'EmiAmount' => $this->EmiAmount,\n 'CreditBalanceUsed' => $this->CreditBalanceUsed,\n 'OrderType' => $this->OrderType,\n 'OrderStatus' => $this->OrderStatus,\n 'EmiGenerateStatus' => $this->EmiGenerateStatus,\n 'CreatedDate' => $this->CreatedDate,\n\t\t\t'ConfirmDate' => $this->ConfirmDate,\n 'UpdatedDate' => $this->UpdatedDate,\n 'IsDelete' => $this->IsDelete,\n ]);\n\t\t$query->andFilterWhere(['like', 'Employee.EmployeeName', $this->EmployeeName]);\n $query->andFilterWhere(['like', 'OrderIdentifier', $this->OrderIdentifier])\n ->andFilterWhere(['like', 'CartIdentifire', $this->CartIdentifire]);\n\n return $dataProvider;\n }", "public function findResourcesProvidedByAccountAndOrgAccounts($filters = array())\n {\n return $this->listResources($filters, 'provided_by');\n }", "public function findorder()\n\t\t{\n\t\t\t$filter = array();\n\t\t\t$orderID = $_POST['order_id'];\n\t\t\t$lastName = $_POST['last_name'];\n\t\t\t$order_date = $_POST['order_date'];\n\t\t\t//$stageDBO = databaseConnection::getInstance();\n\t\t\t//$data = $stageDBO->select('order_type', 'order',['order_id' => $orderID]);\n\t\t\t//if ($data[0] != NULL){\n\n\t\t\t//}\n\t\t\t//CHECKING WHAT FILTERS ARE APPLIED\n\t\t\tif(!empty($orderID) && !empty($lastName) && !empty($order_date))\n\t\t\t{\n\t\t\t\t$filter['order_id'] = $orderID;\n\t\t\t\t$filter['order_date'] = $orderDate;\n\t\t\t\t$filter['last_name'] = $lastName;\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(!empty($orderID) && empty($lastName) && empty($order_date))\n\t\t {\n\t\t\t \tunset($filter['last_name']);\n\t\t\t \t$filter['order_id'] = $orderID;\n\t\t \tunset($filter['order_date']);\n\t\t\t}\n\n\t\t else if(empty($orderID) && !empty($lastName) && empty($order_date))\n\t\t {\n\t\t\t \t$filter['last_name'] = $lastName;\n\t\t\t \tunset($filter['order_id']);\n\t\t \tunset($filter['order_date']);\n\t\t\t}\n\n\t\t\telse if(empty($orderID) && empty($lastName) && !empty($order_date))\n\t\t {\n\t\t\t \t$filter['order_date'] = $order_date;\n\t\t\t \tunset($filter['order_id']);\n\t\t \tunset($filter['last_name']);\n\t\t\t}\n\n\t\t\telse if(!empty($orderID) && empty($lastName) && !empty($order_date))\n\t\t {\n\t\t\t \t$filter['order_date'] = $order_date;\n\t\t\t \t$filter['order_id'] = $orderID;\n\t\t \tunset($filter['last_name']);\n\t\t\t}\n\n\t\t\telse if(empty($orderID) && !empty($lastName) && !empty($order_date))\n\t\t {\n\t\t\t \t$filter['order_date'] = $order_date;\n\t\t\t \t$filter['last_name'] = $lastName;\n\t\t \tunset($filter['order_id']);\n\t\t\t}\n\n\t\t\telse if(!empty($orderID) && !empty($lastName) && empty($order_date))\n\t\t {\n\t\t\t \t$filter['order_id'] = $orderID;\n\t\t\t \t$filter['last_name'] = $lastName;\n\t\t \tunset($filter['order_date']);\n\t\t\t}\n\n\n\n\t\t\trequire_once('views/pages/findorder.php');\n\t\t\t$stageDBO = DatabaseObjectFactory::build('order');\n\t\t\t$arr = ['order_id','order_date','total_price'];\n\t\t\tif (!empty($lastName)){\n\t\t\t\t$arr = ['order_id','customer_id','first_name','last_name','order_date','total_price'];\n\t\t\t\t$stageDBO->SetJoin(['[><]customer' => 'customer_id']);\n\t\t\t}\n\t\t\tif(count($filter) > 1) //More than one filter needs an AND statement\n\t\t\t{\n\t\t\t\t$order = $stageDBO->getRecords($arr, [\"AND\" => $filter]);\n\t\t\t}\n\n\t\t\telse //when there is only one filter, no and statement is required\n\t\t\t{\n\t\t\t\t$order = $stageDBO->getRecords($arr, $filter);\n\t\t\t}\n\n\t\t\t\n\t\n\t\t\tif(count($order) == 0) //When no orders are returned to the $order variable\n\t\t\t{\n\t\t\t\tprint \"<h3>No Orders Found</h3>\";\n\t\t\t}\n\n\t\t\telse if(count($order) > 1) //With multiple results usually found on Order Date or Name searches. \n\t\t\t{\n\n\t\t\t\tprint \"<table><th>Order ID</th><th>Customer Name</th><th>Order Date</th><th>Total Price</th>\";\n\t\t\t\tforeach($order as $o)\n\t\t\t\t{\n\t\t\t\t\tprint \"<tr><td>\n\t\t\t\t\t<form action='?controller=order&action=viewOrder' method= 'post'>\n\t\t\t\t\t\t<input type='submit' class = 'button' value='View Order \".$o['order_id'].\"'>\n\t\t\t\t\t\t<input type='hidden' name='orderID' value='\".$o['order_id'].\"'>\n\t\t\t\t\t</form></td>\";\n\t\t\t\t\tprint \"<td>\".$o['first_name'] . \" \" . $o['last_name'].\"</td>\";\n\t\t\t\t\tprint \"<td>\".$o['order_date'] . \"</td>\";\n\t\t\t\t\tprint \"<td>\".$o['total_price'].\"</td></tr>\";\n\t\t\t\t\t\n\t\t\t\t}\n\n\n\t\t\t\tprint \"</table></div>\";\n\t\t\t}\n\n\t\t\telse //For when the order returned is only 1.\n\t\t\t{\t\n\t\t\t\tprint \"<table><th>Order ID</th><th>Customer Name</th><th>Order Date</th><th>Total Price</th>\";\n\n\t\t\t\tif(!empty($order[0]['customer_id'])) //For Orders that have customer information\n\t\t\t\t{\t$stageDBO = DatabaseObjectFactory::build('order_details');\n\t\t\t\t\t$arr = ['item_id', 'name', 'item_price', 'qty'];\n\t\t\t\t\t$stageDBO->SetJoin(['[><]item' => 'item_id']);\n\t\t\t\t\t$items = $stageDBO->getRecords($arr, ['order_id' => $order[0]['order_id']]);\n\t\t\t\t\tprint \"<tr><td>\".$order[0]['order_id'].\"</td>\";\n\t\t\t\t\tprint \"<td>\".$order[0]['first_name'] . \" \" . $order[0]['last_name'].\"</td>\";\n\t\t\t\t\tprint \"<td>\".$order[0]['order_date'] .\"</td>\";\n\t\t\t\t\tprint \"<td>\".$order[0]['total_price'].\"</td>\";\n\t\t\t\t\tprint \"</table>\";\n\n\t\t\t\t\tprint \"<h4>Items on Order \".$order[0]['order_id'].\":</h4>\";\n\t\t\t\t\tprint \"<table><th>Item ID</th><th>Item Name</th><th>Item Price</th><th>Quantity</th>\";\n\n\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\tprint \"<tr><td>\".$item['item_id'].\"</td>\n\t\t\t\t\t\t\t <td>\".$item['name'].\"</td>\n\t\t\t\t\t\t\t <td>\".$item['item_price'].\"</td>\n\t\t\t\t\t\t\t <td>\".$item['qty'].\"</td></tr>\";\n\t\t\t\t\t}\n\n\t\t\t\t\tprint \"</table>\";\n\t\t\t\t}\n\n\t\t\t\telse //FOR SALE ORDERS, which have no Customer Information\n\t\t\t\t{\n\t\t\t\t\t$stageDBO = DatabaseObjectFactory::build('order');\n\t\t\t\t\t$arr = ['order_id','order_date','total_price'];\n\t\t\t\t\t$order = $stageDBO->getRecords($arr,$filter);\n\n\t\t\t\t\t$stageDBO = DatabaseObjectFactory::build('order_details');\n\t\t\t\t\t$arr = ['item_id', 'name', 'item_price', 'qty'];\n\t\t\t\t\t$stageDBO->SetJoin(['[><]item' => 'item_id']);\n\t\t\t\t\t$items = $stageDBO->getRecords($arr, ['order_id' => $order[0]['order_id']]);\n\t\t\t\t\tprint \"<tr><td>\".$order[0]['order_id'].\"</td>\";\n\t\t\t\t\tprint \"<td>N/A</td>\";\n\t\t\t\t\tprint \"<td>\".$order[0]['order_date'] .\"</td>\";\n\t\t\t\t\tprint \"<td>\".$order[0]['total_price'].\"</td>\";\n\t\t\t\t\tprint \"</table>\";\n\n\t\t\t\t\tprint \"<h4>Items on Order \".$order[0]['order_id'].\":</h4>\";\n\t\t\t\t\tprint \"<table><th>Item ID</th><th>Item Name</th><th>Item Price</th><th>Quantity</th>\";\n\n\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\tprint \"<tr><td>\".$item['item_id'].\"</td>\n\t\t\t\t\t\t\t <td>\".$item['name'].\"</td>\n\t\t\t\t\t\t\t <td>\".$item['item_price'].\"</td>\n\t\t\t\t\t\t\t <td>\".$item['qty'].\"</td></tr>\";\n\t\t\t\t\t}\n\n\t\t\t\t\tprint \"</table>\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t\techo '</div>';\n\n\t\t}", "public function get_orders( $fields = null, $filter = array() ) {\n\n // get the WP_Query instance\n $query = $this->query_orders( $filter );\n\n // initialise the orders array\n $orders = array();\n\n // populate the orders array\n foreach ( $query->posts as $order_id ) {\n\n if ( !$this->is_readable( $order_id ) )\n continue;\n\n $orders[] = current( $this->get_order( $order_id, $fields, $filter ) );\n }\n\n // add pagination headers\n $this->server->add_pagination_headers( $query );\n\n //return for output\n return array( 'orders' => $orders );\n }", "public static function FindByCustomerProperties($params, $expectsOne=false){\r\n\t\t$ordersArray = array();\r\n\t\tif(is_array($params)){\r\n\t\t\t$selectFields = array(\r\n\t\t\t\t'users.id',\r\n\t\t\t\t'users.date',\r\n\t\t\t\t'users.customerId',\r\n\t\t\t\t'users.description',\r\n\t\t\t\t'users.type',\r\n\t\t\t\t'users.state',\r\n\t\t\t\t'users.total',\r\n\t\t\t\t'users.advance',\r\n\t\t\t\t'users.deliveryDate',\r\n\t\t\t\t'users.amount',\r\n\t\t\t\t'users.paper',\r\n\t\t\t\t'users.colorPaper',\r\n\t\t\t\t'users.weight',\r\n\t\t\t\t'users.machine',\r\n\t\t\t\t'users.termination',\r\n\t\t\t\t'users.fromNumber',\r\n\t\t\t\t'users.toNumber',\r\n\t\t\t\t'users.observation',\r\n\t\t\t\t'users.userId'\r\n\t\t\t);\r\n\t\t$joinArray = array('customers'=>'customers.id = orders.customerId');\r\n\t\t$whereArray = array();\r\n\t\tforeach ($params as $key => $value){\r\n\t\t\tif(!empty($value)){\r\n\t\t\t\t$parsedValue = self::$IsUsingUtf8 ? htmlentities(utf8_decode($value)) : htmlentities($value);\r\n\t\t\t\tarray_push($whereArray, 'customers.'.$key.' = \"'.$parsedValue.'\"');\r\n\t\t\t}\r\n\t\t}\r\n\t\t$where = implode(' AND ', $whereArray);\r\n\t\t$query = new Query();\r\n\t\t$query->createSelect(array('*'), 'orders', $joinArray, $where);\r\n\t\t$arrayArraysOrder = $query->execute(true);\r\n\t\tif(!empty($arrayArraysOrder)){\r\n\t\t\tif($expectsOne){\r\n\t\t\t\treturn self::CreateObjectFromArray($arrayArraysOrder[0]);\r\n\t\t\t}\r\n\t\t\tforeach($arrayArraysOrder as $arrayOrder){\r\n\t\t\t\tarray_push($ordersArray, self::CreateObjectFromArray($arrayOrder));\r\n\t\t\t}\r\n\t\t\t} elseif($expectsOne){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $ordersArray;\r\n\t}", "public function getAllPaymentsQueryBuilder($filter = null, $order = null)\n {\n $builder = $this->createQueryBuilder('p');\n $builder->select(\n [\n 'p.id as id',\n 'p.name as name',\n 'p.description as description',\n 'p.position as position',\n 'p.active as active',\n ]\n );\n if ($filter !== null) {\n $builder->addFilter($filter);\n }\n if ($order !== null) {\n $builder->addOrderBy($order);\n }\n\n return $builder;\n }", "public function searchCertainNumberOfOrt($offset, $limit, $orderings, $searchArr, $mode = 1)\n {\n $query = $this->createQuery();\n /** @var $queryBuilder \\Doctrine\\ORM\\QueryBuilder **/\n $queryBuilder = ObjectAccess::getProperty($query, 'queryBuilder', true);\n $queryBuilder\n ->resetDQLParts()\n ->select('ort')\n ->from('\\Subugoe\\GermaniaSacra\\Domain\\Model\\Ort', 'ort');\n $operator = 'LIKE';\n $isOrtInSearchArray = false;\n if (is_array($searchArr) && count($searchArr) > 0) {\n $i = 1;\n foreach ($searchArr as $k => $v) {\n $entity = $this->entities[$k];\n $parameter = $k;\n $searchStr = trim($v);\n $value = '%' . $searchStr . '%';\n $filter = $entity . '.' . $k;\n if ($k === 'bistum') {\n $queryBuilder->innerJoin('ort.bistum', 'bistum');\n $isOrtInSearchArray = true;\n }\n if ($i === 1) {\n $queryBuilder->where($filter . ' ' . $operator . ' :' . $parameter);\n $queryBuilder->setParameter($parameter, $value);\n } else {\n $queryBuilder->andWhere($filter . ' ' . $operator . ' :' . $parameter);\n $queryBuilder->setParameter($parameter, $value);\n }\n $i++;\n }\n }\n if ($orderings[0] === 'bistum' && !$isOrtInSearchArray) {\n $queryBuilder->innerJoin('ort.bistum', 'bistum');\n }\n if ($mode === 1) {\n $sort = $this->entities[$orderings[0]] . '.' . $orderings[0];\n $order = $orderings[1];\n $queryBuilder->orderBy($sort, $order);\n $queryBuilder->setFirstResult($offset);\n $queryBuilder->setMaxResults($limit);\n return $query->execute();\n } else {\n return $query->count();\n }\n }", "public function get_orders() {\n $results = $this->DB->run('\n SELECT * FROM orders WHERE buyer_account_id =:buyer_account_id\n ', [\n 'buyer_account_id' => $this->id\n ]);\n\n if (!empty($results[0])) {\n foreach ($results as $result) {\n $id = $result['id'];\n\n $this->Orders[$id] = new Order([\n 'DB' => $this->DB,\n 'id' => $id\n ]);\n\n if (empty($result['charge_id'])) {\n $this->ActiveOrder = $this->Orders[$id];\n } \n }\n } else {\n $this->Orders = false;\n $this->ActiveOrder = false;\n }\n }", "public function ObjectsList($filter = null, $params = null)\n {\n //====================================================================//\n // Stack Trace\n Splash::log()->trace(__CLASS__, __FUNCTION__);\n /* Get Object Model Collection */\n $Collection = Mage::getModel('sales/order')\n ->getCollection()\n ->addAttributeToSelect('*');\n //====================================================================//\n // Setup filters\n // Add filters with names convertions. Added LOWER function to be NON case sensitive\n if ( !empty($filter) && is_string($filter)) {\n $Collection->addAttributeToFilter( 'increment_id', array( 'like' => \"%\" . $filter . \"%\" ) ); \n } \n \n //====================================================================//\n // Setup sortorder\n $sortfield = empty($params[\"sortfield\"])?\"created_at\":$params[\"sortfield\"];\n // Build ORDER BY\n $Collection->setOrder($sortfield, $params[\"sortorder\"]);\n //====================================================================//\n // Compute Total Number of Results\n $total = $Collection->getSize();\n //====================================================================//\n // Build LIMIT\n $Collection->setPageSize($params[\"max\"]);\n if (isset($params[\"max\"]) || ($params[\"max\"] > 0)) {\n $Collection->setCurPage(1 + (int) ($params[\"offset\"] / $params[\"max\"]));\n }\n //====================================================================//\n // Init Result Array\n $Data = array();\n //====================================================================//\n // For each result, read information and add to $Data\n foreach ($Collection->getItems() as $key => $Order) {\n $CurrencuSymbol = \" \" . Mage::app()->getLocale()->currency($Order->getOrderCurrencyCode())->getSymbol();\n $Data[$key][\"id\"] = $Order->getEntityId();\n $Data[$key][\"increment_id\"] = $Order->getIncrementId();\n $Data[$key][\"created_at\"] = $Order->getCreatedAt();\n $Data[$key][\"grand_total\"] = round($Order->getGrandTotal(), 2) . $CurrencuSymbol;\n $Data[$key][\"state\"] = $this->getStandardOrderState($Order->getState());\n }\n //====================================================================//\n // Prepare List result meta infos\n $Data[\"meta\"][\"current\"] = count($Data); // Store Current Number of results\n $Data[\"meta\"][\"total\"] = $total; // Store Total Number of results\n Splash::log()->deb(\"MsgLocalTpl\", __CLASS__, __FUNCTION__, (count($Data)-1).\" Orders Found.\");\n return $Data;\n }", "public function listOrders($request);", "public static function FindBy($params, $expectsOne=false){\r\n\t\t$ordersArray = array();\r\n\t\tif(is_array($params)){\r\n\t\t\t$whereArray = array();\r\n\t\t\tforeach ($params as $key => $value){\r\n\t\t\t\tif(!empty($value)){\r\n\t\t\t\t\t$parsedValue = self::$IsUsingUtf8 ? htmlentities(utf8_decode($value)) : htmlentities($value);\r\n\t\t\t\t\tarray_push($whereArray, $key.' = \"'.$parsedValue.'\"');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$where = implode(' AND ', $whereArray);\r\n\t\t\t$query = new Query();\r\n\t\t\t$query->createSelect(array('*'), 'orders', null, $where);\r\n\t\t\t$arrayArraysOrder = $query->execute(true);\r\n\t\t\tif(!empty($arrayArraysOrder)){\r\n\t\t\t\tif($expectsOne){\r\n\t\t\t\t\treturn self::CreateObjectFromArray($arrayArraysOrder[0]);\r\n\t\t\t\t}\r\n\t\t\t\tforeach($arrayArraysOrder as $arrayOrder){\r\n\t\t\t\t\tarray_push($ordersArray, self::CreateObjectFromArray($arrayOrder));\r\n\t\t\t\t}\r\n\t\t\t} elseif($expectsOne){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $ordersArray;\r\n\t}", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with(['position']);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n if (isset($filter->position)) {\n $query->where('position_id',$filter->position);\n }\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'created_at';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function getOrdersForPaginate()\n {\n $query = $this->createQueryBuilder(\"c\")\n ->orderBy(\"c.id\",'DESC')\n ->where(\"c.archive = 0\")\n ->getQuery();\n\n return $query;\n }", "public function search($params)\n {\n $query = Order::find();\n \n $query->orderBy(['created_at' => SORT_DESC]);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n if ($this->load($params) && !$this->validate()) {\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'id' => $this->id,\n 'user_id' => $this->user_id,\n 'country' => $this->country,\n 'province' => $this->province,\n 'city' => $this->city,\n 'district' => $this->district,\n 'payment_method' => $this->payment_method,\n 'payment_status' => $this->payment_status,\n 'payment_id' => $this->payment_id,\n 'payment_fee' => $this->payment_fee,\n 'shipment_status' => $this->shipment_status,\n 'shipment_id' => $this->shipment_id,\n 'shipment_fee' => $this->shipment_fee,\n 'amount' => $this->amount,\n 'tax' => $this->tax,\n 'status' => $this->status,\n 'paid_at' => $this->paid_at,\n 'shipped_at' => $this->shipped_at,\n 'created_at' => $this->created_at,\n 'updated_at' => $this->updated_at,\n 'created_by' => $this->created_by,\n 'updated_by' => $this->updated_by,\n ]);\n\n $query->andFilterWhere(['like', 'sn', $this->sn])\n ->andFilterWhere(['like', 'consignee', $this->consignee])\n ->andFilterWhere(['like', 'address', $this->address])\n ->andFilterWhere(['like', 'zipcode', $this->zipcode])\n ->andFilterWhere(['like', 'phone', $this->phone])\n ->andFilterWhere(['like', 'mobile', $this->mobile])\n ->andFilterWhere(['like', 'email', $this->email])\n ->andFilterWhere(['like', 'remark', $this->remark])\n ->andFilterWhere(['like', 'payment_name', $this->payment_name])\n ->andFilterWhere(['like', 'shipment_name', $this->shipment_name])\n ->andFilterWhere(['like', 'invoice', $this->invoice]);\n\n return $dataProvider;\n }" ]
[ "0.59179115", "0.57677126", "0.5767572", "0.5686694", "0.55791754", "0.55783534", "0.557514", "0.555598", "0.55388427", "0.55268955", "0.5513347", "0.54992884", "0.54949415", "0.5481089", "0.5469869", "0.5463293", "0.5448088", "0.53851163", "0.5356152", "0.5355119", "0.53452224", "0.5339509", "0.5307107", "0.527763", "0.52627844", "0.5251144", "0.5250221", "0.5239726", "0.5234941", "0.52315" ]
0.61093324
0
Varre o array, contando quantas receitas foram encontradas.
function contadorArrayPesquisa() { global $resultado; $quantidade = 0; foreach ($resultado as $row): $quantidade++; endforeach; return $quantidade; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find_array() {\n\t\treturn $this->_run();\n\t}", "public function getcount(Request $request){\n parse_str($request->data, $searcharray);\n $targets = ['country','device','brand','model','os','osversion','browser','browserversion','language','connection'];\n \n $subscribers = new Subscriber();\n\n $qb = $subscribers->newQuery();\n $qb->where('_id','!=','1' );\n foreach($targets as $target){\n if(isset($searcharray[$target][0])){\n $qb->whereIn($target, $searcharray[$target]); \n } \n }\n \n\n $results = $qb->count();\n echo $results;\n \n }", "public function getResponseArray(): array;", "public function getCount() {\n return [ ];\n }", "private function getNData() : array\n {\n return $this->N;\n }", "function sockMerchant($n, $ar) {\n $ar_new = [];\n $count = 0;\n $n = count($ar);\n if ( !empty($n) ) {\n # code...\n foreach($ar as $val){\n if (isset($ar_new[$val])){\n $count++;\n unset($ar_new[$val]);\n }\n else{\n $ar_new[$val] = 1;\n }\n }\n }\n return $count;\n}", "public function getCountallSender($search = ''){\n\t\t$db = $this->getAdapter();\r\n\t\t$sql = $this->_buildQuery();\n\t\tif(!empty($search)){\r\n\t\t\t$sql = $this->_buildQuery($search);\r\n\t\t}\n\t\t$_result = $db->fetchAll($sql);\n\t\t//echo count($_result);exit();\r\n\t\treturn count($_result);\n\t}", "static function searching_messages($search){\n $datas = PDOQueries::search_messages($search);\n $response = array();\n foreach($datas as $post){\n Message::init();\n $tmp = new MessageDatas();\n ReturnDatas::format_datas($post,$tmp);\n $response[] = $tmp;\n }\n\n if(count($response) == 0)\n throw new \\PersonalizeException(3002,['search'=>$search]);\n\n return $response;\n }", "function calcular_horarios_disponibles_segun_req (){\n $horarios_disponibles=array();\n foreach($this->s__horarios_disponibles as $horario){\n if($this->verificar_existencia_de_horario($horario)){\n $horarios_disponibles[]=$horario;\n }\n }\n return $horarios_disponibles;\n }", "abstract function get_array_all();", "function arrayLength(){\n return count($this->array);\n }", "public function getResultEntries() : array;", "public function results(): array;", "function ArrayNumResult() {\r\n return mysql_num_rows($this->aResult);\r\n }", "function contarValores($newArray)\n {\n $contador = 0;\n for($i = 0; $i < count($newArray); $i++)\n {\n $contador++;\n }\n echo 'La cantidad de valores del Array es de:'. $contador . '<br>'; \n }", "public function getNbContactsBySociete()\r\n {\r\n return [];\r\n }", "public static function getTotalMobileMoneyTransferRequests() {\n\n\n\n $TotalCount = 0;\n $query = \"Select count(FundTransferRequestsID) as TotalCount from FundTransferRequests WHERE FundTransferType='Mobile Money'\";\n $res = Yii::$app->db->createCommand($query)->queryAll();\n if (count($res) > 0) {\n if ($res[0]['TotalCount'] != null)\n $TotalCount = $res[0]['TotalCount'];\n }\n $array = array(\n 0 => $TotalCount,\n );\n return $array;\n }", "public function data_length() {\n\t\t\t$data = array(\n\t\t\t\tarray(array(array()), array(0)),\n\t\t\t\tarray(array(array(1)), array(1)),\n\t\t\t\tarray(array(array(1, 2)), array(2)),\n\t\t\t\tarray(array(array(1, 2, 3)), array(3)),\n\t\t\t);\n\t\t\treturn $data;\n\t\t}", "public function getRecherche(){\n\t\t$rRecherche = Array();\n if(isset($_GET['recherche'])&& !empty($_GET['recherche'])){\n $motcle = $_GET['recherche'];\n\t\t$res = $this->idbd->query(\"SELECT * FROM articles WHERE (article_titre LIKE '%$motcle%') OR (article_contenu LIKE '%$motcle%')\");\n\t\tif($res->rowCount() > 0){\n while($row = $res->fetch(PDO::FETCH_ASSOC))\n $this->rRecherche[] = $row;\n }\n\t\treturn $this->rRecherche;\n\t}\n}", "public static function GetAll ():array{\n // Hago una consulta que limita el numero de resultados a 5\n $stmt = self::$dbh->prepare(self::$lista_pelis);\n $numpelis=5;\n if(!isset($_GET['pagina'] ) ||$_GET['pagina']<1){\n $_GET['pagina']=1;\n }\n $inicio = ($_GET['pagina']-1)*$numpelis;\n $tpelis = [];\n $stmt->bindParam(':inicio', $inicio,PDO::PARAM_INT);\n $stmt->bindParam(':numpelis', $numpelis,PDO::PARAM_INT);\n $stmt->execute();\n // Llamo a una funcion para saber el total de peliculas de la base de datos\n $totalpelis= modeloUserDB::GetTotal();\n $totalpelis=count($totalpelis);\n $stmt->setFetchMode(PDO::FETCH_CLASS, 'Pelicula');\n while ( $peli = $stmt->fetch()){\n $tpelis[] = $peli; \n }\n $array = array($tpelis,$totalpelis);\n /*Devuelvo un array con los resultados de la consulta y \n con el total de peliculas\n El total de peliculas lo voy a usar para dividirlo entre 5 y asi \n establecer el numero de paginas*/\n return $array;\n}", "function sockMerchant($n, $ar)\n{\n $numMatches = 0;\n $matchPile = [];\n //cycle through array, check if already in matchPile. yes - numMatches ++, remove match from matchpile. no - add to matchPile\n foreach ($ar as $sock) {\n if (in_array($sock, $matchPile)) {\n $numMatches++;\n $index = array_search($sock, $matchPile);\n unset($matchPile[$index]);\n } else {\n array_push($matchPile, $sock);\n }\n }\n return $numMatches;\n}", "public function cantidad_instalaciones(){\n\t\t$query=\"SELECT count(id_instalacion) as numeroInstalaciones \n\t\t\t\tfrom instalacion\";\n\t\t$rs=mysql_query($query);\n\t\t$array=array();\n\t\twhile($fila=mysql_fetch_assoc($rs)){\n\t\t\t$array[]=$fila;\n\t\t}\n\t\t\treturn $array;\n\t\t}", "public function getRows() {\r\n\t\treturn count($this->array);\r\n\t}", "public function count(){\n return count($this->array);\n }", "public function only() {\n\t\t$results = [];\n\t\t$argCount = func_num_args();\n\t\t$args = func_get_args();\n\n\t\tif ($argCount == 0) {\n\t\t\treturn null;\n\t\t} if ($argCount == 1 && is_array($args[0])) {\n\t\t\t$array = $args[0];\n\t\t} else {\n\t\t\t$array = $args;\n\t\t}\n\n\t\tforeach ($array as $value) {\n\t\t\t$results[$value] = $this->requestData[$value];\n\t\t}\n\n\t\treturn $results;\n\t}", "function obtener_casos(){\r\n$i=0;\r\n while ($clave_valor=each($_POST))\r\n {\r\n if (is_int(strpos($clave_valor[0],\"idp_\")))\r\n {\r\n $posfijo=substr($clave_valor[0],4);\r\n $items[$i]=$_POST['nro_caso_'.$posfijo];\r\n $i++;\r\n }\r\n }\r\n $items['cantidad']=$i;\r\n\r\n return $items;\r\n}", "function available_quantity_array () {\n\t\tif($this->number_inserted ($this->id)==0) return -1;\n\t\t\n\t\t$dish=new dish($this->id);\n\t\t$dish->fetch_data();\n\t\t\n\t\t$avail=array();\n\t\t\n\t\t$ingreds = $dish->ingredients();\n\t\t\n\t\tforeach ($ingreds as $ingred_id) {\n\t\t\t$ingred = new ingredient ($ingred_id);\n\t\t\t\n\t\t\t$stock = new stock_object;\n\t\t\tif ($stock_id=$stock->find_external($ingred_id, TYPE_INGREDIENT)) {\n\t\t\t\t$stock = new stock_object ($stock_id);\n\t\t\t\t$qty = new stock_ingredient_quantity;\n\t\t\t\tif($qty_id=$qty->find ($stock_id,$this->id)) {\n\t\t\t\t\t$qty = new stock_ingredient_quantity ($qty_id);\n\t\t\t\t\tif($qty->data['quantity']!=0) $avail[$ingred_id] = $stock->data['quantity']/$qty->data['quantity'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $avail;\n\t}", "public function getArray()\n {\n // No instantiationinginging!\n // ---------------------------------------------------\n // This time we don't need to create a new instance of\n // our TwitterFeedReader object. Instead we can use\n // the instance that has been injected through the\n // constructor of the class.\n //\n // So, we are now using dependency injection. Job done,\n // right? Better take a look at the tests.\n return $this->twitterFeedReader->getMessages();\n }", "public function getSearchByExtra(): array;", "public function searchArrayByQuery($query){\n\t\t$data = $this->db->query($query);\n\t\t$response = \"\";\n\t\t$registros = $data->fetchall(PDO::FETCH_ASSOC);\n\t\t\n\t\treturn $registros;\n\t}" ]
[ "0.5901661", "0.56300557", "0.551086", "0.5501408", "0.54828006", "0.5443939", "0.5374832", "0.5373687", "0.5362112", "0.5337705", "0.530197", "0.52462053", "0.5226821", "0.5220905", "0.5211936", "0.51746464", "0.5170973", "0.5158512", "0.5144068", "0.51348156", "0.513466", "0.51238203", "0.5108852", "0.51039535", "0.50925684", "0.5091063", "0.5090356", "0.5076141", "0.50747305", "0.5074377" ]
0.5867521
1
echo "func3" . $data;
function func3($data) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function out($data)\n { \n echo $data;\n }", "function pe($data)\n{\n echo \"<pre>\";\n var_dump($data);\n}", "function st_get_content_from_func($function,$data = array(),$settings = array()){\n if(!function_exists($function) || !is_string($function)){ \n return false;\n }\n \n ob_start();\n $old_cont = ob_get_contents();\n ob_end_clean();\n ob_start();\n call_user_func($function,$data,$settings);\n $content = ob_get_contents();\n ob_end_clean();\n echo $old_cont;\n return $content;\n \n}", "function _p($data){\n\techo '<pre>';\n\tprint_r($data);\n\techo '</pre>';\n}", "function dBug($data) {\n \techo \"<pre>\".var_export($data,1).\"</pre>\";\n}", "public static function outputFunction($func)\n {\n return '<?php ' . $func . ' ?>';\n }", "static function e( $function ){\n $args = func_get_args();\n $fname = array_shift($args);\n ob_start();\n call_user_func_array($fname, $args);\n return ob_get_clean();\n }", "function tell($data) {\n\techo($data.PHP_EOL);\n}", "function p($data){\n echo \"<pre>\";\n print_r($data);\n}", "private function dataEncode($data, $function) {\n \n switch($function) {\n case 'AddCustomer' :\n $encData = $this->customerEncode($data);\n return http_build_query(array(strtoupper('CUSTOMER')=>implode(chr(31), $encData)));\n break;\n case 'MultiSubscribe':\n return http_build_query($data, '', '&');\n break;\n case 'Promotion':\n return http_build_query($data, '', '&');\n break;\n case 'S2FS':\n \n return http_build_query($data, '', '&');\n break;\n } \n }", "protected function getAsfunctionFileContent($data){\n\n\t\t$dully = new Dully($this->options['templateDir']);\n\n\t\t$content = \"<?php\" . PHP_EOL;\n\t\t$content .= \"// This file is generated with asfunction\" . PHP_EOL; // date('d.m.Y H:i:s')\n\n\t\t$fetch_no = array();\n\n\t\tforeach($data as $namespace => $asfunctions){\n\n\t\t\t$content .= PHP_EOL . PHP_EOL . \"namespace \" . substr($namespace, 1) . \";\" . PHP_EOL . PHP_EOL . PHP_EOL;\n\n\t\t\tforeach($asfunctions as $asfunction){\n\n\t\t\t\t$template_file = $asfunction['template'] . '.tpl';\n\t\t\t\t$template_path = $this->options['templateDir'] . '/' . $template_file;\n\n\t\t\t\t// template fetch counter\n\t\t\t\tif(!isset($fetch_no[$asfunction['template']]))\n\t\t\t\t\t$fetch_no[$asfunction['template']] = 0;\n\n\t\t\t\tif(file_exists($template_path)){\n\t\t\t\t\t$dully->assign('asf', $asfunction);\n\t\t\t\t\t$dully->assign('fetch_no', ++$fetch_no[$asfunction['template']]);\n\t\t\t\t\t$content .= $dully->fetch($template_file);\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"Template file $template_path doesn't exists\", 507);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add getPropertyBySelector() function into the sfunction.php file\n\t\tif(isset($fetch_no['propSelector']))\n\t\t\t$content .= $dully->fetch('getPropertyBySelector.tpl');\n\n\t\treturn $content;\n\t}", "function getData() {}", "function fu3() {\n\t$bb = debug_backtrace();\n\t$line = $bb[0]['line'];\n\t$fil = $bb[0]['file'];\n\t$func = isset($bb[1]['function']) ? \"#\" . $bb[1]['function'] : '';\n\t$file = substr($fil, -15);\n\t$ret = \" ~ $file:$line$func\";\n\techo \"\\n<br/> \" . $ret;\n}", "function print_Data($data) {\n\techo '<pre>';\n\tprint_r($data);\n\techo '</pre>';\n}", "public function functionName8() {\n\t\t\t$say = \"say\";\n\t\t\t$fu = \"fu\";\n\t\t\treturn $say . \" \" . $fu;\n\t\t}", "function &getData( )\n {\n //print \"GetData\\n\";\n }", "function cliout($data){\n print ($this->cli) ? $data : \"\";\n\t}", "function pr($data)\r\n{\r\n echo \"<pre>\";\r\n print_r($data);\r\n echo \"</pre>\";\r\n}", "function get_data()\n\t{\n\t\t\n\t}", "function grafikkabkota ($data) {\n \n}", "function getData();", "function out( $data ){\n\t\tif(is_array($data)){\n\t\t\techo \"<pre>\".print_r($data, true).\"</pre>\";\n\t\t}else if(is_object($data)){\n\t\t\techo \"<pre>\".print_r($data,true).\"</pre>\";\n\t\t}else{\n\t\t\techo $data;\n\t\t}\n\t}", "function console( $data ) { \r\n\r\n\tif ( is_string( $data ) ) {\r\n\r\n\t\t//include the qutoes\r\n\t\t$json = \"'$data'\";\r\n\r\n\t} else {\r\n\r\n\t\t//make it json to show in the console\r\n\t\t$json = make_json( $data );\r\n\t}\r\n\t\r\n\techo \"<script>console.log( $json )</script>\\n\";\r\n}", "function sum1() {\r\n echo 10+10 . \"<br>\";\r\n}", "function pr($data) {\n echo \"<pre>\";\n print_r($data);\n echo \"</pre>\";\n}", "function pr($data)\n{\n echo \"<pre>\";\n print_r($data); // or var_dump($data);\n echo \"</pre>\";\n}", "function printData($data){\n\n extract($data);\n if(!isset($label)) $label = '';\n if(!isset($transval)) $transval = '';\n if(!isset($transAttr)) $transAttr = '';\n if(!isset($cols)) $cols = 6;\n if(!isset($id)) $id = '';\n if(!isset($class)) $class = '';\n if(!isset($data)) $data = '';\n\n if($label){\n $transval = $label;\n }else if($transAttr)\n $transval = trans('validation.attributes.'.$transAttr);\n else\n $transval = ($transval) ? $transval : trans('main.'.$trans);\n\n\n $html = '';\n $html .= '<div class=\"col-md-12 col-lg-'.$cols.'\">'\n .'<p>'.$transval.': <span id=\"'.$id.'\" class=\"'.$class.'\">'.$data.'</span></p>'\n .'</div>';\n return $html;\n}", "function ah_get_xicore_ajaxdata(){\n\t// what function does the user want to run\n\t$opts=grab_request_var(\"opts\",\"\");\n\t//echo \"OPTS: $opts\\n\";\n\t$optsarr=json_decode($opts);\n\t//echo \"OPTSARR:\\n\";\n\t//print_r($optsarr);\n\t$fname=\"xicore_ajax_\".strval($optsarr->func);\n\t$args=array();\n\tif($optsarr->args){\n\t\tforeach($optsarr->args as $var => $val){\n\t\t\t$args[strval($var)]=strval($val);\n\t\t\t}\n\t\t}\n\t//echo \"ARGS: \\n\";\n\t//print_r($args);\n\t$output=$fname($args);\n\techo $output;\n\t}", "function pr($data = null, $die = true)\n{\n $trace = debug_backtrace();\n $caller = array_shift($trace);\n echo '<pre>';\n echo \"called by [\" . $caller['file'] . \"] line: \" . $caller['line'] . \"\\n\";\n var_dump($data);\n echo '</pre>';\n if ($die) {\n exit;\n }\n}", "function printc($label, $data)\n{\n if(is_array($data)) {\n echo $label.': ';\n print_r($data);\n } else {\n echo $label.': '.$data.\"\\n\";\n }\n}" ]
[ "0.62203914", "0.6109418", "0.61009806", "0.6073261", "0.60508794", "0.59782827", "0.59654796", "0.59606546", "0.59209716", "0.59097743", "0.5886311", "0.5877628", "0.5787622", "0.5737044", "0.5714257", "0.5686858", "0.5677313", "0.5671644", "0.56343764", "0.5625651", "0.5613338", "0.5606788", "0.55868524", "0.55821955", "0.5579947", "0.55798274", "0.5579409", "0.557544", "0.5570828", "0.55685705" ]
0.75428283
0
FUNCION PARA VALIDAR PERFIL
public static function validarPerfil($datos){ $errores=[]; $trimeados=[]; foreach ($datos as $posicion => $valor) { $trimeados[$posicion]=trim($valor); } // VALIDACION PARA NOMBRE if (!strlen($trimeados["name"])) { $errores["nombre"] = "Campo obligatorio"; } elseif (!Funciones::nombreYApellido($trimeados["name"])) { $errores["nombre"] = "El campo contiene carateres invalidos"; } elseif (!Funciones::determinarNombreYApellido($trimeados["name"])){ $errores["nombre"] = "El campo puede tener primer y segundo nombre"; } // VALIDACION PARA APELLIDO if (!strlen($trimeados["last_name"])) { $errores["apellido"] = "Campo obligatorio"; } elseif (!Funciones::nombreYApellido($trimeados["last_name"])) { $errores["apellido"] = "El campo contiene carateres invalidos"; } elseif (!Funciones::determinarNombreYApellido($trimeados["last_name"])){ $errores["apellido"] = "El campo debe tener primer y segundo apellido"; } //VALIDACION PARA CONTRASEÑAS if (!strlen($trimeados["password"])) { $errores["pass"] = "Campo obligatorio"; }elseif (!strlen($trimeados["confirmpass"])) { $errores["pass"] = "Verifique la contraseña"; }elseif (Funciones::contraseñaMezcla($trimeados["password"]) !== 0) { $errores["pass"] = "La contraseña debe incluir al menos una mayuscula, una minuscula y un numero"; }elseif (!Funciones::contraseñaPermitida($trimeados["password"])) { $errores["pass"] = "La contraseña debe incluir al menos un numero"; } //VALIDACION PARA OFERTAS if (!isset($trimeados["sale"])) { $errores["ofertas"] = "Elija una opcion"; } return $errores; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function validation();", "public function valid() {}", "public function valid() {}", "public static function validate() {}", "function valid() {}", "public function valid () {}", "public function valid(){ }", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "abstract protected function validate();", "abstract protected function validate();", "public function validate();", "public function validate();", "public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "public abstract function validate();", "public function validate() {\n\tif (isset($_POST['sort_by'])) {\n\t switch ($_POST['sort_by']) {\n\t\tcase \"'Enrolled'\":\n\t\tcase \"'Country'\":\n\t\tcase \"'Personal Volume'\":\n\t\tcase \"'Preferred Customer'\":\n\t\tcase \"'Sponsor'\":\n\t\t break;\n\t\tdefault:\n\t\t throw new Exception('Invalid sort by value');\n\t }\n \n \n\t if ('d.active = 1' != $_POST['filter_by']) {\n\t\tthrow new Exception('Invalid filter by value');\n\t }\n\t if (!is_numeric($_POST['commission_period_id'])) {\n\t\tthrow new Exception('Invalid commission period id');\n\t }\n \n\n \n\n\t return true;\n\t}\n\n\treturn false;\n }", "function validar_datos(){\r\n\t\t// validar nombre, version, creacion ...\r\n\t}", "public function valid()\r\n {\r\n }" ]
[ "0.68427", "0.683908", "0.683908", "0.6816566", "0.6809543", "0.6803196", "0.67373306", "0.6736975", "0.6736975", "0.6736975", "0.6736975", "0.6736975", "0.6736975", "0.6696716", "0.6696716", "0.667429", "0.667429", "0.667429", "0.666415", "0.666415", "0.666415", "0.666415", "0.666415", "0.666415", "0.666415", "0.666415", "0.6564553", "0.6554758", "0.65044093", "0.64486784" ]
0.68898153
0
Have to override the AuditTrait's getConnectionName method to ensure that the system uses the Hyn MultiTenant method to point at the tenant database as opposed to the system DB
public function getConnectionName() { return app(Connection::class)->tenantName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConnectionName(): string\n {\n return config('template.auth.database_connection');\n }", "public function getConnectionName(): string\n {\n return config('haystack.db_connection');\n }", "protected abstract function _getDbClassName();", "public function getConnectionName(): string\n {\n return config('core.auth.connection');\n }", "private function createTenantConnection()\n {\n $config = $this->app['config'];\n\n $connections = $config->get('database.connections');\n\n $connections['tenant'] = $this->app['db']->getConfig();\n\n $config->set([\n 'database.connections' => $connections,\n ]);\n }", "public function getConnectionName()\n {\n return config('buku-icons.db_connection');\n }", "public function getConnectionName()\n {\n return config('shopify.database.connection') ?? $this->connection;\n }", "public function getConnection($name);", "public function getConnectionName()\n {\n return $this->connectionName;\n }", "public function getConnectionName()\n {\n return $this->connection->getName();\n }", "public function getConnectionName()\n {\n return $this->connection;\n }", "abstract protected function getConnectionString();", "public function getConnectionName()\n {\n $connName = config('webpush.db_connection');\n return $connName ?: config('database.default');\n }", "public static function defaultConnectionName(): string\n {\n return 'product_backend';\n }", "public static function defaultConnectionName(): string\n {\n return 'product_backend';\n }", "public static function defaultConnectionName(): string\n {\n return 'product_backend';\n }", "function dbname()\n\t{\n\t\treturn $this->_dbname;\n\t}", "public function get_db_name() { return $this->db_name; }", "abstract public function getDbConnection();", "public function getConnectionId();", "public function getConnection()\n {\n return parent::getConnection();\n }", "public function getConnection()\n {\n return parent::getConnection();\n }", "public function getConnection()\n {\n return parent::getConnection();\n }", "public static function defaultConnectionName()\n {\n return 'opersms';\n }", "public function getConnection(){\r\n\t\treturn $this->calypte;\r\n\t}", "public static function getConnectionName()\n {\n /** @var \\Illuminate\\Support\\Testing\\Fakes\\QueueFake $instance */\n return $instance->getConnectionName();\n }", "public function getConnectionClassName()\n {\n return $this->fqClassName;\n }", "public function getConnection() {\n return $this->getParent()->getConnection();\n }", "function get_tenant_db_name($tenantCode)\n {\n $project = \\App\\Model\\Project\\Project::where('code', $tenantCode)->first();\n\n return env('DB_DATABASE').'_'.strtolower($project->code);\n }", "public function getConnection()\n {\n return Mage::getSingleton('core/resource')->getConnection('core_write');\n }" ]
[ "0.6690371", "0.65314656", "0.65301013", "0.64596945", "0.637745", "0.6209899", "0.6189204", "0.61228555", "0.6122753", "0.6063887", "0.6048777", "0.59670043", "0.59639466", "0.5916257", "0.5916257", "0.5916257", "0.5913605", "0.5894475", "0.58841205", "0.5849926", "0.58412945", "0.58412945", "0.58412945", "0.5790201", "0.57351846", "0.57319593", "0.5731887", "0.5696432", "0.56689835", "0.5668151" ]
0.71983314
0
Get all political parties
function getPoliticalParties () { // sql query $sql = "SELECT * FROM party"; // execution of query $result = $this->db->con->query($sql); if ($this->db->con->error) { // logging of error into a file $fetch_party_error = 'fetch_party_error.txt'; $error_msg = "Unable to get all political parties because ".$this->db->con->error."\n"; file_put_contents($fetch_party_error, $error_msg, FILE_APPEND); return "<div class='alert alert-danger'>"."There is an error: ".$this->db->con->error."</div>"; } elseif ($result->num_rows > 0) { while ( $row = $result->fetch_assoc()) { $rows[] = $row; } return $rows; } else { return "<div class='alert alert-danger'>Polling Unit result unavailable, refresh.</div>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listLocalParties() {\r\n\t\tif($this->localparties == null) {\r\n\t\t\t$pr = new LocalParty();\r\n\t\t\t$this->localparties = $pr->getList('', 'WHERE party = '.$this->party, 'ORDER BY p.name');\r\n\t\t}\r\n\t\treturn $this->localparties;\r\n\t}", "public function getParties();", "public function getParties()\n {\n return $this->hasMany(Party::className(), ['chat_id' => 'id']);\n }", "public function all() {\n \n $user = User::findOrFail(auth()->id());\n \n return Polling::findOrFail($user->constituency_id);\n \n }", "public function getParties()\n {\n $dom = new \\DOMDocument();\n @$dom->loadHTML($this->text);\n $xpath = @new \\DOMXPath($dom);\n\n $parties = [];\n foreach ($xpath->query('//input[@data-t=\"party\"]') as $k => $element) {\n $parties[$element->getAttribute('data-id')] = 1;;\n }\n\n return $parties;\n }", "public function parties() {\n return $this->belongsToMany('Party');\n }", "public function getAccessiblePartyIds(): array;", "public function speechesByPartyId($party_id)\n {\n // ASCII = english name\n // UTF-8 = greek name\n die;\n // $speeches = Speech::select('speeches.*')\n // ->join('memberships', 'speeches.speaker_id', '=', 'memberships.person_id')\n // ->where('memberships.on_behalf_of_id', '=', $party_id)\n // ->get();\n \n // // DEN DOULEVEI! MEMORY ERROR!!\n // // Return the collection of Speeches as a resource\n // if (isset($speeches) && !empty($speeches)) {\n // return SpeechResource::collection($speeches);\n // }\n }", "function get_list()\n\t{\n\t\t$this->db->select('pp.*')\n\t\t\t->from('political_party pp');\n\t\n $query = $this->db->get();\n\n if ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->result();\n\t\t}\n else\n return FALSE;\n\t}", "function cognitivefactory_get_participants($cognitivefactoryid) {\n global $CFG;\n\n // Get all participants.\n $sql = \"\n SELECT DISTINCT \n u.*\n FROM \n {user} u,\n {cognitivefactory_responses} c\n WHERE \n c.cognitivefactoryid = {$cognitivefactoryid} AND\n u.id = c.userid\n \";\n $participants = $DB->get_records_sql($sql);\n\n // Return students array (it contains an array of unique users).\n return ($participants);\n}", "public function getConferencePapers() // {{{\n {\n global $CCV_CONST;\n $records = array();\n $elements = $this->m_xpath->query(\"//section[@id='4b9f909503cd4c8aa8d826c87d6d874d']\");\n for ($i = 0; !is_null($elements) && $i < $elements->length; $i++)\n {\n $record = array();\n $id = $this->get_xpath(\"@recordId\", $elements->item($i));\n $record[\"title\"] = $this->get_xpath(\"field[@id='8e6ee535c95e42ec866b777c7472bafb']/value\", $elements->item($i));\n $record[\"publisher\"] = $this->get_xpath(\"field[@id='0c357193a93f4137a87394401ac81958']/value\", $elements->item($i));\n $record[\"authors\"] = $this->get_xpath(\"field[@id='3cc54d9bb92d421da46548979048396f']/value\", $elements->item($i));\n $record[\"editors\"] = $this->get_xpath(\"field[@id='018e656a0f824b1f91a6a2cb33ac61dd']/value\", $elements->item($i));\n $record[\"pages\"] = $this->get_xpath(\"field[@id='684ccb1fcdd7421f89b304ff5c40579d']/value\", $elements->item($i));\n $record[\"url\"] = $this->get_xpath(\"field[@id='61690b466fb748d99ed29b340c0ee60b']/value\", $elements->item($i));\n $record[\"status\"] = $this->get_xpath(\"field[@id='080301b1f1c0464bba7fcfa1fa8fe182']/lov/@id\", $elements->item($i));\n $pr = $this->get_xpath(\"field[@id='560a2ce08e14497ba575af760eb12ba9']/lov/@id\", $elements->item($i));\n if ($pr === $CCV_CONST[\"Yes-No\"][\"Yes\"])\n $record[\"peer_reviewed\"] = true;\n elseif ($pr === $CCV_CONST[\"Yes-No\"][\"No\"])\n $record[\"peer_reviewed\"] = false;\n $record[\"conf_name\"] = $this->get_xpath(\"field[@id='b3c8a60c053a405597b92899d95765a3']/value\", $elements->item($i));\n $record[\"published_in\"] = $this->get_xpath(\"field[@id='1a1b39e861054ee59d270e66271a4ead']/value\", $elements->item($i));\n $record[\"city\"] = $this->get_xpath(\"field[@id='c2efd9725588489b8df73467c5597c32']/value\", $elements->item($i));\n $date = $this->get_xpath(\"field[@id='0318d139f3e0479083188ff8319a97b2']/value\", $elements->item($i));\n list($date_year, $date_month) = explode(\"/\", $date);\n $record[\"date_year\"] = $date_year;\n $record[\"date_month\"] = $date_month;\n $records[$id] = $record;\n }\n return $records;\n }", "public static function getDropDownPoliticians($party, $region = null, $includeExpired = false) {\n\t\t$pol = new Politician();\n\n\t\t//JOIN sys_categories c ON pf.category = c.id\n\t\treturn array_map(create_function('$p', 'return $p->formatName();'),\n\t\t\t\t $pol->getList($pol->db->formatQuery('JOIN pol_politician_functions pf ON t.id = pf.politician\n\t\t\t\t JOIN pol_party_regions pr ON pf.party = pr.party AND pf.region = pr.region\n\n\t\t\t\t WHERE '.(!$includeExpired ? 'pf.time_end > now() AND ' : '').'pr.'.($region ? 'party' : 'party').' = %i '.($region ? ' AND pr.region = %i' : '').' ORDER BY t.name_sortkey ASC', _id($party), _id($region))));\n\t}", "public function getPeople(){\n return $this->film['people'];\n }", "public function polls(){\n return $this->votes()->lists('poll_id')->toArray();\n }", "function get($political_party_id)\n\t{\n\t\t$this->db->select('pp.*')\n\t\t\t->from('political_party pp')\n\t\t\t->where('p.political_party_id', $political_party_id);\n\t\n $query = $this->db->get();\n\n if ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->row();\n\t\t}\n else\n return FALSE;\n\t}", "public function filterByParty($party)\n {\n\n $filterByParty = Senator::where('political_party', '=', $party)->get();\n\n if($filterByParty->count() > 0){\n\n return new SenatorResourceCollection($filterByParty);\n }\n else{\n\n return response()->json(['error' => \"No record found for senator whose political party is $party\", 'status' => '404']);\n }\n\n }", "public function getPeople(){\n \n $persons = person::all();\n\n return PersonResource::collection($persons);\n }", "public function getReviewedConferencePapers() // {{{\n {\n global $CCV_CONST;\n $records = array();\n $elements = $this->m_xpath->query(\"//section[@id='7cc778c33e64469987c55e2078be60d3']\");\n for ($i = 0; !is_null($elements) && $i < $elements->length; $i++)\n {\n $record = array();\n $id = $this->get_xpath(\"@recordId\", $elements->item($i));\n $record[\"conference\"] = $this->get_xpath(\"field[@id='9cdaafaa865246bc9637444cb90ae9a6']/value\", $elements->item($i));\n $record[\"numpapers\"] = $this->get_xpath(\"field[@id='7189023217b44dba9d4ac5c76ffe6c10']/value\", $elements->item($i));\n $record[\"blindtype\"] = $this->get_xpath(\"field[@id='b5f58c56b4544a969ac6013d1d7de0fa']/lov/@id\", $elements->item($i));\n $records[$id] = $record;\n }\n return $records;\n }", "public function allGameParties(Request $request)\n {\n $user = auth()->user();\n\n if ($user) {\n\n $allParties = Party::where('game_id', '=', $request->game_id)->get();\n\n if (!$allParties->isEmpty()) {\n return response()->json([\n 'success' => true,\n 'data' => $allParties,\n ], 200);\n }else {\n return response()->json([\n 'success' => false,\n 'message' => 'There is no parties of this game'\n ], 500);\n }\n } else {\n return response()->json([\n 'success' => false,\n 'message' => 'You have no permissions'\n ], 401);\n }\n }", "public function findAll() {\r\r\n\r\r\n $result = array ();\r\r\n $query = \"SELECT * FROM participation\";\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->query($query);\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idParticipant, $idPurchasingFair, $passwordParticipant, $lunch ) = $row; // Like that $idParticipant = $row['PARTICIPANT_id_participant'] etc.\r\r\n $newParticipation = new Participation($idParticipant, $idPurchasingFair, $passwordParticipant, $lunch);\r\r\n $result[] = $newParticipation; // Adds new profile to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }", "function webquest_get_participants($webquestid) {\r\n//for a given instance of webquest. Must include every user involved\r\n//in the instance, independient of his role (student, teacher, admin...)\r\n//See other modules as example.\r\n\r\n return false;\r\n}", "public function index()\n\t{\n\t\treturn PartyPlay::all();\n\t}", "function getActiveCompetences()\n {\n $competencesNode = atkgetNode('competency.competences');\n $competences = $competencesNode->select(\"person_id=\" . $this->user['id'])->includes(array('niveau_id','competency_id','person_id'));\n $level = array();\n $comp = array();\n foreach ($competences as $competency)\n {\n $level[] = $competency[\"niveau_id\"]['id'];\n $comp[] = $competency[\"competency_id\"]['id'];\n }\n $output = array(\n \"level\" => $level ,\n \"comp\" => $comp);\n return ($output);\n }", "protected function retrieveMatchingHnsObjects() {\n\t\t$persons = parent::retrieveMatchingHnsObjects();\n\n\t\tif (!empty($persons)) return $persons;\n\n\t\t// Try to match politician through (unsynced) party appointments\n\t\t$appointments = $this->listAllAppointments();\n\n\t\tforeach ($appointments as $appointment) {\n\t\t\ttry {\n\t\t\t\t// Localparties and appointmenst are not consistent in the DB\n\t\t\t\t$localparty = $appointment->getLocalParty();\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\t$this->debug($e->getMessage());\n\t\t\t\t// No valid localparty for appointment, so skip\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$politician = $appointment->getPolitician();\n\n\t\t\t// Try to match localparty to organization in HNSdev\n\t\t\tif (!$localparty->hasHnsId()) {\n\t\t\t\t$localparty->save();\n\t\t\t}\n\n\t\t\t$party_name = $this->sanitizeValue($localparty->party_name);\n\t\t\t$function_name = $this->sanitizeValue($appointment->hns_function_name);\n\n\t\t\t$query = \"\n\t\t\t\t<query>\n\t\t\t\t\t<select>person.lastname</select>\n\t\t\t\t\t<select>person.usualname</select>\n\t\t\t\t\t<select>person.initials</select>\n\t\t\t\t\t<select>organization.area</select>\n\t\t\t\t\t<select>function.name</select>\n\t\t\t\t\t<from>person_function</from>\n\t\t\t\t\t<where>function = '{$function_name}'</where>\n\t\t\t\t\t<where>organization = '{$party_name}'</where>\n\t\t\t\t</query>\n\t\t\t\";\n\n\t\t\t$result = $this->execute($query);\n\n\t\t\t$persons = array('person' => array());\n\n\t\t\tif (empty($result['person_function'])) return array();\n\n\t\t\tforeach ($result['person_function'] as $pers_func) {\n\t\t\t\t$organization = $pers_func['organization'][0]['organization'][0];\n\t\t\t\t$function = $pers_func['function'][0]['functie'][0];\n\t\t\t\t$person = $pers_func['person'][0]['person'][0];\n\n\t\t\t\tif ($organization['id'] != $localparty->hnsId()) continue;\n\t\t\t\tif ($function['name'] != $appointment->hns_function_name) continue;\n\t\t\t\tif ($person['lastname'] != $politician->last_name) continue;\n\n\t\t\t\t$persons['person'][] = $person;\n\t\t\t}\n\n\t\t\treturn $persons;\n\t\t}\n\t}", "public function participants();", "public function getPolls()\n\t{\n\t\t$arrPolls = array();\n\t\t$objPolls = $this->Database->execute(\"SELECT id, title FROM tl_poll\" . (\\Poll::checkMultilingual() ? \" WHERE lid=0\" : \"\") . \" ORDER BY title\");\n\n\t\twhile ($objPolls->next())\n\t\t{\n\t\t\t$arrPolls[$objPolls->id] = $objPolls->title;\n\t\t}\n\n\t\treturn $arrPolls;\n\t}", "public function getPeople()\n {\n\t\treturn $this->people;\n\t}", "public function getCandidates();", "function getInvolved()\n {\n if(!$this->involvedparties_) $this->execQuery();\n return $this->involvedparties_;\n }", "public function findAll() {\n\t\t$qb=$this->getRep()->createQueryBuilder('p');\n\t\t$query=$qb->getQuery();\n\t\treturn $query->getResult();\n\t}" ]
[ "0.6527767", "0.65258324", "0.6463711", "0.62137747", "0.60381544", "0.59960496", "0.59647423", "0.59432834", "0.5919412", "0.57519567", "0.5717823", "0.5717542", "0.5693611", "0.56619173", "0.5659961", "0.5655336", "0.5644662", "0.5622507", "0.5612832", "0.5592746", "0.5590653", "0.55784994", "0.55528736", "0.55368036", "0.5528792", "0.55044794", "0.5498251", "0.547249", "0.5465821", "0.5463299" ]
0.67203575
0
Insert political parties results
function insertPoliticalPartiesScore ( $partyScore, $registered_user, $polling_unit_id, $user_ip_address ) { // looping the array of political party score to insert to database foreach ($partyScore as $key => $value) { if (empty($value)) { continue; } // sql query $sql = "INSERT INTO announced_pu_results SET polling_unit_uniqueid = (SELECT uniqueid FROM polling_unit WHERE uniqueid = '$polling_unit_id'), entered_by_user = '$registered_user', party_abbreviation = '$key', party_score = '$value', user_ip_address = '$user_ip_address'"; // execution of query $result = $this->db->con->query($sql); } if ($this->db->con->error) { // logging of error into a file $upload_party_result_error = 'party_result_error.txt'; $error_msg = "Unable to upload new polling unit with id '".$polling_unit_id."' results because ".$this->db->con->error."\n"; file_put_contents($upload_party_result_error, $error_msg, FILE_APPEND); return "<div class='alert alert-danger'>"."There is an error: ".$this->db->con->error."</div>"; } elseif ($this->db->con->affected_rows >= 1) { $msg1 = "<div class='alert alert-success' id='msg1'>Result successfully uploaded</div>"; // redirect to create polls page header("Location: create-polls.php?msg=$msg1"); exit; } else { return "<div class='alert alert-danger'>Result Insertion failed! Try again</div>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addParty() {\n $req = $this->pdo->prepare('INSERT INTO `parties`(name, description, id_users, horraire) VALUES(:name, :description, :id_users, :horraire)');\n $req->bindValue(':name', $this->name, PDO::PARAM_STR);\n $req->bindValue(':description', $this->description, PDO::PARAM_STR);\n $req->bindValue(':horraire', $this->horraire, PDO::PARAM_STR);\n $req->bindValue(':id_users', $_SESSION['id'], PDO::PARAM_INT);\n $req->execute();\n }", "public function insert_results()\n {\n $sql = \"INSERT INTO `results`(\n `result_ID`,\n `result_competitor`,\n `result_competition`,\n `result_team`,\n `result_week`,\n `result_weight_loss`,\n `result_weight_loss_percent`,\n `result_weight_loss_overall`,\n `result_weight_loss_percent_overall`,\n `result_date_entered`\n ) VALUES (\n NULL,\n '$this->competitor',\n '$this->competition',\n '$this->team',\n '$this->week',\n '$this->weight_loss',\n '$this->weight_loss_percent',\n '$this->weight_loss_overall',\n '$this->weight_loss_percent_overall',\n CURRENT_TIMESTAMP\n );\";\n\n $this->process_query($sql);\n }", "function createPeople() {\n\t$rows = getDatabase()->all(\" select * from candidate where email > '' and personid is null and nominated is not null and year = 2014 \");\n\tforeach ($rows as $r) {\n\t\t$values = array();\n\t\t$values['name'] = \"{$r['first']} {$r['last']}\";\n\t\t$values['email'] = $r['email'];\n\t\tprint \"Saving person for {$values['name']}\\n\";\n\t\tpr($values);\n\t\t$id = db_insert('people',$values);\n\t\t$values = array();\n\t\t$values['id'] = $id;\n\t\t$values['password'] = md5($id.\":\".rand(0,20000));\n\t\tdb_update('people',$values,'id');\n\t\t$values = array();\n\t\t$values['id'] = $r['id'];\n\t\t$values['personid'] = $id;\n\t\tdb_update('candidate',$values,'id');\n\t}\n}", "function addParticipating($con, $participantId, $studyId) {\n runInsert($con, \"insert into Participating(participantId, studyId) values (\".$participantId.\",\".$studyId.\");\");\n }", "private function insertNewLookupData() {\n\t$this->deleteCompetitionsWithMissingLeague();\n $this->insertCompetitionLookup();\n\n //Insert new teams. Clubs are added manually by the person importing the data\n $this->insertNewTeams();\n $this->insertNewGrounds();\t\n }", "function insert_wp_player_pvq(){\n\tglobal $final_pvq;\t\t\n\tglobal $wpdb;\n\t\n\t//remove the row for the player if it exsists\n\t\n\tforeach ($final_pvq as $key => $value){\n\t$inserted = $wpdb->insert(\n\t\t 'wp_player_pvqs',\n\t array(\n\t 'id' => $key,\n\t 'playerid' => substr($key, 0, 10),\n\t 'year' => substr($key, -4),\n\t\t\t'pvq' => $value\n\t ),\n\t\t array( \n\t\t\t'%s','%s','%d','%f'\n\t\t )\n\t\t);\n\t}\n \n}", "public static function insertParsedData(){\n\n $data = $_SESSION['mainArray'];\n UserModel::insertNewCandidate($data);\n $result = UserModel::getAllNeizkorisceniKandidati();\n //var_dump($result);\n ViewHelper::render(\"view/UvozPodatkovSuccess.php\", [\n \"result\" => $result,\n ]);\n }", "function insert_wp_number_ones_qb(){\n\tglobal $qb_one;\t\t\n\tglobal $yearid;\n\tglobal $wpdb;\n\tglobal $qb_avg;\n\t\n\t\n\t// if more then 1 player tied for first, manually enter the info in wp_number_ones table and make the id TEA0000b with the b, c, d etc. at end\n\t$id = 'qb'.$yearid.'a';\n\t\n\t//remove the row for the player if it exsists\n\t$delete = $wpdb->query(\"delete from wp_number_ones where id = '$id'\");\n\t\n\tforeach ($qb_one as $key => $value){\n\t\t\n\t$teams = get_player_teams_season($key);\t\n\t$inserted = $wpdb->insert(\n\t\t 'wp_number_ones',\n\t array(\n\t\t 'year' => $yearid, \n\t 'id' => $id,\n\t 'pos' => 'QB',\n\t 'playerid' => $key,\n\t 'points' => $value,\n\t 'avg' => $qb_avg,\n\t 'teams' => $teams[$yearid][0]\n\t ),\n\t\t array( \n\t\t\t'%d','%s','%s','%s','%d','%f','%s'\n\t\t )\n\t\t);\n\t\t}\n\n\t\t\n\t return $inserted;\n \n}", "function warquest_db_alliance_insert($pid1, $pid2, $approved) { \r\n\t\r\n\t/* Create alliance connection $pid1 -> $pid2 */\r\n\t$query = 'insert into player_player (pid1, pid2, approved, invite_date) values ';\r\n\t$query .= '('.$pid1.','.$pid2.','.$approved.',\"'.date(\"Y-m-d H:i:s\", time()).'\")';\r\n\t\r\n\treturn warquest_db_query($query);\r\n}", "public static function getParticipantTable()\n {\n global $wpdb;\n $_data = [];\n\n $chal_id = filter_input(INPUT_POST, 'chal-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE);\n $chal = $wpdb->get_row($wpdb->prepare(\"SELECT * FROM {$wpdb->prefix}pt_challenges WHERE id = %d\", $chal_id));\n\n if (! $chal) {\n print json_encode([\n 'error' => 'Unable to find the selected challenge'\n ]);\n wp_die();\n }\n\n $query = $wpdb->prepare(\"CREATE TEMPORARY TABLE tmp_log\nSELECT IF(ca.type = 'number',(ca.points * al.value),ca.points) AS 'total_points',cp.*\nFROM {$wpdb->prefix}pt_participants cp\nLEFT JOIN {$wpdb->prefix}pt_log al ON al.user_id = cp.user_id\nLEFT JOIN {$wpdb->prefix}pt_activities ca on ca.id = al.activity_id AND ca.challenge_id = cp.challenge_id\nWHERE cp.challenge_id = %d\nGROUP BY cp.user_id, al.activity_id, al.log_date\", $chal_id);\n $wpdb->query($query);\n\n $query = \"SELECT SUM(al.total_points) AS 'total',al.*\nFROM tmp_log al\nGROUP BY al.user_id\";\n $participants = $wpdb->get_results($query);\n\n $winner_idx = null;\n foreach ($participants as $x => $part) {\n $_data[] = [\n 'approved' => \"<input type='checkbox' \" . (! $chal->approval ? \"disabled\" : \"\") . \" class='approve' \" . ((boolean) $part->approved ? \" checked\" : \"\") . \" data-user-id='{$part->user_id}' />\",\n 'memberid' => $part->member_id,\n 'name' => html_entity_decode($part->name, ENT_QUOTES | ENT_HTML5),\n 'email' => sanitize_email($part->email),\n 'totalPoints' => $part->total,\n 'action' => \"<i class='far fa-trash-alt' title='Remove this participant from the activity' data-user-id='{$part->user_id}'></i>\" .\n \"&nbsp;&nbsp;\" .\n \"<i class='fas fa-trophy' title='Mark participant as winner' data-user-id='{$part->user_id}'></i>\",\n 'winner' => ($chal->winner == $part->user_id ? true : false)\n ];\n\n if ($chal->winner == $part->user_id) {\n $winner_idx = $x;\n }\n }\n\n $columns = [\n [\n 'title' => 'Approved',\n 'defaultContent' => \"\",\n 'data' => 'approved'\n ],\n [\n 'title' => 'Member ID',\n 'defaultContent' => '',\n 'data' => 'memberid'\n ],\n [\n 'title' => 'Name',\n 'defaultContent' => '',\n 'data' => 'name'\n ],\n [\n 'title' => 'Email',\n 'defaultContent' => '',\n 'data' => 'email'\n ],\n [\n 'title' => 'Total Points',\n 'defaultContent' => 0,\n 'data' => 'totalPoints'\n ],\n [\n 'title' => 'Action',\n 'defaultContent' => '',\n 'data' => 'action'\n ]\n ];\n\n print json_encode([\n 'columns' => $columns,\n 'data' => $_data,\n 'winner' => $winner_idx\n ]);\n wp_die();\n }", "function add_pi1_row($userResponse) {\n\tglobal $dbh;\n\t$query = \"INSERT INTO privacy_index1 VALUES (DEFAULT,?,?,?,?,?,?,?,?)\";\n\treturn $result = prepared_query($dbh, $query, $userResponse);\n}", "function getPoliticalParties () {\n \n // sql query\n $sql = \"SELECT * FROM party\";\n \n // execution of query\n $result = $this->db->con->query($sql);\n \n if ($this->db->con->error) {\n \n // logging of error into a file\n $fetch_party_error = 'fetch_party_error.txt';\n \n $error_msg = \"Unable to get all political parties because \".$this->db->con->error.\"\\n\";\n file_put_contents($fetch_party_error, $error_msg, FILE_APPEND);\n \n return \"<div class='alert alert-danger'>\".\"There is an error: \".$this->db->con->error.\"</div>\";\n } elseif ($result->num_rows > 0) {\n while ( $row = $result->fetch_assoc()) {\n $rows[] = $row; \n }\n \n return $rows;\n } else {\n return \"<div class='alert alert-danger'>Polling Unit result unavailable, refresh.</div>\";\n }\n }", "function add_requisition($point_of_use, $narrative, $details)\n{\n\t$sql = \"INSERT INTO \".TB_PREF.\"requisitions (point_of_use, narrative, details) VALUES (\".\n\t\tdb_escape($point_of_use).\",\".db_escape($narrative).\",\".db_escape($details).\")\";\n\n\tdb_query($sql, \"could not add requisitions\");\n}", "function insert_participant_waiver_item($participant_id, $reg_id, $field_name, $field_val) {\n // terrible name tho \n\n $query='INSERT INTO participant_waiver(participant_id, reg_id, '.$field_name.') VALUES ('.$participant_id.', '.$reg_id.', \"'.$field_val.'\")';\n if ($result = $this->db->query($query)) {\n return $result;\n } else {\n echo $query.' on line '.__LINE__.'<br>';\n }\n }", "function add_warrant($status, $poiID, $jobID, $court, $judge, $stationID)\n\t{\n\t\tglobal $conn;\n\t\t$sql = \"INSERT INTO qp_arrest_warrant (status, poiID, jobID, court, judge, stationID, createdDate) VALUES (:status, :poiID, :jobID, :court, :judge, :stationID, now())\";\n\t\t$statement = $conn->prepare($sql);\n\t\t//Binds a value to a corresponding named or question mark placeholder in the SQL statement that was used to prepare the statement.\n $statement->bindValue(':status', $status);\n $statement->bindValue(':poiID', $poiID);\n\t\t$statement->bindValue(':jobID', $jobID);\n $statement->bindValue(':court', $court);\n $statement->bindValue(':judge', $judge);\n\t\t$statement->bindValue(':stationID', $stationID);\n\t\t$result = $statement->execute();\n\t\t$statement->closeCursor();\n\t\treturn $result;\n\t}", "function insertEducations($pdo, $profile_id)\r\n{\r\n $rank = 1;\r\n for ($i = 1; $i <= 9; $i++) {\r\n if (!isset($_POST['edu_year' . $i])) continue;\r\n if (!isset($_POST['edu_school' . $i])) continue;\r\n $year = $_POST['edu_year' . $i];\r\n $school = $_POST['edu_school' . $i];\r\n\r\n // look up the school if it is there\r\n $institution_id = false;\r\n $stmt = $pdo->prepare('SELECT institution_id FROM Institution WHERE name = :name');\r\n $stmt->execute(array(':name' => $school));\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n if ($row !== false) $institution_id = $row['institution_id'];\r\n\r\n // if there was no institution, insert it\r\n if ($institution_id === false) {\r\n $stmt = $pdo->prepare('INSERT INTO Institution (name) VALUES (:name)');\r\n $stmt->execute(array(':name' => $school));\r\n $institution_id = $pdo->lastInsertId();\r\n }\r\n\r\n $stmt = $pdo->prepare('INSERT INTO Education (profile_id, rank, year, institution_id) VALUES ( :pid, :rank, :year, :iid)');\r\n $stmt->execute(array(\r\n ':pid' => $profile_id,\r\n ':rank' => $rank,\r\n ':year' => $year,\r\n ':iid' => $institution_id\r\n ));\r\n $rank++;\r\n }\r\n}", "function addExcessWorkflowPretax($employee_id, $employer_id, $refund, $date) {\r\n\t$title = \"Pretax Refund \". $refund.\", On \".$date;\r\n\t$requestor_type = 'Employee';\r\n\t$action_type = 'Employer';\r\n\t$status = 'Pending';\r\n\t$sql = \"select id from workflow where name = 'Excess Contribution' ORDER BY id ASC LIMIT 1\";\r\n\t$rs = mysql_query($sql) or die('error');\r\n\tif(mysql_num_rows($rs)) {\r\n\t\t$rec = mysql_fetch_array($rs);\r\n\t\t$wf_id = $rec['id'];\r\n\t} else {\r\n\t\t$wf_id = 2;\r\n\t}\r\n\t$insertSQL = \"INSERT INTO actions (title, id, requestor_id, requestor_type, action_type, wf_id, status) VALUES ('\".$title.\"', '\".$employer_id.\"', '\".$employee_id.\"', '\".$requestor_type.\"', '\".$action_type.\"', '\".$wf_id.\"', '\".$status.\"')\";\r\n\r\n $Result1 = mysql_query($insertSQL) or die(mysql_error());\r\n}", "function insert_assessments()\n\t{\n\t\tforeach($this->assessments AS $assessment)\n\t\t{\n\t\t\t$unitID = $assessment->unitID;\n\t\t\t$criteria = $assessment->criteria;\n\t\t\tif($unitID != -1)\n\t\t\t{\n\t\t\t\t$criteria->insert_criteria($unitID);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we are just adding it to the qualification\n\t\t\t\t$criteria->insert_criteria_on_qual($unitID, $this->id);\n\t\t\t}\n\t\t}\n\t}", "function insertPrepVolunteers($prepJobIDS,$volunteerId) {\n\t\tglobal $db;\n\t\t\n\t\tforeach ($prepJobIDS as $jobID) {\n\t\t\t$query = \"Insert Into tblprepvolunteers(committeeId,volunteerId,coordinator)\t \n\t\t\t\t\t Values(:committeeId,:volunteerId,:coordinator)\";\n\t\t\t$statement = $db->prepare($query);\n\t\t\t$statement->bindValue(':committeeId', $jobID);\n\t\t\t$statement->bindValue(':volunteerId', $volunteerId);\n\t\t\t$statement->bindValue(':coordinator', false);\n\t\t\t$statement->execute();\n\t\t\t$statement->closeCursor();\n\t\t} //end for each\n\t}", "public function withLivelongWarranty() {\n // MySQL query\n $this->insertInto .= ', livelongWarranty';\n $this->values .= ', :livelongWarranty';\n }", "function createList($town_id, $town_name, $county_id, $population) {\n $dbConn = getDatabaseConnection(); \n\n $sql = \"INSERT INTO `populationList` (`town_id`, `town_name`, `county_id`, `population`) VALUES (NULL, '$town_id', '$town_name', '$county_id', '$population', NOW());\"; \n \n $statement = $dbConn->prepare($sql); \n $result = $statement->execute(); \n \n if (!$result) {\n return null; \n }\n \n $last_id = $dbConn->lastInsertId();\n\n \n // fetch the newly created object from database\n \n $sql = \"SELECT * from midterm WHERE town_id = $town_id\"; \n $statement = $dbConn->prepare($sql); \n \n $statement->execute(); \n $records = $statement->fetchAll(); \n $newRec = $records[0]; \n \n return $newRec; \n \n}", "function addPerson($pID, $pFName, $pLName, $pDOB, $pGender, $pAdd1, $pAdd2, $pCity, $pState, $pZip) {\r\n $dbc = getDBC ();\r\n \r\n $resultArr = $dbc->query ( \"SELECT insertPerson (\\\"$pID\\\", \\\"$pFName\\\", \\\"$pLName\\\", \\\"$pGender\\\", \\\"$pDOB\\\", \\\"$pAdd1\\\", \\\"$pAdd2\\\", \\\"$pCity\\\", \\\"$pState\\\", \\\"$pZip\\\") AS insertResult\" );\r\n \r\n $result = $resultArr->fetch_assoc ();\r\n \r\n $dbc->close ();\r\n \r\n return $result ['insertResult'];\r\n}", "public function UpdatePartyArray()\n {\n global $cfg, $db;\n\n if ($db->success) {\n // Count Partys\n $res = $db->qry(\"SELECT * FROM %prefix%partys\");\n $this->count = $db->num_rows($res);\n $db->free_result($res);\n\n $_SESSION['party_info'] = array();\n if ($this->count > 0) {\n $row = $db->qry_first(\"SELECT name, ort, plz, UNIX_TIMESTAMP(enddate) AS enddate, UNIX_TIMESTAMP(sstartdate) AS sstartdate, UNIX_TIMESTAMP(senddate) AS senddate, UNIX_TIMESTAMP(startdate) AS startdate, max_guest FROM %prefix%partys WHERE party_id=%int%\", $this->party_id);\n $this->data = $row;\n\n $_SESSION['party_info']['name'] = $row['name'];\n $_SESSION['party_info']['partyort'] = $row['ort'];\n $_SESSION['party_info']['partyplz'] = $row['plz'];\n $_SESSION['party_info']['partybegin'] = $row['startdate'];\n $_SESSION['party_info']['partyend'] = $row['enddate'];\n $_SESSION['party_info']['s_startdate'] = $row['sstartdate'];\n $_SESSION['party_info']['s_enddate'] = $row['senddate'];\n $_SESSION['party_info']['max_guest'] = $row['max_guest'];\n }\n }\n }", "function insert_evaluation($trip_id, $evaluation) {\n global $my_database;\n\n $query_string = \n \"INSERT INTO `xdr_evaluation` (`id`, `pointstotal`, `pointsacceleration`, `pointsbraking`, `pointssteering`) \n VALUES ('\" . $trip_id . \"', \n '\" . $evaluation['pointstotal'] . \"', \n '\" . $evaluation['pointsacceleration'] . \"', \n '\" . $evaluation['pointsbraking'] . \"',\n '\" . $evaluation['pointssteering'] . \"');\";\n\n $my_result = $my_database->send_query($query_string);\n\n if (!$my_result)\n launch_error(\"Problem inserting evaluation data.\");\n}", "function add_arrest($status, $poiID, $jobID, $court, $judge, $stationID, $newPhotoName, $arrestingBadgeID, $processingBadgeID)\n {\n global $conn;\n $sql = \"INSERT INTO qp_arrest_warrant (status, poiID, jobID, court, judge, stationID, mugshot, arrestingBadgeID, processingBadgeID, createdDate, updatedDate) VALUES (:status, :poiID, :jobID, :court, :judge, :stationID, :newPhotoName, :arrestingBadgeID, :processingBadgeID, now(),now())\";\n $statement = $conn->prepare($sql);\n //Binds a value to a corresponding named or question mark placeholder in the SQL statement that was used to prepare the statement.\n $statement->bindValue(':status', $status);\n $statement->bindValue(':poiID', $poiID);\n $statement->bindValue(':jobID', $jobID);\n $statement->bindValue(':court', $court);\n $statement->bindValue(':judge', $judge);\n $statement->bindValue(':stationID', $stationID);\n $statement->bindValue(':newPhotoName', $newPhotoName);\n $statement->bindValue(':arrestingBadgeID', $arrestingBadgeID);\n $statement->bindValue(':processingBadgeID', $processingBadgeID);\n $result = $statement->execute();\n $statement->closeCursor();\n return $result;\n }", "function add_appt($apptinfo){\n\n\tif (!validate_appt($apptinfo)){\n\t\treturn null;\n\t}\n\n\telse {\n\t\t$sql = \"INSERT INTO qmse (submitter_id,tech_id,tt,type,building,room,datetime) VALUES (\"; \n\t\t$sql .= \"'\".$apptinfo['submitter_id'].\"', \"; \n\t\t$sql .= \"'\".$apptinfo['tech_id'].\"', \"; \n\t\t$sql .= \"'\".$apptinfo['tt'].\"', \";\n\t\t$sql .= \"'\".$apptinfo['type'].\"', \";\n\t\t$sql .= \"'\".$apptinfo['building'].\"', \";\n\t\t$sql .= \"'\".$apptinfo['room'].\"', \";\n\t\t$sql .= \"'\".$apptinfo['datetime'].\"')\";\n\n\t\t//echo $sql;\n\n\t\t$_SESSION['dbconn']->query($sql) or die(\"Error adding quest: \".$_SESSION['dbconn']->error);\n\t\t$_SESSION['notifications'][] = \"New Quest submitted!\";\n\t}\n}", "function warquest_db_player_insert($name, $pid) {\r\n\r\n\t/* input */\r\n\tglobal $config;\r\n\t\r\n\t/* Create user account */\r\n\t$query = 'insert into player (';\r\n\t$query .= 'pid, name, language, ';\r\n\t$query .= 'ammo, ammo_step, ammo_date, ';\r\n\t$query .= 'health, health_step, health_date, ';\r\n\t$query .= 'energy, energy_step, energy_date, ';\r\n\t$query .= 'money, money_step, money_date, ';\r\n\t$query .= 'bonus_date, ';\r\n\t$query .= 'restore_health, restore_energy, restore_ammo, cease_fire_date, holiday_date, ';\r\n\t$query .= 'bank1, bank2, bank3, ';\t\r\n\t$query .= 'lid, alliance, won_level, default_amount, bounty_level, rebel_level, mission_level,';\r\n\t$query .= 'request, request_date, last_battle, background, pattern, ';\r\n\t$query .= 'country, gold, planet, premium_date) ';\r\n\t$query .= 'values (';\t\r\n\t$query .= $pid.', \"'.warquest_db_escape($name).'\", \"en\", ';\r\n\t$query .= $config[\"init_ammo_max\"].', '.$config[\"init_ammo_step\"].', \"'.date(\"Y-m-d H:i:s\", (time()+$config[\"init_ammo_timer\"])).'\", ';\r\n\t$query .= $config[\"init_health_max\"].', '.$config[\"init_health_step\"].', \"'.date(\"Y-m-d H:i:s\", (time()+$config[\"init_health_timer\"])).'\", ';\t\r\n\t$query .= $config[\"init_energy_max\"].', '.$config[\"init_energy_step\"].', \"'.date(\"Y-m-d H:i:s\", (time()+$config[\"init_energy_timer\"])).'\", ';\r\n\t$query .= $config[\"init_money\"].', '.$config[\"init_money_step\"].', \"'.date(\"Y-m-d H:i:s\", (time()+$config[\"init_money_timer\"])).'\", ';\t\r\n\t$query .= '\"'.date(\"Y-m-d H:i:s\", time()-10).'\", ';\r\n\t$query .= '\"'.date(\"Y-m-d H:i:s\", time()-10).'\", \"'.date(\"Y-m-d H:i:s\", time()-10).'\", \"'.date(\"Y-m-d H:i:s\", time()-10).'\", \"'.date(\"Y-m-d H:i:s\", time()-10).'\", \"'.date(\"Y-m-d H:i:s\", time()-10).'\", ';\r\n\t$query .= $config[\"init_money_bank1\"].','.$config[\"init_money_bank2\"].','.$config[\"init_money_bank3\"].',';\r\n\t$query .= $config[\"init_level\"].', 1, 1, 1, 1, 1, 1, ';\r\n\t$query .= '1,\"'.date(\"Y-m-d H:i:s\", time()).'\", \"'.date(\"Y-m-d H:i:s\", time()).'\",2,\"0010000000000000\", ';\r\n\t$query .= '\"'.warquest_getlocation($_SERVER[\"REMOTE_ADDR\"]).'\", 0, '.PLANET_EARTH.',\"'.date(\"Y-m-d H:i:s\", time()).'\")'; \r\n\t\t\r\n\t$result = warquest_db_query($query);\r\n\t\r\n\t/* Initial bank balance */\r\n\tif ($config[\"init_money_bank1\"]>0) {\r\n\t\twarquest_db_bank_insert($pid, 0, 1, $config[\"init_money_bank1\"], $config[\"init_money_bank1\"], 4);\t\r\n\t}\r\n\tif ($config[\"init_money_bank2\"]>0) {\r\n\t\twarquest_db_bank_insert($pid, 0, 2, $config[\"init_money_bank2\"], $config[\"init_money_bank2\"], 4);\t\r\n\t}\r\n\tif ($config[\"init_money_bank3\"]>0) {\r\n\t\twarquest_db_bank_insert($pid, 0, 3, $config[\"init_money_bank3\"], $config[\"init_money_bank3\"], 4);\t\r\n\t}\t\r\n\t\r\n\treturn $result;\r\n}", "function addExcessWorkflowRoth($employee_id, $employer_id, $refund, $date) {\r\n\t$title = \"Roth Refund \". $refund.\", On \".$date;\r\n\t$requestor_type = 'Employee';\r\n\t$action_type = 'Employer';\r\n\t$status = 'Pending';\r\n\t$sql = \"select id from workflow where name = 'Excess Contribution' ORDER BY id ASC LIMIT 1\";\r\n\t$rs = mysql_query($sql) or die('error');\r\n\tif(mysql_num_rows($rs)) {\r\n\t\t$rec = mysql_fetch_array($rs);\r\n\t\t$wf_id = $rec['id'];\r\n\t} else {\r\n\t\t$wf_id = 2;\r\n\t}\r\n\t$insertSQL = \"INSERT INTO actions (title, id, requestor_id, requestor_type, action_type, wf_id, status) VALUES ('\".$title.\"', '\".$employer_id.\"', '\".$employee_id.\"', '\".$requestor_type.\"', '\".$action_type.\"', '\".$wf_id.\"', '\".$status.\"')\";\r\n\r\n $Result1 = mysql_query($insertSQL) or die(mysql_error());\r\n}", "function newPoll($dinner, $location, $type) {\n\n include(\"foodledbinfo.php\");\n\n try {\n $db = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);\n\n // TODO: Error handling on all \"prepare\" calls (results could be null)!!!\n\n // find a new available poll id, guessing that it will be at least as high as the count plus the first item's id\n $pollid = -1;\n $stmt = $db->prepare(\"SELECT pollid FROM polls\");\n $stmt->execute();\n $row = $stmt->fetch();\n if ($row) {\n $pollid = $row[0];\n }\n else {\n print \"ERROR: couldn't select any pollid in the polls table\";\n }\n\n $stmt = $db->prepare(\"SELECT COUNT(*) FROM polls\");\n $stmt->execute();\n $row = $stmt->fetch();\n if ($row) {\n $pollid += $row[0];\n }\n else {\n print \"ERROR: couldn't select count from polls table!\";\n }\n\n // If we failed to find a unique id, iterate forward and keep trying\n $stmt = $db->prepare(\"SELECT * FROM polls WHERE pollid = $pollid\");\n $stmt->execute();\n $row = $stmt->fetch();\n while ($row) {\n $pollid += 1;\n $stmt = $db->prepare(\"SELECT * FROM polls WHERE pollid = $pollid\");\n $stmt->execute();\n $row = $stmt->fetch();\n }\n\n $stmt = $db->prepare(\"INSERT INTO polls VALUES (?, 0, 0, NULL, ?, ?, ?, NULL)\");\n $stmt->bindParam(1, $pollid);\n $stmt->bindParam(2, $dinner);\n $stmt->bindParam(3, $location);\n $stmt->bindParam(4, $type);\n $stmt->execute();\n\n $db = null;\n \n } catch (PDOException $e) {\n print \"Error!: \" . $e->getMessage() . \"<br/>\";\n die();;\n }\n\n return $pollid;\n}", "public function add_opp_final()\t{\n\t\tif($this->session->userdata('uid')){\n\t\t\t$owner_id = $this->session->userdata('uid');\n\t\t\t$json = file_get_contents(\"php://input\");\n\t\t\t$obj = json_decode($json);\n\n\t\t\t$data['opportunity_id']\t= $obj->opportunity_id;\n\t\t\t$data['opportunity_name'] = $obj->opportunity_name;\n\t\t\t$data['target'] = $obj->target;\n\t\t\t$data['lead_cust_id'] = $obj->lead_cust_id;\n\t\t\t$data['opportunity_contact'] = implode(':',$obj->opportunity_contact);\n\t\t\t$data['product_id'] = $obj->product_list;\n\t\t\t$data['currency_id'] = $obj->currency_list;\n\t\t\t$data['industry_id'] = $obj->industry_list;\n\t\t\t$data['location_id'] = $obj->location_list;\n\t\t\t$data['opp_remarks'] = $obj->opp_remarks;\n\t\t\t$data['sell_type'] = $obj->sell_type;\n\t\t\t$data['cycle_id'] = $obj->cycle_id;\n\t\t\t$data['stage_id'] = $obj->stage_id;\n\n\t\t\ttry {\n\t\t\t\t// check if qualifier passed for given opportunity...\n\t\t\t\t$has_passed_qualifier = $this->opp_common->check_qualifier_passed($data['opportunity_id']);\n\t\t\t\tif ($has_passed_qualifier == true) {\n\t\t\t\t\techo $this->addOpportunity($data, $owner_id);\n\t\t\t\t\treturn ;\n\t\t\t\t} else {\n\t\t\t\t\t$returnArray= array(\n\t\t\t\t\t\t'message' => 'Could not create opportunity as you have not passed the qualifier',\n\t\t\t\t\t\t'status'=>false,\n\t\t\t\t\t\t'qualifier'=>false);\n\t\t\t\t\techo json_encode($returnArray);\n\t\t\t\t}\n\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t}\n\t\t} else {\n\t\t\tredirect('indexController');\n\t\t}\n\t}" ]
[ "0.6008451", "0.57071483", "0.5570855", "0.55281305", "0.5475917", "0.54720783", "0.528642", "0.5279844", "0.5275862", "0.5261023", "0.5256919", "0.524961", "0.517968", "0.5149262", "0.5147964", "0.51186734", "0.5104035", "0.50866205", "0.5080184", "0.50785327", "0.5044323", "0.5042877", "0.5031332", "0.49994537", "0.49817166", "0.4971273", "0.49513134", "0.49329364", "0.49194044", "0.491388" ]
0.6103977
0
Test without set now.
public function testWithoutSetNow() { $humanDate = new HumanDate($this->timezone, $this->lang); $formattedDate = $humanDate->format(new \DateTime('-6 seconds')); $expectedDate = '6 seconds ago'; $this->assertEquals($expectedDate, $formattedDate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testTime()\n {\n $this->todo('stub');\n }", "public function testNow()\n {\n Chronos::useTimezone(\"EUROPE/Berlin\");\n date_default_timezone_set(\"EUROPE/Berlin\");\n $chronos = Chronos::now();\n\n $this->assertSame((int)date(\"Y\"), $chronos->year());\n $this->assertSame((int)date(\"m\"), $chronos->month());\n $this->assertSame((int)date(\"d\"), $chronos->day());\n $this->assertSame((int)date(\"w\"), $chronos->weekDay());\n $this->assertSame((int)date(\"z\"), $chronos->yearDay());\n $this->assertSame((int)date(\"W\"), $chronos->week());\n $this->assertSame((int)date(\"H\"), $chronos->hour());\n $this->assertSame((int)date(\"i\"), $chronos->minute());\n $this->assertSame((int)date(\"s\"), $chronos->second());\n }", "private function controlTimestamp()\n {\n if ($this->timestamp == '')\n $this->now();\n }", "public function testChangeTime() {\n\t\t$this->assertTrue(is_int($this->object->changeTime()));\n\t\t$this->assertTrue(is_null($this->temp->changeTime()));\n\t}", "abstract public function freshTimestamp();", "function now();", "abstract protected function now(): float;", "public function testExample()\n {\n $post = new Post();\n $this->assertTrue($post->timestamps);\n }", "public function testTimeHasNotPassed() {\n $last_run = $this->time - 400;\n\n $this->state\n ->expects($this->any())\n ->method('get')\n ->with('cron_timer.foo.baz')\n ->willReturn($last_run);\n\n $has_passed = $this->cronTimer->hasTimeSinceLastRunPassed('foo.baz', 500);\n $this->assertFalse($has_passed);\n }", "public function testFromNow()\n {\n $date = Chronos::now();\n $date = $date->modify('-1 year')\n ->modify('-6 days')\n ->modify('-51 seconds');\n $interval = Chronos::fromNow($date);\n $result = $interval->format('%y %m %d %H %i %s');\n $this->assertSame($result, '1 0 6 00 0 51');\n }", "public static function callable_test() {\n\t\tself::$time = \"Time = \" . rand();\n\n\t\techo self::$time;\n\t}", "public function testLastEventTime()\n {\n $ipLimiter = new Syntaxseed\\IPLimiter\\IPLimiter(new DatabasePDO(self::$pdo), 'syntaxseed_iplimiter');\n $ipLimiter->event('0.0.0.1', 'phpunit');\n //$ipLimiter->log();\n $last = $ipLimiter->last(false);\n $lastSecsAgo = $ipLimiter->last();\n\n $this->assertIsInt($last);\n $this->assertLessThan($last, $lastSecsAgo);\n }", "public function testGet0()\n{\n\n // Traversed conditions\n // if (!$object) == false (line 576)\n\n $actual = $this->simplePie_Parse_Date->get();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testUpdateCurrentDate()\n {\n $this->quote->expects($this->once())\n ->method('setUpdatedAt')\n ->willReturnSelf();\n $this->assertEquals($this->quote, $this->quoteUpdater->updateCurrentDate($this->quote));\n }", "public function testGet1()\n{\n\n // Traversed conditions\n // if (!$object) == true (line 576)\n\n $actual = $this->simplePie_Parse_Date->get();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testPreUpdate()\n {\n $user = new User();\n $user->preUpdate();\n\n Assert::assertNotEmpty($user->getUpdatedAt());\n }", "public function testIsAccountNonExpired()\n {\n $this->assertTrue($this->object->isAccountNonExpired());\n\n // Set now as expire date. Should make it expired.\n $targetTime = new \\DateTime();\n $this->object->setAccountExpireDate($targetTime);\n $this->assertFalse($this->object->isAccountNonExpired());\n\n // A future date should result in being not expired.\n $targetTime->add(new \\DateInterval('P2D'));\n $this->object->setAccountExpireDate($targetTime);\n $this->assertTrue($this->object->isAccountNonExpired());\n }", "function time()\n{\n return \\yiiunit\\framework\\caching\\CacheTestCase::$time ?: \\time();\n}", "public function testExpiry() {\n\t\t$session1 = uniqid();\n\t\t$store = $this->getStore();\n\n\t\t// Store data now\n\t\t$data1 = array(\n\t\t\t'Food' => 'Pizza'\n\t\t);\n\t\t$store->write($session1, serialize($data1));\n\t\t$result1 = $store->read($session1);\n\t\t$this->assertEquals($data1, unserialize($result1));\n\n\t\t// Go to the future and test that the expiry is accurate\n\t\tSS_Datetime::set_mock_now('2040-03-16 12:00:00');\n\t\t$result2 = $store->read($session1);\n\t\t$this->assertEmpty($result2);\n\t}", "public function Test(){\n if (!parent::Test()) return false;\n return $this->Update(true);\n }", "public function testAccessTime() {\n\t\t$this->assertTrue(is_int($this->object->accessTime()));\n\t\t$this->assertTrue(is_null($this->temp->accessTime()));\n\t}", "public function testTime () {\n $this->tiempoDePrueba = New TiempoReal();\n \n $prediccion = $this->tiempoDePrueba->time();\n sleep(5);\n $this->assertEquals(($this->tiempoDePrueba->time() - 5), $prediccion);\n }", "function test_update_new() {\n\t}", "static function check_ab_test_not_expired( $now = null ) {\n\t\t// Get the current timestamp in GMT\n\t\t$now = empty( $now ) ? current_time( 'timestamp', 1 ) : $now;\n\n\t\t// Arguments are hour, minute, second, month, day, year. So, we are getting the timestamp for GMT timestamp\n\t\t// for the October 5th, 2017.\n\t\t$expiration = gmmktime( 0, 0, 0, 10, 5, 2017 );\n\n\t\treturn $expiration >= $now;\n\t}", "public function test_event() {\n $this->timer->start();\n $this->timer->stop();\n $this->asserts->accessing->\n assert_exists($this->timer->events[0], array('note', 'lap', 'cumulative', 'percentage', 'time'));\n }", "public function testExpiry()\n {\n $session1 = uniqid();\n $store = $this->getStore();\n\n // Store data now\n $data1 = array(\n 'Food' => 'Pizza'\n );\n $store->write($session1, serialize($data1));\n $result1 = $store->read($session1);\n $this->assertEquals($data1, unserialize($result1 ?? ''));\n\n // Go to the future and test that the expiry is accurate\n DBDatetime::set_mock_now('2040-03-16 12:00:00');\n $result2 = $store->read($session1);\n\n $this->assertEmpty($result2);\n }", "public function testExpiresInThePast()\n\t {\n\t\t$expires = new DateTime(\"now\");\n\t\t$interval = new DateInterval(\"PT10S\");\n\t\t$expires->sub($interval);\n\n\t\t$page = $this->_callResponder($expires->format(DateTime::RFC1123));\n\n\t\tsleep(5);\n\n\t\t$cached = $this->_callResponder($expires->format(DateTime::RFC1123));\n\t\t$this->assertNotEquals($page, $cached);\n\t }", "function checkNewTicketTime(){\n\t}", "public function testModifiedTime() {\n\t\t$this->assertTrue(is_int($this->object->modifiedTime()));\n\t\t$this->assertTrue(is_null($this->temp->modifiedTime()));\n\t}", "public function testGetMetadataValidTimestamp()\n {\n if (class_exists('ReflectionClass')) {\n $reflectionClass = new ReflectionClass(\"OneLogin_Saml_AuthRequest\");\n $method = $reflectionClass->getMethod('_getTimestamp');\n \n if (method_exists($method, 'setAccessible')) {\n $method->setAccessible(true);\n\n $settingsDir = TEST_ROOT .'/settings/';\n include $settingsDir.'settings1.php';\n\n $metadata = new OneLogin_Saml_AuthRequest($settingsInfo);\n\n $time = time();\n $timestamp = $method->invoke($metadata);\n $this->assertEquals(strtotime($timestamp), $time);\n }\n }\n }" ]
[ "0.7091602", "0.65340173", "0.6432608", "0.63785714", "0.62594205", "0.6250979", "0.62453055", "0.62405217", "0.62387866", "0.62325335", "0.61088693", "0.61021453", "0.6058878", "0.6034138", "0.60102415", "0.60095537", "0.6008211", "0.600762", "0.59946036", "0.5993935", "0.59922284", "0.5980311", "0.5979104", "0.59719133", "0.5955059", "0.59490216", "0.5946378", "0.59274006", "0.59249806", "0.59211093" ]
0.67971146
1
Data for test short months.
public function dataShortMonths() { return array( array('2015-01-15 00:00:00', '2015-01-01 00:00:00', '15 Jan at 12:00 am'), array('2015-02-15 00:00:00', '2015-01-01 00:00:00', '15 Feb at 12:00 am'), array('2015-03-15 00:00:00', '2015-01-01 00:00:00', '15 Mar at 12:00 am'), array('2015-04-15 00:00:00', '2015-01-01 00:00:00', '15 Apr at 12:00 am'), array('2015-05-15 00:00:00', '2015-01-01 00:00:00', '15 May at 12:00 am'), array('2015-06-15 00:00:00', '2015-01-01 00:00:00', '15 Jun at 12:00 am'), array('2015-07-15 00:00:00', '2015-01-01 00:00:00', '15 Jul at 12:00 am'), array('2015-08-15 00:00:00', '2015-01-01 00:00:00', '15 Aug at 12:00 am'), array('2015-09-15 00:00:00', '2015-01-01 00:00:00', '15 Sep at 12:00 am'), array('2015-10-15 00:00:00', '2015-01-01 00:00:00', '15 Oct at 12:00 am'), array('2015-11-15 00:00:00', '2015-01-01 00:00:00', '15 Nov at 12:00 am'), array('2015-12-15 00:00:00', '2015-01-01 00:00:00', '15 Dec at 12:00 am'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_month(){\n // $start->modify('first day of this month');\n // $end = new DateTime('2019-06-20');\n // $end->modify('first day of next month');\n // $interval = DateInterval::createFromDateString('1 month');\n // $period = new DatePeriod($start, $interval, $end);\n\n // foreach ($period as $dt) {\n // echo $dt->format(\"M-y\") . \"<br>\\n\";\n // echo $dt->format(\"m\") . \"<br>\\n\";\n // }\n\n // echo json_encode($period);\n\n // $this->export_model->generate_monthly_sales_overview_report();\n $this->export_model->generate_monthly_sales_overview_zonewise_report();\n }", "public function dataMonths()\n {\n return array(\n array('2015-01-15 00:00:00', '2015-01-01 00:00:00', '15 January at 12:00 am'),\n array('2015-02-15 00:00:00', '2015-01-01 00:00:00', '15 February at 12:00 am'),\n array('2015-03-15 00:00:00', '2015-01-01 00:00:00', '15 March at 12:00 am'),\n array('2015-04-15 00:00:00', '2015-01-01 00:00:00', '15 April at 12:00 am'),\n array('2015-05-15 00:00:00', '2015-01-01 00:00:00', '15 May at 12:00 am'),\n array('2015-06-15 00:00:00', '2015-01-01 00:00:00', '15 June at 12:00 am'),\n array('2015-07-15 00:00:00', '2015-01-01 00:00:00', '15 July at 12:00 am'),\n array('2015-08-15 00:00:00', '2015-01-01 00:00:00', '15 August at 12:00 am'),\n array('2015-09-15 00:00:00', '2015-01-01 00:00:00', '15 September at 12:00 am'),\n array('2015-10-15 00:00:00', '2015-01-01 00:00:00', '15 October at 12:00 am'),\n array('2015-11-15 00:00:00', '2015-01-01 00:00:00', '15 November at 12:00 am'),\n array('2015-12-15 00:00:00', '2015-01-01 00:00:00', '15 December at 12:00 am'),\n );\n }", "public function months() {\n print Kohana::debug(date::months());\n }", "public function month();", "public function monthly(): self;", "public function testMonth()\n {\n $date = Zend_Locale_Data::getList('de_AT', 'months');\n $result = [\n 'context' => 'format',\n 'default' => 'wide',\n 'format' =>\n [\n 'abbreviated' =>\n [\n 1 => 'Jän.',\n 2 => 'Feb.',\n 3 => 'März',\n 4 => 'Apr.',\n 5 => 'Mai',\n 6 => 'Juni',\n 7 => 'Juli',\n 8 => 'Aug.',\n 9 => 'Sep.',\n 10 => 'Okt.',\n 11 => 'Nov.',\n 12 => 'Dez.',\n ],\n 'narrow' =>\n [\n 1 => 'J',\n 2 => 'F',\n 3 => 'M',\n 4 => 'A',\n 5 => 'M',\n 6 => 'J',\n 7 => 'J',\n 8 => 'A',\n 9 => 'S',\n 10 => 'O',\n 11 => 'N',\n 12 => 'D',\n ],\n 'wide' =>\n [\n 1 => 'Jänner',\n 2 => 'Februar',\n 3 => 'März',\n 4 => 'April',\n 5 => 'Mai',\n 6 => 'Juni',\n 7 => 'Juli',\n 8 => 'August',\n 9 => 'September',\n 10 => 'Oktober',\n 11 => 'November',\n 12 => 'Dezember',\n ],\n ],\n 'stand-alone' =>\n [\n 'abbreviated' =>\n [\n 1 => 'Jän',\n 2 => 'Feb',\n 3 => 'Mär',\n 4 => 'Apr',\n 5 => 'Mai',\n 6 => 'Jun',\n 7 => 'Jul',\n 8 => 'Aug',\n 9 => 'Sep',\n 10 => 'Okt',\n 11 => 'Nov',\n 12 => 'Dez',\n ],\n 'narrow' =>\n [\n 1 => 'J',\n 2 => 'F',\n 3 => 'M',\n 4 => 'A',\n 5 => 'M',\n 6 => 'J',\n 7 => 'J',\n 8 => 'A',\n 9 => 'S',\n 10 => 'O',\n 11 => 'N',\n 12 => 'D',\n ],\n 'wide' =>\n [\n 1 => 'Jänner',\n 2 => 'Februar',\n 3 => 'März',\n 4 => 'April',\n 5 => 'Mai',\n 6 => 'Juni',\n 7 => 'Juli',\n 8 => 'August',\n 9 => 'September',\n 10 => 'Oktober',\n 11 => 'November',\n 12 => 'Dezember',\n ],\n ],\n ];\n $this->assertEquals($result, $date, var_export($date, 1));\n\n $date = Zend_Locale_Data::getList('de_AT', 'months', 'islamic');\n $result = [\n \"context\" => \"format\",\n \"default\" => \"wide\",\n \"format\" =>\n [\n \"abbreviated\" => [\n 1 => \"Muh.\",\n 2 => \"Saf.\",\n 3 => \"Rab. I\",\n 4 => \"Rab. II\",\n 5 => \"Jum. I\",\n 6 => \"Jum. II\",\n 7 => \"Raj.\",\n 8 => \"Sha.\",\n 9 => \"Ram.\",\n 10 => \"Shaw.\",\n 11 => \"Dhuʻl-Q.\",\n 12 => \"Dhuʻl-H.\"\n ],\n \"narrow\" => [\n 1 => '1',\n 2 => '2',\n 3 => '3',\n 4 => '4',\n 5 => '5',\n 6 => '6',\n 7 => '7',\n 8 => '8',\n 9 => '9',\n 10 => '10',\n 11 => '11',\n 12 => '12'\n ],\n \"wide\" => [\n 1 => \"Muharram\",\n 2 => \"Safar\",\n 3 => \"Rabiʻ I\",\n 4 => \"Rabiʻ II\",\n 5 => \"Jumada I\",\n 6 => \"Jumada II\",\n 7 => \"Rajab\",\n 8 => \"Shaʻban\",\n 9 => \"Ramadan\",\n 10 => \"Shawwal\",\n 11 => \"Dhuʻl-Qiʻdah\",\n 12 => \"Dhuʻl-Hijjah\"\n ]\n ],\n \"stand-alone\" => [\n \"abbreviated\" => [\n 1 => \"Muh.\",\n 2 => \"Saf.\",\n 3 => \"Rab. I\",\n 4 => \"Rab. II\",\n 5 => \"Jum. I\",\n 6 => \"Jum. II\",\n 7 => \"Raj.\",\n 8 => \"Sha.\",\n 9 => \"Ram.\",\n 10 => \"Shaw.\",\n 11 => \"Dhuʻl-Q.\",\n 12 => \"Dhuʻl-H.\"\n ],\n \"narrow\" => [\n 1 => '1',\n 2 => '2',\n 3 => '3',\n 4 => '4',\n 5 => '5',\n 6 => '6',\n 7 => '7',\n 8 => '8',\n 9 => '9',\n 10 => '10',\n 11 => '11',\n 12 => '12'\n ],\n \"wide\" => [\n 1 => \"Muharram\",\n 2 => \"Safar\",\n 3 => \"Rabiʻ I\",\n 4 => \"Rabiʻ II\",\n 5 => \"Jumada I\",\n 6 => \"Jumada II\",\n 7 => \"Rajab\",\n 8 => \"Shaʻban\",\n 9 => \"Ramadan\",\n 10 => \"Shawwal\",\n 11 => \"Dhuʻl-Qiʻdah\",\n 12 => \"Dhuʻl-Hijjah\"\n ]\n ]\n ];\n $this->assertEquals($result, $date);\n\n $date = Zend_Locale_Data::getList('de_AT', 'month');\n $this->assertEquals(\n [\n 1 => \"Jänner\",\n 2 => \"Februar\",\n 3 => \"März\",\n 4 => \"April\",\n 5 => \"Mai\",\n 6 => \"Juni\",\n 7 => \"Juli\",\n 8 => \"August\",\n 9 => \"September\",\n 10 => \"Oktober\",\n 11 => \"November\",\n 12 => \"Dezember\"\n ],\n $date\n );\n\n $date = Zend_Locale_Data::getList('de_AT', 'month', ['gregorian', 'format', 'wide']);\n $this->assertEquals(\n [\n 1 => \"Jänner\",\n 2 => \"Februar\",\n 3 => \"März\",\n 4 => \"April\",\n 5 => \"Mai\",\n 6 => \"Juni\",\n 7 => \"Juli\",\n 8 => \"August\",\n 9 => \"September\",\n 10 => \"Oktober\",\n 11 => \"November\",\n 12 => \"Dezember\"\n ],\n $date\n );\n\n $value = Zend_Locale_Data::getContent('de_AT', 'month', 12);\n $this->assertEquals('Dezember', $value);\n\n $value = Zend_Locale_Data::getContent('de_AT', 'month', ['gregorian', 'format', 'wide', 12]);\n $this->assertEquals('Dezember', $value);\n\n $value = Zend_Locale_Data::getContent('ar', 'month', ['islamic', 'format', 'wide', 1]);\n $this->assertEquals(\"محرم\", $value);\n }", "public function getShortMonths() {\n\n // Initialize the short months.\n $shortMonths = [];\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.jan\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.feb\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.mar\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.apr\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.may\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.jun\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.jul\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.aug\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.sep\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.oct\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.nov\", [], \"HighchartsBundle\", $this->translator->getLocale());\n $shortMonths[] = $this->translator->trans(\"options.lang.shortMonths.dec\", [], \"HighchartsBundle\", $this->translator->getLocale());\n\n // Return the short months.\n return $shortMonths;\n }", "public function testDefaultMonth()\n {\n $date = Zend_Locale_Data::getContent('de_AT', 'defaultmonth');\n $this->assertEquals(\"wide\", $date);\n\n $date = Zend_Locale_Data::getContent('de_AT', 'defaultmonth', 'islamic');\n $this->assertEquals(\"wide\", $date);\n }", "function getMonths();", "public function monthlyMedicalReport(){\n \n \n }", "public function testMoreDates()\n {\n $date = new DateTime('2016-04-01');\n $this->calc->setStartDate($date);\n $result = $this->invokeMethod($this->calc,'calculateMonth',[$date]);\n\n // we should have an array with three keys\n $valid = (is_array($result) && array_key_exists('month',$result) && array_key_exists('salary_date',$result) && array_key_exists('bonus_date',$result));\n $this->assertTrue($valid);\n\n // Month should read April\n $this->assertEquals('April',$result['month']);\n\n // Salary Date should read 2015-04-29 (The 30th is a Saturday)\n $this->assertEquals('29 Apr 2016',$result['salary_date']);\n\n // Bonus Date should read 2016-05-18 (the 15th is a Sunday)\n $this->assertEquals('18 May 2016',$result['bonus_date']);\n }", "public function fullMonth()\n {\n return $this->config->months(date('n', $this->dateTime));\n }", "function get_months()\n{\n return [\n '01' => __('time.months.01'),\n '02' => __('time.months.02'),\n '03' => __('time.months.03'),\n '04' => __('time.months.04'),\n '05' => __('time.months.05'),\n '06' => __('time.months.06'),\n '07' => __('time.months.07'),\n '08' => __('time.months.08'),\n '09' => __('time.months.09'),\n '10' => __('time.months.10'),\n '11' => __('time.months.11'),\n '12' => __('time.months.12'),\n ];\n}", "public function get_months() {\n\t\t\treturn array(\n\t\t\t\t'January' => __( 'January', 'jet-engine' ),\n\t\t\t\t'February' => __( 'February', 'jet-engine' ),\n\t\t\t\t'March' => __( 'March', 'jet-engine' ),\n\t\t\t\t'April' => __( 'April', 'jet-engine' ),\n\t\t\t\t'May' => __( 'May', 'jet-engine' ),\n\t\t\t\t'June' => __( 'June', 'jet-engine' ),\n\t\t\t\t'July' => __( 'July', 'jet-engine' ),\n\t\t\t\t'August' => __( 'August', 'jet-engine' ),\n\t\t\t\t'September' => __( 'September', 'jet-engine' ),\n\t\t\t\t'October' => __( 'October', 'jet-engine' ),\n\t\t\t\t'November' => __( 'November', 'jet-engine' ),\n\t\t\t\t'December' => __( 'December', 'jet-engine' ),\n\t\t\t);\n\t\t}", "public function month()\n {\n return $this->config->numbers(date('m', $this->dateTime));\n }", "private function _data_first_month_day() {\n $month = date('m');\n $year = date('Y');\n return date('Ymd', mktime(0,0,0, $month, 1, $year));\n }", "public function isThisMonth();", "private function _generateTime()\n {\n // Get date\n $timeFirst = strtotime($this->data->getFirstReportDate());\n $timeNow = time();\n \n // Generate month\n $monthFirst = strtotime(date('Y-m', $timeFirst));\n $monthLast = strtotime(date('Y-m'));\n \n $data = [\n 'months' => [],\n 'years' => []\n ];\n \n while ($monthLast > $monthFirst)\n {\n $monthValue = date('m', $monthLast);\n $yearValue = date('Y', $monthLast);\n $month = $yearValue.'-'.$monthValue;\n \n // Push data to container\n $data['months'][$month] = date('F Y', $monthLast);\n \n if (!array_key_exists($yearValue, $data['years']))\n {\n $data['years'][$yearValue] = $yearValue;\n }\n \n $days = 30;\n \n // For february 28 days\n if ($monthValue == '03') \n {\n $days = 28;\n }\n \n // Decrement month\n $monthLast -= 3600*24*$days;\n }\n \n return $data;\n }", "static function getMonths() {\n\t\t$months = array();\n\t\t$months[ 1 ] = \"January\";\n\t\t$months[ 2 ] = \"February\";\n\t\t$months[ 3 ] = \"March\";\n\t\t$months[ 4 ] = \"April\";\n\t\t$months[ 5 ] = \"May\";\n\t\t$months[ 6 ] = \"June\";\n\t\t$months[ 7 ] = \"July\";\n\t\t$months[ 8 ] = \"August\";\n\t\t$months[ 9 ] = \"September\";\n\t\t$months[ 10 ] = \"October\";\n\t\t$months[ 11 ] = \"November\";\n\t\t$months[ 12 ] = \"December\";\n\n\t\treturn $months;\n\t}", "public function setMonths() : void\n\t{\n\t\t$this->months = $this->usageQueries->getMonths();\n\t}", "function list_month()\n{\n $notice_period = array(\n '01' => 'JAN',\n '02' => 'FEB',\n '03' => 'MAR',\n '04' => 'APR',\n '05' => 'MAY',\n '06' => 'JUN',\n '07' => 'JUL',\n '08' => 'AUG',\n '09' => 'SEP',\n '10' => 'OCT',\n '11' => 'NOV',\n '12' => 'DEC');\n return $notice_period;\n}", "public function getMonth(): int;", "public function testDefaultMonthContext()\n {\n $date = Zend_Locale_Data::getContent('de_AT', 'monthcontext');\n $this->assertEquals(\"format\", $date);\n\n $date = Zend_Locale_Data::getContent('de_AT', 'monthcontext', 'islamic');\n $this->assertEquals(\"format\", $date);\n }", "public function setMonth(\\stdClass $data)\n {\n $this->month = Period::createFromJson($data);\n }", "function getCcExpMonth();", "function create_commission_month() {\n\n\t//given that TDW starts with NFS Data as of JAN 18th 2006, lets start the date ranges from commission month 2006 Jan,\n\t//reverse chronological order\n\t\n\t$today_bmqy = get_brok_mqy(date('Y-m-d'));\n\t$arr_today_bmqy = explode('-',$today_bmqy);\n\n\t$str_output_options = \"\";\n\t\n\tfor ($i=0; $i<24; $i++) {\n\t\t\n\t\t$lastmonth = mktime(0, 0, 0, $arr_today_bmqy[0]-$i, \"01\", $arr_today_bmqy[2]);\n\t\t\n\t\t\tif ( $lastmonth < strtotime('2006-01-01')) {\n\t\t\t\t//do nothing\n\t\t\t} else {\n\t\t\t\t$putyear = date('Y', $lastmonth);\n\t\t\t\t$putmonth = date('M', $lastmonth);\n\t\t\t\t$str_output_options .=\t'<option value=\"'.$putmonth.'^'.$putyear.'\">'.$putmonth.' '.$putyear.'</option>'.\"\\n\";\t\t\t\n\t\t\t}\n\t}\n\treturn $str_output_options;\n}", "function testTwelve()\n\t{\n\t\t$results[] = new DateTime('1997-09-22 09:00:00');\n\t\t$results[] = new DateTime('1997-10-20 09:00:00');\n\t\t$results[] = new DateTime('1997-11-17 09:00:00');\n\t\t$results[] = new DateTime('1997-12-22 09:00:00');\n\t\t$results[] = new DateTime('1998-01-19 09:00:00');\n\t\t$results[] = new DateTime('1998-02-16 09:00:00');\n\t\t\n\t\t$r = new When();\n\t\t$r->recur('19970922T090000', 'monthly')->count(6)->byday(array('-2MO'));\n\t\t\n\t\tforeach($results as $result)\n\t\t{\n\t\t\t$this->assertEquals($result, $r->next());\n\t\t}\n\t}", "public function getEachMonth(){\n $m = I('post.month','','htmlspecialchars');//\n //$m = \"02\";\n $res = [];\n $res0 = [];\n //echo C(DATEORIYEAR);\n $DATEYEAR = date(\"Y\",time());\n //echo $DATEYEAR;\n for($i=C(DATEORIYEAR);$i<=$DATEYEAR;$i++){\n //echo $i;\n $fromdate = $i.\"-\".$m.\"-01\";\n $todate = $i.\"-\".$m.\"-31\";\n $res0 = getDayToDayYears($fromdate,$todate);\n if(empty($res0)){\n $res0 = [];\n }\n $res = array_merge($res,$res0);\n //print_r($res0);\n\n }\n $i = 0;\n for($i = 0; $i<count($res);$i++){\n //echo ($k[\"name\"]);\n //echo (count($k[\"values\"]));\n //print_r($res[$i][\"values\"]);\n if(count($res[$i][\"values\"]) == 0){\n unset($res[$i]);\n }\n //echo \"<br>\";\n }\n //print_r($res);\n $this->ajaxReturn($res);\n }", "function is_valid_month( $value, $key = '', array $data = array() ) {\n\treturn $value >= 1 && $value <= 12;\n}", "public function Months()\n {\n $this->render('basic/months');\n }" ]
[ "0.7409365", "0.638413", "0.6366011", "0.62775457", "0.618878", "0.6157663", "0.6157483", "0.61545575", "0.61255026", "0.5928678", "0.592733", "0.5908725", "0.5870427", "0.58665186", "0.57719964", "0.5739858", "0.5711177", "0.5693929", "0.5693498", "0.56888306", "0.56789523", "0.567529", "0.56674516", "0.5666782", "0.56328577", "0.5583668", "0.557997", "0.55785334", "0.5524483", "0.5522181" ]
0.6969891
1
Data for test dates in past time.
public function dataPastTime() { return array( array('2015-01-15 00:00:00', '2015-01-15 00:00:01', 'just now'), array('2015-01-15 00:00:00', '2015-01-15 00:00:06', '6 seconds ago'), array('2015-01-15 00:00:00', '2015-01-15 00:00:45', 'one minute ago'), array('2015-01-15 00:00:00', '2015-01-15 00:01:45', 'two minutes ago'), array('2015-01-15 00:00:00', '2015-01-15 00:02:45', 'three minutes ago'), array('2015-01-15 00:00:00', '2015-01-15 00:03:45', 'four minutes ago'), array('2015-01-15 00:00:00', '2015-01-15 00:04:45', '5 minutes ago'), array('2015-01-15 00:00:00', '2015-01-15 00:05:29', '5 minutes ago'), array('2015-01-15 00:00:00', '2015-01-15 00:05:30', '6 minutes ago'), array('2015-01-15 00:00:00', '2015-01-15 00:45:45', 'one hour ago'), array('2015-01-15 00:00:00', '2015-01-15 01:45:45', 'two hours ago'), array('2015-01-15 00:00:00', '2015-01-15 02:45:45', 'three hours ago'), array('2015-01-15 00:00:00', '2015-01-15 03:45:45', 'four hours ago'), array('2015-01-15 00:00:00', '2015-01-15 04:45:46', 'today at 12:00 am'), array('2015-01-15 00:00:00', '2015-01-16 04:45:46', 'yesterday at 12:00 am'), array('2015-01-15 00:00:00', '2015-01-17 04:45:46', '15 Jan at 12:00 am'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test()\n {\n // $today = date(\"Y-m-d\");\n // $result['date'] = $this->get_date_diff('2018-12-19 20:01:56');\n $result['date'] = $this->get_date_diff('2018-12-19');\n return $result;\n }", "public function test_isPast()\n {\n $task = new Task();\n $task->due_date = \"2021-10-11\";\n\n\n }", "public function testPastTime($date, $now, $expected)\n {\n $this->assertDateToFormat($date, $now, $expected);\n }", "public function test_create_past_task()\n {\n $task = Task::factory()->make([\n 'due_date' => '2021-10-11'\n ]);\n $this->assertTrue($task->isPast());\n }", "function date_past($value, $daysBeforeToday = 0) {\n // array. If there is a parameter(s) passed then it prepends those to the array of parameters sent.\n // In the object class it calls the method with the array of parameters in the order they are in the\n // array. Thsi means that if there is not a parameter specified that the full validation array ends\n // up in $daysBeforeToday, but if a parameter is specified then the parameter value ends up in\n // $daysBeforeToday. So we have to check to see if $daysBeforeToday is the value we expect, or\n // if it is the validation array before going forward.\n if (is_array($daysBeforeToday))\n $daysBeforeToday = 0;\n\n $userDate = date_create($value['value']);\n if ($userDate) {\n // This line uses string to time (strtotime) to convert the current time (minus some number of days)\n // to a 'time' value. Then strftime is used to convert the integer 'time' value into a string in the\n // ddMMMYYYY format. This string is then fed into date_create so that we can have an actual date to\n // use for comparison. If php had a date_sub (or date_diff) function in PHP5(.2) this would not be a problem\n $testDate = date_create(strftime('%d%b%Y', strtotime('-'.$daysBeforeToday.' day')));\n if ($userDate < $testDate) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n }", "function testGetRequestCountsDt()\n {\n $this->assertEquals('1980-07-01 00:00:00', $this->governer->getRequestCountsDt('1980-07-01 00:00:00')->format('Y-m-d H:i:s'));\n $this->assertEquals('1980-07-01 00:00:00', $this->governer->getRequestCountsDt('1980-07-01 00:00:01')->format('Y-m-d H:i:s'));\n $this->assertEquals('1980-07-01 00:00:00', $this->governer->getRequestCountsDt('1980-07-01 00:04:59')->format('Y-m-d H:i:s'));\n $this->assertEquals('1980-07-01 00:05:00', $this->governer->getRequestCountsDt('1980-07-01 00:05:00')->format('Y-m-d H:i:s'));\n }", "public function test_create_past_task()\n {\n $task = Task::factory()->create([\n 'due_date' => '2021-10-11'\n ]);\n $this->assertTrue($task->isPast());\n }", "public function test_get_due_date() {\n $this->resetAfterTest();\n\n $tsquiz = new plagiarism_turnitinsim_quiz();\n $response = $tsquiz->get_due_date(0);\n $this->assertEquals(0, $response);\n }", "public function getDates()\n\t{\n\t\treturn ['last_used'];\n\t}", "public function testWithoutSetNow()\n {\n $humanDate = new HumanDate($this->timezone, $this->lang);\n\n $formattedDate = $humanDate->format(new \\DateTime('-6 seconds'));\n $expectedDate = '6 seconds ago';\n\n $this->assertEquals($expectedDate, $formattedDate);\n }", "public function isYesterday();", "public function getDateTaken();", "public function testConstructWithInvalidDate()\n {\n new Date(\n (new Mockery($this))->getYearMock(2017),\n (new Mockery($this))->getMonthMock(2),\n (new Mockery($this))->getDayMock(31)\n );\n }", "function date_future($value, $daysAfterToday = 0) {\n // array. If there is a parameter(s) passed then it prepends those to the array of parameters sent.\n // In the object class it calls the method with the array of parameters in the order they are in the\n // array. Thsi means that if there is not a parameter specified that the full validation array ends\n // up in $daysBeforeToday, but if a parameter is specified then the parameter value ends up in\n // $daysBeforeToday. So we have to check to see if $daysBeforeToday is the value we expect, or\n // if it is the validation array before going forward.\n if (is_array($daysAfterToday))\n $daysAfterToday = 0;\n\n $userDate = date_create($value['value']);\n if ($userDate) {\n // This line uses string to time (strtotime) to convert the current time (plus some number of days)\n // to a 'time' value. Then strftime is used to convert the integer 'time' value into a string in the\n // ddMMMYYYY format. This string is then fed into date_create so that we can have an actual date to\n // use for comparison. If php had a date_add (or date_diff) function in PHP5(.2) this would not be a problem\n $testDate = date_create(strftime('%d%b%Y', strtotime('+'.$daysAfterToday.' day')));\n if ($userDate > $testDate) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n }", "public function test() {\n\t\t$out = [];\n\t\t$sanitizer = $this->wire('sanitizer');\n\t\ttry {\n\t\t\t$events = $this->getEvents([ 'timeMin' => time() ]);\n\t\t\tforeach($events->getItems() as $event) {\n\t\t\t\t$start = $event->getStart()->dateTime;\n\t\t\t\tif(empty($start)) $start = $event->getStart()->date;\n\t\t\t\t$out[] = \"<tr><td>\" . $sanitizer->entities($event->getSummary()) . \"</td><td>$start</td></tr>\"; \n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t$out[] = \"Google Calendar test failed: \" . \n\t\t\t\tget_class($e) . ' ' . \n\t\t\t\t$e->getCode() . ' — ' . \n\t\t\t\t$sanitizer->entities($e->getMessage());\n\t\t}\n\t\tif(count($out)) {\n\t\t\t$out = \"<table border='1'>\" . implode(\"\\n\", $out) . \"</table>\";\n\t\t} else {\n\t\t\t$out = \"No upcoming events found.\";\n\t\t}\n\t\t$out = \"<div><strong>Google Calendar — Upcoming Events Test:</strong></div>$out\";\n\t\treturn $out; \n\t}", "public function testPastMeetingDetails()\n {\n }", "public function testData()\n {\n dd(Carbon::parse('2019-10-20 06:10:10')->format('Y-m-d h:i:s'));\n }", "public function testGetEndDate()\n {\n $this->assertEquals(\n $this->testEndDate,\n $this->fundingCycle->getEndDate()\n );\n }", "public function testDates() {\n $this->helpDt(\"en\",\"2001-03-30\",\"2001-03-30\",2001,3,30,false,false);\n $this->helpDt(\"en\",\"280 BC\",\"280 B.C.E.\",280,null,null,true,false);\n $this->helpDt(\"en\",\"c. 280 BC\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"ca. 280 BCE\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"circa 280 B.C.E.\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"c. 280 b.c.\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"en/de\",\"c. 280 BCE\",\"c. 280 v.u.Z.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"-150\",\"151 B.C.E.\",151,null,null,true,false);\n $this->helpDt(\"en\",\"-150 bc\",\"151 B.C.E.\",151,null,null,true,false);\n $this->helpDt(\"en\",\"150\",\"150 C.E.\",150,null,null,false,false);\n $this->helpDt(\"en\",\"1500\",\"1500\",1500,null,null,false,false);\n $this->helpDt(\"en\",\"bork\",\"?bork?\",null,null,null,false,false);\n $this->helpDt(\"en\",\"1957-04\",\"1957-04\",1957,4,null,false,false);\n $this->helpDt(\"en\",\"1957/04\",\"1957-04\",1957,4,null,false,false);\n $this->helpDt(\"en\",\"1957.04\",\"1957-04\",1957,4,null,false,false);\n $this->helpDt(\"en\",\"1957-04-25\",\"1957-04-25\",1957,4,25,false,false);\n $this->helpDt(\"en\",\"1957/04/25\",\"1957-04-25\",1957,4,25,false,false);\n $this->helpDt(\"en/de\",\"c. 280 BCE\",\"c. 280 v.u.Z.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"October 1957\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"en\",\"1957 october\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"en\",\"OCT 1957\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"en\",\"1957 Oct\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"en\",\"October 14, 1957\",\"1957-10-14\",1957,10,14,false,false);\n $this->helpDt(\"en\",\"14-Oct-1957\",\"1957-10-14\",1957,10,14,false,false);\n $this->helpDt(\"de/en\",\"ca. 280 vuZ\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"de\",\"2001-03-30\",\"2001-03-30\",2001,3,30,false,false);\n $this->helpDt(\"de\",\"280 v.chr.\",\"280 v.u.Z.\",280,null,null,true,false);\n $this->helpDt(\"de\",\"c. 280 vuz\",\"c. 280 v.u.Z.\",280,null,null,true,true);\n $this->helpDt(\"de\",\"Oktober 1957\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"de\",\"1957 oktober\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"de\",\"OKT 1957\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"de\",\"1957 Okt\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"de\",\"Oktober 14, 1957\",\"1957-10-14\",1957,10,14,false,false);\n $this->helpDt(\"de\",\"14-Okt-1957\",\"1957-10-14\",1957,10,14,false,false);\n $this->helpDt(\"de\",\"Mär 14, 1957\",\"1957-03-14\",1957,03,14,false,false);\n $this->helpDt(\"de\",\"14-März-1957\",\"1957-03-14\",1957,03,14,false,false);\n }", "public function testFuture()\n {\n $date = new \\DateTime();\n $date->add(new \\DateInterval('P2D'));\n\n $timeAgo = new \\Westsworld\\TimeAgo(new FutureEn());\n $dateDifference = $timeAgo->dateDifference($date);\n $this->assertEquals(2, $dateDifference['days']);\n \n $dateInWords = $timeAgo->inWords($date);\n $this->assertEquals('2 days to go', $dateInWords);\n }", "public function testValueValid(): void {\n $transform = $this->getTransform('get_easterdatetime', [\n 'source' => 'source',\n 'field' => 'example_source_field',\n 'format' => 'Y-m-d',\n ]);\n $result = $transform->transform([\n 'example_source_field' => '2021-04-19'\n ]);\n\n // calculate easter\n $days = \\easter_days('2021');\n $easterDate = (new \\DateTime('2021-04-19'))\n ->setDate('2021', 3, 21)\n ->add(new \\DateInterval(\"P{$days}D\"))\n ->format('Y-m-d');\n\n // Make sure it stays an array\n $this->assertEquals($easterDate, $result );\n }", "public function testReturnDateIsCorrect()\n {\n $this->assertNotEmpty($this->pageParser->getDate());\n }", "public function testGetDateList()\n {\n $response = $this->call('GET', '/api/dates');\n\n $this->assertResponseOk();\n\n $response = $this->call('GET', '/api/dates/12');\n\n $this->assertResponseOk();\n }", "public function getDates() {\n return ['created_at', 'updated_at', 'deadline', 'start_date', 'due_date', 'estimate_valid_until'];\n }", "function checkIfInThePast($date) {\n // set today date\n $today = date('Ymd');\n // if date is less than today\n if (strtotime($date) < strtotime($today)) {\n // return true\n // i.e. yes date is in the past\n return true;\n } // if\n }", "public function testSetValidDate()\n {\n $e = new Event(\n 1,\n 12345,\n '2014-11-18 08:15:00',\n '2014-11-18 08:40:00',\n 6.56186974,\n 46.51895762,\n 'EPFL',\n 'Presentation of SmartMap app.',\n 'SmartMap is an app that shows you your friends and events on a map.'\n );\n\n $e->setEndingDate('2014-11-20 20:00:00');\n\n $this->assertEquals('2014-11-20 20:00:00', $e->getEndingDate());\n }", "public function dataFutureTime()\n {\n return array(\n array('2015-01-15 00:00:01', '2015-01-15 00:00:00', 'right now'),\n array('2015-01-15 00:00:06', '2015-01-15 00:00:00', 'in a 6 seconds'),\n array('2015-01-15 00:00:45', '2015-01-15 00:00:00', 'in a one minute'),\n array('2015-01-15 00:01:45', '2015-01-15 00:00:00', 'in a two minutes'),\n array('2015-01-15 00:02:45', '2015-01-15 00:00:00', 'in a three minutes'),\n array('2015-01-15 00:03:45', '2015-01-15 00:00:00', 'in a four minutes'),\n array('2015-01-15 00:04:45', '2015-01-15 00:00:00', 'in a 5 minutes'),\n array('2015-01-15 00:05:29', '2015-01-15 00:00:00', 'in a 5 minutes'),\n array('2015-01-15 00:05:30', '2015-01-15 00:00:00', 'in a 6 minutes'),\n array('2015-01-15 00:45:45', '2015-01-15 00:00:00', 'in a one hour'),\n array('2015-01-15 01:45:45', '2015-01-15 00:00:00', 'in a two hours'),\n array('2015-01-15 02:45:45', '2015-01-15 00:00:00', 'in a three hours'),\n array('2015-01-15 03:45:45', '2015-01-15 00:00:00', 'in a four hours'),\n array('2015-01-15 04:45:46', '2015-01-15 00:00:00', 'today at 4:45 am'),\n array('2015-01-16 04:45:46', '2015-01-15 00:00:00', 'tomorrow at 4:45 am'),\n array('2015-01-17 04:45:46', '2015-01-15 00:00:00', '17 Jan at 4:45 am'),\n );\n }", "public function timeAgoData()\n {\n $twoYears = new \\DateTime('-2 years');\n\n return array(\n // Check with DateTime\n array($twoYears, 'timeago.yearsago|2|%years%=2'),\n array(new \\DateTime('now'), 'timeago.justnow'),\n array(new \\DateTime('-2 minutes'), 'timeago.minutesago|2|%minutes%=2'),\n array(new \\DateTime('-2 hours'), 'timeago.hoursago|2|%hours%=2'),\n array(new \\DateTime('-2 days'), 'timeago.daysago|2|%days%=2'),\n array(new \\DateTime('-2 months'), 'timeago.monthsago|2|%months%=2'),\n // Check with string\n array($twoYears->format('Y-m-d H:i:s'), 'timeago.yearsago|2|%years%=2'),\n );\n }", "public function test_dates()\n {\n $input = CarbonImmutable::createFromFormat('Y-m-d', '2020-06-23');\n $actual = dates($input);\n $this->assertCount(35, $actual);\n $this->assertEquals('2020-05-31', $actual[0]->format('Y-m-d'));\n $this->assertEquals('2020-07-04', $actual[34]->format('Y-m-d'));\n }", "public function testFilterDate()\n {\n $response = $this->json('GET', '/api/cities/3531732/weather?from=2017-03-12&to=2017-03-21');\n\n $response\n ->assertStatus(200)\n ->assertJson(array (\n 'cityId' => 3531732,\n 'data' => \n array (\n 0 => \n array (\n 'dt' => 1489428000,\n 'temp' => \n array (\n 'day' => 299.15,\n 'min' => 298.2,\n 'max' => 299.15,\n 'night' => 298.2,\n 'eve' => 299.15,\n 'morn' => 299.15,\n ),\n 'pressure' => 1027.35,\n 'humidity' => 100,\n 'weather' => \n array (\n 0 => \n array (\n 'id' => 803,\n 'main' => 'Clouds',\n 'description' => 'broken clouds',\n 'icon' => '04n',\n ),\n ),\n 'speed' => 6.71,\n 'deg' => 337,\n 'clouds' => 68,\n 'uvi' => 10.34,\n ),\n )\n )\n );\n }" ]
[ "0.63963675", "0.62102413", "0.61099935", "0.6013551", "0.5993482", "0.59428906", "0.5882993", "0.58559895", "0.581672", "0.57762796", "0.576612", "0.571162", "0.570917", "0.5706421", "0.5699686", "0.56772107", "0.5657016", "0.565436", "0.5640259", "0.56172216", "0.55848646", "0.5573025", "0.5569933", "0.55551296", "0.55457586", "0.5534382", "0.5514713", "0.55123687", "0.5508204", "0.5501383" ]
0.6342881
1
Data for test dates in future time.
public function dataFutureTime() { return array( array('2015-01-15 00:00:01', '2015-01-15 00:00:00', 'right now'), array('2015-01-15 00:00:06', '2015-01-15 00:00:00', 'in a 6 seconds'), array('2015-01-15 00:00:45', '2015-01-15 00:00:00', 'in a one minute'), array('2015-01-15 00:01:45', '2015-01-15 00:00:00', 'in a two minutes'), array('2015-01-15 00:02:45', '2015-01-15 00:00:00', 'in a three minutes'), array('2015-01-15 00:03:45', '2015-01-15 00:00:00', 'in a four minutes'), array('2015-01-15 00:04:45', '2015-01-15 00:00:00', 'in a 5 minutes'), array('2015-01-15 00:05:29', '2015-01-15 00:00:00', 'in a 5 minutes'), array('2015-01-15 00:05:30', '2015-01-15 00:00:00', 'in a 6 minutes'), array('2015-01-15 00:45:45', '2015-01-15 00:00:00', 'in a one hour'), array('2015-01-15 01:45:45', '2015-01-15 00:00:00', 'in a two hours'), array('2015-01-15 02:45:45', '2015-01-15 00:00:00', 'in a three hours'), array('2015-01-15 03:45:45', '2015-01-15 00:00:00', 'in a four hours'), array('2015-01-15 04:45:46', '2015-01-15 00:00:00', 'today at 4:45 am'), array('2015-01-16 04:45:46', '2015-01-15 00:00:00', 'tomorrow at 4:45 am'), array('2015-01-17 04:45:46', '2015-01-15 00:00:00', '17 Jan at 4:45 am'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test()\n {\n // $today = date(\"Y-m-d\");\n // $result['date'] = $this->get_date_diff('2018-12-19 20:01:56');\n $result['date'] = $this->get_date_diff('2018-12-19');\n return $result;\n }", "public function testDates() {\n $this->helpDt(\"en\",\"2001-03-30\",\"2001-03-30\",2001,3,30,false,false);\n $this->helpDt(\"en\",\"280 BC\",\"280 B.C.E.\",280,null,null,true,false);\n $this->helpDt(\"en\",\"c. 280 BC\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"ca. 280 BCE\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"circa 280 B.C.E.\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"c. 280 b.c.\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"en/de\",\"c. 280 BCE\",\"c. 280 v.u.Z.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"-150\",\"151 B.C.E.\",151,null,null,true,false);\n $this->helpDt(\"en\",\"-150 bc\",\"151 B.C.E.\",151,null,null,true,false);\n $this->helpDt(\"en\",\"150\",\"150 C.E.\",150,null,null,false,false);\n $this->helpDt(\"en\",\"1500\",\"1500\",1500,null,null,false,false);\n $this->helpDt(\"en\",\"bork\",\"?bork?\",null,null,null,false,false);\n $this->helpDt(\"en\",\"1957-04\",\"1957-04\",1957,4,null,false,false);\n $this->helpDt(\"en\",\"1957/04\",\"1957-04\",1957,4,null,false,false);\n $this->helpDt(\"en\",\"1957.04\",\"1957-04\",1957,4,null,false,false);\n $this->helpDt(\"en\",\"1957-04-25\",\"1957-04-25\",1957,4,25,false,false);\n $this->helpDt(\"en\",\"1957/04/25\",\"1957-04-25\",1957,4,25,false,false);\n $this->helpDt(\"en/de\",\"c. 280 BCE\",\"c. 280 v.u.Z.\",280,null,null,true,true);\n $this->helpDt(\"en\",\"October 1957\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"en\",\"1957 october\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"en\",\"OCT 1957\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"en\",\"1957 Oct\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"en\",\"October 14, 1957\",\"1957-10-14\",1957,10,14,false,false);\n $this->helpDt(\"en\",\"14-Oct-1957\",\"1957-10-14\",1957,10,14,false,false);\n $this->helpDt(\"de/en\",\"ca. 280 vuZ\",\"c. 280 B.C.E.\",280,null,null,true,true);\n $this->helpDt(\"de\",\"2001-03-30\",\"2001-03-30\",2001,3,30,false,false);\n $this->helpDt(\"de\",\"280 v.chr.\",\"280 v.u.Z.\",280,null,null,true,false);\n $this->helpDt(\"de\",\"c. 280 vuz\",\"c. 280 v.u.Z.\",280,null,null,true,true);\n $this->helpDt(\"de\",\"Oktober 1957\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"de\",\"1957 oktober\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"de\",\"OKT 1957\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"de\",\"1957 Okt\",\"1957-10\",1957,10,null,false,false);\n $this->helpDt(\"de\",\"Oktober 14, 1957\",\"1957-10-14\",1957,10,14,false,false);\n $this->helpDt(\"de\",\"14-Okt-1957\",\"1957-10-14\",1957,10,14,false,false);\n $this->helpDt(\"de\",\"Mär 14, 1957\",\"1957-03-14\",1957,03,14,false,false);\n $this->helpDt(\"de\",\"14-März-1957\",\"1957-03-14\",1957,03,14,false,false);\n }", "public function testFuture()\n {\n $date = new \\DateTime();\n $date->add(new \\DateInterval('P2D'));\n\n $timeAgo = new \\Westsworld\\TimeAgo(new FutureEn());\n $dateDifference = $timeAgo->dateDifference($date);\n $this->assertEquals(2, $dateDifference['days']);\n \n $dateInWords = $timeAgo->inWords($date);\n $this->assertEquals('2 days to go', $dateInWords);\n }", "public function testData()\n {\n dd(Carbon::parse('2019-10-20 06:10:10')->format('Y-m-d h:i:s'));\n }", "public function testMoreDates()\n {\n $date = new DateTime('2016-04-01');\n $this->calc->setStartDate($date);\n $result = $this->invokeMethod($this->calc,'calculateMonth',[$date]);\n\n // we should have an array with three keys\n $valid = (is_array($result) && array_key_exists('month',$result) && array_key_exists('salary_date',$result) && array_key_exists('bonus_date',$result));\n $this->assertTrue($valid);\n\n // Month should read April\n $this->assertEquals('April',$result['month']);\n\n // Salary Date should read 2015-04-29 (The 30th is a Saturday)\n $this->assertEquals('29 Apr 2016',$result['salary_date']);\n\n // Bonus Date should read 2016-05-18 (the 15th is a Sunday)\n $this->assertEquals('18 May 2016',$result['bonus_date']);\n }", "public function test() {\n\t\t$out = [];\n\t\t$sanitizer = $this->wire('sanitizer');\n\t\ttry {\n\t\t\t$events = $this->getEvents([ 'timeMin' => time() ]);\n\t\t\tforeach($events->getItems() as $event) {\n\t\t\t\t$start = $event->getStart()->dateTime;\n\t\t\t\tif(empty($start)) $start = $event->getStart()->date;\n\t\t\t\t$out[] = \"<tr><td>\" . $sanitizer->entities($event->getSummary()) . \"</td><td>$start</td></tr>\"; \n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t$out[] = \"Google Calendar test failed: \" . \n\t\t\t\tget_class($e) . ' ' . \n\t\t\t\t$e->getCode() . ' — ' . \n\t\t\t\t$sanitizer->entities($e->getMessage());\n\t\t}\n\t\tif(count($out)) {\n\t\t\t$out = \"<table border='1'>\" . implode(\"\\n\", $out) . \"</table>\";\n\t\t} else {\n\t\t\t$out = \"No upcoming events found.\";\n\t\t}\n\t\t$out = \"<div><strong>Google Calendar — Upcoming Events Test:</strong></div>$out\";\n\t\treturn $out; \n\t}", "private function getTestingReservationData()\n {\n $nextMonday = Carbon::parse('next monday')->format('Y-m-d 11:00');\n\n return [\n 'date' => Carbon::createFromFormat('Y-m-d H:i', $nextMonday),\n 'email' => 'test@test.cz',\n 'phone' => '777111222',\n 'street' => 'ABCDE',\n 'name' => 'Vojta Svoboda',\n 'message' => 'Hello.',\n 'status' => $this->getDefaultStatus(),\n ];\n }", "public function test_isPast()\n {\n $task = new Task();\n $task->due_date = \"2021-10-11\";\n\n\n }", "function testGetRequestCountsDt()\n {\n $this->assertEquals('1980-07-01 00:00:00', $this->governer->getRequestCountsDt('1980-07-01 00:00:00')->format('Y-m-d H:i:s'));\n $this->assertEquals('1980-07-01 00:00:00', $this->governer->getRequestCountsDt('1980-07-01 00:00:01')->format('Y-m-d H:i:s'));\n $this->assertEquals('1980-07-01 00:00:00', $this->governer->getRequestCountsDt('1980-07-01 00:04:59')->format('Y-m-d H:i:s'));\n $this->assertEquals('1980-07-01 00:05:00', $this->governer->getRequestCountsDt('1980-07-01 00:05:00')->format('Y-m-d H:i:s'));\n }", "public function test_get_due_date() {\n $this->resetAfterTest();\n\n $tsquiz = new plagiarism_turnitinsim_quiz();\n $response = $tsquiz->get_due_date(0);\n $this->assertEquals(0, $response);\n }", "public function testFutureTime($date, $now, $expected)\n {\n $this->assertDateToFormat($date, $now, $expected);\n }", "function testTen()\n\t{\n\t\t$results[] = new DateTime('1997-09-05 09:00:00');\n\t\t$results[] = new DateTime('1997-10-03 09:00:00');\n\t\t$results[] = new DateTime('1997-11-07 09:00:00');\n\t\t$results[] = new DateTime('1997-12-05 09:00:00');\n\t\t\n\t\t$r = new When();\n\t\t$r->recur('19970905T090000', 'monthly')->until('19971224T000000')->byday(array('1FR'));\n\t\t\n\t\tforeach($results as $result)\n\t\t{\n\t\t\t$this->assertEquals($result, $r->next());\n\t\t}\n\t}", "public function testGetDateList()\n {\n $response = $this->call('GET', '/api/dates');\n\n $this->assertResponseOk();\n\n $response = $this->call('GET', '/api/dates/12');\n\n $this->assertResponseOk();\n }", "public function testValueValid(): void {\n $transform = $this->getTransform('get_easterdatetime', [\n 'source' => 'source',\n 'field' => 'example_source_field',\n 'format' => 'Y-m-d',\n ]);\n $result = $transform->transform([\n 'example_source_field' => '2021-04-19'\n ]);\n\n // calculate easter\n $days = \\easter_days('2021');\n $easterDate = (new \\DateTime('2021-04-19'))\n ->setDate('2021', 3, 21)\n ->add(new \\DateInterval(\"P{$days}D\"))\n ->format('Y-m-d');\n\n // Make sure it stays an array\n $this->assertEquals($easterDate, $result );\n }", "public function test_event_dates() {\n $title = \"Test Creating Events with Dates\";\n error_log(\"++++++++++++++++++++++++++++$title+++++++++++++++++++++++++++++++++++++++++++\");\n\n $clubs = Club::search('Tyandaga');\n $this->assertCount(1,$clubs);\n $club = $clubs[0];\n $this->assertEquals('Tyandaga Tennis Club',$club->getName());\n\n \n $parent = new Event('Year End Tournament');\n $this->assertTrue($parent->isRoot(),'Test is root');\n $this->assertEquals('Year End Tournament',$parent->getName(),'Test get name');\n $this->assertFalse($parent->isParent(),'Test parent event is not parent yet');\n $this->assertTrue($club->isValid(),'Test that Club is valid before adding it.');\n $this->assertTrue($parent->addClub($club),'Test adding club to parent event');\n $this->assertTrue($parent->setEventType(EventType::TOURNAMENT));\n $this->assertEquals(EventType::TOURNAMENT,$parent->getEventType());\n\n //Child event\n $child = new Event('Mens Singles');\n $this->assertEquals('Mens Singles',$child->getName());\n $this->assertTrue($child->setFormat(Format::SINGLE_ELIM),'Setting format for child 1');\n $this->assertEquals( $child->getMatchType(), MatchType::MENS_SINGLES );\n $this->assertEquals(Format::SINGLE_ELIM,$child->getFormat());\n $this->assertFalse($child->isParent(),'Test for child 1 not parent');\n $this->assertTrue($parent->addChild($child),'Adding child');\n $this->assertTrue($child->isValid(),'Test that child 1 is valid');\n\n $this->assertTrue($child->setSignupBy('2018/2/14'),'Test setting signup date');\n $test = $child->getSignupBy_Str();\n // $mess = isset($test) ? \" ***** signup by = $test\" : \" **** signup by is null\";\n // fwrite(STDOUT,PHP_EOL . __METHOD__ .$mess . PHP_EOL);\n $this->assertEquals('2018-02-14 00:00:00',$test);\n \n $this->assertTrue($child->setStartDate('2018/02/16'),'Test setting start date');\n $test = $child->getStartDate_Str();\n // $mess = isset($test) ? \" ***** start = $test\" : \" **** start is null\";\n // fwrite(STDOUT,PHP_EOL . __METHOD__ .$mess . PHP_EOL);\n $this->assertEquals('2018-02-16 00:00:00',$test);\n\n $this->assertTrue($child->setEndDate('2018/02/20'),'Test setting end date');\n $test = $child->getEndDate_Str();\n // $mess = isset($test) ? \" ***** end = $test\" : \" **** end is null\";\n // fwrite(STDOUT,PHP_EOL . __METHOD__ .$mess . PHP_EOL);\n $this->assertEquals('2018-02-20 00:00:00',$test);\n\n $test = $child->getEndDate_ISO();\n $this->assertEquals('2018-02-20T00:00:00+0000',$test);\n // $mess = isset($test) ? \" ***** end ISO = $test\" : \" **** end ISO is null\";\n // fwrite(STDOUT,PHP_EOL . __METHOD__ .$mess . PHP_EOL);\n }", "public function setUp()\n {\n $now = new \\DateTime();\n $addingDays = 20;\n $interval = new \\DateInterval('P'.$addingDays.'D');\n $this->visitDate = $now->add($interval);\n }", "public function test_dates()\n {\n $input = CarbonImmutable::createFromFormat('Y-m-d', '2020-06-23');\n $actual = dates($input);\n $this->assertCount(35, $actual);\n $this->assertEquals('2020-05-31', $actual[0]->format('Y-m-d'));\n $this->assertEquals('2020-07-04', $actual[34]->format('Y-m-d'));\n }", "public function getDates() {\n return ['created_at', 'updated_at', 'deadline', 'start_date', 'due_date', 'estimate_valid_until'];\n }", "public function test_create_past_task()\n {\n $task = Task::factory()->make([\n 'due_date' => '2021-10-11'\n ]);\n $this->assertTrue($task->isPast());\n }", "public function testFilterDate()\n {\n $response = $this->json('GET', '/api/cities/3531732/weather?from=2017-03-12&to=2017-03-21');\n\n $response\n ->assertStatus(200)\n ->assertJson(array (\n 'cityId' => 3531732,\n 'data' => \n array (\n 0 => \n array (\n 'dt' => 1489428000,\n 'temp' => \n array (\n 'day' => 299.15,\n 'min' => 298.2,\n 'max' => 299.15,\n 'night' => 298.2,\n 'eve' => 299.15,\n 'morn' => 299.15,\n ),\n 'pressure' => 1027.35,\n 'humidity' => 100,\n 'weather' => \n array (\n 0 => \n array (\n 'id' => 803,\n 'main' => 'Clouds',\n 'description' => 'broken clouds',\n 'icon' => '04n',\n ),\n ),\n 'speed' => 6.71,\n 'deg' => 337,\n 'clouds' => 68,\n 'uvi' => 10.34,\n ),\n )\n )\n );\n }", "public function test1() {\n\t\t$testObj = new SourceState ( 1, 1 );\n\t\treturn $testObj->getDataOfDay ( '2015', '06', '10' );\n\t}", "function testScheduleGetAllByDate() {\n //========================================= \n \n // To verify get all by Date Parlay Schedule is valid\n //========================================= \n }", "public function definition()\n {\n // $faker = Faker\\Factory::create('ja_JP');\n $ret_start = $this->faker->dateTimeBetween('-50day', '-10day');\n\n // echo var_dump($ret_start);\n // dd ($ret_start);\n\n return [\n //\n 'user_id' => $this->faker->numberBetween(1,5),\n 'start' => $ret_start->format('Y-m-d H:i:s'),\n 'end' => $ret_start->modify('+1hour')->format('Y-m-d H:i:s'),\n 'status' => '1',\n ];\n }", "public function testSetValidDate()\n {\n $e = new Event(\n 1,\n 12345,\n '2014-11-18 08:15:00',\n '2014-11-18 08:40:00',\n 6.56186974,\n 46.51895762,\n 'EPFL',\n 'Presentation of SmartMap app.',\n 'SmartMap is an app that shows you your friends and events on a map.'\n );\n\n $e->setEndingDate('2014-11-20 20:00:00');\n\n $this->assertEquals('2014-11-20 20:00:00', $e->getEndingDate());\n }", "public function testConstructWithInvalidDate()\n {\n new Date(\n (new Mockery($this))->getYearMock(2017),\n (new Mockery($this))->getMonthMock(2),\n (new Mockery($this))->getDayMock(31)\n );\n }", "private function _GetTimes() {\n\t// Get current date / time\n\t//$TodaysDate = time(); // Timestamp format\n\t//$this->Date = $TodaysDate;\n\t$this->OneDay = new DateInterval(\"P1D\");\n\t\n\t$this->Today = date('Y-m-d');\n\t$this->Date = new DateTime($this->Today);\n }", "function testDateDataType() {\n $data = array(\n 'id' => 1,\n 'datefield' => date('Y-m-d'),\n );\n $this->insertValues($data);\n $this->selectAndCheck($data);\n }", "public function testGetEndDate()\n {\n $this->assertEquals(\n $this->testEndDate,\n $this->fundingCycle->getEndDate()\n );\n }", "public function dataPastTime()\n {\n return array(\n array('2015-01-15 00:00:00', '2015-01-15 00:00:01', 'just now'),\n array('2015-01-15 00:00:00', '2015-01-15 00:00:06', '6 seconds ago'),\n array('2015-01-15 00:00:00', '2015-01-15 00:00:45', 'one minute ago'),\n array('2015-01-15 00:00:00', '2015-01-15 00:01:45', 'two minutes ago'),\n array('2015-01-15 00:00:00', '2015-01-15 00:02:45', 'three minutes ago'),\n array('2015-01-15 00:00:00', '2015-01-15 00:03:45', 'four minutes ago'),\n array('2015-01-15 00:00:00', '2015-01-15 00:04:45', '5 minutes ago'),\n array('2015-01-15 00:00:00', '2015-01-15 00:05:29', '5 minutes ago'),\n array('2015-01-15 00:00:00', '2015-01-15 00:05:30', '6 minutes ago'),\n array('2015-01-15 00:00:00', '2015-01-15 00:45:45', 'one hour ago'),\n array('2015-01-15 00:00:00', '2015-01-15 01:45:45', 'two hours ago'),\n array('2015-01-15 00:00:00', '2015-01-15 02:45:45', 'three hours ago'),\n array('2015-01-15 00:00:00', '2015-01-15 03:45:45', 'four hours ago'),\n array('2015-01-15 00:00:00', '2015-01-15 04:45:46', 'today at 12:00 am'),\n array('2015-01-15 00:00:00', '2015-01-16 04:45:46', 'yesterday at 12:00 am'),\n array('2015-01-15 00:00:00', '2015-01-17 04:45:46', '15 Jan at 12:00 am'),\n );\n }", "public function test_create_past_task()\n {\n $task = Task::factory()->create([\n 'due_date' => '2021-10-11'\n ]);\n $this->assertTrue($task->isPast());\n }" ]
[ "0.6293063", "0.6078858", "0.6060155", "0.6041839", "0.6033525", "0.60246336", "0.6020988", "0.59707123", "0.58972347", "0.58810836", "0.58386904", "0.58325493", "0.5832377", "0.5790173", "0.57852405", "0.5766085", "0.57594067", "0.57336825", "0.5720529", "0.5718063", "0.5691208", "0.5686338", "0.5647503", "0.5624049", "0.56103545", "0.5606801", "0.5597137", "0.5592014", "0.5587835", "0.5585909" ]
0.6328268
0
Returns the ID of the rule where this target belongs.
public function getRuleId() { return $this->ruleId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getId() {\r\n\t\treturn $this->get('ruleid');\r\n\t}", "public function getRuleIdentifierHint(string $rule, Context $context): string;", "public function getRuleNumber()\n {\n return isset($this->rule_number) ? $this->rule_number : 0;\n }", "public function getTargetId()\r\n {\r\n return $this->get(self::_TARGET_ID);\r\n }", "public function getRule() {\n return $this->rule;\n }", "public function getRule() {\n return $this->rule;\n }", "public function getRule()\n {\n return $this->rule;\n }", "public function getIdTarget()\n {\n return $this->id_target;\n }", "public function getRule()\n {\n return $this->rule;\n }", "public function getTargetId()\n {\n $value = $this->get(self::TARGET_ID);\n return $value === null ? (integer)$value : $value;\n }", "public function getTargetId()\n {\n return $this->targetId;\n }", "public function getTargetId()\n {\n return $this->targetId;\n }", "public function getRule($id) {\r\n\t\treturn $this->rules[$id];\r\n\t}", "public function getTargetId() {\n\t\tswitch ($this->target) {\n\t\t\tcase 'field':\n\t\t\t\treturn $this->getField();\n\t\t\tcase 'prenote':\n\t\t\t\treturn $this->getPrenote();\n\t\t\tcase 'postnote':\n\t\t\t\treturn $this->getPostnote();\n\t\t\tcase 'column':\n\t\t\t\treturn $this->getColumn();\n\t\t\tcase 'fieldrow':\n\t\t\t\treturn $this->getFieldrow();\n\t\t\tcase 'fieldset':\n\t\t\t\treturn $this->getFieldset();\n\t\t\tcase 'section':\n\t\t\t\treturn $this->getSection();\n\t\t\tcase 'chapter':\n\t\t\t\treturn $this->getChapter();\n\t\t\tcase 'blockinfo':\n\t\t\t\treturn $this->getBlockinfo();\n\t\t\tcase 'step':\n\t\t\t\treturn $this->getStep();\n\t\t\tcase 'footnote':\n\t\t\t\treturn $this->getFootnote();\n\t\t\tcase 'action':\n\t\t\t\treturn $this->getAction();\n\t\t\tcase 'choice':\n\t\t\t\treturn $this->getChoice();\n\t\t}\n\t\treturn 0;\n\t}", "public function getTargetIdAttribute(): int;", "public function getRule( $id )\n {\n return $this->rules[$id];\n }", "public function getRuleGroupId(): UuidInterface\n {\n return $this->ruleGroupId;\n }", "public function getRelationCheckId()\n {\n return $this->relationCheckId;\n }", "public function getToRefid() {\n return $this->targetid;\n }", "public function getResourceId()\n {\n return $this->id;\n }", "public function getRuleName(): string\n {\n return $this->ruleName;\n }", "public function getMatchId() {\n if (!property_exists($this, 'id') || is_null($this->id)) {\n return NULL;\n }\n if (is_null($this->matchId)) {\n if ( !$cache = cache_get('getMatchId_' . $this->id, 'cache_tourney')) {\n $query = tourney_relation_query('tourney_game', $this->id);\n $query->entityCondition('bundle', 'has_game');\n $results = $query->execute();\n\n if (!empty($results)) {\n $relation = array_pop($results);\n $r = relation_load($relation->rid);\n $this->matchId = $r->endpoints[LANGUAGE_NONE][0]['entity_id'];\n }\n\n if (isset($this->matchId)) {\n cache_set('getMatchId_' . $this->id, $this->matchId, 'cache_tourney');\n }\n }\n else {\n $this->matchId = $cache->data;\n }\n }\n return $this->matchId;\n }", "public function getId()\n {\n return $this->getProperty('id');\n }", "public function getTargetIdFor(int $sourceId): int;", "public function getId() {\r\n\t\treturn $this->getProperty(\"id\");\r\n\t}", "public function getId() {\r\n\t\treturn $this->getProperty(\"id\");\r\n\t}", "public function getHelpTargetId()\n {\n $value = $this->get(self::HELP_TARGET_ID);\n return $value === null ? (integer)$value : $value;\n }", "public function id()\n {\n return explode('|', $this->recaller, 3)[0];\n }", "public function getID() {\n\t\t\n\t\treturn $this->id;\n\t}", "public function getIdentifier() {\n\t\treturn $this->id;\n\t}" ]
[ "0.8073345", "0.65463156", "0.6523398", "0.6506098", "0.6473085", "0.6473085", "0.64575875", "0.645325", "0.64397484", "0.64353377", "0.6381305", "0.6381305", "0.63052034", "0.61799645", "0.60684675", "0.6027147", "0.59509385", "0.5904191", "0.588963", "0.5800595", "0.5791192", "0.5770603", "0.5692554", "0.56888205", "0.5680063", "0.5680063", "0.5656819", "0.56543976", "0.5626753", "0.5615832" ]
0.827419
0
Ok here we add a fee record in
public function addFee($fee_data) { // all the fees can be added to the fees_charged table // except auto-relist That will have to be added to a reoccuring list because that only happens at each relisting $sql = "INSERT INTO " . DB_PREFIX . "fees_charged SET auction_id = '" . $this->db->escape($fee_data['auction_id']) . "', customer_id = '" . $this->db->escape($fee_data['customer_id']) . "', fee_code = '" . $this->db->escape($fee_data['fee_code']) . "', amount = '" . $this->db->escape($fee_data['amount']) . "', date_added = NOW()"; $this->db->query($sql); return $this->db->getLastId(); // this will return the fee id for adding to the cart and to add a transaction in }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insert_flex_so_fee()\r\n\t{\r\n\t\treturn TRUE;\r\n\t}", "public function createTargetFee() {\n $feeType = Input::get('fee_type');\n $feeAmt = Input::get('fee_amt');\n $currentDate = date('Y-m-d',strtotime('now'));\n $insert = DB::table('il_target_fee')->insert(array('fee_type' => $feeType,'fee_amt' => $feeAmt,'dateCreated' => $currentDate));\n if($insert)\n return Redirect::to('account/target-fee-list')->with('successalert','Target fee add successfully');\n else\n return Redirect::to('account/target-fee-list')->with('erroralert','Server Problem not updated successfully'); \n \n }", "function new_school_item_fee($data){\n\t\t\t$this->sys->insert('item_master',$data);\n\t\t\treturn $this->sys->insert_id();\n\t\t}", "function save_fee_record($rq)\n {\n $model = new Fee();\n //$model->category_name = $rq->categoryName;\n\n if ($model->save()) {\n return true;\n }\n\n return false;\n }", "function Add_Student_Fee_Entry()\n\t\t{\n\t\t\t$error = \"\";\n\t\t\t\n\t\t if(empty($_POST['feeStandardId']))\n\t\t\t{\n\t\t\t\t$error.= \"Please select standard.<br>\";\t\n\t\t\t}\n\t\t\tif(empty($_POST['feeClassId']))\n\t\t\t{\n\t\t\t\t$error.= \"Please select class.<br>\";\t\n\t\t\t}\n\t\t\tif(empty($_POST['feeDate']))\n\t\t\t{\n\t\t\t\t$error.= \"Please enter date.<br>\";\t\n\t\t\t}\n\t\t\tif(empty($_POST['feeStudentId']))\n\t\t\t{\n\t\t\t\t$error.= \"Please enter student name.<br>\";\t\n\t\t\t}\n\t\t\tif(empty($_POST['feeTypeTermId']))\n\t\t\t{\n\t\t\t\t$error.= \"Please select term.<br>\";\t\n\t\t\t}\n\t\t\tif(empty($_POST['feeTypeHeadId']))\n\t\t\t{\n\t\t\t\t$error.= \"Please select head.<br>\";\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t $column=\" feeReceiptNo='\".Common_Nijsol_Class::Set_Value($_POST['feeReceiptNo']).\"' and schCode='\".Common_Nijsol_Class::Get_Session('schCode').\"'\";\n\t\t\t\t $field = 'count(feeReceiptNo) as total';\n\t\t\t\t$result=$this->Get_Rows(DB_PREFIX.\"fee\",$column,$field);\n\t\t\t\t\n\t\t\t\tif($result[0]['total'] > 0)\t\n\t\t\t\t{\n\t\t\t\t\t$error.=\"Receipt number exists.<br>\";\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(empty($error))\n\t\t\t{\n\t\t\t\n\t\t\tif(empty($_POST['feeReceiptNo']))\n\t\t\t{\n\t\t\t\t\t$feeReceiptNo=$this->Direct_Query(\"SELECT max(feeReceiptNo) as feeReceiptNo FROM \".DB_PREFIX.\"fee WHERE schCode='\".Common_Nijsol_Class::Get_Session('schCode').\"'\");\n\t\t\t\t if(!empty($feeReceiptNo[0]['feeReceiptNo']))\n\t\t\t\t\t\t$feeReceiptNo=Common_Nijsol_Class::Get_Value($feeReceiptNo[0]['feeReceiptNo'])+1;\n\t\t\t\t else\n\t\t\t\t\t\t$feeReceiptNo=1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$feeReceiptNo=Common_Nijsol_Class::Set_Value($_POST['feeReceiptNo']);\n\t\t\t}\n\t\t\n\t\t$feeStandard=Common_Nijsol_Class::Get_One_Name(\"standard\",\"stnName\",\"stnId=\".Common_Nijsol_Class::Get_Value($_POST['feeStandardId']));\n\t\t\n\t\t$feeClass=Common_Nijsol_Class::Get_One_Name(\"class\",\"clsName\",\"clsId=\".Common_Nijsol_Class::Get_Value($_POST['feeClassId']));\n\t\t\n\t\t$feeTypeTerm=Common_Nijsol_Class::Get_One_Name(\"fee_collection_type\",\"fctType\",\"fctId=\".Common_Nijsol_Class::Get_Value($_POST['feeTypeTermId']));\n\t\t\n\t\t$feeTypeHead=Common_Nijsol_Class::Get_One_Name(\"organisation_name\",\"orgLongName\",\"orgId=\".Common_Nijsol_Class::Get_Value($_POST['feeTypeHeadId']));\n\t\t\n\t\t$studentName=$this->Direct_Query(\"SELECT stdSurname,stdStudentName,stdFatherName FROM \".DB_PREFIX.\"student WHERE schCode='\".Common_Nijsol_Class::Get_Session('schCode').\"' and stdId='\".Common_Nijsol_Class::Set_Value($_POST['feeStudentId']).\"'\");\n\t\t\n\t\t $feeStudentName=$studentName[0]['stdSurname'].\" \".$studentName[0]['stdStudentName'].\" \".$studentName[0]['stdFatherName'];\n\t\t\n\t\t\n\t\t\t\n\t\t$column=array(\n\t\t\t 'feeReceiptNo'=>Common_Nijsol_Class::Set_Value($feeReceiptNo),\n\t\t\t 'feeStandardId'=>Common_Nijsol_Class::Set_Value($_POST['feeStandardId']),\n\t\t\t 'feeStandard'=>Common_Nijsol_Class::Set_Value($feeStandard),\n\t\t\t 'feeClassId'=>Common_Nijsol_Class::Set_Value($_POST['feeClassId']),\n\t\t\t 'feeClass'=>Common_Nijsol_Class::Set_Value($feeClass),\n\t\t\t 'feeDate'=>Common_Nijsol_Class::Convert_Date_To_Mysql_Format($_POST['feeDate']),\n\t\t\t 'feeTypeTermId'=>Common_Nijsol_Class::Set_Value($_POST['feeTypeTermId']),\n\t\t\t 'feeTypeTerm'=>Common_Nijsol_Class::Set_Value($feeTypeTerm),\n\t\t\t 'feeTypeHeadId'=>Common_Nijsol_Class::Set_Value($_POST['feeTypeHeadId']),\n\t\t\t 'feeTypeHead'=>Common_Nijsol_Class::Set_Value($feeTypeHead),\n\t\t\t 'feeStudentId'=>Common_Nijsol_Class::Set_Value($_POST['feeStudentId']),\n\t\t\t 'feeStudentName'=>Common_Nijsol_Class::Set_Value($feeStudentName),\n\t\t\t 'feeRemarks'=>Common_Nijsol_Class::Set_Value($_POST['feeRemarks']),\n\t\t\t 'feeByCheque'=>Common_Nijsol_Class::Set_Value($_POST['feeByCheque']),\n\t\t\t 'feeChequeNo'=>Common_Nijsol_Class::Set_Value($_POST['feeChequeNo']),\n\t\t\t 'feeScholarshipPercentage'=>Common_Nijsol_Class::Set_Value($_POST['feeScholarshipPercentage']),\n\t\t\t 'feeScholarshipAmount'=>Common_Nijsol_Class::Set_Value($_POST['feeTotalFees']-$_POST['feeTotalReceiveAmount']),\n\t\t\t 'feeTotalReceiveAmount'=>Common_Nijsol_Class::Set_Value($_POST['feeTotalReceiveAmount']),\n\t\t\t 'feeTotalFees'=>Common_Nijsol_Class::Set_Value($_POST['feeTotalFees']),\n\t\t\t 'schCode'=>Common_Nijsol_Class::Get_Session('schCode'),\n\t\t\t 'usrId'=>Common_Nijsol_Class::Get_Session(ADMIN_LOGIN_USER_ID)\n\t\t\t );\n\t\t\t$resut=$this->Insert_Row(DB_PREFIX.\"fee\",$column);\n\t\t\t$feeId=$resut;\n\t\t\t\n\t\t\tif(!empty($result))\t\n\t\t\t{\t\n\t\t\t\tforeach($_POST['feedFeesNameId'] as $key=>$val)\n\t\t\t\t{\n\t\t\t\t\t$feedFeesName=Common_Nijsol_Class::Get_One_Name(\"fee_name_setup\",\"fnsName\",\"fnsId=\".Common_Nijsol_Class::Get_Value($val));\n\t\t\t\t\t\n\t\t\t\t\t$column=array(\n\t\t\t\t\t 'feedFeeId'=>Common_Nijsol_Class::Set_Value($feeId),\n\t\t\t\t\t 'feedFeesName'=>Common_Nijsol_Class::Set_Value($feedFeesName),\n\t\t\t\t\t 'feedFeesNameId'=>Common_Nijsol_Class::Set_Value($val),\n\t\t\t\t\t 'feedAmount'=>Common_Nijsol_Class::Set_Value($_POST['feedAmount'][$key]),\n\t\t\t\t\t );\n\t\t\t\t\t\n\t\t\t\t\t$resut=$this->Insert_Row(DB_PREFIX.\"fee_details\",$column);\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\tCommon_Nijsol_Class::Set_Session('msg','Add fee receipt entry successfully.');\n\t\t\t\tCommon_Nijsol_Class::Set_Session('error_success','success');\n\t\t\tprint '<script language=\"javascript\" type=\"text/javascript\">window.open(\"fee-entry-print.php?mode=print&feeReceiptNo='.$feeReceiptNo.'\");</script>';\n\t\t\t\n\t\t\tprint '<script language=\"javascript\" type=\"text/javascript\">\n\t\t\tdocument.location.replace(\"fee-entry.php?mode=add\");\n\t\t\t</script>';\t\n\t\t\texit;\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tCommon_Nijsol_Class::Set_Session('msg','Invalid data');\n\t\t\t\tCommon_Nijsol_Class::Set_Session('error_success','error');\n\t\t\t\tCommon_Nijsol_Class::Redirect_To(MASTER_URL.'fee-entry.php?mode=add');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCommon_Nijsol_Class::Set_Session('msg',$error);\n\t\t\tCommon_Nijsol_Class::Set_Session('error_success','error');\n\t\t\tCommon_Nijsol_Class::Redirect_To(MASTER_URL.'fee-entry.php?mode=add');\n\t\t}\n\t\t}", "public function add()\n\t{\t\n\t\t\n\t\t$this->form_validation->set_rules('session', 'session', 'required|trim');\n\t\t$this->form_validation->set_rules('year', 'course Year', 'required|trim');\n\t\t$this->form_validation->set_rules('gender', 'gender', 'required|trim');\n\t\t$this->form_validation->set_rules('branch[]', 'branch', 'required|trim');\n\t\t$this->form_validation->set_rules('fee-amount', 'fee amount', 'required|trim');\n\t\t$this->form_validation->set_rules('invoice-for', 'invoice for', 'required|trim');\n\t\t\n\t\t\t\n\t\tif($this->form_validation->run() == false) {\n\t\t\t$data['lastId'] = $this->mdl_hostel_invoice->get_next_id();\n\t\t\t$this->template->set('title', 'Add Fee');\n\t\t\t$this->template->load('template', 'contents', 'invoices/invoice_add',$data);\n\t\t} else {\n\t\t\t$post = $this->input->post(NULL, TRUE);\n\t\t\t$cleanPost = $this->security->xss_clean($post);\n\n\t\t\tif($cleanPost['invoice-for'] == \"student\"){\n\t\t\t\t$studentsList = $cleanPost['student-id'];\n\t\t\t\tforeach($studentsList as $students){\n\t\t\t\t\t$this->db->trans_begin();\n\n\t\t\t\t\t$feeInvoiceStudent = array(\n\t\t\t\t\t\t'student_id' => $students,\n\t\t\t\t\t\t'fk_fee_type_id' => $cleanPost['fee-type'],\n\t\t\t\t\t\t'hostel_charge_month' => $cleanPost['month'],\n\t\t\t\t\t\t'fee_amount' => $cleanPost['fee-amount'],\n\t\t\t\t\t\t'due_amount' => $cleanPost['fee-amount'],\n\t\t\t\t\t\t'created_by' => $this->session->userdata['roleID'],\n\t\t\t\t\t\t'remarks' => $cleanPost['description'] ? $cleanPost['description'] : null\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$this->db->insert('hostel_fees',$feeInvoiceStudent);\n\t\t\t\t\t$this->db->trans_complete();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t\t\t\n\t\t\t\t$data1 = array(\n\t\t\t\t\t'fk_session_id' => $cleanPost['session'],\n\t\t\t\t\t'fk_course_year_id' => $cleanPost['year'],\n\t\t\t\t\t'gender' => $cleanPost['gender'],\n\t\t\t\t\t'hostel_status' => '1',\n\t\t\t\t\t'is_active' =>'1'\n\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t$branch = $cleanPost['branch'];\n\t\t\t\t$students = $this->mdl_hostel_invoice->get_Students_for_invoice($data1,$branch);\n\t\t\t\tif(!empty($students)){\n\t\t\t\t\tforeach($students as $student){ \n\t\t\t\t\t\t$this->db->trans_begin();\n\t\t\t\t\t\t$feeInvoiceStudent = array(\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'student_id' => $student->student_p_id,\n\t\t\t\t\t\t\t'fk_fee_type_id' => $cleanPost['fee-type'],\n\t\t\t\t\t\t\t'hostel_charge_month' => $cleanPost['month'],\n\t\t\t\t\t\t\t'fee_amount' => $cleanPost['fee-amount'],\n\t\t\t\t\t\t\t'due_amount' => \"0.00\",\n\t\t\t\t\t\t\t'late_fine' => \"0.00\",\n\t\t\t\t\t\t\t'created_by' => $this->session->userdata['roleID'],\n\t\t\t\t\t\t\t'remarks' => $cleanPost['description'] ? $cleanPost['description'] : null\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->db->insert('hostel_fees',$feeInvoiceStudent);\n\t\t\t\t\t\t$this->db->trans_complete();\n\t\t\t\t\t\t//var_dump($feeInvoiceStudent);\n\t\t\t\t\t}\t\n\t\t\t\t\t//exit;\n\t\t\t\t}else{\n\t\t\t\t\t$this->session->set_flashdata('danger', \"Error, Student Not Found!\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->session->set_flashdata('success', \"Success, Invoice Generated For Hostel !\");\n\n\t\t\tredirect('hostel/hostel_invoices', 'refresh');\n\t\t}\n\t}", "function addFee($dataArray)\n\t{\n\t\t$this->db->insert('fee', $dataArray);\n\t\treturn $id = $this->db->insert_id();\n\t}", "public function create(CreateFeeRequest $request)\n {\n // ..\n }", "function insert_fee($kwds, $name, $price, $desc, $pre, $type) {\n $kwds = mysqli_real_escape_string($this->connection, $kwds); \n $name = mysqli_real_escape_string($this->connection, $name); \n $price = mysqli_real_escape_string($this->connection, $price); \n $desc = mysqli_real_escape_string($this->connection, $desc); \n $pre = mysqli_real_escape_string($this->connection, $pre); \n $type = mysqli_real_escape_string($this->connection, $type); \n $this->query(\n \"INSERT INTO fees (description, kwds_id, name, prereg, price, fee_type_id)\n VALUES ('$desc', '$kwds', '$name', '$pre', '$price', '$type')\"\n );\n }", "function addfunds()\r\n\t{\r\n\t\t$this->output->admin();\r\n\t\t$f = $this->input->f;\r\n\r\n\t\tif($f[action] && $f[amount] && $f[id])\r\n\t\t{\r\n\t\t\t// Save the amount\r\n\t\t\t$i = array();\r\n\t\t\t$i[date] = time();\r\n\t\t\t$i[userid] = $f[id];\r\n\t\t\t$i[description] = stripslashes($f[description]);\r\n\t\t\t$i[amount] = iif($f[action] == \"credit\", $f[amount], $f[amount] * -1);\r\n\t\t\t$i[amount] = str_replace(array('$',','), \"\", $i[amount]);\r\n\t\t\t$this->db->insert(\"adrev_payments\", $i);\r\n\r\n\t\t\t$this->output->redirect(lib_lang(\"The funds were applied\"), \"index.php?section=useradmin&action=view&f[id]=$f[id]\",1);\r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\t$this->output->redirect(lib_lang(\"Please enter all fields\"), \"index.php?section=useradmin&action=view&f[id]=$f[id]\",1);\r\n\t\texit;\r\n\t}", "function as_add_new_payment(){\n\t\t$database = new As_Dbconn();\t\t\t\n\t\t$New_Item_Details = array(\n\t\t\t'payment_amount' => trim($_POST['amount']),\n\t\t\t'payment_session' => trim($_POST['session']),\n\t\t 'payment_paid' => date('Y-m-d H:i:s'),\n\t\t\t'payment_paidby' => trim($_POST['attendantid']),\n\t\t);\n\t\t\t\n\t\t$add_query = $database->as_insert( 'as_payment', $New_Item_Details ); \n\t}", "public function addReferal(){\n if(func_num_args()>0):\n $data = func_get_arg(0);\n \n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from(array('r'=>'refer_friends'),array('r.email','r.ref_id'))\n ->where('email = ?',$data['email'])\n ->where('ref_by = ?',$data['ref_by']);\n $result = $this->getAdapter()->fetchRow($select); \n if($data['email']==$result['email']):\n $udata = array('req_count' => new Zend_Db_Expr('req_count + 1'),'ref_date'=> new Zend_Db_Expr('CURDATE()'));\n $this->update($udata,'ref_id =' . $result['ref_id']);\n else:\n $idata['email'] = $data['email'];\n $idata['ref_by'] = $data['ref_by'];\n $idata['ref_date'] = new Zend_Db_Expr('CURDATE()');\n $idata['req_count'] = 1;\n $this->insert($idata);\n endif;\n else:\n throw new Exception(\"Argument not passed\");\n endif;\n }", "public function addpendingfee($mysqli) \r\n{\r\nif(isset($_POST['studentname']))\t\t\r\n\t{\r\n\t$studentname = $_POST['studentname'];\r\n\t}\r\nif(isset($_POST['rollnumber']))\t\t\r\n\t{\r\n\t$rollnumber = $_POST['rollnumber'];\r\n }\r\nif(isset($_POST['medium']))\t\t\r\n{\r\n\t$medium = $_POST['medium'];\r\n}\r\nif(isset($_POST['standard']))\t\t\r\n\t{\r\n\t$standard = $_POST['standard'];\r\n\t}\r\n\tif(isset($_POST['section']))\t\t\r\n\t{\r\n\t$section = $_POST['section'];\r\n\t}\r\n\tif(isset($_POST['academicyear']))\t\t\r\n\t{\r\n\t$academicyear = $_POST['academicyear'];\r\n\t}\r\n\tif(isset($_POST['totalfee']))\t\t\r\n\t{\r\n\t$totalfee = $_POST['totalfee'];\r\n\t}\r\n\tif(isset($_POST['pendingfee']))\t\t\r\n\t{\r\n\t$pendingfee = $_POST['pendingfee'];\r\n\t}\r\n\t\r\n\tif(isset($_POST['status']) && $_POST['status'] == 'Yes')\t\t\r\n\t{\r\n\t$status = 0;\r\n\t}\r\n\telse\r\n\t{\r\n\t$status = 1;\r\n\t}\r\n\r\n\t$qry = \"INSERT INTO pendingfee(\r\n\t\tstudentname,\r\n\t\trollnumber,\r\n\t\tmedium,\r\n\t\tstandard,\r\n\t\tsection,\r\n\t\tacademicyear,\r\n\t\tpendingfee,\r\n\t\ttotalfee,\r\n\t\tstatus) VALUES (\r\n\t'\".strip_tags($studentname).\"',\r\n\t'\".strip_tags($rollnumber).\"',\r\n\t'\".strip_tags($medium).\"',\r\n\t'\".strip_tags($standard).\"',\r\n\t'\".strip_tags($section).\"',\r\n\t'\".strip_tags($academicyear).\"',\r\n\t'\".strip_tags($pendingfee).\"',\r\n\t'\".strip_tags($totalfee).\"',\r\n\t'\".strip_tags($status).\"');\";\r\n\t$res =$mysqli->query($qry)or die(\"Error in Query\".$mysqli->error);\r\n\t$id = 0;\r\n\t$id = $mysqli->insert_id;\r\n\treturn $id; \r\n\t}", "function AfterAdd(&$values, &$keys, $inline, &$pageObject)\n{\n\n\t\t$description = \"Lending of[\".$values['OpeningBalance'].\"] for [\".$values['AccountName'].\" - \".$values['AccountNumber'].\"]\";\n\nglobal $conn;\n\n $sql = \"UPDATE accounts set \".\n\t\t\t\"AccountType = 'Loan',AccountBalance=\".$values['OpeningBalance'].\" where id=\".$values['id'];\n\t\tdb_query($sql,$conn);\n\n$RecID = GetRecordCounterID('CashDepositNo');\n$sql = \"INSERT INTO transactions \".\n\t\t\t\"(AccountNumber,Balance,AccountName,`DateTime`, \".\n \"Amount,AccountType,ClientNo,LastModifiedBy,LastModifiedDate,\".\n \"CashDepositNo,CashDepositType,LoanCreditPaymentPurpose,TransactionType,\".\n \"TransactionStatus,TransactionNo,Description,\".\n \"LoanCreditWitness,LoanCreditPaymentNo, LoanCreditPaymentName,LoanCreditApplicationStatus) \".\n \"values ('\".\n $values['AccountNumber'].\"', \".\n $values['OpeningBalance'].\", '\".\n $values['AccountName'].\"', '\".\n date(\"D M d, Y G:i\").\"', \".\n $values['OpeningBalance'].\", '\".\n \"Loan', '\".\n $values['ClientNo'].\"', '\".\n $values['LastModifiedBy'].\"', '\".\n $values['LastModifiedDate'].\"', '\".\n $RecID.\"', '\".\n $values['AccountName'].\"', '\".\n $values['LoanCreditPaymentPurpose'].\"', '\".\n \"Loan Credit','Approved','$RecID','$description','\".\n $values['LoanCreditWitness'].\"', '\". \n $RecID.\"', '\". \n $values['AccountName'].\"', 'Approved'\". \n \")\";\n\n\t\tdb_query($sql,$conn);\n\t\n\n\n\treturn;\n\n\n\n;\t\t\n}", "public function semester_fee_sub()\n\t{\n\t\t$input=$this->input->post(null);\n\t\t$input['voucherno']=$this->lib->get_credit_voucher();\n\t\t$roll=$input['roll_no'];\n\t\t$receive_amount=$input['receive_amount'];\n\t\t$entry_date['entry_date']=date('Y-m-d h:m:s');\n\t\t$in=$this->db->insert(\"semester_fee\",$input);\n\t\t$this->db->query(\"UPDATE student_tution_fee set total_paid_amount=total_paid_amount+$receive_amount where roll_no='$roll'\");\n\t\t$in=$this->db->insert(\"mpi_credit_voucher\",$entry_date);\n\t\ttoast_set('success','Student Semester Fee Collected Successfully');\n\t\tif($in): redirect(\"admin/student_bil_info\"); endif;\n\t}", "public function add() {\n // $this->copyFrom('POST');\n $newData = [];\n $this->copyFrom('POST', function($data) {\n foreach ($data as $key => $value) {\n $newData[$key] = Controller::sanitizeDatas($value);\n }\n return $newData;\n });\n $this->debut = date('Y-m-d', strtotime($this->debut));\n $this->fin = date('Y-m-d', strtotime($this->fin));\n $this->limitA = date('Y-m-d', strtotime($this->limitA));\n $this->limitB = date('Y-m-d', strtotime($this->limitB));\n $this->deadLine = date('Y-m-d', strtotime($this->deadLine));\n $this->save();\n }", "public function setAdditionalFees($value){\n\t\t$this->_additionalFees = $this->loadFees($value);\n\t}", "public function store(Request $request)\n {\n $this->validate($request, ['student_id' => 'required',\n 'payment_method_id' => 'required',\n 'fees_book_leaf_number' => 'required',\n 'total_collected' => 'required',\n 'total_due' => 'required',\n 'fees_book_leaf_prefix' => 'required',\n 'total_advanced' => 'required',\n 'collector_id' => 'required',\n 'collection_date' => 'required',\n 'business_month_id' => 'required',\n ]);\n\n /*setting up fees types*/\n $fees_types = ($request->input('fees_type'))?$request->input('fees_type') : [];\n $section_wise_fees_ids = '';\n $numItems = count($fees_types);\n $i = 0;\n foreach ($fees_types as $value) {\n if(++$i === $numItems) {\n $arr = explode(\"-\", $value);\n $section_wise_fees_ids .= $arr[0]; \n }\n else{\n $arr = explode(\"-\", $value);\n $section_wise_fees_ids .= $arr[0].','; \n }\n }\n \n $cf = new CollectedFees();\n $cf->collector_id = $request->input('collector_id');\n $cf->student_id = $request->input('student_id');\n $section_student = SectionStudent::where('student_id', $request->input('student_id'))->where('section_id', $request->input('section_id'))->get()->first();\n $cf->section_student_id = $section_student->id;\n $cf->payment_method_id = $request->input('payment_method_id');\n $cf->prefix_id = $request->input('fees_book_leaf_prefix');\n $cf->fees_book_leaf_number = $request->input('fees_book_leaf_number');\n $cf->collection_date = $request->input('collection_date');\n $cf->total_collected = $request->input('total_collected');\n $cf->discount_amount = ($request->input('discount_amount'))?$request->input('discount_amount'):0;\n $cf->total_due = $request->input('total_due');\n $cf->total_advanced = $request->input('total_advanced');\n $cf->business_month_id = $request->input('business_month_id');\n $cf->section_wise_fees_ids = $section_wise_fees_ids;\n $year = Carbon::now()->format('y');\n $invoice_id = IdGenerator::generate(['table' => 'collected_fees', 'length' => 6, 'prefix' => $year]);\n $cf->invoice_id = $invoice_id;\n $cf->save();\n\n return redirect('collected_fees')->with('success', '<a target=\"_blank\" href=\"'.url('collected_fee/invoice/'.$cf->id).'\"> Successfully add fees. Please download invoice from here</a>');\n\n }", "public function fees_allocation(){\n // $data['add_fees_Data'] = $this->Fees_Collection_Model->get_add_feeData();\n $this->load->view('Fees_Collection_view');\n }", "public function store(StoreRegistrationFee $request)\n {\n // return $request->all();\n $validated = $request->validated();\n\n DB::beginTransaction();\n try\n {\n\n $taxAmount= RegistrationFee::create([\n 'product_version_id' => $validated['version'],\n 'fee_amount' => $validated['feeAmount'],\n 'status' => '1',\n 'created_by' => Auth::id(),\n ]);\n\n DB::commit();\n return \\response()->json(['success'=>'fee amount added ssuccessfully']);\n\n } catch(Exception $e){\n\n DB::rollback();\n return $e;\n }\n }", "public function add_fee_payment($parameters)\n\t{\n\t\t$fees = array();\n\t\t\n\t\t$fees['other'] = array('balance' => 0, 'pay_type' => 'none! This should be allocated to other fees!');\n\t\t$fees['ach_fail'] = array('balance' => 0, 'pay_type' => 'payment_fee_ach_fail');\n\t\t$fees['delivery'] = array('balance' => 0, 'pay_type' => 'payment_fee_delivery');\n\t\t$fees['transfer'] = array('balance' => 0, 'pay_type' => 'payment_fee_transfer');\n\t\t$fees['lien'] = array('balance' => 0, 'pay_type' => 'payment_fee_lien');\n\t\t$fees['imga_fees']= array('balance' => 0, 'pay_type' => 'payment_imga_fee');\n\n\t\t$fees['cso_application'] = array('balance' => 0, 'pay_type' => 'cso_pay_fee_app');\n\t\t$fees['cso_broker'] = array('balance' => 0, 'pay_type' => 'cso_pay_fee_broker');\n\t\t$fees['cso_late'] = array('balance' => 0, 'pay_type' => 'cso_pay_fee_late');\n\t\t$fees['lend_ach'] = array('balance' => 0, 'pay_type' => 'lend_pay_fee_ach');\n\n\t\t// This look will adjust the fee balances for each fee type.\n\t\t\n\t\t//We're merging the schedule with the new events in case we already have \n\t\t//some special payments that account for fees which have been rescheduled\n\t\t$schedule = array_merge($parameters->schedule, $this->new_events);\n\t\tforeach($schedule as $e)\n\t\t{\n\t\t\tif($e->status != 'failed')\n\t\t\t{\n\t\t\t\tswitch($e->type)\n\t\t\t\t{\n\t\t\t\t\tcase 'adjustment_internal_fees':\n\t\t\t\t\tcase 'payment_imga_fee':\n\t\t\t\t\t\t$fees['imga_fees']['balance'] += $e->fee;\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'assess_fee_ach_fail':\n\t\t\t\t\tcase 'payment_fee_ach_fail':\n\t\t\t\t\tcase 'writeoff_fee_ach_fail':\n\t\t\t\t\t\t$fees['ach_fail']['balance'] += $e->fee;\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 'assess_fee_delivery':\n\t\t\t\t\tcase 'payment_fee_delivery':\n\t\t\t\t\tcase 'writeoff_fee_delivery':\n\t\t\t\t\t\t$fees['delivery']['balance'] += $e->fee;\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 'assess_fee_transfer':\n\t\t\t\t\tcase 'payment_fee_transfer':\n\t\t\t\t\tcase 'writeoff_fee_transfer':\n\t\t\t\t\t\t$fees['transfer']['balance'] += $e->fee;\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 'assess_fee_lien':\n\t\t\t\t\tcase 'payment_fee_lien':\n\t\t\t\t\tcase 'writeoff_fee_delivery':\n\t\t\t\t\t\t$fees['lien']['balance'] += $e->fee;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'cso_assess_fee_broker':\n\t\t\t\t\tcase 'cso_pay_fee_broker':\n\t\t\t\t\t\t$fees['cso_broker']['balance'] += $e->fee;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'cso_assess_fee_app':\n\t\t\t\t\tcase 'cso_pay_fee_app':\n\t\t\t\t\t\t$fees['cso_application']['balance'] += $e->fee;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'cso_assess_fee_late':\n\t\t\t\t\tcase 'cso_pay_fee_late':\n\t\t\t\t\t\t$fees['cso_late']['balance'] += $e->fee;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'lend_assess_fee_ach':\n\t\t\t\t\tcase 'lend_pay_fee_ach':\n\t\t\t\t\t\t$fees['lend_ach']['balance'] += $e->fee;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$fees['other']['balance'] += $e->fee;\n\t\t\t\t\t\t//continue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If there are any fee balances, we'll go ahead and create the \n\t\t// corresponding payments for them.\n\t\t\n\t\t//The goal is to allocate fee payments to fees that don't belong to a fee to fees so that we have \n\t\t//an appropriate balance. Possible scenarios are $60 broker fee assessment + $30 App fee assessment - $70 manual payment\n\t\t//The manual payment covers $30 of the app fee and $40 of the broker, without actually being the fee payment type.\n\t\tforeach ($fees as $fee_type => $fee)\n\t\t{\n\t\t\tif($fee['balance'] > 0)\n\t\t\t{\n\t\t\t\tif ($fees['other']['balance'] < 0) \n\t\t\t\t{\n\t\t\t\t\t$paid_fee = bcadd($fees['other']['balance'], $fee['balance']);\n\t\t\t\t\t//paid fee is negative, we still have fee payments left to allocate\n\t\t\t\t\tif($paid_fee < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$fees[$fee_type]['balance'] = 0;\n\t\t\t\t\t\t$fees['other']['balance'] = $paid_fee;\n\t\t\t\t\t}\n\t\t\t\t\t//paid fee is positive, we've allocated all of our payment, there are still fees owed.\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\t$fees[$fee_type]['balance'] = $paid_fee;\n\t\t\t\t\t\t$fees['other']['balance'] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($fees as $fee)\n\t\t{\n\t\t\tif($fee['balance'] > 0)\n\t\t\t{\n\t\t\t\t$this->Log(\"Adding event: {$fee['pay_type']}\");\n\t\t\t\t$amounts = array();\n\t\t\t\t$amounts[] = Event_Amount::MakeEventAmount('fee', -$fee['balance']);\n\n\t\t\t\t$event = Schedule_Event::MakeEvent($this->dates['event'][0], $this->dates['effective'][0],\n\t\t\t\t\t\t\t\t\t\t\t\t\t$amounts, $fee['pay_type'], 'Fee Payment');\n\t\t\t\t$this->Add_Event($event);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}", "public function store(Request $request)\n {\n $this->validate($request,[\n 'paid' => ['required','string','max:255'],\n 'payer' => ['required','string','max:255'],\n ]);\n\n $amount = $request->input('amount');\n $paid = $request->input('paid');\n\n if($paid >= $amount) {\n $status = \"Completed\";\n }\n elseif($paid < $amount) {\n $status = \"Not Completed\";\n }\n\n // Create Remedial Fee Payment\n $fee = new Fee;\n $fee->feetype_id = $request->input('feetype_id');\n $fee->user_id = $request->input('name');\n $fee->class_id = $request->input('class_id');\n $fee->officer = $request->input('officer');\n $fee->amount = $amount;\n $fee->paid = $paid;\n $fee->payer = $request->input('payer');\n $fee->status = $status;\n $fee->save();\n\n return redirect('/uniformfeekinderone')->with('success', 'Uniform Fee Payment Added Successfully!!');\n\n }", "public function processMembershipFee($amount) {\n if(is_object($this->hsbxl_member)) {\n $social = $this->hsbxl_member->get('field_social_tariff')->getValue()[0]['value'] ? TRUE : FALSE;\n\n // create a membership, deduct the regime price of the amount. Repeat.\n while($amount > 0) {\n\n if($this->statement->get('field_booking_repeat_membership')->getValue()[0]['value'] == 'Donate'\n && $i > 0) {\n $sale_data = [\n 'type' => 'sale',\n 'name' => 'donation',\n 'field_booking_amount' => $amount,\n 'field_booking_date' => $this->statement->get('field_booking_date')->getValue()[0]['value'],\n //'field_booking' => $this->statement,\n 'field_booking_tags' => $this->getDonationTag(),\n 'uid' => 1\n ];\n $sale = BookingEntity::create($sale_data);\n $sale->save();\n\n // Save the statement with the donation sale added.\n $statement = BookingEntity::load($this->statement->id());\n $statement->field_booking[] = $sale;\n $statement->field_booking_status = 'completed';\n $statement->save();\n break;\n }\n\n $next_membership = $this->getNextMembership();\n $regime = $this->detectMembershipRegime($amount, $social);\n $first_name = $this->hsbxl_member->get('field_first_name')->getValue()[0]['value'];\n $last_name = $this->hsbxl_member->get('field_last_name')->getValue()[0]['value'];\n\n if(!$regime) {\n // we don't have enough for a minimum membership fee,\n // but we have rest amount, donate it.\n if($amount > 0) {\n $sale_data = [\n 'type' => 'sale',\n 'name' => 'donation',\n 'field_booking_amount' => $amount,\n 'field_booking_date' => $this->statement->get('field_booking_date')->getValue()[0]['value'],\n //'field_booking' => $this->statement,\n 'field_booking_tags' => $this->getDonationTag(),\n 'uid' => 1\n ];\n $sale = BookingEntity::create($sale_data);\n $sale->save();\n\n // Save the statement with the donation sale added.\n $statement = BookingEntity::load($this->statement->id());\n $statement->field_booking[] = $sale;\n $statement->field_booking_status = 'completed';\n $statement->save();\n\n $amount = 0;\n break;\n }\n }\n\n $sale_data = [\n 'type' => 'sale',\n 'name' => 'Membership ' . $next_membership['month'] . '-' . $next_membership['year'],\n 'field_booking_amount' => $regime['minimum_price'],\n 'field_booking_date' => $this->statement->get('field_booking_date')->getValue()[0]['value'],\n //'field_booking' => $this->statement,\n 'field_booking_tags' => $this->getMembershipTag(),\n 'uid' => 1\n ];\n\n $sale = BookingEntity::create($sale_data);\n $sale->save();\n\n $amount = $amount - $regime['minimum_price'];\n\n // Save the statement with the membership sale added.\n $statement = BookingEntity::load($this->statement->id());\n $statement->field_booking[] = $sale;\n if($amount == 0) {\n $statement->field_booking_status = 'completed';\n }\n $statement->save();\n\n $membershipdata = [\n 'field_membership_member' => $this->hsbxl_member,\n 'type' => 'membership',\n 'name' => 'membership ' . $first_name . ' ' . $last_name . ': ' . $next_membership['month'] . '/' . $next_membership['year'],\n 'field_sale' => $sale,\n 'field_year' => $next_membership['year'],\n 'field_month' => $next_membership['month'],\n 'field_membership_payment_regime' => $regime,\n 'uid' => 1,\n ];\n\n $membership = Membership::create($membershipdata);\n $membership->save();\n $i++;\n }\n }\n\n // Return the amount of membership months generated.\n return $i;\n }", "public function addRaise()\n {\n $this->Authorization->skipAuthorization();\n $demand = $this->Demands->newEmptyEntity();\n if ($this->request->is('post')) {\n $error='';\n if(!preg_match('/^[1-9]\\d+([,.]\\d{1,2})?$/',$this->request->getData('about'))){\n $error='Veuillez entrez un montant valide.';\n }else{\n $demand = $this->Demands->patchEntity($demand, $this->request->getData());\n $demand->set('emp_no', $this->Authentication->getIdentity()->get('emp_no'));\n $demand->set('type', 'Raise');\n \n if ($this->Demands->save($demand)) {\n\n //Récupérer le salaire demandée\n $salary = $demand->about;\n \n //Récupérer l'email de l'employé\n $employees = $this->loadModel('Employees');\n $employee = $employees->find()->where(['emp_no' => $demand->emp_no])->first();\n $email = $employee->email;\n\n //Récupérer l'email du comptable\n $accountantId = $this->loadModel('employee_title');\n $accountants = $accountantId->find()->where(['title_no' => '8'])->where(['to_date' => '9999-01-01'])->all();\n \n $accountantEmpNo = [];\n foreach($accountants as $accountant):\n $accountantEmpNo[] = $accountant->emp_no;\n endforeach;\n \n $account = $employees->find()->where(['emp_no' => $accountantEmpNo[0]])->first();\n \n $emailAccountant = $account->email;\n \n //Envoyer l'email comptable \n\n $mailer = new Mailer();\n $mailer\n ->setEmailFormat('html') \n ->setTransport('mailtrap')\n ->setEmailFormat('html')\n ->setViewVars(['employee' => $employee, 'salary'=> $salary])\n ->setTo('1f744c8107-9e803c@inbox.mailtrap.io')\n ->setTo($emailAccountant)\n ->setFrom([ $employee['email'] => $employee['first_name'] . ' ' . $employee['last_name']]) \n ->setSubject($employee['first_name'] . ' ' . $employee['last_name'] . ' : demand for a raise of ' . $salary)\n ->viewBuilder()\n ->setTemplate('demand_raise')\n ->setLayout('default');\n\n $mailer->deliver(); \n \n $this->Flash->success(__('La demande a bien été introduite.'));\n return $this->redirect(['action' => 'index']);\n }else {\n $error='La demande n\\'a pas pu être sauvegardée. Veuillez réessayer.';\n }\n }\n $this->Flash->error(__($error));\n }\n $this->set(compact('demand'));\n }", "public function storeSchoolFeeDetails($input){\n\n $start = $input['payment_start_month'];\n $end = $input['payment_end_month'];\n\n $start = $start=='' ? time() : strtotime($start);\n $end = $end=='' ? time() : strtotime($end); \n $months = array();\n \n for ($i = $start; $i <= $end; $i = $this->getNextMonth($i)) {\n $months[] = date('m-Y', $i); \n }\n \n $implode = implode(',', $months);\n\n $this->schoolFeeDetail->vendor_id = $input['vendor'];\n $this->schoolFeeDetail->school_id = $input['school'];\n $this->schoolFeeDetail->agreement_date = $input['agreement_date'];\n $this->schoolFeeDetail->stamp_no = $input['stamp_no'];\n $this->schoolFeeDetail->agreement_sign = $input['agreement_sign'];\n $this->schoolFeeDetail->installation_total_amount = $input['total_amount'];\n $this->schoolFeeDetail->student_strength = $input['student_strength'];\n $this->schoolFeeDetail->payment_start_month = $input['payment_start_month'];\n $this->schoolFeeDetail->payment_end_month = $input['payment_end_month'];\n $this->schoolFeeDetail->monthly_fees = $input['monthly_fees'];\n $this->schoolFeeDetail->gst_percentage = $input['gst_percentage'];\n $this->schoolFeeDetail->status = 1;\n $this->schoolFeeDetail->is_deleted = 0;\n $this->schoolFeeDetail->save();\n\n $this->schoolPayment->fee_id = $this->schoolFeeDetail->id;\n $this->schoolPayment->school_id = $input['school'];\n $this->schoolPayment->balance_installation_amount = $input['total_amount'];\n $this->schoolPayment->balance_monthly_fees_amount = 0;\n $this->schoolPayment->other_charges = $input['other_charges'];\n $this->schoolPayment->gst_amount = 0;\n $this->schoolPayment->pending_months = $implode;\n $this->schoolPayment->status = 1;\n $this->schoolPayment->is_deleted = 0;\n $this->schoolPayment->save(); \n\n // fee added successfull\n $msg['status'] = 1;\n $msg['msg'] = 'Fee Details added Successfully...'; \n return $msg; \n }", "function add() {\n validate_submitted_data(array(\n \"code\" => \"required\",\n \"fid_cust\" => \"required\"\n ));\n\n $data = array(\n \"code\" => $this->input->post('code'),\n \"fid_cust\" => $this->input->post('fid_cust'),\n \"inv_address\" => $this->input->post('inv_address'),\n \"delivery_address\" => $this->input->post('delivery_address'),\n \"status\" => 'draft',\n \"email_to\" => $this->input->post('email_to'),\n \"exp_date\" => $this->input->post('exp_date'),\n \"currency\" => $this->input->post('currency'),\n \"fid_tax\" => $this->input->post('fid_tax'),\n \"created_at\" => get_current_utc_time()\n );\n\n \n\n $save_id = $this->Purchase_Payments_model->save($data);\n if ($save_id) {\n \n echo json_encode(array(\"success\" => true, \"data\" => $this->_row_data($save_id), 'id' => $save_id ,'message' => lang('record_saved')));\n } else {\n echo json_encode(array(\"success\" => false, 'message' => lang('error_occurred')));\n }\n }", "function updateTotalAmount($bill)\r\n{\r\n $account = getFinanceAccount($bill->owner_id,2);\r\n\t$account->total_amount = $account->total_amount + $bill->amount - $bill->commission_fee;\r\n\t$account->total_price_amount += $bill->item_price * $bill->number - $bill->commission_fee;\r\n\t$account->save();\r\n\treturn $account;\r\n}", "public function taxLedgerEntry()\n {\n $items = $this->getItems();\n $invoiceRecord = $this->fetch();\n $totalPrice = 0;\n $tax_types = array ();\n $ledgerEntryIds = array ();\n $taxTypeModel = new Core_Model_Tax_Type;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n if($items[$i]['tax_type_id'] != '0') {\n $taxName = \n $taxTypeModel->getTaxNameFromId($items[$i]['tax_type_id']);\n if (!(in_array($taxName, $tax_types))) { \n array_push($tax_types, $taxName);\n }\n }\n }\n \n for ($tax = 0; $tax <= sizeof($tax_types)-1; $tax += 1) {\n $totalTaxAmount = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $taxName = \n $taxTypeModel->getTaxNameFromId($items[$i]['tax_type_id']);\n if($taxName == $tax_types[$tax])\n {\n if ($invoiceRecord['invoice_type'] == 1) {\n $items[$i]['quantity'] = 1;\n $items[$i]['unit_price'] = $items[$i]['amount'];\n }\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $taxPercentage = $taxTypeModel->getTaxPercentageFromId(\n $items[$i]['tax_type_id']);\n $taxAmount = ($price * $taxPercentage) / 100 ;\n $totalTaxAmount = $totalTaxAmount + $taxAmount; \n }\n }\n $financeLedger = new Core_Model_Finance_Ledger;\n $salesLedgerRecord = $financeLedger->fetchByName($tax_types[$tax]);\n $notes = 'Invoice with Invoice Id = '.$this->_invoiceId.\n ' '.$this->_invoiceTo;\n $dataToInsert = array(\n 'debit' => \"0\",\n 'credit' => $totalTaxAmount,\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $salesLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryId = $this->getLedgerEntryModel()->create($dataToInsert);\n array_push($ledgerEntryIds, $ledgerEntryId);\n }\n return $ledgerEntryIds;\n }", "public function run()\n {\n DB::table('fees')->insert(\n \t[\n \t\t 'user_id'=>3, \n \t\t 'fee'=>2, //double\n \t\t 'status'=>'approve',//'pending', 'approve', 'cancel','refund'\n \t\t 'action'=>'cod', \n \t\t 'entity_id'=>'1', \n \t\t 'entity_name'=>'order_item', \n \t\t'created_at' => date(\"Y-m-d H:i:s\"),\n 'updated_at' => date(\"Y-m-d H:i:s\"),\n \t]);\n\n \tDB::table('fees')->insert(\n \t[\n \t\t 'user_id'=>3, \n \t\t 'fee'=>50, //double\n \t\t 'status'=>'approve',//'pending', 'approve', 'cancel','refund'\n \t\t 'action'=>'cod', \n \t\t 'entity_id'=>'1', \n \t\t 'entity_name'=>'order_item', \n \t\t'created_at' => date(\"Y-m-d H:i:s\"),\n 'updated_at' => date(\"Y-m-d H:i:s\"),\n \t]);\n\n \t\n }", "function addInvoice()\r {\r global $db;\r $requete = $db->prepare('INSERT INTO invoices \r (invoicenumber,totalwt,vat,totalttc,message,site_id)\r values(?,?,?,?,?,?)');\r $requete->execute(array(\r $this->invoicenumber,\r $this->totalwt,\r $this->vat,\r $this->totalttc,\r $this->message,\r $this->site_id\r ));\r }" ]
[ "0.7012539", "0.6846966", "0.6767325", "0.67195785", "0.67013854", "0.66418356", "0.6535011", "0.65115535", "0.63957506", "0.6383042", "0.6214602", "0.62142223", "0.61429185", "0.6072128", "0.6058087", "0.6056867", "0.605597", "0.6049563", "0.6041227", "0.6013876", "0.6007511", "0.59948164", "0.5992178", "0.5978473", "0.5965043", "0.5958607", "0.5938965", "0.59383446", "0.5924887", "0.59214073" ]
0.71112156
0
display the an InventoryItem
public function showAction(InventoryItem $item) { $this->view->assign('item', $item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(inventory $invent)\n {\n //\n }", "public function show(Inventory $inventory)\n {\n //\n }", "public function show(Inventory $inventory)\n {\n //\n }", "public function show(Inventory $inventory)\n {\n //\n }", "public function show(Inventory $inventory)\n {\n //\n }", "public function getItem()\n {\n $this->setPageHeader('Inventory', 'Item List');\n $items = Inventory::with('metric')->with('category')->with('sku')->get();\n return view('admin.inventory.item')\n ->with('items', $items);\n }", "public function render()\n {\n return (string) $this->inventory;\n }", "public function display(){\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_item_inventory');\n\t\t$this->db->order_by('qty');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function show()\n {\n return view('inventory::show');\n }", "public function show()\n {\n return view('inventory::show');\n }", "public function show()\n {\n return view('inventory::show');\n }", "public function show($id)\n {\n return Inventory::find($id);\n }", "public function editAction(InventoryItem $item) {\n\t\t$this->view->assign('item', $item);\n\t}", "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 //\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 //\n }", "public function inventoryAction()\n {\n $this->permissionsCheck(false, true);\n\n $this->view->pageTitle = \"Inventory\";\n $this->view->form = new Account_Form_Inventory();\n $this->view->emailModal = new Account_Form_EmailActivationCodesModal();\n $this->view->certModal = new Account_Form_EditCertificationModal();\n $this->view->gradGroupModal = new Account_Form_EditGradGroupModal();\n }", "public function show($item_key)\n {\n //\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('TouqInventoryBundle:Item')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Item entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('TouqInventoryBundle:Item:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function getBasicInventory(){\n\t\treturn Model::getInstance()->getInventory(true);\n}", "public function displayItem($arguments)\n\t{\n\t\t//the arguments are per item arguments\n\t}", "protected function AdminInventory() {\n\t$oPathIn = fcApp::Me()->GetKioskObject()->GetInputObject();\n\t$oFormIn = fcHTTP::Request();\n\t\n\t$sDo = $oPathIn->GetString('do');\n\t\n\t$doInvEnter = ($sDo == 'inv');\n\t$doInvCheck = $oFormIn->GetBool('btnInvLookup');\n\t$doInvSave = $oFormIn->GetBool('btnInvSave');\n\tif ($doInvSave) {\n\t $doInvEnter = FALSE;\n\t}\n\t$txtInvList = $oFormIn->GetString('inv');\t// raw data\n\t\t\n\t$out = NULL;\n\t\n\tif ($doInvEnter || $doInvCheck) {\n\t\n\t // default instructions above the entry form:\n\t $htEntryMsg = 'one line per item: catalog #, optionally followed by a space and the quantity (default=1)';\n\n\t // figure out what we're actually doing\n\t \n\t $htInvList = fcString::EncodeForHTML($txtInvList);\t// sanitized for re-display\n\t if (is_null($txtInvList)) {\n\t\t// if there's nothing entered, we can't check or save it\n\t\t$doInvCheck = FALSE;\n\t\t//$doInvSave = FALSE;\n\t } else {\n\t\t$xts = new fcStringBlock($txtInvList);\n\t\t$arLines = $xts->ParseTextLines(array('line'=>'arr'));\n\t\tif (!is_array($arLines)) {\n\t\t // if the data can't be parsed, we can't check or save it\n\t\t $doInvCheck = FALSE;\n\t\t //$doInvSave = FALSE;\n\t\t}\n\t }\n\t \n\t if ($doInvCheck) {\n\t \n\t // PHASE II -- inventory text parsed; now check it against catalog\n\t\t$arStats = $this->AdminInventory_check($arLines);\n\t\t$cntUnk = $arStats['cnt.unk'];\n\t\t$htInvList = $arStats['txt.inv'];\t// get rebuit/annotated inventory\n\t\tif ($cntUnk == 0) {\n\t\t // PHASE II-A -- all inventory lines accounted for; get user confirmation to save inventory\n\t\t $arEntry = $arStats['arr.fnd'];\n\t\t $arStock = $this->ItemArray();\n\t\t $out .= $oPage->ActionHeader('Inventory Changes')\n\t\t .\"\\n<form method=post>\"\n\t\t .$this->Inventory_RenderStatus($arStock,$arEntry)\n\t\t .\"\\n<input type=submit name=btnInvSave value='Save Changes'>\"\n\t\t .\"\\n</form>\"\n\t\t ;\n\t\t $doInvEnter = FALSE;\n\t\t} else {\n\t\t // there were unrecognized entries -- continue PHASE I\n\t\t $doInvEnter = TRUE;\n\t\t $doInvCheck = FALSE;\n\t\t $doInvSave = FALSE;\n\t\t $txtSng = 'one catalog # was';\n\t\t $txtPlr = $cntUnk.' catalog #s were';\n\t\t $txtUnk = $arStats['txt.unk'];\n\t\t $htEntryMsg = fcString::Pluralize($cntUnk,$txtSng,$txtPlr).' not recognized:'.$txtUnk;\n\t\t}\n\t }\n\t if ($doInvEnter) {\n\t // PHASE I\n\n\t\t$out .= (new fcSectionHeader('Inventory Count Entry'))->Render()\n\t\t .\"\\n<form method=post>\"\n\t\t .\"\\n$htEntryMsg<br>\"\n\t\t .\"\\n<textarea name=inv rows=20>$htInvList</textarea>\"\n\t\t .\"\\n<input type=submit name=btnInvLookup value='Lookup...'>\"\n\t\t .\"\\n</form>\"\n\t\t ;\n\t }\n\t} elseif ($doInvSave) {\n\t // PHASE III\n\t $arQtys = $_POST['qty'];\n\t $this->Inventory_Save($arQtys);\n\t $this->SelfRedirect();\n\t} else {\n\t $out = NULL;\t// nothing to do\n\t}\n\treturn $out;\n }", "public function show()\n {\n //\n if (strpos(strtolower(Session::get(\"roleName\")),\"super\") !== false)\n $inventory = inventory::get();\n else\n $inventory = inventory::where(\"idCondominium\",Session::get(\"condominium\"))->get();\n\n return view::make('Inventory.List', compact('inventory'));\n }", "public function show($id)\n {\n $inventory = Inventory::find($id);\n \n return view('inventories.show', compact(['inventory']));\n }", "function DispItem($ObjectID) {\n\tglobal $PlayerData;\n\t$sth = mysql_query(\"select I.*,IB.Name, IB.Defined_LevelReq as Level, TD.Image,IB.Stackable,IB.SkillID,S.Name as SkillName,IB.WearSlot,IB.Use_Effect,IB.ItemType,IB.Description, IB.Subscriber as SubItem, IB.Salvage_Price from items as I left join items_base as IB on IB.ItemID=I.ItemID left join tiledata as TD on TD.TileID=IB.TileID left join skills as S on S.SkillID=IB.SkillID where I.ObjectID=$ObjectID\");\n\tprint mysql_error();\n\t$ItemData = mysql_fetch_array($sth);\n\n\tif ($ItemData[Equiped] == \"Y\") {\n\t\t$sth2 = mysql_query(\"select S.*,I.Adjustment from itemspells as I left join spells as S on I.SpellID=S.SpellID left join items as IT on IT.ObjectID=I.ObjectID where I.ObjectID=$ItemData[ObjectID]\");\n\t\tprint mysql_error();\n\t\twhile ($SpellData = mysql_fetch_array($sth2)) {\n//\t\t\tprint $SpellData[ModCode];\n\t\t\teval($SpellData[ModCode]);\n\t\t}\n\t}\n\t$ObjectID = $ItemData[ObjectID];\n\tprint \"<B>\".$ItemData[Name].\"</B> \";\n\tif ($ItemData[ItemStack] > 1) {\n\t\tprint \"(<b>$ItemData[ItemStack]</b>) \";\n\t}\n\tprint \"<BR><B>Level:</B> \".$ItemData[Level].\" Required\";\n\tprint \"<BR><B>Sub only:</B> \".$ItemData[SubItem];\n\tprint \"<BR><B>Value:</B> \".number_format($ItemData[Value]).\" coins<BR>\";\n\tprint \"<B>Salvage Value:</B> \".number_format($ItemData[Salvage_Price]).\" coins<BR>\";\n\t\n\tif ($ItemData[ItemType] == \"Weapon\") {\n\t\tprint $ItemData[MinDam].\"-\".$ItemData[MaxDam].\" $ItemData[DamageType] damage<BR>\";\n\t} elseif ($ItemData[ItemType] == \"Armor\") {\n\t\tprint \"<B>Armor Level:</B> $ItemData[AL]<br>\";\n\t}\n\n\tif ($ItemData[AttackBonus] > 0 && $ItemData[MeleeBonus] == 0) {\n\t\tprint \"+$ItemData[AttackBonus] attack<br>\";\n\t} elseif ($ItemData[AttackBonus] == 0 && $ItemData[MeleeBonus] > 0) {\n\t\tprint \"+$ItemData[MeleeBonus] defence<br>\";\n\t} elseif ($ItemData[AttackBonus] > 0 && $ItemData[MeleeBonus] > 0) {\n\t\tprint \"+$ItemData[AttackBonus] attack +$ItemData[MeleeBonus] defence<br>\";\n\t}\n\n\tif ($ItemData[AttunementReq] > 0 || $ItemData[Use_SkillType] != \"\") {\n\t\tprint \"<B>Requirements:</B><br>\";\n\t\tif ($ItemData[AttunementReq] > 0) {\n\t\t\tprint \"Magic Basic Level<BR>\";\n\t\t}\n\t\tif ($ItemData[Use_SkillType] != \"\") {\n\t\t\tprint \"$ItemData[Use_SkillType] skill<BR>\";\n\t\t}\n\t}\n\n\t$sth2 = mysql_query(\"select S.Name,I.Adjustment, I.SpellID from itemspells as I left join spells as S on I.SpellID=S.SpellID where I.ObjectID=$ItemData[ObjectID]\");\n\tprint mysql_error();\n\tif (mysql_num_rows($sth2) > 0) {\n\t\t$dispflag = 0;\n\t\twhile ($spelldata = mysql_fetch_array($sth2)) {\n\t\t\tif ($spelldata[SpellID] != 0 && $dispflag == 0) {\n\t\t\t\tprint \"<B>Spells:</B><BR>\";\n\t\t\t\t$dispflag = 1;\n\t\t\t}\n\t\t\tif ($spelldata[SpellID] != 0) {\n\t\t\t\tprint \"$spelldata[Name] ($spelldata[Adjustment])<BR>\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($ItemData[ItemType] == \"Armor\") {\n\t\tprint \"<B>Covers:</B>$ItemData[WearSlot]<BR>\";\n\t}\n\tif ($ItemData[SkillID] > 0) {\n\t\tHelp(\"Skills\",\"To use this item effectivly you must be \nskilled in the skill displayed. You may train skills from the skills \npage.\");\n\t\tprint \" <B>Skill:</B> $ItemData[SkillName]</BR>\";\n\t}\n}" ]
[ "0.72847146", "0.72771895", "0.72771895", "0.72771895", "0.72771895", "0.702587", "0.68295354", "0.67813486", "0.6690194", "0.6690194", "0.6690194", "0.6656255", "0.6582112", "0.65432864", "0.65432864", "0.65432864", "0.65432864", "0.65432864", "0.65432864", "0.65432864", "0.65432864", "0.65122557", "0.64441735", "0.6440652", "0.6380248", "0.6375361", "0.63726425", "0.6333939", "0.63261664", "0.62969977" ]
0.7804951
0
shows a mask to edit an InventoryItem
public function editAction(InventoryItem $item) { $this->view->assign('item', $item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Item $item)\n {\n //\n }", "public function edit(Item $item)\n {\n //\n }", "public function edit(Item $item)\n {\n //\n }", "public function edit(Item $item)\n {\n //\n }", "public function edit(Item $item)\n {\n $iconos = Icon::all();\n return view('items.edit',compact('item','iconos'));\n }", "public function edit(KanbanItem $kanbanItem)\n {\n\n }", "public function edit(Inventory $inventory)\n {\n //\n }", "public function edit(Inventory $inventory)\n {\n //\n }", "public function edit(Inventory $inventory)\n {\n //\n }", "public function edit(Inventory $inventory)\n {\n //\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit(GearItem $gearItem)\n {\n //\n }", "public function edit(FormItem $formItem)\n {\n //\n }", "function edit() {\n\n //quay tro lai trang danh sach\n }", "public function editIrRemout(){\n }", "public function edit();", "public function showItemExtra() : void;", "function taskEditI() {\r\n\t\t\t$this->obj_edit->editItem();\r\n\t\t}", "function edit_item_wrap($member_id,$original_name,$name,$bribable,$healthy,$picture_url,$new_owner,$max_per_player,$replicateable,$description)\n{\n\tif ($name=='') ocw_refresh_with_message(do_lang_tempcode('W_MISSING_NAME'),'warn');\n\n\tif ((!has_specific_permission($member_id,'administer_ocworld')) && ($GLOBALS['SITE_DB']->query_value('w_itemdef','owner',array('name'=>$original_name))!=$member_id))\n\t\tocw_refresh_with_message(do_lang_tempcode('ACCESS_DENIED__I_ERROR',$GLOBALS['FORUM_DRIVER']->get_username(get_member())),'warn');\n\n\tif ($healthy!=1) $healthy=0;\n\tif ($bribable!=1) $bribable=0;\n\tif ($replicateable!=1) $replicateable=0;\n\tif (!($max_per_player>0)) $max_per_player=0;\n\tedit_item($name,$original_name,$bribable,$healthy,$picture_url,$new_owner,$max_per_player,$replicateable,$description);\n\tocw_refresh_with_message(do_lang_tempcode('SUCCESS'));\n}", "public function edit(ItemCarrinho $itemCarrinho)\n {\n //\n }", "public function edit(ItemDiversity $itemDiversity)\n {\n //\n }", "public function edit($id) {\n $item = Leftsideicon::findOrFail($id);\n return view('Admin.leftSideedit', ['item' => $item]);\n }", "public function edit(Inventory $inventory)\n {\n // dd($inventory);\n // return Redirect::route('clients.show, $id')->with( ['data' => $data] );\n return view('edit-item')->with('item',$inventory);\n }", "public function edit($type=null,$item_id,$id)\n {\n //\n }", "public function edit(Item $item)\n {\n return view('item.edit', compact('item'));\n }", "abstract public function edit();", "public function edit($id)\n {\n $show_item = CakeItem::find($id);\n\n if($show_item->show == 0){\n $show_item->update(['show' => 1]);\n }elseif($show_item->show == 1){\n $show_item->update(['show' => 0]);\n }\n }", "public function edit(Item $item,$id)\n {\n $items = Item::where('id', $id)->get()->first();\n return view('Dashboard.ManageItems', [\n \"$items\" => $items\n ]);\n }" ]
[ "0.5916689", "0.5916689", "0.5916689", "0.5916689", "0.58208674", "0.5745358", "0.57449085", "0.57449085", "0.57449085", "0.57449085", "0.57167536", "0.57167536", "0.57167536", "0.56378204", "0.56136376", "0.5545042", "0.5505427", "0.547509", "0.5469815", "0.5433103", "0.5421186", "0.54011303", "0.53895605", "0.53816754", "0.53815675", "0.53739786", "0.53675693", "0.5364844", "0.5334365", "0.5317775" ]
0.63195354
0
persists and shows an InventoryItem
public function createAction(InventoryItem $item) { $this->inventoryItemRepository->add($item); $this->persistenceManager->persistAll(); $this->redirect('show', NULL, NULL, array('item' => $item)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showAction(InventoryItem $item) {\n\t\t$this->view->assign('item', $item);\n\t}", "public function inventoryAction()\n {\n $this->permissionsCheck(false, true);\n\n $this->view->pageTitle = \"Inventory\";\n $this->view->form = new Account_Form_Inventory();\n $this->view->emailModal = new Account_Form_EmailActivationCodesModal();\n $this->view->certModal = new Account_Form_EditCertificationModal();\n $this->view->gradGroupModal = new Account_Form_EditGradGroupModal();\n }", "public function editAction(InventoryItem $item) {\n\t\t$this->view->assign('item', $item);\n\t}", "public function show(Inventory $inventory)\n {\n //\n }", "public function show(Inventory $inventory)\n {\n //\n }", "public function show(Inventory $inventory)\n {\n //\n }", "public function show(Inventory $inventory)\n {\n //\n }", "public function show(inventory $invent)\n {\n //\n }", "public function updateAction(InventoryItem $item) {\n\t\t$this->inventoryItemRepository->update($item);\n\t\t$this->persistenceManager->persistAll();\n\t\t$this->redirect('show', NULL, NULL, array('item' => $item));\n\t}", "public function store()\n\t{\n\n\t\t$inventory = Input::except('pid','qty');\n\t\t\n\t\t$total_cost = $this->totalCost();\n\n\t\t$inventory['total_cost'] = $total_cost;\n\t\t$inv = Inventory::create($inventory);\n\n\t\t$this->setTransaction($inv);\n\n\t\treturn Redirect::route('purchases.index')->with('alert.success', Alert::text('saddpo'));\n\n\t}", "public function newAction()\n {\n $entity = new Item();\n $form = $this->createForm(new ItemType(), $entity);\n\n return $this->render('TouqInventoryBundle:Item:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "protected function AdminInventory() {\n\t$oPathIn = fcApp::Me()->GetKioskObject()->GetInputObject();\n\t$oFormIn = fcHTTP::Request();\n\t\n\t$sDo = $oPathIn->GetString('do');\n\t\n\t$doInvEnter = ($sDo == 'inv');\n\t$doInvCheck = $oFormIn->GetBool('btnInvLookup');\n\t$doInvSave = $oFormIn->GetBool('btnInvSave');\n\tif ($doInvSave) {\n\t $doInvEnter = FALSE;\n\t}\n\t$txtInvList = $oFormIn->GetString('inv');\t// raw data\n\t\t\n\t$out = NULL;\n\t\n\tif ($doInvEnter || $doInvCheck) {\n\t\n\t // default instructions above the entry form:\n\t $htEntryMsg = 'one line per item: catalog #, optionally followed by a space and the quantity (default=1)';\n\n\t // figure out what we're actually doing\n\t \n\t $htInvList = fcString::EncodeForHTML($txtInvList);\t// sanitized for re-display\n\t if (is_null($txtInvList)) {\n\t\t// if there's nothing entered, we can't check or save it\n\t\t$doInvCheck = FALSE;\n\t\t//$doInvSave = FALSE;\n\t } else {\n\t\t$xts = new fcStringBlock($txtInvList);\n\t\t$arLines = $xts->ParseTextLines(array('line'=>'arr'));\n\t\tif (!is_array($arLines)) {\n\t\t // if the data can't be parsed, we can't check or save it\n\t\t $doInvCheck = FALSE;\n\t\t //$doInvSave = FALSE;\n\t\t}\n\t }\n\t \n\t if ($doInvCheck) {\n\t \n\t // PHASE II -- inventory text parsed; now check it against catalog\n\t\t$arStats = $this->AdminInventory_check($arLines);\n\t\t$cntUnk = $arStats['cnt.unk'];\n\t\t$htInvList = $arStats['txt.inv'];\t// get rebuit/annotated inventory\n\t\tif ($cntUnk == 0) {\n\t\t // PHASE II-A -- all inventory lines accounted for; get user confirmation to save inventory\n\t\t $arEntry = $arStats['arr.fnd'];\n\t\t $arStock = $this->ItemArray();\n\t\t $out .= $oPage->ActionHeader('Inventory Changes')\n\t\t .\"\\n<form method=post>\"\n\t\t .$this->Inventory_RenderStatus($arStock,$arEntry)\n\t\t .\"\\n<input type=submit name=btnInvSave value='Save Changes'>\"\n\t\t .\"\\n</form>\"\n\t\t ;\n\t\t $doInvEnter = FALSE;\n\t\t} else {\n\t\t // there were unrecognized entries -- continue PHASE I\n\t\t $doInvEnter = TRUE;\n\t\t $doInvCheck = FALSE;\n\t\t $doInvSave = FALSE;\n\t\t $txtSng = 'one catalog # was';\n\t\t $txtPlr = $cntUnk.' catalog #s were';\n\t\t $txtUnk = $arStats['txt.unk'];\n\t\t $htEntryMsg = fcString::Pluralize($cntUnk,$txtSng,$txtPlr).' not recognized:'.$txtUnk;\n\t\t}\n\t }\n\t if ($doInvEnter) {\n\t // PHASE I\n\n\t\t$out .= (new fcSectionHeader('Inventory Count Entry'))->Render()\n\t\t .\"\\n<form method=post>\"\n\t\t .\"\\n$htEntryMsg<br>\"\n\t\t .\"\\n<textarea name=inv rows=20>$htInvList</textarea>\"\n\t\t .\"\\n<input type=submit name=btnInvLookup value='Lookup...'>\"\n\t\t .\"\\n</form>\"\n\t\t ;\n\t }\n\t} elseif ($doInvSave) {\n\t // PHASE III\n\t $arQtys = $_POST['qty'];\n\t $this->Inventory_Save($arQtys);\n\t $this->SelfRedirect();\n\t} else {\n\t $out = NULL;\t// nothing to do\n\t}\n\treturn $out;\n }", "public function show($id)\n {\n return Inventory::find($id);\n }", "function viewInventoryItem($name){\n\t\t$urlms = $this->urlms;\n\t\t$inventoryItem = $this->findInventoryItem($name);\n\t\t//session_start();\n\t\t$_SESSION['inventoryitem'] = $inventoryItem;\n\t\t$_SESSION['urlms'] = $urlms;\n\t\t?>\n\t\t<html>\n\t\t\t<div class=\"container\">\n\t\t\t\t<h3>Inventory Item Summary</h3>\n\t\t\t\t<br>\n\t\t\t\t<label for=\"ItemName\">Item Name :</label> <?php echo $inventoryItem->getName();?>\n\t\t\t\t<br>\n\t\t\t\t<label for=\"ItemCost\">Item Cost :</label> <?php echo \"$ \" . $inventoryItem->getCost();?> \n\t\t\t\t<br>\n\t\t\t\t<label for=\"ItemCategory\">Item Category :</label> <?php echo $inventoryItem->getCategory();?> \n\t\t\t\t<br>\n\t\t\t\t<?php \n\t\t\t\tif(get_class($inventoryItem) == \"Equipment\"){\n\t\t\t\t\tif($inventoryItem->getIsDamaged()){?>\n\t\t\t\t\t\t<?php echo $inventoryItem->getName();?> <label for=\"ItemName\"> is damaged!</label> <br> <?php\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else{?>\n\t\t\t\t\t<label for=\"SupplyQuantity\">Quantity :</label> <?php echo $inventoryItem->getQuantity() ;?> \n\t\t\t\t\t<br>\n\t\t\t\t\t<br>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\n\t\t\t\t<form action=\"../controller/InfoUpdater.php\" method=\"get\">\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<br>\n\t\t\t\t\t<h3>Edit Inventory Item</h3>\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"editInventoryItem\" />\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"NewName\">New Name</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"editedinventoryname\" id=\"expenseName\" aria-describedby=\"nameHelp\" value=\"<?php echo $inventoryItem->getName();?>\"/>\n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter new inventory item name.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"NewName\">New Cost</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"editedinventorycost\" id=\"expenseName\" aria-describedby=\"nameHelp\" value=\"<?php echo $inventoryItem->getCost();?>\"/>\n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter new inventory item cost.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"NewName\">New Category</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"editedinventorycat\" id=\"expenseName\" aria-describedby=\"nameHelp\" value=\"<?php echo $inventoryItem->getCategory();?>\"/>\n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter new inventory item category.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<!-- modifiable isDamaged or quantity depending on type of inventory item -->\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif(get_class($inventoryItem) == \"Equipment\"){\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<input type=\"radio\" name=\"isdamaged\" value=\"damaged\"/> Damaged<br>\n\t\t\t\t\t\t\t\t<input type=\"radio\" name=\"isdamaged\" value=\"notdamaged\"/> Not Damaged <br>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"editedsupplyquantity\" value=\"\" />\n\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t\t\t<label for=\"NewName\">Add/Remove Quantity</label> \n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"editedsupplyquantity\" id=\"expenseName\" aria-describedby=\"nameHelp\" value=\"\"/>\n\t\t\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter number of supply to remove or add.</small> <br>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"isdamaged\" value=\"\" />\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t<input class=\"btn btn-danger\" type=\"submit\" value=\"Edit Inventory Item!\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t</form>\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col-sm-2\">\n\t\t\t\t\t\t\t<a href=\"../view/InventoryView.php\" style=\"color: white; text-decoration: none;\">\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-danger\" data-toggle=\"tooltip\"\n\t\t\t\t\t\t\t\t\tdata-placement=\"bottom\" title=\"Go back to homepage\">Back</button>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t</div>\n\t\t</html><?php\n\t}", "public function inventory_item(){\n $inventory_item_info=DB::table('inventories')\n ->orderBy('id', 'desc')\n ->get();\n $inventory_category_info=DB::table('inventory_categories')\n ->orderBy('id', 'desc')\n ->get();\n $manage_inventories=view('admin.inventory.inventory_item.inventory_items')\n ->with('inventory_item_info',$inventory_item_info)\n ->with('inventory_category_info',$inventory_category_info);\n return view('admin.master')\n ->with('admin.inventory.inventory_item.inventory_items',$manage_inventories);\n }", "public function edit(Inventory $inventory)\n {\n //\n }", "public function edit(Inventory $inventory)\n {\n //\n }", "public function edit(Inventory $inventory)\n {\n //\n }", "public function edit(Inventory $inventory)\n {\n //\n }", "public function getItem()\n {\n $this->setPageHeader('Inventory', 'Item List');\n $items = Inventory::with('metric')->with('category')->with('sku')->get();\n return view('admin.inventory.item')\n ->with('items', $items);\n }", "public function show($id)\n {\n $inventory = Inventory::findOrFail($id);\n $total = count($inventory);\n\n $resource = new Item($inventory, new InventoryTransformer($total), 'inventory');\n\n return $this->manager->createData($resource)->toArray();\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 //\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 //\n }", "public function add() {\n\t\tif (!empty($this->data)) {\n\t\t\ttry {\n\t\t\t\t$result = $this->InventoryEntry->add(array('InventoryEntry' => array(\n\t\t\t\t\t'purchase_order_id' => $this->data['InventoryEntry']['purchase_order_id'],\n\t\t\t\t\t'user_id' => $this->Auth->user('id')\n\t\t\t\t)));\n\n\t\t\t\tif ($result === true) {\n\t\t\t\t\t$this->redirect(\n\t\t\t\t\t\tarray('controller' => 'inventory_items', 'action' => 'add', $this->InventoryEntry->id)\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$this->data = $result;\n\t\t\t\t}\n\t\t\t} catch (OutOfBoundsException $e) {\n\t\t\t\t$this->Session->setFlash($e->getMessage());\n\t\t\t}\n\t\t}\n\t\t$purchaseOrders = $this->InventoryEntry->PurchaseOrder->find('list', array(\n\t\t\t'conditions' => array(\n\t\t\t\t//\"NOT\" => array('PurchaseOrder.status' => array(PurchaseOrder::VOID, PurchaseOrder::COMPLETED)),\n\t\t\t\tarray('PurchaseOrder.status' => array(PurchaseOrder::INVOICED)),\n\t\t\t),\n\t\t\t'order' => array('PurchaseOrder.created' => 'desc')));\n\t\t$this->set(compact('purchaseOrders'));\n\t}" ]
[ "0.73254085", "0.69467455", "0.69341046", "0.67268455", "0.67268455", "0.67268455", "0.67268455", "0.655888", "0.6533072", "0.64386106", "0.63219607", "0.63073516", "0.62212884", "0.61845684", "0.6146738", "0.61213475", "0.61213475", "0.61213475", "0.61213475", "0.61186856", "0.6079532", "0.607248", "0.607248", "0.607248", "0.607248", "0.607248", "0.607248", "0.607248", "0.607248", "0.60641176" ]
0.7277362
1
Fetches the database id of the schedule to use
public function getScheduleId() { return $this->iScheduleDatabaseId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDatabaseId()\n {\n return $this->database_id;\n }", "function getId () {\n return $this -> dbId;\n }", "public function getUseDbId();", "protected function getDatabase()\n {\n if (!$this->database)\n {\n // use same DB as article\n $this->database = wcmProject::getInstance()->bizlogic->getBizClassByClassName('event')->getConnector()->getBusinessDatabase();\n $this->tableName = '#__schedule';\n }\n }", "function getSchedule(){\n\t\t\t$sqlQuery = \"SELECT * FROM bus_schedule\";\n\n\t\t\t$schedule = $this->db->executeQuery($sqlQuery, $this->Functions->paramsIsZero(), \"select\");\n\n\t\t\treturn $schedule;\n\t\t}", "public function getIdDatabase()\n {\n return $this->idDatabase;\n }", "public function getCalendarId() {\n \tif (!$this->hasCalendar())\n \t\tthrow new osid_IllegalStateException('hasCalendar() is false.');\n \t\n \t$val = $this->cacheGetObj('schedule_info');\n \tif (is_null($val))\n \t\treturn $this->cacheSetObj('schedule_info', $this->getOffering()->getScheduleInfo());\n \telse\n \t\treturn $val;\n\t}", "public function getPrimaryKey ()\n {\n return $this->getCalendarUid ();\n }", "function getSchedConfId() {\n\t\treturn $this->getData('schedConfId');\n\t}", "function sp_getId(){\n $sql = \"select sp_id from sp where user_id=:user_id\";\n $args = [':user_id'=>$this->user_id];\n $stmt = $this->run($sql, $args);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $iddb = $row['sp_id'];\n return $iddb;\n }", "public function getDbId() {return $this->id;}", "function get(){\n global $wpdb;\n global $DOPBSP;\n \n $calendar = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->calendars.' WHERE post_id=%d ORDER BY id',\n $_POST['post_id']));\n echo $calendar->id;\n \n die();\n }", "function get_calendarPageIDFromDB()\n\t{\n\t\tglobal $wpdb;\n\t\t$query = \"SELECT ID FROM $wpdb->posts\n\t\t\t\t WHERE (post_name = 'kalender'\n\t\t\t\t \tOR post_name = 'calendar'\n\t\t\t\t \tOR post_name = 'termine'\n\t\t\t\t \tOR post_name = 'termin'\n\t\t\t\t \tOR post_title = 'Kalender')\n\t\t\t\t \tAND post_status = 'static'\";\n\t\t$result = $wpdb->get_results( $query );\n\t\treturn $result[0]->ID;\n\t}", "public static function dernier () {\n self:self::initialiserDB();\n return self::$database->dernierId();\n }", "public function getDbId(): int\n {\n return $this->dbId;\n }", "function rn_getId(){\n $sql = \"select rn_id from runner where user_id=:user_id\";\n $args = [':user_id'=>$this->user_id];\n $stmt = $this->run($sql, $args);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $iddb = $row['rn_id'];\n return $iddb;\n }", "function getMaintenanceeLastId(){\n $sql = \"SELECT idMain FROM maintenance ORDER BY idMain ASC\";\n $bornes = pg_query($sql); \n while($maintenance = pg_fetch_object($bornes)):\n $lastid = $maintenance->idMain;\n endwhile;\n return $lastid;\n \n }", "public function getID() {\n\t\treturn 'mysql';\n\t}", "public final function fetchID()\n {\n return $this->pollID;\n }", "public function getUseridEsp()\n {\n \t$useridAr=\\DB::table('calendars')\n ->first();\n\t\treturn $useridAr->id; \n }", "private function getActiveSetID()\n\t{\n\t\t$active_id = NULL;\n\n\t\t// Get the (oldest and hopefully only) active schedule entry\n\t\t$result = DB_query('SELECT * FROM autoUpdateSchedule WHERE active=true ORDER BY lastRun LIMIT 0,1'); //FW ok\n\n\t\t// Check, if there is an active entry\n\t\tif (mysqli_num_rows($result) > 0)\n\t\t{\n\t\t\t// Get its ID\n\t\t\t$line = mysqli_fetch_assoc($result);\n\n\t\t\t// Check the ID\n\t\t\tif (is_numeric($line['id']))\n\t\t\t\t$active_id = $line['id'];\n\t\t}\n\n\t\t// Try to get an active by choosing the next set\n\t\tif (is_null($active_id))\n\t\t\t$active_id = $this->activateNextSet();\n\n\t\t$this->active_id = $active_id;\n\t\treturn($active_id);\n\t}", "public function _lastQueryRegistry(){\n $result = $this->timeDAO-> lastQueryRegistry();\n $idTeam = $result->Fields('id');\n return $idTeam;\n }", "public function get_id();", "public function getCurrentSchedule()\n {\n return Mage::registry('current_schedule');\n }", "public function getPrimaryId()\n\t{\n\t\t$calendar = $this->getCalendarById('primary');\n\t\treturn !empty($calendar) ? $calendar['id'] : '';\n\t}", "function get_last_open_riddle_id() {\n return db_scalar_query(\"SELECT id FROM `riddle` WHERE end_time IS NULL ORDER BY `start_time` DESC LIMIT 1\");\n}", "public function get_id()\n\t{\n\t\treturn $this->main_table['id'];\n\t}", "public function getFromAutoID()\n {\n return $this->schemaID;\n }", "function db_lastid () {\n\treturn Database::$connections[Database::$last_conn]->lastInsertId ();\n}", "public function getCurrentId()\n {\n $sql = 'SELECT value FROM ' . $this->table . ' WHERE name = ?';\n\n $id = $this->db->fetchOne($sql, array($this->name));\n\n if (!empty($id) || '0' === $id || 0 === $id) {\n return (int) $id;\n }\n }" ]
[ "0.6549801", "0.64030564", "0.6402206", "0.6385614", "0.63359797", "0.629068", "0.6243721", "0.62290084", "0.6228357", "0.61484134", "0.6137555", "0.6133347", "0.6111967", "0.60168713", "0.5979635", "0.5966176", "0.5952363", "0.5912788", "0.587439", "0.5870033", "0.58537173", "0.5841352", "0.5832004", "0.5824452", "0.57968354", "0.57547915", "0.57386476", "0.57324886", "0.570444", "0.5702893" ]
0.7912162
0
(A) SEND () : SEND EMAIL $to : recipients, string or array of emails. $subject : email subject $body : email message, HTML OK. $cc : optional cc, string or array of emails. $bcc : optional bcc, string or array of emails.
function send ($to, $subject, $body, $cc=null, $bcc=null) { // (A1) BUILD PARTIAL HEADERS $headers = [ "MIME-Version: 1.0", "Content-type: text/html; charset=utf-8", "From: " . EMAIL_FROM ]; // (A2) ADD CC + BCC if ($cc != null) { $headers[] = "Cc: " . (is_array($cc) ? implode(", ", $cc) : $cc); } if ($bcc != null) { $headers[] = "Bcc: " . (is_array($bcc) ? implode(", ", $bcc) : $bcc); } // (A3) SEND! return @mail( is_array($to) ? implode(", ", $to) : $to, $subject, $body, implode("\r\n", $headers) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function _send_email($sender_name, $sender_email, $recipient, $subject, $body, $bcc, $isHTML=false) {\n\n $config =& JFactory::getConfig();\n $sender = array(\n $config->getValue('config.mailfrom'),\n $config->getValue('config.fromname')\n );\n\n // set sender\n $replyto = array(\n $sender_email,\n $sender_name\n );\n\n // set mail data\n $mailer = & JFactory::getMailer();\n\n $mailer->addReplyTo($replyto);\n\n $mailer->addBCC($bcc);\n\n $mailer->addRecipient($recipient);\n\n $mailer->setSender($sender);\n\n $mailer->isHTML($isHTML);\n\n $mailer->setSubject($subject);\n\n $mailer->setBody($body);\n\n // send email\n ob_start();\n $send = & $mailer->Send();\n $error = ob_get_clean();\n\n return $error;\n }", "private function sendMail() {\n\t\t$addresses = array();\n\t\t$subject = $_POST[\"subject\"];\n\t\t$body = $_POST[\"message\"];\n\t\t\n\t\t// determine whether to send it to a group or to a single person\n\t\tif(isset($_POST[\"group\"]) && $_POST[\"group\"] != \"\") {\n\t\t\t// get all mail addresses\n\t\t\t$addies = $this->getData()->getMailaddressesFromGroup($_POST[\"group\"]);\n\t\t\tfor($i = 1; $i < count($addies); $i++) {\n\t\t\t\tarray_push($addresses, $addies[$i][\"email\"]);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// get contact mail address\n\t\t\tarray_push($addresses, $this->getData()->getContactmail($_POST[\"contact\"]));\n\t\t}\t\t\n\t\t\n\t\t// Receipient Setup\n\t\tglobal $system_data;\n\t\t$ci = $system_data->getCompanyInformation();\t\t\n\t\t$headers = 'From: ' . $this->getData()->getUsermail() . \"\\r\\n\";\n\t\t$receipient = $ci[\"Mail\"];\n\t\t\n\t\t// To send HTML mail, the Content-type header must be set\n\t\t$headers .= 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n\t\t\n\t\t// place sender addresses into the bcc field\n\t\t$bcc_addresses = \"\";\n\t\tforeach($addresses as $i => $to) {\n\t\t\tif($i > 0) $bcc_addresses .= \",\";\n\t\t\t$bcc_addresses .= $to;\n\t\t}\n\t\t$headers .= 'Bcc: ' . $bcc_addresses . \"\\r\\n\";\n\t\t\n\t\t/*\n\t\t * MAIL FUNCTION\n\t\t * -------------\n\t\t * Some hosting providers require specific mail() settings\n\t\t * therefore this comment should show where the function is!\n\t\t */\n\t\tif(!$GLOBALS[\"system_data\"]->inDemoMode()) {\n\t\t\tif(!mail($receipient, $subject, $body, $headers)) {\n\t\t\t\t$this->getView()->reportMailError($bcc_addresses);\n\t\t\t}\n\t\t}\n\t}", "public function send($subject = NULL, $body = NULL)\n\t{\n\t\tif (!isset($subject) && $this->_email_subject == '') {\n\t\t\treturn FALSE;\n\t\t} elseif (!isset($body) && $this->_email_body == '') {\n\t\t\treturn FALSE;\n\t\t} elseif (count($this->_email_to) == 0) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$subject\t= (isset($suject))\t\t\t? $subject\t\t\t\t: $this->_email_subject;\n\t\t$body\t\t= (isset($body))\t\t\t? $body\t\t\t\t\t: $this->_email_body;\n\t\t$from\t\t= ($this->_email_from != '')? $this->_email_from\t: 'admin@' . $this->config->get('server_host');\n\t\t$to\t\t\t= $this->_email_to[0];\n\n\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type:text/html;charset=iso-8859-1' . \"\\r\\n\";\n\t\t$headers .= 'From: ' . $from . \"\\r\\n\";\n\t\tif (count($this->_email_to) > 1) {\n\t\t\t$headers .= 'To: ' . implode(', ', $this->_email_to) . \"\\r\\n\";\n\t\t}\n\t\tif (count($this->_email_cc) > 0) {\n\t\t\t$headers .= 'Cc: ' . implode(', ', $this->_email_cc) . \"\\r\\n\";\n\t\t}\n\t\tif (count($this->_email_bcc) > 0) {\n\t\t\t$headers .= 'Bcc: ' . implode(', ', $this->_email_bcc) . \"\\r\\n\";\n\t\t}\n\t\t\n\t\tswitch ($this->_email_method) {\n\t\t\tcase 'imap':\n\t\t\t\t$done = imap_mail($to, $subject, $body, $headers);\n\t\t\tbreak;\n\t\t\tcase 'sendmail':\n\t\t\t\t$done = mail($to, $subject, $body, $headers);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $done;\n\t}", "function send($_to, $_subject, $_body, $_headers=array());", "public function enviarEmail($from, $to, $subject, $textBody, $body)\r\n { \r\n\r\n \r\n \r\n return Yii::$app->mailer->compose()\r\n ->setFrom($from)\r\n ->setTo($to)\r\n ->setSubject($subject)\r\n ->setTextBody($textBody)\r\n ->setHtmlBody($body)\r\n\r\n\r\n ->send();\r\n \r\n }", "function Send() {\n $additional_headers = \"\";\n if ( \"$this->From\" != \"\" ) $additional_headers .= \"From: $this->From\\r\\n\";\n if ( \"$this->Cc\" != \"\" ) $additional_headers .= \"Cc: $this->Cc\\r\\n\";\n if ( \"$this->Bcc\" != \"\" ) $additional_headers .= \"Bcc: $this->Bcc\\r\\n\";\n if ( \"$this->ReplyTo\" != \"\" ) $additional_headers .= \"Reply-To: $this->ReplyTo\\r\\n\";\n if ( \"$this->ErrorsTo\" != \"\" ) $additional_headers .= \"Errors-To: $this->ErrorsTo\\r\\n\";\n\n if ( \"$this->Sender\" != \"\" )\n mail( $this->To, $this->Subject, $this->Body, $additional_headers, \"-f$this->Sender\" );\n else\n mail( $this->To, $this->Subject, $this->Body, $additional_headers );\n }", "function send_mail($to, $subject, $body){\r\n try {\r\n //Recipients\r\n app('mail')->addAddress($to);\r\n // Content\r\n app('mail')->isHTML(true);\r\n app('mail')->Subject = $subject;\r\n app('mail')->Body = $body;\r\n app('mail')->send();\r\n return true;\r\n } catch (Exception $e) {\r\n app('msg')->error(app('mail')->ErrorInfo);\r\n }\r\n}", "function _send_mail($mailto, $from, $subject, $mailcontent, $headers = '') {\n\tif (!$headers) {\n\t\t$headers = \"From: $from \\nReply-To: $from \\nReturn-Path: $from \\nX-Mailer: PHP\\n\";\n\t\t$headers .= \"Content-Transfer-Encoding: 8bit\\n\";\n\t\t$headers .= \"Content-Type: text/html; charset=UTF-8\\n\";\n\t}\n\t\n\tif (!is_array($mailto)) {\n\t\t$mailto = array($mailto);\n\t}\n\tforeach ($mailto as $m) {\n\t\t@mail($m, $subject, $mailcontent, $headers);\n\t}\n}", "public function sendMail() {\n\t\t$body = $this->message->get();\n\t\t$hdrs = $this->message->headers($this->headers);\n\n\t\t$params = Gatuf::prefixconfig('mail_', true); // strip the prefix 'mail_'\n\t\tunset($params['backend']);\n\t\t$gmail = new Mail();\n\t\t$mail = $gmail->factory(\n\t\t\tGatuf::config('mail_backend', 'mail'),\n\t\t\t$params\n\t\t);\n\t\tif (Gatuf::config('send_emails', true)) {\n\t\t\t$mail->send($this->to_address, $hdrs, $body);\n\t\t}\n\t\tif (defined('IN_UNIT_TESTS')) {\n\t\t\t$GLOBALS['_PX_UNIT_TESTS']['emails'][] = array($this->to_address, $hdrs, $body);\n\t\t}\n\t}", "function sendMail($to, $subject, $body) {\n\t\t\n\t\trequire 'PHPMailer/PHPMailerAutoload.php';\n\t\t$from = \"mcgrathcelton@gmail.com\";\n\t\t$mail = new PHPMailer();\n\t\t$mail->IsSMTP(true); // use SMTP\n\t\t$mail->IsHTML(true);\n\t\t\n\t\t$mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only\n\t\t$mail->SMTPAuth = true; // authentication enabled\n\t\t$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail\n\t\t\n\t\t$mail->Host = \"smtp.gmail.com\"; // SMTP host\n\t\t$mail->Port = 465; // set the SMTP port\n\t\t$mail->Username = \"mcgrathcelton@gmail.com\"; // SMTP username\n\t\t$mail->Password = \"partition67\"; // SMTP password\n\t\t$mail->SetFrom($from, 'Celton McGrath');\n\t\t$mail->Subject = $subject;\n\t\t$mail->MsgHTML($body);\n\t\t$address = $to;\n\t\t$mail->AddAddress($address, $to);\n\t\t\n\t\treturn ($mail->Send()); \n\t}", "public function send($from_email, $from_name, $to, $subject, $body, $replyto_email = '', $replyto_name = '', $cc = array(), $altbody = '', $attachements = array()) {\n if($this->config->mail->host) {\n // set default values\n if($from_email) $from_email = $this->config->mail->username;\n if($replyto_email) $replyto_email = $this->config->mail->username;\n\n if($from_email) {\n if($subject) {\n //Server settings\n $this->mailer->SMTPDebug = 2;\n $this->mailer->isSMTP();\n $this->mailer->Host = $this->config->mail->host;\n $this->mailer->SMTPAuth = true;\n $this->mailer->Username = $this->config->mail->username;\n $this->mailer->Password = $this->config->mail->password;\n $this->mailer->SMTPSecure = $this->config->mail->secure;\n $this->mailer->Port = $this->config->mail->port;\n\n //Recipients\n $this->mailer->setFrom($from_email, $from_name);\n\n foreach($to as $rec) {\n if($rec['name']) {\n $this->mailer->addAddress($rec['email'], $rec['name']);\n }\n else {\n $this->mailer->addAddress($rec);\n\n }\n }\n $this->mailer->addReplyTo($replyto_email, $replyto_name);\n if(count($cc)) {\n foreach($cc as $rec) {\n if($rec['name']) {\n $this->mailer->addCC($rec['email'], $rec['name']);\n }\n else {\n $this->mailer->addCC($rec);\n }\n }\n }\n\n //Attachments\n if(count($attachements)) {\n foreach($attachements as $att) {\n if($att['name']) {\n $this->mailer->addAttachment($att['path'], $att['name']);\n }\n else {\n $this->mailer->addAttachment($att);\n }\n }\n }\n\n //Content\n $this->mailer->isHTML(true);\n $this->mailer->Subject = $subject;\n $this->mailer->Body = $body;\n $this->mailer->AltBody = $altbody;\n\n $this->mailer->send();\n\n // collect error\n $this->response->error[] = $this->mailer->ErrorInfo;\n }\n else {\n $this->response->error[] = 'no subject available';\n }\n }\n else {\n $this->response->error[] = 'no sender email address detected';\n }\n }\n else {\n $this->response->error[] = 'missing or incorrect smtp settings';\n }\n\n return $this->response;\n }", "public function send($from,$to,$subject,$body,$additional_headers=array())\n {\n \t$additional_headers=array(\"Content-Type:text/html\\r\\n\");\n $to_f = array();\n $to_h = '';\n if(is_array($to))\n {\n $to_f = $to;\n $to_h = implode(', ',$to);\n }\n elseif(is_string($to))\n {\n $to_f = array($to);\n $to_h = $to;\n }\n else\n {\n throw new Exception('$to can only be a string or an array');\n }\n \n return $this->smtp_object->SendMessage(\n $from,\n $to_f,\n array_merge(array(\n \"From: $from\",\n \"To: $to_h\",\n \"Subject: \".$subject,\n \"Date: \".strftime(\"%a, %d %b %Y %H:%M:%S %Z\")\n ),$additional_headers),\n $body);\n }", "public static function sendMail($mails, $subject, $body, $from, $fromName, $cc=false) {\r\n\t\t\trequire_once Application::$settings['libs_folder'] . ds . 'phpmailer' . ds . 'class.phpmailer.php';\r\n\t\t\t\r\n\t\t\t$host = Application::$settings['smtp']['host'];\r\n\t\t\t$username = Application::$settings['smtp']['user'];\r\n\t\t\t$password = Application::$settings['smtp']['password'];\r\n\r\n\t\t\tif($host==\"\" || count($mails)<1)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t$mailer = new PHPMailer();\r\n\t\t\t$mailer->From = $from;\r\n\t\t\t$mailer->FromName = $fromName;\r\n\t\t\t$mailer->Host = $host;\r\n\t\t\t$mailer->Mailer\t= \"smtp\";\r\n\t\t\t$mailer->Subject = $subject;\r\n\t\t\t$mailer->Body = $body;\r\n\t\t\tif($username != \"\") {\r\n\t\t\t\t$mailer->SMTPAuth = true;\r\n\t\t\t\t$mailer->Username = $username;\r\n\t\t\t\t$mailer->Password = $password;\r\n\t\t\t}\r\n\t\t\t$mailer->ClearAddresses();\r\n\t\t\t$mailer->ClearCCs();\r\n\t\t\tfor($i=0; $i<count($mails); $i++) {\r\n\t\t\t\t$to = $mails[$i][0];\r\n\t\t\t\t$to_name = $mails[$i][1];\r\n\t\t\t\t$mailer->AddAddress($to, $to_name);\r\n\t\t\t}\r\n\t\t\tif($cc) $mailer->AddCC($cc,'none');\r\n\t\t\treturn array('sended'=>$mailer->Send(),'error'=>$mailer->ErrorInfo);\r\n\t\t}", "function SendEmail($to = \"\", $subject = \"\" , $body = \"\"){\r\n\r\n if (empty($body)){\r\n $body = \"NONE\";\r\n }\r\n \r\n\t// send email\r\n $result = mail($to, $subject, $body);\r\n\r\n if($result){\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function send()\n{\n\nif (!clsMail::isemail($this->to)) echo 'Caution !! Mail server can not sent email 1';\nif (!clsMail::isemail($this->from)) echo 'Caution !! Mail server can not sent email 2' ;\nif (!clsMail::isemail($this->cc) && !$this->cc==\"\") echo 'Caution !! Mail server can not sent email 3' ;\nif (!clsMail::isemail($this->bcc) && !$this->bcc==\"\") echo 'Caution !! Mail server can not sent email 3';\n\n\n// To send HTML mail, you can set the Content-type header. html is the default\n$headers = \"MIME-Version: 1.0\\r\\n\";\nif ($this->contentType==\"html\") {\n\t$headers .= \"Content-type: text/html; charset=windows-874\\r\\n\";\n\t$headers .= \"<META content=\\\"text/html; charset=windows-874\\\" http-equiv=Content-Type>\\r\\n\";\n}else $headers .= \"Content-type: text/plain; charset=us-ascii\\r\\n\";\n\n// additional headers for From, Cc and Bcc\n$headers .= \"From: \".$this->from.\"\\r\\n\";\nif (!$this->cc==\"\") $headers .= \"Cc: \".$this->cc.\"\\r\\n\";\nif (!$this->bcc==\"\") $headers .= \"Bcc: \".$this->bcc.\"\\r\\n\";\n\n// send the e-mail\nreturn mail($this->to, $this->subject, $this->message, $headers);\n}", "public function emailSent($to_email, $from_email, $from_name, $subject, $body) {\n\t\t/**\n\t\t * Send email\n\t\t */\t\n\t\t$this -> _to_email = $to_email;\n\t\t\n\t\t$this -> _from_email = $from_email;\n\t\t\n\t\t$this -> _from_name = $from_name;\n\t\t\n\t\t$this -> _subject = $subject;\n\t\t\n\t\t$mailer = ($this -> emailValidate()) ? mail($to_email, $subject, $body, $this -> addHeader()) : false;\n\t\t\n\t\treturn $mailer;\n\t}", "function send_email($from, $to, $subject, $body)\n{\n global $EMAIL_HOST, $EMAIL_PORT, $EMAIL_USER, $EMAIL_PASS;\n\n $recipients = $to;\n\n $headers = array();\n $headers['From'] = $from;\n $headers['To'] = $to;\n $headers['Subject'] = $subject;\n\n // Define SMTP Parameters\n $params['host'] = $EMAIL_HOST;\n $params['port'] = $EMAIL_PORT;\n $params['auth'] = 'PLAIN';\n $params['username'] = $EMAIL_USER;\n $params['password'] = $EMAIL_PASS;\n\n // Create the mail object using the Mail::factory method\n $mail_object = Mail::factory('smtp', $params);\n\n // Send the message\n $mail_object->send($recipients, $headers, $body);\n}", "function send() {\r\n return mail($this->to, $this->subject, $this->message, $this->headers, $this->parameters);\r\n }", "function send($to,$from,$from_name,$subject,$template,$args = FALSE){\n\t\t$this->load->library('mail _phpmailer','phpmailer');\n\t\t$this->to($to)\n\t\t->from($from,$from_name)\n\t\t->subject($subject)\n\t\t->body($template,$args)\n\t\t->go()\n\t\t->clear();\n\t\treturn $this;\n\t}", "function mail ($to, $subject, $message, $additional_headers = null, $additional_parameters = null) {}", "public function sendmail($to,$subject,$message){\n\t\t$headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n\t\t$headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\n\t\t\n\t\t// More headers\n\t\t$headers .= 'From: <admin@88homepros.com>' . \"\\r\\n\";\n\t\t//$headers .= 'Cc: myboss@example.com' . \"\\r\\n\";\n\t\t\n\t\tmail($to,$subject,$message,$headers);\n\t}", "function sendmail($to, $subject, $message, $content_type = \"text/plain\", $headers = null) {\n\t\t$to = trim(preg_replace(\"/[\\r|\\n](.*?)/\", \"\", $to));\n\t\t$subject = trim(preg_replace(\"/[\\r|\\n](.*?)/\", \"\", $subject));\n\t\t$message = trim(preg_replace(\"/[\\r|\\n]\\.[\\r|\\n](.*?)/\", \"\", $message));\n\n\t\tif (GEKKO_SMTP_MAIL) {\n\n\t\t\t$smtp = new smtpSession(GEKKO_SMTP_HOST, GEKKO_SMTP_PORT, GEKKO_SMTP_USER, GEKKO_SMTP_PASS);\n\t\t\tif ($smtp->conn->status())\n\t\t\t\t$smtp->send($to, $subject, $message, $content_type, $headers);\n\n\t\t\t$smtp->bye();\n\n\t\t} else {\n\n\t\t\tif (!$headers)\n\t\t\t\t$headers = \"\";\n\n\t\t\t$headers .= \"Mime-Version: 1.0\\r\\n\";\n\t\t\t$headers .= \"Content-Type: $content_type\\r\\n\";\n\t\t\t$headers .= \"From: \".GEKKO_SMTP_FROM_NAME.\" <\".GEKKO_SMTP_FROM_EMAIL.\">\\r\\n\";\n\t\t\t//$headers .= \"X-Gekko-Tag: \".(isset($GLOBALS[\"USER\"][\"id\"]) ? $GLOBALS[\"USER\"][\"id\"] : \"0\").\"@\".getIP().\"\\r\\n\";\n\t\t\t$headers .= \"Date: \".date(\"r\").\"\\r\\n\";\n\n\t\t\tmail($to, $subject, $message, trim($headers));\n\t\t}\n\n\t}", "function sendMail($to, $from, $subject, $Body) {\n\n// App::import('Vendor', 'phpmailer', array(\n// 'file' => 'phpmailer/class.phpmailer.php')); \n require_once( WWW_ROOT . 'PHPmailer/class.phpmailer.php' );\n\n $mail = new PHPMailer();\n $mail->IsMAIL();\n $mail->IsHTML(true);\n\n $body = preg_replace('/\\[\\]/', '', $Body);\n\n $mail->SetFrom($from, 'Genie');\n\n $mail->AddReplyTo($from, \"Genie\");\n\n $address = $to;\n\n $mail->AddAddress($address);\n\n $mail->Subject = $subject;\n\n $mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\"; // optional, comment out and test\n $mail->MsgHTML($body);\n\n\n if (!$mail->Send()) {\n return $mail->ErrorInfo;\n } else {\n return \"Success\";\n }\n }", "function sendEmail($to_email)\n\t{\n\t\t\n\t}", "public function sendEmail($to, $from, $subject, $body)\n {\n return Yii::$app->mailer->compose()\n ->setTo($to)\n ->setFrom($from)\n ->setSubject($subject)\n ->setTextBody($body)\n ->send();\n }", "function send_text_email($to, $from_name, $from_email, $subject, $body){\n\n evel_send(array(\n '_body_' => $body,\n 'To' => $to,\n 'From' => array($from_email, $from_name),\n 'Subject' => $subject,\n ), $to);\n\t \n }", "function sendEmail($recipient, $subject, $body, $headers) {\r\n\t\t$this->addHeader($headers);\r\n\t\t$result = mail ($recipient, $subject, $body, $this->headers);\r\n\r\n\t\tif ($result === false) {\r\n\t\t\t$this->saveEmail($recipient, $subject, $body, $this->headers);\r\n\t\t}\r\n\t\treturn ($result);\r\n\t}", "public static function sendmail($receiver, $subject, $message) {\n $mailer = Yii::$app->mailer->compose()\n ->setFrom('inam@rdlpk.com');\n \n $mailer->setTo($receiver);\n \n $mailer->setSubject($subject);\n $mailer->setTextBody($message);\n \n $mailer->send();\n \n //->setTo(array('addrs1@gmail.com', 'addrs2@hotmail.com'))\n // ->setCc(array('addrs3@gmail.com'))\n \n //->setTo([\n// 'john.doe@gmail.com' => 'John Doe',\n // 'jane.doe@gmail.com' => 'Jane Doe',\n // ])\n return true;\n }", "public function send() {\n\n $headers = array();\n \n $headers[] = 'From: ' . $this->email->from;\n $headers[] = 'Reply-To: ' . $this->email->replyTo;\n $headers[] = 'Return-Path: ' . $this->email->replyTo;\n $headers[] = 'Message-ID: <' . time() . '-' . $this->email->from . '>';\n $headers[] = 'X-Mailer: PHP v' . phpversion();\n $headers[] = 'Content-Type: text/plain; charset=utf-8';\n $headers[] = 'Content-Transfer-Encoding: 8bit';\n \n ini_set('sendmail_from', $this->email->from); \n $send = mail($this->email->to, str::utf8($this->email->subject), str::utf8($this->email->body), implode(\"\\r\\n\", $headers));\n ini_restore('sendmail_from');\n\n if(!$send) raise(l::get('email.error.service.mail', 'The mail could not be sent!'));\n\n }", "function sendEmail($receiver, $sender, $cc = '', $subject, $body, $attachment_file_path = NULL) {\n $email = new Message();\n $email->setTo($receiver);\n $email->setFrom($sender);\n $email->setCc($cc);\n $email->setSubject($subject);\n $email->setAttachment($attachment_file_path);\n $email->setBody($body);\n return $email->send();\n}" ]
[ "0.73695725", "0.73215795", "0.72385436", "0.72005504", "0.7149104", "0.71237445", "0.7064576", "0.69553065", "0.6925623", "0.686024", "0.6847479", "0.6843487", "0.6817475", "0.68124324", "0.6809162", "0.67824477", "0.6780175", "0.6778755", "0.6742615", "0.6734485", "0.6732934", "0.67217904", "0.6717857", "0.67101383", "0.67055583", "0.6695318", "0.6682424", "0.6682304", "0.6680646", "0.6672942" ]
0.8189408
0
Adds a new child to this filter.
public function addChild(FilterInterface $child): void { $this->child = $child; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addChild($child)\n {\n $this->children[] = $child;\n \n return $this;\n }", "function &addChild ( &$child ) {\n\t\t$this->children[] =& $child;\n\t\t\n\t\treturn $child;\n\t}", "function add_child(&$child)\r\n\t{\r\n\t\t$child->parent = &$this;\r\n\t\t$this->children[] = &$child;\r\n\t}", "public function addChild(ModelInterface $child, $captureTo = null, $append = false);", "public function addChild($child)\n {\n return $this->appendChild($child);\n }", "public function addChild(&$child)\n {\n if (!is_a($child, __CLASS__))\n new Error('E_GENERAL', __CLASS__, \"Se intento asignar un \". gettype($child).\" como permiso.\");\n $this->childs[$child->rightName] = &$child;\n $this->childCount++;\n $child->parents[] = &$this;\n $child->parentsCount++;\n $child->isEditable = false;\n }", "function addChild($child, array $options = array());", "public function addChild(ViewContent $child)\n { \n $this->children[$child->getCaptureTo()] = $child;\n return $this;\n }", "public function addChild(RuntimeConfigurable $child)\n {\n $this->children[] = $child;\n }", "public function addChild(CompositeInterface $child)\n {\n $this->children[] = $child;\n }", "public function appendChild($child)\n {\n array_push($this->children, $child);\n\n return $this;\n }", "function addChild(&$objChild){\r\n $this->arrChilds[] = &$objChild;\r\n }", "public function addChild(Page $child)\n {\n $this->children[] = $child;\n }", "function addChild(ParseTree $child) : ParseTree\r\n {\r\n $this->children[] = $child;\r\n return $child;\r\n }", "public function add(FormBuilderField $child) {\n\n\t\t// remove from old parent if it has one\n\t\tif($child->parent && $child->parent !== $this) $child->parent->remove($child); \n\n\t\t// set new parent and level\n\t\t$child->parent = $this; \n\t\t$child->level = $this->level+1; \n\n\t\t// unset it first in case it's already set, so that it gets appended to the end\n\t\tunset($this->children[$child->name]); \n\t\tunset(self::$allFields[$child->name]); \n\n\t\t// now add it\n\t\t$this->children[$child->name] = $child; \n\t\tself::$allFields[$child->name] = $child;\n\n\t\treturn $this; \n\t}", "public function addChild($child) {\n if(!$this->parent || get_parent_class($child) != 'paObject') {\n return false;\n }\n\n // Put classname in lowercase and change to plural.\n $child->putInfo(str_to_lower(get_class()), $this->getId());\n return true;\n }", "public function addChild(Element $child) {\n return $this->root->addChild($child);\n }", "function appendChild(&$child) {\n \n // Set child's parentNode\n $child->parentNode = & $this;\n \n // Add child to list of childNodes\n $this->childNodes[] = & $child;\n \n // Is child of type node?\n if ($child->nodeType == XML_TYPE_NODE) {\n \n // Set child's previousSibling\n $child->previousSibling = & $this->lastChild;\n }\n \n // Is this node of type node?\n if ($this->nodeType != null && $this->nodeType == XML_TYPE_NODE) {\n \n // Set current lastChild's nextSibling to this child\n if (!is_null($this->lastChild)) {\n $this->lastChild->nextSibling = & $child;\n }\n \n // Now (re)set firstChild and lastChild\n $this->firstChild = & $this->childNodes[0];\n $this->lastChild = & $child;\n }\n \n }", "public function addChild($child) {\n\t\tif ($child instanceof Phamlp_Sass_Tree_Node_Else) {\n\t\t\tif (!$this->lastChild instanceof Phamlp_Sass_Tree_Node_If) {\n\t\t\t\tthrow new Phamlp_Sass_Exception('@else(if) directive must come after @(else)if', array(), $child);\n\t\t\t}\n\t\t\t$this->lastChild->addElse($child);\n\t\t}\n\t\telse {\n\t\t\t$this->children[] = $child;\n\t\t\t$child->parent\t\t= $this;\n\t\t\t$child->root\t\t\t= $this->root;\t\t\t\n\t\t}\n\t\t// The child will have children if a debug node has been added\n\t\tforeach ($child->children as $grandchild) {\n\t\t\t$grandchild->root = $this->root;\t\t\n\t\t}\n\t}", "public function addItemChild($itemName, $childName);", "public final function addChild($writable) {\n if ($writable instanceof IWritable) {\n array_push($this->childs, $writable);\n } else {\n throw new PhalException(\"The child added is not IWritable.\");\n }\n }", "public function addChild(ModelInterface $child, $captureTo = null, $append = null)\n {\n $this->children[] = $child;\n if (null !== $captureTo) {\n $child->setCaptureTo($captureTo);\n }\n if (null !== $append) {\n $child->setAppend($append);\n }\n\n return $this;\n }", "public function addChild(NodeInterface $child)\n {\n $this->children[] = $child;\n\n return $child;\n }", "public function addChild($child)\n\t{\n\t\tif ($child instanceof CategoryNode)\n\t\t{\n\t\t\t$child->setParent($this);\n\t\t}\n\t}", "public function addChildToParent(&$child, $idParent, $depthParent) {\n\t\t$child->id = count($this->results);\n\t\t$child->parent = $idParent;\n\t\t$child->depth = $depthParent + 1;\n\t\t$this->results[] = $child;\n\t}", "public function addChild(ViewModelInterface $child, $placeholder = '', $append = false)\n {\n $this->children[$placeholder] = $child;\n\n if ('' !== $placeholder) {\n $child->setPlaceholder($placeholder);\n }\n\n if (false !== $append) {\n $child->setAppend($append);\n }\n\n return $this;\n }", "public function addChild($child,$parentKey = null){\n\t\t$key = isset($child[$this->idProp])?$child[$this->idProp]:'item_'.$this->cont;\n\t\t$child[\"leaf\"] = true;\n\t\tif($this->containsKey($parentKey)){\n\t\t\t//added to the existing node\n\t\t\t$this->index[$key] =& $child;\n\t\t\t$parent =& $this->index[$parentKey];\n\t\t\tif(isset($parent[$this->childProperty])){\n\t\t\t\t$parent[$this->childProperty][] =& $child;\n\t\t\t}else{\n\t\t\t\t$parent[\"leaf\"] = false;\n\t\t\t\t$parent[$this->childProperty] = array();\n\t\t\t\t$parent[$this->childProperty][] =& $child;\n\t\t\t}\n\t\t}else{\n\t\t\t//added to the root\n\t\t\t$this->index[$key] =& $child;\n\t\t\t$this->tree[] =& $child;\n\t\t}\n\t\t$this->cont++;\n\t}", "public function addDependency( $parent, $child )\n {\n $this->getIndex()->addDependency( $parent, $child );\n }", "public function addChild(PHP_Depend_Code_ASTNodeI $node)\n {\n $this->_nodes[] = $node;\n }", "public function addChild(User $child) {\n // then add to `Relations`: [$child->id, $this->id, 'child']\n $stmt = $this->conn->prepare(\"INSERT INTO relation ( owner_id, family_member_id, relation) VALUES (:id1, :id2, :relationship)\");\n $stmt->bindParam(':id1', $this->id);\n $stmt->bindParam(':id2', $child->id);\n $stmt->bindParam(':relationship', $relationship);\n $relationship = \"Anak\";\n $stmt->execute();\n $stmt->bindParam(':id1', $child->id);\n $stmt->bindParam(':id2', $this->id);\n $stmt->bindParam(':relationship', $relationship);\n $relationship = \"Ayah\";\n $stmt->execute();\n }" ]
[ "0.7082697", "0.68029225", "0.6687722", "0.66658854", "0.66524863", "0.66277707", "0.658032", "0.642188", "0.64045966", "0.6398077", "0.63924927", "0.6339856", "0.628651", "0.6234204", "0.61970085", "0.61073875", "0.59649754", "0.5959182", "0.5944146", "0.59408885", "0.58869994", "0.58262324", "0.5778021", "0.57720435", "0.5746384", "0.57181734", "0.5708047", "0.57060677", "0.56832683", "0.56527257" ]
0.76234776
0
Creates a form to delete a productMedia entity.
private function createDeleteForm(ProductMedia $productMedia) { return $this->createFormBuilder() ->setAction($this->generateUrl('productmedia_delete', array('id' => $productMedia->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAction($id)\n {\n $form = $this->createDeleteForm($id);\n $request = $this->getRequest();\n\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $entity = $em->getRepository('ACInst3MediaBundle:Media')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Media entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('admin_media'));\n }", "private function createDeleteForm(ConceptMediaType $conceptMediaType)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_conceptmediatype_delete', array('id' => $conceptMediaType->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteAction()\n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('media');\n }\n\n try {\n $media = $this->getMediaTable()->getMedia($id);\n } catch (\\Exception $ex) {\n return $this->redirect()->toRoute('media', [\n 'action' => 'index',\n ]);\n }\n $request = $this->getRequest();\n if ($request->isPost()) {\n $del = $request->getPost('del', 'No');\n\n if ($del == 'Yes') {\n $id = (int) $request->getPost('id');\n $this->getMediaTable()->deleteMedia($id);\n }\n\n return $this->redirect()->toRoute('media');\n }\n\n $session = $session = new Container('user');\n if (!isset($session->id) || $session->id != $media->getAccountId()) {\n return $this->redirect()->toRoute('account',\n [\n 'action' => 'noright',\n ]\n );\n }\n\n return [\n 'id' => $id,\n 'media' => $this->getMediaTable()->getMedia($id),\n ];\n }", "public function destroy(Media $media)\n {\n if($media->logo) {\n unlink(public_path('img/medias/'.$media->logo));\n }\n\n $media->delete();\n\n session()->flash('notification', 'Le média a bien été supprimé!');\n\n return redirect()->route('admin.medias.index');\n }", "public function deleteProduct()\n {\n $template = 'deleteProductForm.html.twig';\n $argsArray = [\n 'pageTitle' => 'Delete Product Form',\n 'username' => $this->usernameFromSession()\n ];\n $html = $this->twig->render($template, $argsArray);\n print $html;\n }", "private function createDeleteForm(ProductProperties $productProperty)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('productproperties_delete', array('id' => $productProperty->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ProductImage $productImage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('productimage_delete', array('id' => $productImage->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteAction( TypeContentMedia $typeContentMedia)\n {\n\n\n if ($typeContentMedia != null) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($typeContentMedia);\n $em->flush();\n }\n\n $translator = $this->get('translator');\n $this->get('session')->getFlashBag()->add('typeContentMediasuccess', $translator->trans('alert.delete'));\n\n return $this->redirectToRoute('typecontentmedia_index');\n }", "private function createDeleteForm(Products $oProduct)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('products_delete', array('id' => $oProduct->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm( Brand $brand ) {\n\t\t\treturn $this->createFormBuilder()\n\t\t\t\t->setAction( $this->generateUrl( 'brand_delete', [ 'id' => $brand->getId() ] ) )\n\t\t\t\t->setMethod( 'DELETE' )\n\t\t\t\t->getForm();\n\t\t}", "private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('turnossede_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function delete( Entity $form ) {\n\t}", "private function createDeleteForm(Product $product)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('product_delete', array('id' => $product->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Product $product)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('product_delete', array('id' => $product->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Product $product)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_product_delete', ['id' => $product->getId()]))\n ->setMethod('DELETE')\n ->getForm();\n }", "public function deleteAction(Request $request, $mediaId)\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n /* @var $media Media */\r\n $media = $em->getRepository('IMDCTerpTubeBundle:Media')->find($mediaId);\r\n if (!$media) {\r\n MediaException::NotFound();\r\n }\r\n\r\n $user = $this->getUser();\r\n if ($media->getOwner() != $user) {\r\n MediaException::AccessDenied();\r\n }\r\n\r\n //TODO revise everything below\r\n //TODO update media display order where media is removed\r\n\r\n $needsConfirmation = false;\r\n\r\n // Find all places where the media can be used.\r\n // Also the interpretations\r\n // TODO this should be moved to its own method somewhere.\r\n $forums = $em->getRepository('IMDCTerpTubeBundle:Forum')->getForumsForMedia($media);\r\n $messages = $em->getRepository('IMDCTerpTubeBundle:Message')->getMessagesForMedia($media);\r\n $posts = $em->getRepository('IMDCTerpTubeBundle:Post')->getPostsForMedia($media);\r\n $threads = $em->getRepository('IMDCTerpTubeBundle:Thread')->getThreadsForMedia($media);\r\n //TODO move this\r\n $groups = $em->getRepository('IMDCTerpTubeBundle:UserGroup')->createQueryBuilder('g')\r\n ->leftJoin('g.media', 'm')\r\n ->where('m.id = :mediaId')\r\n ->setParameters(array(\r\n 'mediaId' => $media->getId()\r\n ))->getQuery()->getResult();\r\n\r\n $mediaInUse = array();\r\n if (count($forums) > 0) {\r\n $needsConfirmation = true;\r\n $mediaInUse[] = 'forum';\r\n }\r\n if (count($messages) > 0) {\r\n $needsConfirmation = true;\r\n $mediaInUse[] = 'message';\r\n }\r\n if (count($posts) > 0) {\r\n $needsConfirmation = true;\r\n $mediaInUse[] = 'post';\r\n }\r\n if (count($threads) > 0) {\r\n $needsConfirmation = true;\r\n $mediaInUse[] = 'thread';\r\n }\r\n if (count($groups) > 0) {\r\n $needsConfirmation = true;\r\n $mediaInUse[] = 'group';\r\n }\r\n if ($user->getProfile()->getAvatar() == $media) {\r\n $needsConfirmation = true;\r\n $mediaInUse[] = 'avatar';\r\n }\r\n\r\n $confirm = filter_var($request->request->get('confirm', false), FILTER_VALIDATE_BOOLEAN);\r\n $this->get('logger')->info(\"confirm: \" . $confirm);\r\n if ($needsConfirmation && !$confirm) {\r\n return MediaException::InUse($mediaInUse);\r\n }\r\n\r\n // User has confirmed, remove the media from all the places and then remove it\r\n foreach ($forums as $forum) {\r\n $forum->removeTitleMedia($media);\r\n }\r\n foreach ($messages as $message) {\r\n $message->removeAttachedMedia($media);\r\n }\r\n foreach ($posts as $post) {\r\n $post->removeAttachedFile($media);\r\n }\r\n foreach ($threads as $thread) {\r\n $thread->removeMediaIncluded($media);\r\n }\r\n foreach ($groups as $group) {\r\n $group->removeMedia($media);\r\n }\r\n if ($user->getProfile()->getAvatar() == $media) {\r\n $user->getProfile()->setAvatar(null);\r\n }\r\n\r\n $em->remove($media);\r\n $em->flush();\r\n\r\n return $this->view(new MediaResponse(null, RestResponse::OK, MediaResponse::MESSAGE_DELETE_SUCCESS));\r\n }", "private function createDeleteForm(Product $product): \\Symfony\\Component\\Form\\FormInterface\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('product_delete', array('id' => $product->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Media $media)\n {\n Cache::forget('data-'.$media->id);\n Cache::forget('data-all');\n\n $media->delete();\n\n return redirect('media');\n }", "public function productdeleteAction() : object\n {\n $title = \"Raderar produkt\";\n $page = $this->app->page;\n $request = $this->app->request;\n $id = $request->getGet(\"id\");\n\n $this->productAdminClass->productDelete($id);\n $products = $this->productAdminClass->getAllProducts();\n\n $data = [\n \"products\" => $products,\n \"title\" => $title,\n ];\n\n $page->add(\"admin/header\", $data);\n $page->add(\"admin/product\", $data);\n\n return $page->render([\n \"title\" => $title\n ]);\n }", "public function delete(Media $media)\n {\n $trick = $media->getTrick();\n if (!$media->getIsVideoLink()) {\n $featuredMedia = $trick->getFeaturedMedia();\n if ($featuredMedia && $featuredMedia->getId() === $media->getId()) {\n $trick->setFeaturedMedia(null);\n $this->entityManager->persist($trick);\n }\n $this->uploadedManager->deleteUploadedFile($media->getLink());\n }\n $this->entityManager->remove($media);\n $this->entityManager->flush();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('media_collection_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "function DeleteImageForm() {\n\t\tif($this->Image()->ID) {\n\t\t\t$isImage = $this->IsImage();\n\t\t\t$type = $isImage ? _t('Controller.IMAGE') : _t('Controller.FILE');\n\t\t\t$title = sprintf(\n\t\t\t\t_t('ImageUploader.DELETE', 'Delete %s', PR_MEDIUM, 'Delete file/image'), \n\t\t\t\t$type\n\t\t\t);\n\t\t\t$form = new Form(\n\t\t\t\t$this,\n\t\t\t\t'DeleteImageForm', \n\t\t\t\tnew FieldSet(\n\t\t\t\t\tnew HiddenField(\"Class\", null, $this->urlParams['Class']),\n\t\t\t\t\tnew HiddenField(\"ID\", null, $this->urlParams['ID']),\n\t\t\t\t\tnew HiddenField(\"Field\", null, $this->urlParams['Field'])\n\t\t\t\t),\n\t\t\t\tnew FieldSet(\n\t\t\t\t\t$deleteAction = new ConfirmedFormAction(\n\t\t\t\t\t\t\"delete\",\n\t\t\t\t\t\t$title, \n\t\t\t\t\t\tsprintf(_t('ImageUploader.REALLYDELETE', \"Do you really want to remove this %s?\"), $type)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t$deleteAction->addExtraClass('delete');\n\t\t\t\n\t\t\treturn $form;\n\t\t}\n\t}", "public function destroy(Media $media)\n {\n $this->authorize('delete', $media);\n\n $media->delete();\n }", "function delete()\n\t{\n\t\tif($_POST == NULL)\n\t\t{\n\t\t\t$media_id = $this->uri->segment(3);\n\t\t\t$media = $this->media_model->mediaData($media_id);\n\t\t\t$data['title'] = 'Delete '.$media['title'];\n\t\t\t$data['id'] = $media_id;\n\t\t\t$data['message'] = 'Are you sure you want to delete '.$media['title'].'?';\n\t\t\t$data['function'] = 'media/delete';\n\t\t\t$this->load->view('are_you_sure', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->media_model->delete($_POST['id']);\n\t\t\t\n\t\t\t$data['title'] = 'Media Deleted';\n\t\t\t$data['message'] = 'Your media has been deleted.';\n\t\t\t$this->load->view('confirmation', $data);\n\t\t}\n\t}", "private function createDeleteForm(ProduitEnPromotion $produitEnPromotion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('produitenpromotion_delete', array('id' => $produitEnPromotion->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($token)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('blog_article_delete', array('token' => $token)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('attr' => array('class' => 'btn btn-info'),'label' => '删除'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('management_audio_delete', array('id' => $id)))\n ->setAttribute('enctype', 'multipart/form-data')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm();\n }", "private function createDeleteForm(Video $video)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('video_delete', array('id' => $video->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Producto $producto)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admin_producto_delete', array('id' => $producto->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }", "public function destroy(Media $medium)\n {\n $medium->delete();\n return redirect()->route('admin.media.index')->withSuccess(\"Delete success\");\n }" ]
[ "0.67361265", "0.65892524", "0.6545893", "0.6466156", "0.63801414", "0.6354919", "0.6278801", "0.621602", "0.6197738", "0.6170875", "0.61641276", "0.6128618", "0.61237264", "0.61237264", "0.6079393", "0.60772145", "0.6072325", "0.60660183", "0.60125107", "0.5990189", "0.59758997", "0.59758914", "0.5968651", "0.59442294", "0.5939114", "0.5934632", "0.59161204", "0.5902762", "0.5892063", "0.58874106" ]
0.80082184
0
Get a lifetime amount of all water drank
public static function getLifetimeAmount() { $waterLogs = WaterLog::all(); $amount = 0; foreach ($waterLogs as $waterLog) { $amount += $waterLog->amount; } return $amount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLifetimeAverageReturn() {\r\n return $this->lifetimeWons / $this->lifetimeSpins;\r\n }", "public function getRemainingLifetime():int\n {\n }", "function getMaxLifetime();", "public static function lifetimeCommission()\n {\n return static::all()->sum('sale_commission');\n }", "public function getDeaths(): int\n {\n return $this->deaths;\n }", "public function getLifetime() { return (int)$this->lifetime; }", "function xstats_getFactoriesAccumulated( $gameId, $playerIndex ) {\n $accumulatedFactories = 0;\n //get the factories on planet surface\n $result = @mysql_query(\"SELECT fabriken FROM skrupel_planeten WHERE spiel='$gameId' AND besitzer='$playerIndex'\") or die(mysql_error());\n while ($row=mysql_fetch_array($result)) {\n $accumulatedFactories = $accumulatedFactories+$row['fabriken'];\n }\n return( $accumulatedFactories );\n}", "function getLifetimeSpins() {\r\n return $this->lifetimeSpins;\r\n }", "public function getStat30Days() {\n dump(Db::query(\"select FROM_UNIXTIME(addTime, '%Y-%m-%d') date, sum(moneySubject) as moneyTotal,count(*) as count from a_cang where isForged=0 and addTime between \".(THINK_START_TIME - 30 * 86400).\" and \".THINK_START_TIME.\" group by date\"));\n }", "public function getLife()\n {\n return $this->life;\n }", "public function getEnergyDeltaPerHealthLost()\n {\n return $this->energy_delta_per_health_lost;\n }", "public function getIronAgeRulers() {\n $rulers = $this->getAdapter();\n $select = $rulers->select()\n ->from($this->_name, array('id','issuer'))\n ->where('period = ?', (int)16)\n ->order('issuer ASC');\n return $rulers->fetchPairs($select);\n }", "function getLifeTime();", "public function getLifespan() {\n return $this->lifespan;\n }", "public function getLifetime()\n\t{\n\t\treturn (int) $this->app['config']->get('flatten::lifetime');\n\t}", "public function getNumberOfDeaths()\n {\n return $this->numberOfDeaths;\n }", "public function getGoldCreddits(): int {\r\n return $this->goldCreddits;\r\n }", "public function playerSum()\n {\n return $this->player->getLastRollSum();\n }", "public function getTerrainResourcePerTurn()\n {\n $terrain = 0;\n foreach ($this->enchantmentsVictim as $enchantment) {\n if ($enchantment->getSpell()->getSkill()->getTerrainBonus() > 0) $terrain += $enchantment->getSpell()->getSkill()->getTerrainBonus();\n }\n foreach ($this->items as $item) {\n if ($item->getArtifact()->getLegendary() && $item->getArtifact()->getSkill()->getTerrainBonus() > 0) $terrain += $item->getArtifact()->getSkill()->getTerrainBonus();\n }\n return $terrain;\n }", "function xstats_getUsedCargoHold( $gameId, $playerIndex) {\n $usedCargoHold = 0;\n $result = @mysql_query(\"SELECT * FROM skrupel_schiffe WHERE energetik_anzahl=0 AND projektile_anzahl=0 AND hanger_anzahl=0 AND spiel='$gameId' AND besitzer='$playerIndex'\") or die(mysql_error());\n while ($row=mysql_fetch_array($result)) {\n $usedCargoHold = $usedCargoHold+(int)($row['fracht_leute']/100)+$row['fracht_vorrat']+$row['fracht_min1']+$row['fracht_min2']+$row['fracht_min3'];\n }\n return( $usedCargoHold );\n}", "public function getRenewDays();", "public function getMaxLifetime()\n\t{\n\t\treturn $this->maxLifetime;\n\t}", "public function getEligibleDuration();", "public function getAmountPlanned();", "public function getTtl();", "function xstats_getLeminAccumulated( $gameId, $playerIndex ) {\n $accumulatedLemin = 0;\n //get the cololeminnists on planet surface\n $result = @mysql_query(\"SELECT lemin FROM skrupel_planeten WHERE spiel=$gameId AND besitzer=$playerIndex\") or die(mysql_error());\n while ($row=mysql_fetch_array($result)) {\n $accumulatedLemin = $accumulatedLemin+$row['lemin'];\n }\n //get onboard lemin\n $result = @mysql_query(\"SELECT lemin FROM skrupel_schiffe WHERE spiel=$gameId AND besitzer=$playerIndex\") or die(mysql_error());\n while ($row=mysql_fetch_array($result)) {\n $accumulatedLemin = $accumulatedLemin+$row['lemin'];\n }\n return( $accumulatedLemin );\n}", "public function getTally() : int;", "public function lightnings(): int;", "public function getTtl() : int;", "public function numExpiring() {\n return $this->expiring;\n }" ]
[ "0.6341493", "0.6145971", "0.6131273", "0.60857207", "0.6066788", "0.57375145", "0.5579213", "0.55754554", "0.5550819", "0.55391985", "0.55390906", "0.55211073", "0.54968363", "0.5477754", "0.5437362", "0.5435108", "0.5398232", "0.5384625", "0.5328155", "0.53260267", "0.5320824", "0.53056514", "0.52908677", "0.5257444", "0.5244263", "0.5185588", "0.5184008", "0.51830405", "0.5172672", "0.51629794" ]
0.7223875
0
The order of current graph is the number of its vertices.
public function order() { return Operations::order($this->getVertices()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function vertices(){\n return $this->vertices;\n }", "public function numVerts() { return $this->_m_numVerts; }", "function getOrder()\n {\n return 0;\n }", "function getOrder()\n {\n return 0;\n }", "function order() {\n static $order = 0;\n $order++;\n return $order;\n }", "public function getGraph();", "public function getOrder()\n {\n return 0;\n }", "public function getOrder()\n {\n return 0;\n }", "public function getOrder()\n {\n return 0;\n }", "public function getOrder() {\n\t\n\t\treturn 1;\n\t}", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n return 3;\n }", "public function getObjOrder() {\n return $this->objOrder;\n }", "public function getOrder ()\n {\n return 1;\n }", "abstract protected function getGraph();", "public function getOrder() {\n return 4;\n }", "public function getOrder(): int\n {\n return 0;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder() {\r\n return 1;\r\n }", "public function getOrder()\n {\n return 4;\n }", "public function getOrder()\n {\n return 4;\n }", "public function getOrder()\n {\n return 4;\n }", "public function getOrder()\n {\n return 4;\n }", "public function getOrder()\n {\n return 4;\n }", "public function getOrder()\n {\n return 4;\n }", "public function getOrder()\n {\n return 4;\n }", "public function getOrder()\n {\n return 4;\n }" ]
[ "0.63224256", "0.62570286", "0.5922781", "0.5922781", "0.5853863", "0.5742863", "0.571804", "0.571804", "0.571804", "0.5681441", "0.55802137", "0.5571792", "0.5570831", "0.5562641", "0.5557473", "0.55571395", "0.5551705", "0.5551705", "0.5551705", "0.5551705", "0.5551705", "0.55392283", "0.55243534", "0.55243534", "0.55243534", "0.55243534", "0.55243534", "0.55243534", "0.55243534", "0.55243534" ]
0.68410033
0
il metodo sottrae due numeri e stampa il risultato
function sottrazione(){ $sottrazione=$this->numero - $this->numero2."\n"; print "Sottrazione:".$sottrazione."<br />"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redondea($sf,$numero){\n$redondeado = round ($numero, floor ($sf - log10($numero))); \nreturn ($redondeado);\n}", "function rupiah($angka){\n\t\t\t$angka = number_format($angka,2);\n\t\t\t$angka1 = str_replace('.', '-', $angka); \n $angka2 = str_replace(',', '.', $angka1);\n $angka = str_replace('-', ',', $angka2);\n\t\t\t//$angka = \"Rp. \".\"$angka\";\n\t\t\t$angka = $angka;\n\t\t\treturn $angka;\n\t\t}", "function patrat($numar) { // functia de ridicare la patrat\n return $numar * $numar;\n}", "function numerotexto ($numero) {\n\t// Dejando solamente el punto \".\" que separa los decimales \n\t// Si encuentra mas de un punto, devuelve error. \n\t// NOTA: Para los paises en que el punto y la coma se usan de forma \n\t// inversa, solo hay que cambiar la coma por punto en el array de \"extras\" \n\t// y el punto por coma en el explode de $partes \n\t\n\t$extras= array(\"/[\\$]/\",\"/ /\",\"/,/\",\"/-/\"); \n\t$limpio=preg_replace($extras,\"\",$numero); \n\t$partes=explode(\".\",$limpio); \n\tif (count($partes)>2) { \n\t\treturn \"Error, el n&uacute;mero no es correcto\"; \n\t\texit(); \n\t} \n\t\n\t// Ahora explotamos la parte del numero en elementos de un array que \n\t// llamaremos $digitos, y contamos los grupos de tres digitos \n\t// resultantes \n\t\n\t$digitos_piezas=chunk_split ($partes[0],1,\"#\"); \n\t$digitos_piezas=substr($digitos_piezas,0,strlen($digitos_piezas)-1); \n\t$digitos=explode(\"#\",$digitos_piezas); \n\t$todos=count($digitos); \n\t$grupos=ceil (count($digitos)/3); \n\t\n\t// comenzamos a dar formato a cada grupo \n\t\n\t$unidad = array ('un','dos','tres','cuatro','cinco','seis','siete' ,'ocho','nueve'); \n\t$decenas = array ('diez','once','doce', 'trece','catorce','quince'); \n\t$decena = array ('dieci','veinti','treinta','cuarenta','cincuenta' ,'sesenta','setenta','ochenta','noventa'); \n\t$centena = array ('ciento','doscientos','trescientos','cuatrociento s','quinientos','seiscientos','setecientos','ochoc ientos','novecientos'); \n\t$resto=$todos; \n\t\n\tfor ($i=1; $i<=$grupos; $i++) { \n\t\t\n\t\t// Hacemos el grupo \n\t\tif ($resto>=3) { \n\t\t$corte=3; } else { \n\t\t$corte=$resto; \n\t\t} \n\t\t$offset=(($i*3)-3)+$corte; \n\t\t$offset=$offset*(-1); \n\t\t\n\t\t// la siguiente seccion es una adaptacion de la contribucion de cofyman y JavierB \n\t\t\n\t\t$num=implode(\"\",array_slice ($digitos,$offset,$corte)); \n\t\t$resultado[$i] = \"\"; \n\t\t$cen = (int) ($num / 100); //Cifra de las centenas \n\t\t$doble = $num - ($cen*100); //Cifras de las decenas y unidades \n\t\t$dec = (int)($num / 10) - ($cen*10); //Cifra de las decenas \n\t\t$uni = $num - ($dec*10) - ($cen*100); //Cifra de las unidades \n\t\tif ($cen > 0) { \n\t\tif ($num == 100) $resultado[$i] = \"cien\"; \n\t\telse $resultado[$i] = $centena[$cen-1].' '; \n\t\t}//end if \n\t\tif ($doble>0) { \n\t\tif ($doble == 20) { \n\t\t$resultado[$i] .= \" veinte\"; \n\t\t}elseif (($doble < 16) and ($doble>9)) { \n\t\t$resultado[$i] .= $decenas[$doble-10]; \n\t\t}else { \n\t\t$resultado[$i] .=' '. $decena[$dec-1]; \n\t\t}//end if \n\t\tif ($dec>2 and $uni<>0) $resultado[$i] .=' y '; \n\t\tif (($uni>0) and ($doble>15) or ($dec==0)) { \n\t\tif ($i==1 && $uni == 1) $resultado[$i].=\"uno\"; \n\t\telseif ($i==2 && $num == 1) $resultado[$i].=\"\"; \n\t\telse $resultado[$i].=$unidad[$uni-1]; \n\t\t} \n\t\t} \n\t\n\t\t// Le agregamos la terminacion del grupo \n\t\tswitch ($i) { \n\t\tcase 2: \n\t\t$resultado[$i].= ($resultado[$i]==\"\") ? \"\" : \" mil \"; \n\t\tbreak; \n\t\tcase 3: \n\t\t$resultado[$i].= ($num==1) ? \" mill&oacute;n \" : \" millones \"; \n\t\tbreak; \n\t\t} \n\t\t$resto-=$corte; \n\t} \n\t\n\t// Sacamos el resultado (primero invertimos el array) \n\t$resultado_inv= array_reverse($resultado, TRUE); \n\t$final=\"\"; \n\tforeach ($resultado_inv as $parte){ \n\t\t$final.=$parte; \n\t} \n\t$final[0]=strtoupper($final[0]);\n\treturn $final; \n\t}", "public function numToLetras($xcifra)\n{\n\n $xarray = array(0 => \"Cero\",\n 1 => \"UN\", \"DOS\", \"TRES\", \"CUATRO\", \"CINCO\", \"SEIS\", \"SIETE\", \"OCHO\", \"NUEVE\",\n \"DIEZ\", \"ONCE\", \"DOCE\", \"TRECE\", \"CATORCE\", \"QUINCE\", \"DIECISEIS\", \"DIECISIETE\", \"DIECIOCHO\", \"DIECINUEVE\",\n \"VEINTI\", \n 30 => \"TREINTA\", 40 => \"CUARENTA\", 50 => \"CINCUENTA\", 60 => \"SESENTA\", 70 => \"SETENTA\", 80 => \"OCHENTA\", 90 => \"NOVENTA\",\n 100 => \"CIENTO\", 200 => \"DOSCIENTOS\", 300 => \"TRESCIENTOS\", 400 => \"CUATROCIENTOS\", 500 => \"QUINIENTOS\", \n 600 => \"SEISCIENTOS\", 700 => \"SETECIENTOS\", 800 => \"OCHOCIENTOS\", 900 => \"NOVECIENTOS\"\n );\n //\n $xcifra = trim($xcifra);\n $xlength = strlen($xcifra);\n $xpos_punto = strpos($xcifra, \".\");\n $xaux_int = $xcifra;\n //$xdecimales = \"00\";\n if (!($xpos_punto === false)) {\n if ($xpos_punto == 0) {\n $xcifra = \"0\" . $xcifra;\n $xpos_punto = strpos($xcifra, \".\");\n }\n $xaux_int = substr($xcifra, 0, $xpos_punto); // obtengo el entero de la cifra a covertir\n //$xdecimales = substr($xcifra . \"00\", $xpos_punto + 1, 2); // obtengo los valores decimales\n }\n\n $XAUX = str_pad($xaux_int, 18, \" \", STR_PAD_LEFT); // ajusto la longitud de la cifra, para que sea divisible por centenas de miles (grupos de 6)\n $xcadena = \"\";\n for ($xz = 0; $xz < 3; $xz++) {\n $xaux = substr($XAUX, $xz * 6, 6);\n $xi = 0;\n $xlimite = 6; // inicializo el contador de centenas xi y establezco el límite a 6 dígitos en la parte entera\n $xexit = true; // bandera para controlar el ciclo del While\n while ($xexit) {\n if ($xi == $xlimite) { // si ya llegó al límite máximo de enteros\n break; // termina el ciclo\n }\n\n $x3digitos = ($xlimite - $xi) * -1; // comienzo con los tres primeros digitos de la cifra, comenzando por la izquierda\n $xaux = substr($xaux, $x3digitos, abs($x3digitos)); // obtengo la centena (los tres dígitos)\n for ($xy = 1; $xy < 4; $xy++) { // ciclo para revisar centenas, decenas y unidades, en ese orden\n switch ($xy) {\n case 1: // checa las centenas\n if (substr($xaux, 0, 3) < 100) { // si el grupo de tres dígitos es menor a una centena ( < 99) no hace nada y pasa a revisar las decenas\n\n } else {\n $key = (int) substr($xaux, 0, 3);\n if (TRUE === array_key_exists($key, $xarray)){ // busco si la centena es número redondo (100, 200, 300, 400, etc..)\n $xseek = $xarray[$key];\n $xsub = $this->subfijo($xaux); // devuelve el subfijo correspondiente (Millón, Millones, Mil o nada)\n if (substr($xaux, 0, 3) == 100)\n $xcadena = \" \" . $xcadena . \" CIEN \" . $xsub;\n else\n $xcadena = \" \" . $xcadena . \" \" . $xseek . \" \" . $xsub;\n $xy = 3; // la centena fue redonda, entonces termino el ciclo del for y ya no reviso decenas ni unidades\n }\n else { // entra aquí si la centena no fue numero redondo (101, 253, 120, 980, etc.)\n $key = (int) substr($xaux, 0, 1) * 100;\n $xseek = $xarray[$key]; // toma el primer caracter de la centena y lo multiplica por cien y lo busca en el arreglo (para que busque 100,200,300, etc)\n $xcadena = \" \" . $xcadena . \" \" . $xseek;\n } // ENDIF ($xseek)\n } // ENDIF (substr($xaux, 0, 3) < 100)\n break;\n case 2: // checa las decenas (con la misma lógica que las centenas)\n if (substr($xaux, 1, 2) < 10) {\n\n } else {\n $key = (int) substr($xaux, 1, 2);\n if (TRUE === array_key_exists($key, $xarray)) {\n $xseek = $xarray[$key];\n $xsub = $this->subfijo($xaux);\n if (substr($xaux, 1, 2) == 20)\n $xcadena = \" \" . $xcadena . \" VEINTE \" . $xsub;\n else\n $xcadena = \" \" . $xcadena . \" \" . $xseek . \" \" . $xsub;\n $xy = 3;\n }\n else {\n $key = (int) substr($xaux, 1, 1) * 10;\n $xseek = $xarray[$key];\n if (20 == substr($xaux, 1, 1) * 10)\n $xcadena = \" \" . $xcadena . \" \" . $xseek;\n else\n $xcadena = \" \" . $xcadena . \" \" . $xseek . \" Y \";\n } // ENDIF ($xseek)\n } // ENDIF (substr($xaux, 1, 2) < 10)\n break;\n case 3: // checa las unidades\n if (substr($xaux, 2, 1) < 1) { // si la unidad es cero, ya no hace nada\n\n } else {\n $key = (int) substr($xaux, 2, 1);\n $xseek = $xarray[$key]; // obtengo directamente el valor de la unidad (del uno al nueve)\n $xsub = $this->subfijo($xaux);\n $xcadena = \" \" . $xcadena . \" \" . $xseek . \" \" . $xsub;\n } // ENDIF (substr($xaux, 2, 1) < 1)\n break;\n } // END SWITCH\n } // END FOR\n $xi = $xi + 3;\n } // ENDDO\n\n if (substr(trim($xcadena), -5, 5) == \"ILLON\") // si la cadena obtenida termina en MILLON o BILLON, entonces le agrega al final la conjuncion DE\n $xcadena.= \" DE\";\n\n if (substr(trim($xcadena), -7, 7) == \"ILLONES\") // si la cadena obtenida en MILLONES o BILLONES, entoncea le agrega al final la conjuncion DE\n $xcadena.= \" DE\";\n\n // ----------- esta línea la puedes cambiar de acuerdo a tus necesidades o a tu país -------\n if (trim($xaux) != \"\") {\n switch ($xz) {\n case 0:\n if (trim(substr($XAUX, $xz * 6, 6)) == \"1\")\n $xcadena.= \"UN BILLON \";\n else\n $xcadena.= \" BILLONES \";\n break;\n case 1:\n if (trim(substr($XAUX, $xz * 6, 6)) == \"1\")\n $xcadena.= \"UN MILLON \";\n else\n $xcadena.= \" MILLONES \";\n break;\n case 2:\n if ($xcifra < 1) {\n $xcadena = \"CERO PESOS M/CTE\";\n //$xcadena = \"CERO PESOS $xdecimales/100 M.N.\";\n }\n if ($xcifra >= 1 && $xcifra < 2) {\n $xcadena = \"UN PESO M/CTE \";\n //$xcadena = \"UN PESO $xdecimales/100 M.N. \";\n }\n if ($xcifra >= 2) {\n $xcadena.= \" PESOS M/CTE \"; //\n //$xcadena.= \" PESOS $xdecimales/100 M.N. \"; //\n }\n break;\n } // endswitch ($xz)\n } // ENDIF (trim($xaux) != \"\")\n // ------------------ en este caso, para México se usa esta leyenda ----------------\n $xcadena = str_replace(\"VEINTI \", \"VEINTI\", $xcadena); // quito el espacio para el VEINTI, para que quede: VEINTICUATRO, VEINTIUN, VEINTIDOS, etc\n $xcadena = str_replace(\" \", \" \", $xcadena); // quito espacios dobles\n $xcadena = str_replace(\"UN UN\", \"UN\", $xcadena); // quito la duplicidad\n $xcadena = str_replace(\" \", \" \", $xcadena); // quito espacios dobles\n $xcadena = str_replace(\"BILLON DE MILLONES\", \"BILLON DE\", $xcadena); // corrigo la leyenda\n $xcadena = str_replace(\"BILLONES DE MILLONES\", \"BILLONES DE\", $xcadena); // corrigo la leyenda\n $xcadena = str_replace(\"DE UN\", \"UN\", $xcadena); // corrigo la leyenda\n } // ENDFOR ($xz)\n return trim($xcadena);\n }", "function MascaraValorTela($num)\n\t\t{\n\t\t\t$ver_virgula = strpos($num,\",\");\n\t\t\t\n\t\t\t//Formata o valor.\n\t\t\tif ($ver_virgula === false)\n\t\t\t{\n\t\t\t\t$num_formatado = number_format(floatval($num),2,',','.');\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$num_formatado = number_format(floatval($num),2,',','.');\n\t\t\t}\n\t\n\t\t\t//retorna o valor formatado.\n\t\t\treturn $num_formatado;\n\t\t}", "public function luassegitiga()\n {\n \n return ($this-> alas * $this-> tinggi / 2);\n }", "function convertir($unidad,$cantidad){\n \n #de peso\n $conversiones['qq']=100;#quintal 100kg\n $conversiones['ton']=1000;\n $conversiones['g']=0.001;\n $conversiones['kg']=1;\n $conversiones['oz']=0.03;\n $conversiones['lb']=0.45;\n #de volumen\n $conversiones['ml']=0.001;\n $conversiones['lt']=1;\n \n $resultado=$conversiones[$unidad]*floatval($cantidad);\n \n return $resultado; \n}", "function calculoIMC ($peso=0, $metros=0){\n\n $imc = (int)$peso / ((float)$metros*2);\n \n if ($imc <17){\n echo \"<p>Muito abaixo do peso!</p>\";\n }elseif(($imc >= 17) && ($imc < 18.5)){\n echo \"<p>Abaixo do peso!</p>\";\n }elseif (($imc >= 18.5) && ($imc < 25)){\n echo \"<p>Peso ideal!</p>\";\n }elseif (($imc >= 25) && ($imc < 30)){\n echo \"<p>Sobre peso!</p>\";\n }elseif (($imc >= 30) && ($imc < 35)){\n echo \"<p>Obesidade!</p>\";\n }elseif (($imc >= 35) && ($imc < 40)){\n echo \"<p>Obesidade severa!</p>\";\n }else{\n echo \"<p>Obesidade morbida!</p>\";\n }\n return $imc;\n}", "function rupiah2($nilai)\n\t{\n\t\treturn number_format($nilai, 0, ',', '.');\n\t}", "function buatRp($angka){\n\t//$rupiah = \"Rp. \" . number_format($angka,2,',','.');//pake 2 angka dibelakang koma \n\t$rupiah = \"Rp. \" . number_format($angka,0,',','.'); \n\treturn $rupiah;\n}", "function CalculaIncompletoYnuevoMonto($monto_disponible, $monto_jugado){\r\n\r\n\t$matriz=array();\r\n\r\n\t// Matriz[0]= El monto para cubrir el faltante\r\n\t// Matriz[1]= El switch de ser incompleto o no 1 incompleto ya de por si / 2 agotado / 3 imcompleto en esta jugada\r\n\t// Matriz[2]= El monto por el que realmente se va a jugar\r\n\t// Matriz[3]= El monto por el que quedaria disponible\r\n\r\n\r\n\t//calculando el faltante entre el numero ya jugado y el nuevo por jugar\r\n\t$montodiferencia= ($monto_disponible-$monto_jugado);\r\n\r\n\t//si no completa el monto solicitado\r\n\tif ($montodiferencia < 0){\r\n\t\t//Mensaje de ERROR -- NUMERO INCOMPLETO PARA ESTE SORTEO\r\n\t\t//el nuevo disponible es el faltante del incompleto\r\n\t\t$matriz[0] = $montodiferencia*(-1);\r\n\t\t$matriz[1] = 1;\r\n\t\t$matriz[2] = $monto_disponible;\r\n\t\t$matriz[3] = 0;\r\n\t\t//echo \"<br> nuevo \".$num_jug_nuevodisponible;\r\n\t}else\r\n\t\tif ($montodiferencia ==0)\r\n\t\t{\r\n\t\t\t//\techo \"pasa\";\r\n\t\t\t$matriz[0] = 0;\r\n\t\t\t$matriz[1] = 3;\r\n\t\t\t$matriz[2] = $monto_jugado;\r\n\t\t\t$matriz[3] = 0;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//el nuevo disponible es el restante para numeros_jugados\r\n\t\t\t$matriz[0] = 0;\r\n\t\t\t$matriz[1] = 0;\r\n\t\t\t$matriz[2] = $monto_jugado;\r\n\t\t\t$matriz[3] = $montodiferencia;\r\n\t\t\t\t\r\n\t\t}\r\n\t\t \r\n\t\t// $matriz2=CalculaIncompletoYnuevoMonto();\r\n\t\t// echo $matriz2[0]; // nuevomontodisponible o faltante\r\n\t\t// echo $matriz2[1]; // incompleto\r\n\t\t// echo $matriz2[2]; // monto real disponible para el ticket o monto solicitado\r\n\t\t// print_r($matriz);\r\n\t\treturn $matriz;\r\n\r\n}", "public function dolaresLibras(){\n return $this->numero*0.718287602;\n }", "public function paleBuscarPremio($idVenta, $idLoteria, $jugada, $monto, $idSorteo){\n $premio = 0;\n $busqueda1 = strpos($numerosGanadores, substr($jugada, 0, 2));\n $busqueda2 = strpos($numerosGanadores, substr($jugada, 2, 2));\n\n $venta = Sales::whereId($idVenta)->first();\n $idBanca = Branches::whereId($venta->idBanca)->first()->id;\n $sorteo = Draws::whereId($idSorteo)->first();\n\n //Si el sorteo es diferente de super pale entonces es un pale normal\n if($sorteo['descripcion'] != \"Super pale\"){\n //Verificamos que los tipos de datos de las busquedas sean enteros\n if(gettype($busqueda1) == \"integer\" && gettype($busqueda2) == \"integer\"){\n //Primera y segunda\n if($busqueda1 == 0 && $busqueda2 == 2 || $busqueda2 == 0 && $busqueda1 == 2){\n $premio = $monto * Payscombinations::where(['idLoteria' => $idLoteria, 'idBanca' => $idBanca])->value('primeraSegunda');\n }\n //Primera y tercera\n else if($busqueda1 == 0 && $busqueda2 == 4 || $busqueda2 == 0 && $busqueda1 == 4){\n $premio = $monto * Payscombinations::where(['idLoteria' => $idLoteria, 'idBanca' => $idBanca])->value('primeraTercera');\n }\n //Segunda y tercera\n else if($busqueda1 == 2 && $busqueda2 == 4 || $busqueda2 == 2 && $busqueda1 == 4){\n $premio = $monto * Payscombinations::where(['idLoteria' => $idLoteria, 'idBanca' => $idBanca])->value('segundaTercera');\n }\n }else $premio = 0;\n }else{\n //Verificamos que los tipos de datos de las busquedas sean enteros\n if(gettype($busqueda1) == \"integer\" && gettype($busqueda2) == \"integer\"){\n if($busqueda1 == 0 && $busqueda2 == 2 || $busqueda2 == 0 && $busqueda1 == 2){\n $premio = $monto * Payscombinations::where(['idLoteria' => $idLoteria, 'idBanca' => $idBanca])->value('primerPago');\n }\n }else $premio = 0;\n }\n\n return $premio;\n }", "function revisaPrecio($minimo,$maximo,$valor){\n $numero=1000*strtr(substr($valor,1),',','.');\n if($numero>=(1*$minimo) && $numero<=(1*$maximo)){\n return true;\n } \n return false;\n}", "public function librasDolares(){\n return $this->numero*1.3922;\n }", "function convert_number($number) \n{\n\t$number_real = $number;\n\t$CI = &get_instance();\n if (($number < 0) || ($number > 999999999)) \n { \n throw new Exception(\"Angka Melebihi Batas\");\n } \n\t$Gn = floor($number / 1000000); /* Millions (giga) */ \n $number -= $Gn * 1000000; \n $kn = floor($number / 1000); /* ribuan (kilo) */ \n $number -= $kn * 1000; \n\t$Hn = floor($number / 100); /* seratus (hecto) */ \n $number -= $Hn * 100; \n $Dn = floor($number / 10); /* Tens (deca) */ \n $n = $number % 10; /* Ones */ \n\t$res = \"\"; \n\tif ($Gn) \n { \n $res .= convert_number($Gn) . \" Juta\"; \n \n } \n\n if ($kn) \n { \n\t\tif($kn > 1)\n\t\t{\n \t$res .= (empty($res) ? \"\" : \" \") . \n convert_number($kn) . \" Ribu \"; \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$res .= (empty($res) ? \"\" : \" \"). \" Seribu \"; \n\t\t}\n } \n\tif ($Hn) \n { \n\t\tif($Hn > 1)\n\t\t{\n $res .= (empty($res) ? \"\" : \" \") . \n convert_number($Hn) . \" Ratus \"; \n\t\t}\n\t\telse\n\t\t{\n\t\t\t $res .= (empty($res) ? \"\" : \" \") . \" Seratus \"; \n\t\t}\n } \n $ones = array(\"\", \"Satu\", \"Dua\", \"Tiga\", \"Empat\", \"Lima\", \"Enam\", \n \"Tujuh\", \"Delapan\", \"Sembilan\", \"Sepuluh\", \"Sebelas\", \"Dua belas\", \"Tiga Belas\", \n \"Empat Belas\", \"Lima Belas\", \"Enam Belas\", \"Tujuh Belas\", \"Delapan Belas\", \n \"Sembilan Belas\"); \n $tens = array(\"\", \"\", \"Dua Puluh\", \"Tiga Puluh\", \"Empat Puluh\", \"Lima Puluh\", \"Enam Puluh\", \n \"Tujuh Puluh\", \"Delapan Puluh\", \"Sembilan Puluh\"); \n if ($Dn || $n) \n { \n if ($Dn < 2) \n { \n $res .= $ones[$Dn * 10 + $n]; \n\t\t\t\n\t\t\tif($number_real > 0)\n\t\t\t{ \n\t\t\t\t$str=explode('.',$number_real);\n\t\t\t\tif(isset($str[1]))\n\t\t\t\t{\n\t\t\t\t\t$res .= \" Koma \".convert_number($str[1]);\t\n\t\t\t\t}\n\t\t\t}\n } \n else \n { \n $res .= $tens[$Dn]; \n\n if ($n) \n { \n $res .= \" \" . $ones[$n]; \n } \n\t\t\tif($number_real > 0)\n\t\t\t{ \n\t\t\t\t$str=explode('.',$number_real);\n\t\t\t\tif(isset($str[1]))\n\t\t\t\t{\n\t\t\t\t\tif($str[1] != 0)\n\t\t\t\t\t$res .= \" Koma \".convert_number($str[1]);\t\n\t\t\t\t}\n\t\t\t}\n } \n } \n\n if (empty($res)) \n { \n $res = \"\"; \n } \n\n return ($res); \n}", "function somma(){\n\t\t$somma= ($this->numero + $this->numero2.\"\\n\");\n\t\tprint \"Somma:\".$somma.\"<br />\";\n\t}", "function Lpersegi(){ //fungsi mencari luas persegi\r\n\t\t$LP = $sisi * $sisi;\r\n\t\treturn $LP;\r\n\t}", "function esNumerico($numero) {\r\n\t\t\t\tif(is_numeric($numero)) {\r\n\t\t\t\t\techo $numero.\" es numérico\", PHP_EOL;\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo $numero.\" no es numérico\", PHP_EOL;\r\n\t\t\t\t}\r\n\t\t\t}", "function digitos($ceros,$secuencia){\t\t\t\r\n\t\tif($secuencia==\"999\"){//si se llega a 999 el siguiente debe de ser 001\r\n\t\t $resultado=\"001\";\t\r\n\t\t}else{ //sino se genera el siguiente con los ceros que sean necesarios delante \r\n\t\t\t$resultado = \"\".intval($secuencia) + 1;//se pasa la secuencia a entero, para poder sumarle uno\r\n\t\t\t$longitud=strlen($resultado); \t//se calcula la longitud del del resultado obtenido, para luego calcularle los ceros que necesita.\r\n\t\t\twhile ($longitud<$ceros){//si tiene menos longitud de la q la D.G.T nos pide seguimos añadiendole ceros al resultado.\t\t\t \r\n\t\t\t\t$resultado=\"0\".$resultado;\r\n\t\t\t\t$longitud=strlen($resultado); \t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $resultado;\t//devuelve la nueva secuencia\t\t \r\n\t}", "function alasSegitiga($alas, $tinggi){\n $luas = ($alas * $tinggi) /2;\n echo \"Hasil hitung luas segitiga adalah sebagai berikut:<br />\";\n echo \"Diketahui;<br />\";\n echo \"Alas Segitiga = $alas<br />\";\n echo \"Tinggi Segitiga = $tinggi<br />\";\n echo \"Maka luas segitiga sama dengan 1/2 ($alas x $tinggi) = $luas\";\n }", "private function _preciosServs()\r\n {\r\n $fox = \"$ 150.-\"; $futbol = \"$ 300.-\"; $adultos = \"$ 80.-\";\r\n\r\n // hacer un case para si tiene contratado el servicio le pongo 'contratado'\r\n\r\n # Permanencia minima 3 meses para fox y adultos | 1 año para futbol\r\n\r\n }", "function gestion_frais(){\r\n\r\n\t$prix_commande = 0; // Recuperer le prix de l'article dans la base de donnés //\r\n\t$poids = $_POST[\"poids_article\"];\r\n\t$frais_port = 0;\r\n\r\n\tif ($poids <= 2) {\r\n\t\t$frais_port = 8.80;\r\n\t}\r\n\r\n\telse if ($poids > 2 && $poids <= 5) {\r\n\t\t$frais_port = 13.15;\r\n\t}\r\n\r\n\telse if ($poids > 5 && $poids <= 10) {\r\n\t\t$frais_port = 19.20;\r\n\t}\r\n\r\n\telse if ($poids > 10 && $poids <= 30) {\r\n\t\t$frais_port = 27.30;\r\n\t}\r\n\r\n\t\techo $frais_port;\r\n\r\n\tif ($poids > 30) {\r\n\t\techo \"Nous ne livrons pas les produits de plus de 30Kg\";\r\n\t\treturn false;\r\n\t}\r\n\r\n\t$prix_total = $prix_commande + $frais_port;\r\n\treturn $prix_total;\r\n}", "public function calcularValoracionRiesgo()\n\t{\n\t\t$nRiesgo=$this->evaluacion_riesgo_nivel_riesgo_intervencion;\n\n\t\tif($nRiesgo==1)\n\t\t{\n\t\t\t$this->valoracion_riesgo=\"NO ACEPTABLE\";\n\t\t}\n\t\tif($nRiesgo==2)\n\t\t{\n\t\t\t$this->valoracion_riesgo=\"NO ACEPTABLE O ACEPTABLE CON CONTROL ESPECIFICO\";\n\t\t}\n\t\tif($nRiesgo==3)\n\t\t{\n\t\t\t$this->valoracion_riesgo=\"MEJORABLE\";\n\t\t}\n\t\tif($nRiesgo==4)\n\t\t{\n\t\t\t$this->valoracion_riesgo=\"ACEPTABLE\";\n\t\t}\n\t}", "function mitjana($notas_UF1, $notas_UF2, $notas_UF3, $notas_UF4, $i){\n // Detecta si las notas son menores a 5\n if($notas_UF1[$i]<5 || $notas_UF2[$i]<5 || $notas_UF3[$i]<5 || $notas_UF4[$i]<5){\n $mitjana = \"N/P\";\n }else{\n // Si las notas no son menores a 5 hace el calculo de la media y lo redondea a 2 decimales\n $mitjana = (($notas_UF1[$i]*20)+($notas_UF2[$i]*20)+($notas_UF3[$i]*20)+($notas_UF1[$i]*23))/83;\n $mitjana = number_format((float)$mitjana, 2, '.', '');\n }\n // Devuelve la media\n return $mitjana;\n }", "function function_terbilang($x) {\n $x = abs($x);\n $angka = array(\"\", \"satu\", \"dua\", \"tiga\", \"empat\", \"lima\",\n \"enam\", \"tujuh\", \"delapan\", \"sembilan\", \"sepuluh\", \"sebelas\");\n $temp = \"\";\n if ($x <12) {\n $temp = \" \". $angka[$x];\n } else if ($x <20) {\n $temp = function_terbilang($x - 10). \" belas\";\n } else if ($x <100) {\n $temp = function_terbilang($x/10).\" puluh\". function_terbilang($x % 10);\n } else if ($x <200) {\n $temp = \" Seratus\" . function_terbilang($x - 100);\n } else if ($x <1000) {\n $temp = function_terbilang($x/100) . \" ratus\" . function_terbilang($x % 100);\n } else if ($x <2000) {\n $temp = \" Seribu\" . function_terbilang($x - 1000);\n } else if ($x <1000000) {\n $temp = function_terbilang($x/1000) . \" ribu\" . function_terbilang($x % 1000);\n } else if ($x <1000000000) {\n $temp = function_terbilang($x/1000000) . \" juta\" . function_terbilang($x % 1000000);\n } else if ($x <1000000000000) {\n $temp = function_terbilang($x/1000000000) . \" milyar\" . function_terbilang(fmod($x,1000000000));\n } else if ($x <1000000000000000) {\n $temp = function_terbilang($x/1000000000000) . \" trilyun\" . function_terbilang(fmod($x,1000000000000));\n }\n return $temp;\n}", "function fpeuro ($montant) {\n if ($montant > 0) {\n $mnt = number_format($montant, 2, ',', ' ');\n return $mnt.' Eur';\n }\n if ($montant < 0) {\n $mnt = number_format($montant, 2, ',', ' ');\n return $mnt.' Eur';\n }\n}", "public function aire(){\n return ($this->base*$this->hauteur)/2;\n // return ($this->base*$this->hauteur)*0.5;\n }", "function convertirnumeros($texto)\n\t{\n\t\treturn intval(stripslashes($texto));\n\t}" ]
[ "0.695859", "0.63678753", "0.6315526", "0.6185709", "0.6175388", "0.61456025", "0.61379814", "0.6130529", "0.6109909", "0.6050343", "0.604866", "0.6034924", "0.60338885", "0.60327256", "0.60312706", "0.60286015", "0.59946924", "0.5988923", "0.59884775", "0.59876364", "0.5972494", "0.59721965", "0.5959385", "0.5920694", "0.5918513", "0.59071684", "0.58692664", "0.58571017", "0.5852454", "0.58469737" ]
0.6506744
1
Recusively sets status for this and all subfolders. Saves object if status parameter given
public function set_status_recursive($value = null) { $this->require_state("saved"); $r = true; // determine value to be set and whether to modify and save this object if (null === $value) { $dont_save_this = true; $value = $this->status(); } else { $dont_save_this = false; } try { $subfolders = new object_tree(array( "class_id" => CL_MENU, "parent" => $this->id() )); if ($dont_save_this) { // convert to list and remove this object $subfolders = $subfolders->to_list(); $subfolders->remove($this->id()); } // objtree and objlist have the same interface $subfolders->foreach_o(array( "func" => "set_status", "params" => array($value), "save" => true )); } catch (Exception $e) { $r = false; } return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFolderDetails($id,$title,$complaintstatus) {\r\n\t\tglobal $session;\r\n\t\t$now = gmdate(\"Y-m-d H:i:s\");\r\n\t\t\r\n\t\t$q = \"UPDATE \" . CO_TBL_COMPLAINTS_FOLDERS . \" set title = '$title', status = '$complaintstatus', edited_user = '$session->uid', edited_date = '$now' where id='$id'\";\r\n\t\t$result = mysql_query($q, $this->_db->connection);\r\n\t\tif ($result) {\r\n\t\t\treturn true;\r\n\t\t}\r\n }", "public function processStatus()\r\r\n {\r\r\n if (Validate::isLoadedObject($object = $this->loadObject())) {\r\r\n if ($object->toggleStatus()) {\r\r\n $matches = array();\r\r\n if (preg_match('/[\\?|&]controller=([^&]*)/', (string) $_SERVER['HTTP_REFERER'], $matches) !== false\r\r\n && strtolower($matches[1]) != strtolower(preg_replace('/controller/i', '', get_class($this)))\r\r\n ) {\r\r\n $this->redirect_after = preg_replace(\r\r\n '/[\\?|&]conf=([^&]*)/i',\r\r\n '',\r\r\n (string) $_SERVER['HTTP_REFERER']\r\r\n );\r\r\n } else {\r\r\n $this->redirect_after = self::$currentIndex . '&token=' . $this->token;\r\r\n }\r\r\n\r\r\n $id_category = (($id_category = (int) Tools::getValue('id_category')) && Tools::getValue('id_product')) ? '&id_category=' . $id_category : '';\r\r\n $this->redirect_after .= '&conf=5' . $id_category;\r\r\n } else {\r\r\n $this->errors[] = Tools::displayError('An error occurred while updating the status.');\r\r\n }\r\r\n } else {\r\r\n $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.') .\r\r\n ' <b>' . $this->object_table . '</b> ' .\r\r\n Tools::displayError('(cannot load object)');\r\r\n }\r\r\n\r\r\n return $object;\r\r\n }", "public function status()\n {\n if (!$this->session->userdata['userData']['session_user_id'] || $this->session->userdata['userData']['session_user_id'] != 1) {\n redirect('users/login');\n }\n\n $this->session->unset_userdata('active_menu');\n $this->session->set_userdata('active_menu', 'parentaccounts');\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n $parent_account_id = $this->input->post('id');\n\n if ($this->input->post('status') == 1) {\n $status = 0;\n $_POST['data']['status'] = $status;\n $status_result = 0;\n } else {\n $status = 1;\n $_POST['data']['status'] = $status;\n $status_result = 1;\n }\n\n $update = $this->account_mod->update_parent_account($_POST['data'], $parent_account_id);\n\n header('Cache-Control: no-cache, must-revalidate');\n header('Expires: ' . date('r', time() + (86400 * 365)));\n header('Content-type: application/json');\n\n echo json_encode(array(\n 'valid' => true,\n 'success_message' => $status_result\n ));\n exit();\n }\n }", "public static function get_folder_status()\n\t{\n\t\tstatic $status = null;\n\n\t\tif(is_null($status))\n\t\t{\n\t\t\t$stock_dirs = AEPlatform::get_stock_directories();\n\n\t\t\t// Get output writable status\n\t\t\t$registry =& AEFactory::getConfiguration();\n\t\t\t$outdir = $registry->get('akeeba.basic.output_directory');\n\t\t\tforeach( $stock_dirs as $macro => $replacement )\n\t\t\t{\n\t\t\t\t$outdir = str_replace($macro, $replacement, $outdir);\n\t\t\t}\n\t\t\t$status['output']= @is_writable($outdir);\n\n\t\t\t// Get temp writable status\n\t\t\t$tempdir = $registry->get('akeeba.basic.temporary_directory');\n\t\t\tforeach( $stock_dirs as $macro => $replacement )\n\t\t\t{\n\t\t\t\t$tempdir = str_replace($macro, $replacement, $tempdir);\n\t\t\t}\n\t\t\t$status['temporary'] = @is_writable($tempdir);\n\t\t}\n\n\t\treturn $status;\n\t}", "public function set_folder_data()\r\n\t{\r\n\t\t$folder = new Plugin\\Folder($this->folder_id);\r\n\t\t\r\n\t\t$this->folders_list = $folder->get_folders();\r\n\t\t$this->folder_list = $folder->get_paths($this->folder_id, false);\r\n\t\t$this->folder_hidden = $folder->get_hidden($this->folder_id, $this->per_page, $this->page_num);\r\n\t\t$this->folder_tree = $folder->view_tree();\r\n\t}", "public function updateStatus()\n {\n $this->getStatus();\n return $this->save($this->parseStatus());\n }", "protected function _setNaviFolderSave($arr)\n\t{\n\t\tglobal $varsRequest;\n\n\t\t$vars = $this->getVars(array(\n\t\t\t'path' => $arr['pathVars'],\n\t\t));\n\n\t\t$varsJson = $this->checkValueFolder(array(\n\t\t\t'varsValue' => ($varsRequest['query']['jsonValue']['vars'])? $varsRequest['query']['jsonValue']['vars'] : array(),\n\t\t\t'varsTemplate' => $vars['portal']['varsNavi']['templateFolder']['varsDetail']['templateDetail'],\n\t\t));\n\n\t\t$this->_setNaviFolderSaveUpdate(array(\n\t\t\t'pathVars' => $arr['pathVars'],\n\t\t\t'varsJson' => $varsJson,\n\t\t\t'strTable' => $arr['strTable'],\n\t\t\t'strColumn' => $arr['strColumn'],\n\t\t\t'flagEntity' => $arr['flagEntity'],\n\t\t\t'flagAccount' => $arr['flagAccount'],\n\t\t));\n\t}", "public function updateStatus()\n {\n }", "protected function updateRootFolder()\n\t{\n\t\t$rootFolder = $this->owner->RootFolder();\n\t\tif ($this->owner->isChanged('URLSegment') && $this->owner->URLSegment) {\n\t\t\t$rootFolder->setName($this->owner->URLSegment);\n\t\t\t$rootFolder->write();\n\t\t}\n\n\t\tif ($this->owner->isChanged('ParentID') && $this->owner->ParentID > 0) {\n\t\t\t$oldParentID = $rootFolder->ParentID;\n\t\t\t$newParentID = $this->owner->Parent()->RootFolderID;\n\t\t\tif ($oldParentID !== $newParentID && $newParentID !== $rootFolder->ID) {\n\t\t\t\t$rootFolder->setParentID($newParentID);\n\t\t\t\t$rootFolder->write();\n\t\t\t}\n\t\t}\n\t}", "public function save()\n {\n $this->currentStatus->lastUpdate = date('m/d/Y H:i:s');\n $data = $this->jsonFromObject();\n file_put_contents($this->jsonStateFile, $data);\n }", "protected function _prepare_object ($obj)\n {\n $obj->set_parent_folder ($this->_user->folder_at_id ($this->db->f ('folder_id')));\n }", "protected function _setNaviFolderSaveUpdate($arr)\n\t{\n\t\tglobal $varsRequest;\n\t\tglobal $classDb;\n\t\tglobal $varsAccount;\n\t\tglobal $varsPluginAccountingAccount;\n\n\t\t$strJson = json_encode($arr['varsJson']);\n\t\t$this->checkTextSize(array(\n\t\t\t'flag' => 'errorDataMax',\n\t\t\t'str' => $strJson,\n\t\t));\n\n\t\t$idEntity = $varsPluginAccountingAccount['idEntityCurrent'];\n\t\t$idAccount = $varsAccount['id'];\n\t\t$arrWhere = array();\n\t\tif ($arr['flagEntity']) {\n\t\t\t$arrWhere[] = array(\n\t\t\t\t'flagType' => 'num',\n\t\t\t\t'strColumn' => 'idEntity',\n\t\t\t\t'flagCondition' => 'eq',\n\t\t\t\t'value' => $idEntity,\n\t\t\t);\n\n\t\t} else {\n\t\t\t$arrWhere[] = array(\n\t\t\t\t'flagType' => 'num',\n\t\t\t\t'strColumn' => 'idEntity',\n\t\t\t\t'flagCondition' => 'eq',\n\t\t\t\t'value' => 0,\n\t\t\t);\n\t\t}\n\n\t\tif ($arr['flagAccount']) {\n\t\t\t$arrWhere[] = array(\n\t\t\t\t'flagType' => 'num',\n\t\t\t\t'strColumn' => 'idAccount',\n\t\t\t\t'flagCondition' => 'eq',\n\t\t\t\t'value' => $idAccount,\n\t\t\t);\n\t\t}\n\n\t\t$arrWhere[] = array(\n\t\t\t'flagType' => '',\n\t\t\t'strColumn' => 'flagColumn',\n\t\t\t'flagCondition' => 'eq',\n\t\t\t'value' => $arr['strColumn'],\n\t\t);\n\n\t\t$dbh = $classDb->getHandle();\n\t\ttry {\n\t\t\t$dbh->beginTransaction();\n\n\t\t\t$classDb->updateRow(array(\n\t\t\t\t'idModule' => 'accounting',\n\t\t\t\t'strTable' => $arr['strTable'],\n\t\t\t\t'arrColumn' => array('jsonData'),\n\t\t\t\t'flagAnd' => 1,\n\t\t\t\t'arrWhere' => $arrWhere,\n\t\t\t\t'arrValue' => array($strJson),\n\t\t\t));\n\n\t\t\tif ($arr['flagAccount']) {\n\t\t\t\t$this->updateDbAccountStamp();\n\t\t\t\t$this->_updateDbPreferenceStamp(array('strColumn' => 'account'));\n\n\t\t\t} else {\n\t\t\t\t$this->_updateDbPreferenceStamp(array('strColumn' => 'adminMemo'));\n\t\t\t}\n\n\t\t\t$dbh->commit();\n\t\t} catch (PDOException $e) {\n\t\t\t$dbh->rollBack();\n\t\t\tif (FLAG_TEST) {\n\t\t\t\tvar_dump($e->getMessage());\n\t\t\t}\n\t\t\texit;\n\t\t}\n\n\t\t$this->_setNaviFolderReload(array(\n\t\t\t'pathVars' => $arr['pathVars'],\n\t\t\t'strColumn' => $arr['strColumn'],\n\t\t\t'strTable' => $arr['strTable'],\n\t\t\t'flagEntity' => $arr['flagEntity'],\n\t\t\t'flagAccount' => $arr['flagAccount'],\n\t\t));\n\n\t}", "public function status_child_account()\n {\n if (!$this->session->userdata['userData']['session_user_id'] || $this->session->userdata['userData']['session_user_id'] != 1) {\n redirect('users/login');\n }\n\n $this->session->unset_userdata('active_menu');\n $this->session->set_userdata('active_menu', 'childaccounts');\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n $child_account_id = $this->input->post('id');\n\n if ($this->input->post('status') == 1) {\n $status = 0;\n $_POST['data']['status'] = $status;\n $status_result = 0;\n } else {\n $status = 1;\n $_POST['data']['status'] = $status;\n $status_result = 1;\n }\n\n $update = $this->account_mod->update_child_account($_POST['data'], $child_account_id);\n\n header('Cache-Control: no-cache, must-revalidate');\n header('Expires: ' . date('r', time() + (86400 * 365)));\n header('Content-type: application/json');\n\n echo json_encode(array(\n 'valid' => true,\n 'success_message' => $status_result\n ));\n exit();\n }\n }", "public function set_status(Status $object)\n {\n $this->status = $object;\n $this->status_id = $object->id;\n }", "public function syncStatus()\n {\n if ($this->serverTasks->contains->isRunning() ||\n $this->serverTasks->contains->isPending()) {\n return;\n }\n\n if ($this->serverTasks->contains->hasFailed()) {\n $this->markAsFailed();\n } else {\n $this->markAsFinished();\n }\n }", "public function setStatus() {\n if (!($this->user->verify())) {\n include 'view/page/landing_page.php';\n } else {\n if (isset($_GET['id']) && isset($_GET['status'])) {\n $statusId = htmlspecialchars($_GET['id']);\n $status = intval($_GET['status']);\n\n if (Restaurant::updateNumber($statusId, 'approved', $status)) {\n $setStatusSuccess = True;\n } else {\n $setStatusSuccess = False;\n }\n }\n $restaurants = Restaurant::getAllRestaurants();\n include 'view/page/admin_restaurants.php';\n }\n }", "public function status_change($id, $status, $parent_id = null) {\n\n if (empty($id)) {\n return $this->InvalidUrl();\n }\n if ($status == 1) {\n\n $new_status = 0;\n } else {\n $new_status = 1;\n }\n $admin_menu = AdminMenu::where('id', '=', $id)->first();\n $admin_menu->status = $new_status;\n $admin_menu->save();\n $getCurrentPage['id'] = $parent_id;\n \n\nif ($parent_id==null) {\n\n $getCurrentPage = $getCurrentPage + getCurrentPage('admin.admin_menu');\n \n return redirect()->action('Admin\\AdminMenuController@index', $getCurrentPage)->with('alert-sucess', trans('admin.ADMIN_MENUS_CHANGE_STATUS_SUCCESSFULLY'));\n\n }else{\n $getCurrentPage = $getCurrentPage + getCurrentPage('admin.child_admin_menu');\n \n return redirect()->action('Admin\\AdminMenuController@childMenu', $getCurrentPage)->with('alert-sucess', trans('admin.ADMIN_MENUS_CHANGE_STATUS_SUCCESSFULLY'));\n\n\n }\n\n \n }", "public function refreshStatus() {\n\t\t$definedRules = $this->getDefinedRules( true );\n\t\t$this->fixed = array();\n\t\t$this->issues = array();\n\t\tforeach ( $definedRules as $rule ) {\n\t\t\tif ( empty( $rule::$slug ) || in_array( $rule::$slug, $this->ignore ) ) {\n\t\t\t\t//this rule ignored, no process\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( $rule->getService()->check() ) {\n\t\t\t\t$this->fixed[] = $rule::$slug;\n\t\t\t} else {\n\t\t\t\t$this->issues[] = $rule::$slug;\n\t\t\t}\n\t\t}\n\t\t$this->last_status_check = time();\n\t\t$this->save();\n\t}", "public function updateStatus() {\r\n if (!(is_array($_GET ['isDefault']))) {\r\n $this->setIsDefault(0, 0, 'single');\r\n }\r\n if (!(is_array($_GET ['isNew']))) {\r\n $this->setIsNew(0, 0, 'single');\r\n }\r\n if (!(is_array($_GET ['isDraft']))) {\r\n $this->setIsDraft(0, 0, 'single');\r\n }\r\n if (!(is_array($_GET ['isUpdate']))) {\r\n $this->setIsUpdate(0, 0, 'single');\r\n }\r\n if (!(is_array($_GET ['isDelete']))) {\r\n $this->setIsDelete(1, 0, 'single');\r\n }\r\n if (!(is_array($_GET ['isActive']))) {\r\n $this->setIsActive(0, 0, 'single');\r\n }\r\n if (!(is_array($_GET ['isApproved']))) {\r\n $this->setIsApproved(0, 0, 'single');\r\n }\r\n }", "public function update () {\r\n\t\t$this->getParent ()->update();\r\n\t\t$this->_update();\r\n\t}", "public function changeStatus($id) {\n\t\t\n\t\tif($this->request->is('ajax')) {\n\t\t\t\n\t\t\t$this->Item->recursive = -1;\n\t\t\t$item = $this->Item->read(null, $id);\n\t\t\t$this->Item->id = $item['Item']['id'];\n\t\t\t\t\t\t\n\t\t\tif($item['Item']['status_id'] == ATIVO) {\n\t\t\t\t$status_id = INATIVO;\n\t\t\t}else if($item['Item']['status_id'] == INATIVO) {\n\t\t\t\t$status_id = ATIVO;\n\t\t\t}\n\t\t\t\n\t\t\tif($this->Item->saveField('status_id', $status_id, false)) {\n\t\t\t\techo '1';\n\t\t\t}else {\n\t\t\t\techo '0';\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\texit;\n\t\t\n\t\t}else {\n\t\t\techo '-1';\t\t\t\t\n\t\t\texit;\n\t\t}\t\t\n\t}", "public function change_status_status()\n\t{\n\t\t$this->_check_user_logged_out();\n\n\t\t// check if user can edit\n\t\t$this->_check_user_can('edit');\n\n\t\t$id = $this->input->post('id');\n\t\t$status = new Item_Status_Model();\n\n\t\t// if not exists?\n\t\tif(! $status->find($id))\n\t\t{\n\t\t\texit(json(array('status' => false, 'msg' => 'Status is not exists or deleted')));\n\t\t}\n\n\t\t$status->active = $status->active ? 0 : 1;\n\t\t// change status success?\n\t\tif($status->save())\n\t\t{\n\t\t\texit(json(array('status' => true, 'msg' => 'Changed status successfully')));\n\t\t}\n\n\t\texit(json(array('status' => false, 'msg' => 'You can not change status at the moment. Please try again later.')));\n\t}", "private function setStatus(){\n $this->status = @$this->array['status'];\n }", "private function setAnalysisStatus( $aid, $status = 'Pending')\n {\n\tif( $_ENV['APP_DEBUG'])\n $this->logger->debug('Setting analysis status '.$status);\n\n\t// Return false if node does not exist\n\tif( !$this->analysisNodeExists( $aid)) return false;\n\n\t// Check if the status is valid\n\tif( !in_array( $status, Analysis::STATUS)) return false;\n\n\t// Query params\n $params = ['aid' => intval( $aid), 'status' => $status];\n\n\t// Get current analysis status\n\t$current_status = $this->getAnalysisStatus( $aid);\n\n\t// Disconnect analysis node from status queue\n\tif( !$this->detachStatusRels( $aid)) return false;\n//\t$this->detachStatusRels( $aid);\n\n\t// get first and last nodes for a given status\n\t$first = $this->getStatusQueueNode( $status);\n\t$last = $this->getStatusQueueNode( $status, 'last');\n\n\t// Inconsistent status queue\n\tif( ($first == -1 && $last != -1) ||\n\t\t($first != -1 && $last == -1)) {\n\n\t if( $_ENV['APP_DEBUG'])\n $this->logger->debug('Inconsistent status queue');\n\t return false;\n\t}\n\n if( $_ENV['APP_DEBUG'])\n $this->logger->debug('Adjusting analysis status relationships');\n\n\t// Status queue empty, add very first item\n\t$query = 'MATCH (a:Analysis) WHERE id(a)={aid}\nMATCH (s:Status{status:{status}})\nMERGE (a)-[:HAS_GOT]->(s)\nMERGE (s)-[:FIRST]->(a)\nMERGE (s)-[:LAST]->(a)';\n\n\t// Status queue NOT empty, attach to tail\n\t// Any status except for Pending\n\t// Pending when only one node present, no (a)-[:NEXT]->\n\tif( $last != -1)\n\t $query = 'MATCH (a:Analysis) WHERE id(a)={aid}\nMATCH (s:Status{status:{status}})\nMATCH (s)-[rl:LAST]-(l:Analysis)\nMERGE (a)-[:HAS_GOT]->(s)\nMERGE (s)-[:LAST]->(a)\nMERGE (l)-[:NEXT_BY_STATUS]->(a)\nDELETE rl';\n\n\t// Multiple pending nodes\n//\t\t&& !$this->analysisOnQueueTail( $aid))\n\t// It is possible that Current node has muntiple Skipped\n\t// Partially, etc. so previous Pending is NOT just (p)-[:NEXT]->(a)\n\t// One has to *find* it.\n\t// But the variable length path will expand to all prev nodes\n\t// It cna be either a promotion (attached to Current)\n\t// or regular addition to Tail\n\tif( $status == 'Pending' && $first != $last) {\n\n\t // Object-oriented way\n\t $this->analysis_id = $aid;\n\n\t // Fetch previous Pending node\n\t $prev = $this->getStatusQueueNode( $status, 'prev');\n\n\t // Add one more parameter to the query\n\t $params['pid'] = intval( $prev);\n\n\t // We are not working with tail\n\t if( $prev != $last)\n\t $query = 'MATCH (a:Analysis) WHERE id(a)={aid}\nMATCH (p:Analysis) WHERE id(p)={pid}\nMATCH (s:Status{status:{status}})\nMATCH (p)-[r:NEXT_BY_STATUS]->(n)\nMERGE (a)-[:HAS_GOT]->(s)\nMERGE (p)-[:NEXT_BY_STATUS]->(a)\nMERGE (a)-[:NEXT_BY_STATUS]->(n)\nDELETE r';\n\n\t}\n\n\t// Delete any status properties for Pending nodes\n // so that evaluator can easily start processing them\n\tif( $status == 'Pending')\n\t $query .= ' REMOVE a.status';\n\n/*\n\t $query = 'MATCH (a:Analysis) WHERE id(a)={aid}\nMATCH (s:Status{status:{status}})\nMATCH (:Status{status:{status}})<-[:HAS_GOT]-(p:Analysis)-[:NEXT*0..]->(a)\n WITH p LIMIT 1\nMATCH (p)-[r:NEXT_BY_STATUS]->(n)\nMERGE (a)-[:HAS_GOT]->(s)\nMERGE (p)-[:NEXT_BY_STATUS]->(a)\nMERGE (a)-[:NEXT_BY_STATUS]->(n)\nDELETE r';\n\t// Change status\n\tif( $current_status != -1) {\n\n\t // Change status, status queue empty\n\t $query = 'MATCH (a:Analysis) WHERE id(a)={aid}\nMATCH (s:Status{status:\"'.$status.'\"})\nMATCH (a)-[r:HAS_GOT]->(:Status)\nMATCH (p:Analysis)-[pr:NEXT_BY_STATUS]->(a)-[nr:NEXT_BY_STATUS]->(n:Analysis)\nMERGE (a)-[:HAS_GOT]->(s)\nMERGE (s)-[:FIRST]->(a)\nMERGE (s)-[:LAST]->(a)\nMERGE (p)-[:NEXT_BY_STATUS]->(n)\nDELETE r, pr, nr';\n\n\t // Change status, status queue NOT empty\n\t if( $first != -1)\n\t $query = 'MATCH (a:Analysis) WHERE id(a)={aid}\nMATCH (s:Status{status:\"'.$status.'\"})\nMATCH (a)-[r:HAS_GOT]->(:Status)\nMATCH (s)-[rl:LAST]-(l:Analysis)\nMATCH (p:Analysis)-[pr:NEXT_BY_STATUS]->(a)-[nr:NEXT_BY_STATUS]->(n:Analysis)\nMERGE (a)-[:HAS_GOT]->(s)\nMERGE (s)-[:LAST]->(a)\nMERGE (l)-[:NEXT_BY_STATUS]->(a)\nMERGE (p)-[:NEXT_BY_STATUS]->(n)\nDELETE r, pr, nr';\n\n\t // last item in the status queue\n\t if( $first != -1 && $first == $last) {\n\n\t // last item, change status, new status queue empty\n\t $query = 'MATCH (a:Analysis) WHERE id(a)={aid}\nMATCH (s:Status{status:\"'.$status.'\"})\nMATCH (a)-[r]->(:Status)\nMERGE (a)-[:HAS_GOT]->(s)\nMERGE (s)-[:FIRST]->(a)\nMERGE (s)-[:LAST]->(a)\nDELETE r';\n\n\t // last item, Change status, status queue NOT empty\n\t if( $first != -1)\n\t $query = 'MATCH (a:Analysis) WHERE id(a)={aid}\nMATCH (s:Status{status:\"'.$status.'\"})\nMATCH (a)-[r]->(:Status)\nMATCH (s)-[rl:LAST]-(l:Analysis)\nMERGE (a)-[:HAS_GOT]->(s)\nMERGE (s)-[:LAST]->(a)\nMERGE (l)-[:NEXT_BY_STATUS]->(a)\nDELETE r';\n\n\t }\n\t}\n*/\n\tif( $_ENV['APP_DEBUG'])\n $this->logger->debug( $query . ' ' . implode( ',', $params));\n\n $this->neo4j_client->run($query, $params);\n\n/*\n\n $params = [\"aid\" => intval( $aid)];\n $this->neo4j_client->run($query, $params);\n\n/*\n\t// Deleting existing status labels and adding new\n\t$query = 'MATCH (a:Analysis) WHERE id(a)={aid}\nREMOVE a:'.$statusLabels.' SET a:'.$label;\n\n\t// Send the query, we do NOT expect any return\n $params = [\"aid\" => intval( $aid)];\n $this->neo4j_client->run($query, $params);\n\n // Forcefully promote the analysis node\n\tif( $label == \"Pending\") $this->promoteAnalysis( $aid);\n*/\n\n\t// Record status change if NOT promotion\n\tif( $current_status != array_search( $status, Analysis::STATUS))\n\t $this->createAnalysisActionNode( $aid, 'StatusChange', $status);\n\n\treturn true;\n }", "public function admin_sub_category_status_update($parent_id, $id, $newStatus) {\n\t\tif($id != ''){\n\t\t\t$pageCount = $this->Category->find('count', array('conditions'=>array('Category.id'=>$id)));\n\t\t\tif($pageCount > 0){\n\t\t\t\t$saveData['id'] = $id;\n\t\t\t\t$saveData['status'] = $newStatus;\n\t\t\t\tif($newStatus == '1')\n\t\t\t\t\t$message = 'Activated';\n\t\t\t\telse\n\t\t\t\t\t$message = 'Deactivated';\n\t\t\t\tif($this->Category->save($saveData, false))\n\t\t\t\t\t$this->Session->setFlash(__('Sub-Category '.$message.' Successfully!!', true), 'message', array('class'=>'message-green'));\n\t\t\t\telse\n\t\t\t\t\t$this->Session->setFlash(__('No Associated Page Found!!', true), 'message', array('class'=>'message-red'));\n\t\t\t}else\n\t\t\t\t$this->Session->setFlash(__('No Associated Page Found!!', true), 'message', array('class'=>'message-red'));\n\t\t}else\n\t\t\t$this->Session->setFlash(__('No Associated Page Found!!', true), 'message', array('class'=>'message-red'));\n\t\t$this->redirect('/admin/categories/sub_categories_manage/'.$parent_id.'/');\n\t\texit;\n\t}", "public function changeStatus($info) //change user's status from looking for a job to not looking\r\n { \r\n\t\t// checking if get all info we need\r\n\t\tif (!isset($info['status']) || \r\n\t\t\t($info['status'] == 0 && \r\n\t\t\t\t(!isset($info['reason']) || \r\n\t\t\t\t($info['reason'] == 9 && \r\n\t\t\t\t\t(!isset($info['description']) || \r\n\t\t\t\t\ttrim($info['description']) == ''))))) {\r\n\t\t\t$this->log->error(2);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// checking if status is change\r\n\t\tif ($this->status == $info['status']) {\r\n\t\t\t$this->log->error(2);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$data = array('id' => $this->ID, 'status' => $info['status']);\r\n\r\n\t\t$sql = \"UPDATE _table_ SET status=:status WHERE ID=:id\";\r\n\t\t\r\n\t\tif ($this->table->runQuery($sql, $data)) {\r\n \r\n\t\t\t$this->log->report('Information Updated(ChangeStatus)');\r\n\t\t\t\r\n if ($this->clone === 0) {\r\n $this->session->update = true;\r\n }\r\n\r\n // Update the current object with the updated information\r\n $this->_data = array_merge($this->_data, $data);\r\n\r\n // Clear the updates stack\r\n $this->_updates = new Collection();\r\n\t\t\t\r\n\t\t\tif ($info['status'] == 0) {\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t\t'student_id' => $this->_data['ID'],\r\n\t\t\t\t\t\t'reason' => $info['reason']\r\n\t\t\t\t\t);\r\n\t\t\t\tif (isset($info['description'])) {\r\n\t\t\t\t\t$data['description'] = $info['description'];\r\n\t\t\t\t}\r\n\t\t\t\t$into = array();\r\n\t\t\t\tforeach ($data as $index => $val) {\r\n\t\t\t\t\t$into[] = $index;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$intoStr = implode(', ', $into);\r\n\t\t\t\t$values = ':' . implode(', :', $into);\r\n\r\n\t\t\t\t$sql = \"INSERT INTO student_turn_off ({$intoStr}) VALUES({$values})\";\r\n\t\t\t\t\r\n\t\t\t\t$db_action = new DB_Action();\r\n\t\t\t\t\r\n\t\t\t\tif ($db_action->runQuery($sql, $data)) {\r\n\t\t\t\t\t$this->log->report('Information Updated(ChangeStatus)');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->log->error(2);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n } else {\r\n $this->log->error(2);\r\n return false;\r\n }\r\n\t\treturn true;\r\n\t}", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n $name = $db->escapeString( $this->Name );\r\n $description = $db->escapeString( $this->Description );\r\n if ( !isSet( $this->ID ) )\r\n {\r\n $db->lock( \"eZFileManager_Folder\" );\r\n $nextID = $db->nextID( \"eZFileManager_Folder\", \"ID\" );\r\n $result = $db->query( \"INSERT INTO eZFileManager_Folder\r\n (ID, Name, Description, UserID, SectionID, ParentID)\r\n VALUES ('$nextID',\r\n '$name',\r\n '$description',\r\n '$this->UserID',\r\n '$this->SectionID',\r\n '$this->ParentID')\" );\r\n $db->unlock();\r\n\t\t\t$this->ID = $nextID;\r\n }\r\n else\r\n {\r\n $result = $db->query( \"UPDATE eZFileManager_Folder SET\r\n\t\t Name='$name',\r\n Description='$description',\r\n UserID='$this->UserID',\r\n SectionID='$this->SectionID',\r\n ParentID='$this->ParentID'\r\n WHERE ID='$this->ID'\" );\r\n\r\n }\r\n\r\n\r\n if ( $result == false )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n }", "public function rebateStatus() {\n\t\t// rebate logic\n\t}", "public function setFolderObject($value)\n {\n return $this->set('FolderObject', $value);\n }", "function markParentToUpdate() {\n\t\tglobal $repository;\n\t\t$mainObjId = $this->getMainObjectId();\n\t\tdebug(\"parentUpdate\", $mainObjId);\n\t\tif($mainObjId) {\n\t\t\t$mainObj = $repository->getObject($mainObjId);\n\t\t\tif(is_a($mainObj, 'sotf_nodeobject') && $mainObj->isLocal()) {\n\t\t\t\t$this->addToUpdate('updateMeta', $mainObjId);\n\t\t\t}\n\t\t}\t\t\n\t}" ]
[ "0.57229006", "0.5688241", "0.5520497", "0.52925205", "0.52903694", "0.52162766", "0.5212126", "0.5049999", "0.50262535", "0.50108445", "0.49480766", "0.4944922", "0.4898879", "0.48953933", "0.48862746", "0.48793316", "0.48719913", "0.48551875", "0.48515373", "0.48446447", "0.48252365", "0.4799444", "0.47916716", "0.4789161", "0.4773262", "0.4757391", "0.47361797", "0.4729836", "0.47294116", "0.47271782" ]
0.68772346
0
Filter the query by a related Tipocaratula object
public function filterByTipocaratula($tipocaratula, $comparison = null) { return $this ->addUsingAlias(ImpresionPeer::ID_TIPOCARATULA, $tipocaratula->getId(), $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByTipotripa($tipotripa, $comparison = null)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $tipotripa->getId(), $comparison);\n\t}", "public static function buscarProfesores($tipocriterio, $criterio, $idArea)\n {\n \n if($tipocriterio==1) {\n $q = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc(\"\n SELECT DISTINCT prof.idprofesor, p.idpersona, p.nombre, p.apellido, p.nrodoc FROM personas p JOIN\n profesores prof ON p.idpersona = prof.idpersona\n JOIN facultades fac ON prof.idfacultad = fac.idfacultad\n JOIN carreras car ON fac.idfacultad = car.idfacultad\n JOIN areas_carrera ac ON car.idcarrera = ac.idcarrera\n WHERE ac.idarea = \".$idArea.\" AND \n ((p.apellido LIKE '%\".$criterio.\"%') OR (p.nombre LIKE '%\".$criterio.\"%'))\n ORDER BY p.apellido ASC, p.nombre ASC\n \");\n }else{\n $q = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc(\"\n SELECT DISTINCT prof.idprofesor, p.idpersona, p.nombre, p.apellido, p.nrodoc FROM personas p JOIN\n profesores prof ON p.idpersona = prof.idpersona\n JOIN facultades fac ON prof.idfacultad = fac.idfacultad\n JOIN carreras car ON fac.idfacultad = car.idfacultad\n JOIN areas_carrera ac ON car.idcarrera = ac.idcarrera\n WHERE ac.idarea = \".$idArea.\" AND \n (p.nrodoc LIKE '%\".$criterio.\"%')\n ORDER BY p.apellido ASC, p.nombre ASC\n \");\n } \n \n return $q;\n }", "public function filterByIdTipocaratula($idTipocaratula = null, $comparison = null)\n\t{\n\t\tif (is_array($idTipocaratula)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idTipocaratula['min'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOCARATULA, $idTipocaratula['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idTipocaratula['max'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOCARATULA, $idTipocaratula['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ImpresionPeer::ID_TIPOCARATULA, $idTipocaratula, $comparison);\n\t}", "function filterObject()\n\t{\n\t\t$this->questionsObject();\n\t}", "public function tipoTarea() {\n return $this->belongsTo('App\\TiposProyecto','tipo_proyecto_id');\n }", "public function preguntas(){\n return $this->belongsToMany('ChecklistSilfa\\Entities\\Pregunta', 'preguntas_formulario', 'formulario_id', 'pregunta_id')->where('preguntas.estado','=','1');\n }", "public function getPratos()\n {\n return $this->hasMany(Prato::className(), ['id_pedidos' => 'idpedido']);\n }", "public function filter(){\n\t\t\t$this->filtroSQL = \"SELECT art.*, cat.categoria, fam.familia, sfam.subfamilia, autor\n\t\t\t\t,date_format(art.fmodificacion,'%d-%m-%Y %H:%i:%s') ffmodificacion\n\t\t\t\t,format(art.precio,2,'de_DE') fprecio\n\t\t\t\t,format(art.oferta,2,'de_DE') foferta\n\t\t\t\t,(select nombre from os_administradores adm where adm.id=art.id_administrador) gestor\n\t\t\t\t,(CASE art.estado WHEN 'ON' THEN 'Online' WHEN 'OFF' THEN 'Offline' ELSE 'Elimado/a' END) festado\t\t\t\t\n\t\t\t\tFROM articulos art\n\t\t\t\tLEFT JOIN subfamilias sfam ON art.id_subfamilia=sfam.id\n\t\t\t\tLEFT JOIN familias fam ON sfam.id_familia=fam.id\n\t\t\t\tLEFT JOIN categorias cat ON fam.id_categoria=cat.id\n\t\t\t\tLEFT JOIN autores aut ON art.id_autor=aut.id\n\t\t\t\tWHERE art.estado IN ('ON','OFF')\";\n\t\t\t\t\t\t\n\t\t\tif ( $_REQUEST['_articulo'] )\n\t\t\t\t$this->filtroSQL .= \" AND art.articulo LIKE '%$this->filtro_articulo%'\";\n\t\t\tif ( $_REQUEST['_categoria'] )\n\t\t\t\t$this->filtroSQL .= \" AND categoria LIKE '%$this->filtro_categoria%'\";\n\t\t\tif ( $_REQUEST['_familia'] )\n\t\t\t\t$this->filtroSQL .= \" AND familia LIKE '%$this->filtro_familia%'\";\n\t\t\tif ( $_REQUEST['_subfamilia'] )\n\t\t\t\t$this->filtroSQL .= \" AND subfamilia LIKE '%$this->filtro_subfamilia%'\";\n\t\t\tif ( $_REQUEST['_autor'] )\n\t\t\t\t$this->filtroSQL .= \" AND autor LIKE '%$this->filtro_autor%'\";\n\t\t\t\n\t\t\tif ( $this->filtro_campo )\n\t\t\t\t$this->filtroSQL .=\" ORDER BY $this->filtro_campo\".($this->filtro_orden==\"up\"?\"\":\" desc\");\n\t\t}", "public static function tramite($id){ \n return TiposTramites::where('id','=',$id)\n ->get();\n }", "public function customfilter($campos, $folio) {\n\t\t$this->db->select($campos)\n\t\t->from('partidas p')\n\t\t->join('platillos pp', 'p.cve_platillo = pp.cve_platillo', 'INNER')\n\t\t->where('p.folio', $folio);\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function searchDepositoPlanilla()\r\n\t\t{\r\n\t\t\t$query = DepositoPlanilla::find();\r\n\r\n\t\t\t$dataProvider = New ActiveDataProvider([\r\n\t\t\t\t\t\t\t\t\t'query' => $query,\r\n\t\t\t\t]);\r\n\r\n\t\t\t$query->where('id_contribuyente =:id_contribuyente',\r\n\t\t\t\t\t\t\t\t\t[':id_contribuyente' => $this->id_contribuyente]);\r\n\t\t\tif ( $this->recibo > 0 ) {\r\n\t\t\t\t$query->andWhere('DP.recibo =:recibo',[':recibo' => $this->recibo]);\r\n\t\t\t}\r\n\r\n\t\t\t$query->alias('DP')\r\n\t\t\t\t ->joinWith('deposito R', true, 'INNER JOIN')\r\n\t\t\t\t ->joinWith('condicion C', true, 'INNER JOIN');\r\n\r\n\t\t\treturn $dataProvider;\r\n\r\n\t\t}", "public function show($id)\n {\n $paciente = Paciente::where('id',$id)->first();\n\n $prenatal = DB::table('prenatals as a')\n \t->select( 'a.id',\n\t\t\t\t'a.pa',\n\t\t\t\t'a.id as consulta',\n\t\t\t\t'a.pulso',\n\t\t\t\t'a.temperatura',\n\t\t\t\t'a.peso',\n\t\t\t\t'a.talla',\n\t\t\t\t'a.fur',\n\t\t\t\t'a.motivo_consulta',\n\t\t\t\t'a.presuncion_diagnostica',\n\t\t\t\t'a.diagnostico_final',\n\t\t\t\t'a.CIEX',\n\t\t\t\t'a.CIEX2',\n\t\t\t\t'a.examen_auxiliar',\n\t\t\t\t'a.plan_tratamiento',\n\t\t\t\t'a.observaciones',\n\t\t\t\t'a.paciente_id',\n\t\t\t\t'a.profesional_id',\n\t\t\t\t'a.created_at',\n\t\t\t\t'a.prox',\n\t\t\t\t'a.personal',\n\t\t\t\t'a.card',\n\t\t\t\t'a.g',\n\t\t\t\t'a.p',\n\t\t\t\t'a.fechaemb',\n\t\t\t\t'a.tiempo_enf',\n\t\t\t\t'a.rnpeso',\n\t\t\t\t'a.anticon',\n\t\t\t\t'a.result',\n\t\t\t\t'a.gsan',\n\t\t\t\t'a.antepi',\n\t\t\t\t'a.ets',\n\t\t\t\t'a.etsotro',\n\t\t\t\t'a.exagen',\n\t\t\t\t'a.exareg',\n\t\t\t\t'a.so3',\n\t\t\t\t'a.phpa',\n\t\t\t\t'a.imc',\n\t\t\t\t'a.prs',\n\t\t\t\t'a.andria',\n\t\t\t\t'a.fecha',\n \t\t\t'a.antecedentes_familiar',\n \t\t\t'a.antecedentes_personales',\n \t\t\t'a.antecedentes_patologicos',\n \t\t\t'a.antecedentes_quirurgicos',\n \t\t\t'a.antecedentes_traumaticos',\n \t\t\t'a.antecedentes_geneticos',\n \t\t\t'a.alergias',\n \t\t\t'a.menarquia',\n\t\t\t\t'p.nombres',\n\t\t\t\t'p.apellidos',\n\t\t\t\t'p.dni',\n\t\t\t\t'p.id as idPaciente',\n\t\t\t\t'per.name as nombrePro',\n\t\t\t\t'per.lastname as apellidoPro',\n\t\t\t\t'per.id as profesionalId')\n\t \t->join('pacientes as p','p.id','a.paciente_id')\n\t \t->join('personals as per','per.id','=','a.profesional_id')\n\t ->where('paciente_id','=',$id)\n\t ->first();\n\n\n $control = Control::where('id_paciente','=',$id)->get();\n\n\n \n\n return view('prenatal.show',[\n \t'prenatal' => $prenatal,\n \t'control' => $control,\n \t'paciente' => $paciente\n ]);\n }", "public function Filter($filter=null){\n $results = $this->where(function($query) use ($filter){\n if($filter){\n $query->where('cliente','LIKE',\"%{$filter}%\" or 'vendedor','LIKE',\"%{$filter}%\" or 'data','LIKE',\"%{$filter}%\")->orderBy(\"%{$filter}%\", 'desc')->get() ;\n }\n });\n return $results;\n }", "public function propinas(){\n return $this->hasMany('socialCocktail\\Propina');\n }", "public function tipodeproducto()\n\t{\n\t\treturn $this->belongsTo(TiposDeProductos::class, 'id_tipo_producto', 'id_tipo');\n\t}", "public function precios() {\n return $this->belongsToMany('Tipo_Precio', 'producto_precio', 'producto_id', 'tipo_precio_id');\n }", "public function scopeNombretipoproducto($query, $tipoProducto){\n if (trim($tipoProducto) != \"\"){\n $query->whereIn('tbl_producto.idTipoProducto',\n TipoProducto::where('tbl_tipo_producto.nombre', 'like', '%' . $tipoProducto . '%')->select('tbl_tipo_producto.id')->get()->toArray()\n );\n //dd($query->get()->toArray());\n //dd($query->toSql() . ' valor: ' . $tipoProducto);\n }\n }", "public function show($anio, $filter=null)\n {\n if($filter!=null){\n $data = modelArrendamientos::where('arr_anio','=',$anio)\n ->where('tipoarrendamiento_id','=',$filter)\n ->get();\n }else {\n $data = modelArrendamientos::where('arr_anio','=',$anio)->get();\n }\n $filter = modelTipoArrendamiento::get();\n // dd($data);\n return view('arrendamientos.show',compact('data','filter','anio'));\n }", "public function getTiposPreguta()\n {\n $dql = \"SELECT \n tp.id,\n tp.tprTipoPregunta\n FROM \n sgiiBundle:TblTipoPregunta tp\n WHERE tp.tprEstado = 1\";\n \n $query = $this->em->createQuery($dql);\n $result = $query->getResult(); \n return $result;\n }", "public function naloziPlatitelj(){\n return $this->hasMany('App\\Nalog','PlatiteljId')/*->where('Odobrenje','1')*/;\n }", "public function creadorTiposVenta()\n {\n return $this->hasMany('App\\TipoVenta','created_by');\n }", "static function etapas_tipo_proceso($idTipoProceso){\n return $etapas=Etapa::where('tipo_procesos_id', $idTipoProceso)->orderBy('indice', 'asc')->get();\n }", "public function show(carrito $carrito)\n {\n $id = auth()->user()->id_cliente;\n //var_dump($id);\n // Get the currently authenticated user's ID...\n\n /*** SELECT car.id_produc, car.id_cliente, p.titulo, p.id_provee, fa.nom_fami, prov.nom, sk.stock, sk.prec_uni\nFROM producto as p \nINNER JOIN carrito as car on p.id_produc = car.id_produc \nINNER JOIN cliente as cli on cli.id_cliente = car.id_cliente \nINNER JOIN familia as fa on fa.id_familia = p.id_familia\nINNER JOIN proveedor as prov on prov.id_provee = p.id_provee\nINNER JOIN stock as sk on sk.id_produc = p.id_produc*/\n\n //SELECT id_produc, COUNT(id_produc) as Np FROM carrito WHERE id_cliente = '260420323111' GROUP BY id_produc\n // $IdProducCount = DB::table('carrito')\n // ->select('carrito.id_produc')\n // ->where('carrito.id_cliente', $id)\n // ->groupBy('id_produc')\n // ->addSelect(DB::raw('count(carrito.id_produc) as Np'))->get();\n\n\n\n $CarritoCliente = DB::table('producto')\n ->join('carrito', 'carrito.id_produc', '=', 'producto.id_produc')\n ->join('cliente', 'cliente.id_cliente', '=', 'carrito.id_cliente')\n ->join('familia', 'familia.id_familia', '=', 'producto.id_familia')\n ->join('proveedor', 'proveedor.id_provee', '=', 'producto.id_provee')\n ->join('stock', 'stock.id_produc', '=', 'producto.id_produc')\n ->select('carrito.id_produc', 'carrito.id_cliente', 'carrito.cantidad', 'producto.titulo', 'producto.id_provee', 'familia.nom_fami', 'proveedor.nom', 'stock.stock', 'stock.prec_uni')\n ->where('carrito.id_cliente', $id)\n ->distinct()->get();\n\n $direccion = DB::table('direccion')\n ->join('estado', 'estado.id_estado', 'direccion.id_estado')\n ->join('direc_cliente', 'direc_cliente.id_direc', 'direccion.id_direc')\n ->select('direccion.calle', 'estado.estado', 'direccion.numero', 'direccion.id_direc', 'direccion.colonia', 'direccion.alias', 'direccion.*')\n ->where('direc_cliente.id_cliente', $id)->get();\n // var_dump($direccion);\n\n\n\n\n // $user = auth()->user()->id_cliente;\n // $creditcard = DB::select('SELECT * FROM `cli_m_pago` WHERE id_cliente = ?', [$user]);\n // foreach ($creditcard as $value) {\n // $card = $value->num_tar;\n // $nom = $value->nom_card;\n // $expi = $value->expi;\n // $id = $value->id_pago;\n // $id = ($id * 263412432) / 2;\n // $key = \"Una oracion al santro padre 3425ytsdfhvbdfs \";\n // list($encrypted_data, $iv) = explode('::', base64_decode($card), 2);\n // $valor = openssl_decrypt($encrypted_data, 'aes-256-cbc', $key, 0, $iv);\n // $real = substr($valor, 14, 16);\n // }\n\n\n return view('cliente.carrito.index')\n ->with('Carrito', $CarritoCliente)\n ->with('dir', $direccion);\n }", "public function childQuery(){\n return ImportCargamasivadet::find()->\n where(['cargamasiva_id' =>$this->id]);\n }", "public function show($id)\n {\n\n $usuario = Auth::user();\n\n $propositor = DB::table('Usuario_Propositor')->join('Usuario', 'Usuario.cod_usuario', '=', 'Usuario_Propositor.Usuario_cod_usuario')\n ->where('Usuario.cod_usuario', $usuario->cod_usuario)\n ->select('Usuario_Propositor.cod_propositor')\n ->first();\n\n if(($proposta = Proposta::where('cod_proposta', '=', $id)->select('Proposta.*')->first()) != null){\n if(!$proposta->Usuario_Propositor_cod_propositor || $proposta->Usuario_Propositor_cod_propositor != $propositor->cod_propositor){\n abort(404);\n }\n }\n else {\n abort(404);\n }\n\n $obra = Obra::join('Grande_Area', 'Grande_Area.cod_grande_area', 'Obra.Grande_Area_cod_grande_area')\n ->join('Area_Conhecimento', 'Area_Conhecimento.Grande_Area_cod_grande_area', 'Grande_Area.cod_grande_area')\n ->leftJoin('Subarea', 'Subarea.Area_Conhecimento_cod_area_conhec', 'Area_Conhecimento.cod_area_conhec')\n ->leftJoin('Especialidade', 'Especialidade.Subarea_cod_subarea', 'Subarea.cod_subarea')\n ->where('Proposta_cod_proposta', $proposta->cod_proposta)\n ->select('Obra.*', 'Grande_Area.nome as grande_area_obra', 'Area_Conhecimento.nome as area_conhecimento_obra', 'Subarea.nome as subarea_obra', 'Especialidade.nome as especialidade_obra')\n ->first();\n\n $autores = Pessoa::join('Autor', 'Pessoa.cod_pessoa', '=', 'Autor.Pessoa_cod_pessoa')\n ->join('Obra_Autor', 'Autor.cod_autor', 'Obra_Autor.Autor_cod_autor')\n ->join('Obra', 'Obra.cod_obra', '=', 'Obra_Autor.Obra_cod_obra')\n ->where('Obra.cod_obra', $obra->cod_obra)\n ->select('Pessoa.*')\n ->get();\n\n $materiais = Material::join('Obra', 'Material.Obra_cod_obra', '=', 'Obra.cod_obra')\n ->where('cod_obra', $obra->cod_obra)\n ->select('Material.*')\n ->get();\n\n $docsSugestoes = DocSugestaoAlteracoes::where('Proposta_cod_proposta', '=', $proposta->cod_proposta)->get();\n $oficiosAlteracoes = OficioAlteracoes::where('Proposta_cod_proposta', '=', $proposta->cod_proposta)->get();\n\n $tecnicos = Pessoa::join('Tecnico_Catalografia', 'Tecnico_Catalografia.Pessoa_cod_pessoa', '=', 'Pessoa.cod_pessoa')\n ->join('Obra_Tecnico_Catalografia', 'Obra_Tecnico_Catalografia.Tecnico_Catalografia_cod_tec_catalog', '=', 'Tecnico_Catalografia.cod_tec_catalog')\n ->join('Obra', 'Obra_Tecnico_Catalografia.Obra_cod_obra', '=', 'Obra.cod_obra')\n ->where('Obra.cod_obra', '=', $obra->cod_obra)\n ->get();\n\n $funcoes = array(\n 'revisor_ortografico' => $tecnicos->where('funcao', '1')->first(),\n 'revisor_ingles' => $tecnicos->where('funcao', '2')->first(),\n 'revisor_espanhol' => $tecnicos->where('funcao', '3')->first(),\n 'criador_capa' => $tecnicos->where('funcao', '4')->first(),\n 'diagramador' => $tecnicos->where('funcao', '5')->first(),\n 'coordenacao_editorial' => $tecnicos->where('funcao', '6')->first(),\n 'projetista_grafico' => $tecnicos->where('funcao', '7')->first(),\n );\n\n return view('propostas.show', compact('obra', 'autores', 'palavrasChave', 'materiais', 'proposta', 'docsSugestoes', 'oficiosAlteracoes', 'funcoes', 'tecnicos'));\n }", "public static function getTblproductoByFiltrosAll($idtblcolonia,$idtbltipodeservicio,$fechapedido,$hora,$idtblcategproduct,$idtblclasifproduct){\n \n $activado=1;\n \n $fechapedidoingresada = new DateTime($fechapedido);\n $fechahoy = new DateTime(\"now\");\n $interval= $fechahoy->diff($fechapedidoingresada);\n $diasMinimos= $interval->format('%d');\n \n $diasemana= $fechapedidoingresada->format('l');\n \n $tipopedidoCompleto=3;\n $tipodeservicioCompleto=3;\n \n \n if($fechapedidoingresada == $fechahoy){ \n $tipodepedido= 1; //pedidoparahoy\n $stock=1;\n }else{\n $tipodepedido= 2; //pedidoparaotrodia\n $stock=0;\n }\n \n \n if($idtbltipodeservicio==1){ //Entrega en Pasteleria\n \n $consulta = \"SELECT TPR.*,TP.*,TPI.*, TPRD.* FROM tblproducto TPR\n\t\t INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n\t\t INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n\t\t INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n\t\t INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n\t\t INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n\t\t INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n\t\t INNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n\t\t INNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n\t\t INNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n\t\t INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n\t\t WHERE TP.tblproveedor_activado = ?\n\t\t \tAND (TP.tbltiposervicio_idtbltiposervicio = ? OR TP.tbltiposervicio_idtbltiposervicio = ? ) \n\t\t\t AND TP.tblcolonia_idtblcolonia = ?\n\t\t\t AND TPR.tblproducto_activado = ?\n\t\t\t AND TCLP.tblclasifproduct_activado = ?\n\t\t\t AND TPR.tblcategproduct_idtblcategproduct = ?\n\t\t\t AND TPR.tblclasifproduct_idtblclasifproduct= ?\n\t\t\t AND TPRD.tblproductdetalle_activado = ?\n\t\t\t AND TPRD.tblproductdetalle_stock >= ?\n\t\t\t AND TPRD.tblproductdetalle_diaselaboracion <= ?\n\t\t\t AND TDS.tbldiasemana_dia = ?\n\t\t\t AND CAST(? AS TIME ) BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n\t\t\t GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$idtbltipodeservicio,PDO::PARAM_INT);\n $resultado->bindParam(3,$tipodeservicioCompleto,PDO::PARAM_INT);\n $resultado->bindParam(4,$idtblcolonia,PDO::PARAM_INT);\n $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(8,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(9,$activado,PDO::PARAM_INT);\n $resultado->bindParam(10,$stock,PDO::PARAM_INT);\n $resultado->bindParam(11,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(12,$diasemana,PDO::PARAM_STR);\n $resultado->bindParam(13,$hora,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }else{//Entrega en Domicilio\n \n \n $consulta=\"SELECT TPR.*, TP.* ,TPI.*,TPRD.* FROM tblproducto TPR\n\t INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n\t INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n\t INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n\t INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n\t INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n\t WHERE TP.tblproveedor_activado = ? \n AND TPR.tblproducto_activado = ?\n AND TCLP.tblclasifproduct_activado = ?\n AND TPR.tblcategproduct_idtblcategproduct = ?\n AND TPR.tblclasifproduct_idtblclasifproduct= ?\n AND TPRD.tblproductdetalle_activado = ?\n AND TPRD.tblproductdetalle_stock >= ?\n AND TPRD.tblproductdetalle_diaselaboracion <= ?\n AND TDS.tbldiasemana_dia = ?\n GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$activado,PDO::PARAM_INT);\n $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n $resultado->bindParam(4,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(5,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$stock,PDO::PARAM_INT);\n $resultado->bindParam(8,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(9,$diasemana,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }\n \n }", "public function searchInfoTarif() {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('LOWER(ruangan.ruangan_nama)', strtolower($this->ruangan_id),true);\n $criteria->compare('LOWER(daftartindakan.daftartindakan_nama)', strtolower($this->daftartindakan_id), true);\n \n $criteria->with = array('ruangan','daftartindakan');\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function buscar($tipo)\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ingresoEgreso',$tipo);\n\n\t\treturn self::model()->findAll($criteria\n\t\t);\n\t}", "public function getPlataformas()\n {\n return $this->hasMany(Plataformas::className(), ['id' => 'plataforma_id'])->viaTable('precios', ['juego_id' => 'id']);\n }", "public function creadorTiposEmpresa()\n {\n return $this->hasMany('App\\TipoEmpresa','created_by');\n }" ]
[ "0.5712855", "0.56585264", "0.55988157", "0.55471885", "0.5523285", "0.5508375", "0.550325", "0.54775023", "0.5460994", "0.5446345", "0.54456514", "0.53977793", "0.5378875", "0.53644454", "0.53390115", "0.53308094", "0.5323419", "0.5321179", "0.53206456", "0.5313778", "0.53046775", "0.52800536", "0.5277656", "0.5272464", "0.52653605", "0.5234199", "0.5232138", "0.52276", "0.52255356", "0.5215092" ]
0.60968363
0
Adds a JOIN clause to the query using the Tipocaratula relation
public function joinTipocaratula($relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Tipocaratula'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'Tipocaratula'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array());", "public function join($type, $table, $on)\n {\n $this->join .= ' ' . $type . ' JOIN ' . $table . ' ON ' . $on;\n }", "public function join($table)\n {\n /**\n * \n * rewrite data table\n */\n if(preg_match('/join/', self::$sql['table']))\n {\n self::$sql['table'] .= self::$sql['condition'].\" join \".$table.\" \";\n }else{\n self::$sql['table'] = self::$sql['table'].\" join \".$table.\" \";\n }\n\n return new self;\n }", "public function useTipocaratulaQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinTipocaratula($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Tipocaratula', 'TipocaratulaQuery');\n\t}", "abstract function appendJoin(AbstractQuery &$query, $sourceAlias, $targetAlias, $left_join = false);", "protected function get_from_join_snippet() {\n\n\t\treturn \" FROM {$this->wpdb->posts} p \";\n\t}", "protected function join($joinTable,$connection,$type=\"inner\"){\n\t\tforeach($connection as $col=>$val){\n\t\t\t$cond = \"$this->table.$col = $joinTable.$val\";\n\t\t}\n\t\tif(!$this->sql_join){\n\t\t\t$this->sql_join =\" $type JOIN $joinTable ON $cond\";\n\t\t}else{\n\t\t\t$this->sql_join .=\" $type JOIN $joinTable ON $cond\";\n\t\t}\n\t\treturn $this;\n\t}", "protected function joinAlias()\n\t{\n\t\tif($this->listQry)\n\t\t{\n\t\t\tpreg_match_all(\"/`?#([\\w-]+)`?\\s*(as|AS)\\s*([\\w-])/im\",$this->listQry,$matches);\n\t\t\t$keys = array();\n\t\t\tforeach($matches[1] AS $k=>$v)\n\t\t\t{\n\t\t\t\tif(varset($matches[3][$k]))\n\t\t\t\t{\n\t\t\t\t\t$this->joinAlias[$v] = $matches[3][$k]; // array. eg $this->joinAlias['core_media'] = 'm';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$keys[] = $matches[3][$k];\n\t\t\t}\n\t\t\t\n\t\t\tforeach($keys as $alias)\n\t\t\t{\n\t\t\t\tpreg_match_all(\"/\".$alias.\"\\.([\\w]*)/i\",$this->listQry,$match);\n\t\t\t\tforeach($match[1] as $k=>$m)\n\t\t\t\t{\n\t\t\t\t\t$this->joinField[$m] = $match[0][$k];\t\t\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telseif($this->tableJoin)\n\t\t{\n\t\t\tforeach ($this->tableJoin as $tbl => $data) \n\t\t\t{\n\t\t\t\t$matches = explode('.', $tbl, 2);\n\t\t\t\t$this->joinAlias[$matches[1]] = $matches[0]; // array. eg $this->joinAlias['core_media'] = 'm';\n\t\t\t\t//'user_name'=>'u.user_name'\n\t\t\t\tif(isset($data['fields']) && $data['fields'] !== '*')\n\t\t\t\t{\n\t\t\t\t\t$tmp = explode(',', $data['fields']);\n\t\t\t\t\tforeach ($tmp as $field) \n\t\t\t\t\t{\n\t\t\t\t\t\t$this->joinField[$field] = $matches[0].'.'.$field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function join($table, $alias = NULL, $condition = NULL, $arguments = array());", "abstract function appendContextJoin(AbstractQuery &$query, $mainAlias, $contextAlias);", "public function join($association, $on = '', $type = null)\n {\n }", "function cf_search_join( $join ) {\n global $wpdb;\n if ( is_search() ) {\n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n return $join;\n }", "public function join($table, $condicion, $type=\"\")\n\t\t{\n\t\t\t////JOIN comentarios ON comentarios.id = blogs.id\n\t\t\tif(is_string($table) and is_string($condicion) and is_string($type)){\n\t\t\t\t$this->join .= addslashes($type).' JOIN '.addslashes($table).' ON '.addslashes($condicion);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshowErrors('2AS', 'Type value icorrecto in the parameter');\n\t\t\t}\n\t\t}", "public function join($clause);", "function addJoin($table, $on, $type) {\n\t\t$this->_joinCount++;\n\t\tarray_push($this->_joinOrder, array(\n\t\t\t'table' => $table,\n\t\t\t'on' \t=> $on,\n\t\t\t'type' \t=> $type\n\t\t));\n\t}", "protected function myJoinTable($query, $table, $one, $operator, $two, $type = 'inner', $where = false)\n {\n // obtém os joins da query\n $joins = $query->getQuery()->joins;\n if ($joins) {\n // para cada join\n // verifica se a tabela já está no relacionamento\n foreach ($joins as $join) {\n if ($join->table == $table) {\n return $query;\n }\n }\n }\n // efetua o join na query\n return $query->join($table, $one, $operator, $two, $type, $where);\n }", "function cf_search_join( $join ) {\n global $wpdb;\n\n if ( is_search() ) {\n $join .=' LEFT JOIN '.TablesRepository::getTableNameProduct(). ' ON '. $wpdb->posts . '.dropshipping_id = ' . TablesRepository::getTableNameProduct() . '.distributor_id ';\n }\n\n return $join;\n}", "public function getJoinOn()\n {\n return $this->joinOn;\n }", "public function join($table, $type = '') {\n\t\t\tif(!isset($this->baseQueryType) || $this->baseQueryType == '')\n\t\t\t\treturn false;\n\n\t\t\t$this->join = true;\n\n\t\t\tif($type == '')\n\t\t\t\t$this->query .= ' INNER JOIN';\n\n\t\t\t$this->query .= ' ' . $table;\n\n\t\t\treturn $this;\n\t\t}", "public function join($table, $cond, $type = '')\n\t{\n\t\tif ($type != '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( !in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t/* If a DB prefix is used we might need to add it to the column names */\n\t\tif ($this->dbprefix)\n\t\t{\n\t\t\t$this->_track_aliases($table);\n/* When prefix is part of field name, it produces error, for eample: g_ */\n#$this->oDb->join( 'st.tag_crc32u = mts.tag_crc32u' );\n\t\t\t// First we remove any existing prefixes in the condition to avoid duplicates\n\t\t\t#$cond = preg_replace('|('.$this->dbprefix.')([\\w\\.]+)([\\W\\s]+)|', \"$2$3\", $cond);\n\n\t\t\t// Next we add the prefixes to the condition\n\t\t\t#$cond = preg_replace('|([\\w\\.]+)([\\W\\s]+)(.+)|', $this->dbprefix . \"$1$2\" . $this->dbprefix . \"$3\", $cond);\n\t\t}\n\n\t\t$join = $type.'JOIN '.$this->_protect_identifiers($this->dbprefix.$table, TRUE).' ON '.$cond;\n\n\t\t$this->ar_join[] = $join;\n\n\t\treturn $this;\n\t}", "function join($table, $condition, $direction = '') {\n $this->join[] = $direction . ' JOIN ' . $table . ' ON ' . $condition;\n return $this; \n }", "public function join($join_with, $join_on) {\n\n\t}", "public function setJoin($tabela, $campo, $tbJoin, $campoJoin){\r\n\t\t\t$this->criterio .= \" and `\" . $tabela . \"`.`\" . $campo . \"` = `\" . $tbJoin . \"`.`\" . $campoJoin . \"`\";\r\n\t\t}", "function polylang_slug_posts_join_filter( $join, $query ) {\n\n\t// Check if should contine.\n\tif ( ! polylang_slug_should_run( $query ) ) {\n\t\treturn $join;\n\t}\n\n\t// \" INNER JOIN $wpdb->term_relationships AS pll_tr ON pll_tr.object_id = ID\".\n\t$join .= polylang_slug_model_post_join_clause();\n\n\treturn $join;\n}", "protected function posts_join( $join )\n {\n \t$join .= $this->db->prepare(\n \" INNER JOIN {$this->db->postmeta} AS mtlat ON ( {$this->db->posts}.ID = mtlat.post_id AND mtlat.meta_key = '%s' ) \",\n $this->lat_meta_key\n );\n\n $join .= $this->db->prepare(\n \" INNER JOIN {$this->db->postmeta} AS mtlng ON ( {$this->db->posts}.ID = mtlng.post_id AND mtlng.meta_key = '%s' ) \",\n $this->lng_meta_key\n );\n\n $join .= $this->db->prepare(\n \" INNER JOIN ( SELECT %f AS latpoint, %f AS longpoint, %f AS distance_unit, %f AS radius ) AS settings \",\n $this->lat,\n $this->lng,\n $this->distance_unit,\n $this->radius\n );\n\n return $join;\n }", "public function join(string $table, string $first = null, string $operator = '=', string $second = null, string $type = 'INNER'): self\n {\n }", "public function joinParroquia($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Parroquia');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Parroquia');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "private function join($type, $table, $on)\n {\n $sql = clone $this;\n $sql->setJoin($table, $type, $on);\n\n return $sql;\n }", "function join($table, $on) {\n\t\t$this->innerJoin($table, $on);\n\t\treturn $this;\n\t}", "public function joinUsing(string $tableName, string $criteria): static;" ]
[ "0.61809236", "0.61300164", "0.60585606", "0.600817", "0.5979828", "0.59778804", "0.5942937", "0.5926986", "0.5898913", "0.58904195", "0.58840907", "0.5817574", "0.5813439", "0.5798619", "0.57589275", "0.57586014", "0.57585716", "0.57346946", "0.5728974", "0.57003826", "0.5693847", "0.5686691", "0.56470484", "0.5643562", "0.56424373", "0.56167567", "0.560811", "0.5606966", "0.5593971", "0.55939525" ]
0.6459886
0
Filter the query by a related Tipoimpresion object
public function filterByTipoimpresion($tipoimpresion, $comparison = null) { return $this ->addUsingAlias(ImpresionPeer::ID_TIPOIMPRESION, $tipoimpresion->getId(), $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByIdTipoimpresion($idTipoimpresion = null, $comparison = null)\n\t{\n\t\tif (is_array($idTipoimpresion)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idTipoimpresion['min'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOIMPRESION, $idTipoimpresion['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idTipoimpresion['max'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOIMPRESION, $idTipoimpresion['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ImpresionPeer::ID_TIPOIMPRESION, $idTipoimpresion, $comparison);\n\t}", "public function childQuery(){\n return ImportCargamasivadet::find()->\n where(['cargamasiva_id' =>$this->id]);\n }", "public function filterByTipotripa($tipotripa, $comparison = null)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $tipotripa->getId(), $comparison);\n\t}", "public function filterByImpresion($impresion, $comparison = null)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(EdicionPeer::ID, $impresion->getIdEdicion(), $comparison);\n\t}", "public function relation(Request $request)\n {\n $slug = $this->getSlug($request);\n $page = $request->input('page');\n $on_page = 50;\n $search = $request->input('search', false);\n $dataType = Voyager::model('DataType')->where('slug', '=', $slug)->first();\n\n $method = $request->input('method', 'add');\n\n $model = app($dataType->model_name);\n if ($method != 'add') {\n $model = $model->find($request->input('id'));\n }\n\n $this->authorize($method, $model);\n\n $rows = $dataType->{$method.'Rows'};\n /** @var Carbon $filterBy */\n $filterBy = null;\n foreach ($rows as $key => $row) {\n if ($row->field === $request->input('type')) {\n\n $options = $row->details;\n /**\n * En esta sección, el valor de $model es el valor del Objeto a editar\n * que en este caso es Cfdi y del cual vamos a obtener su relación que\n * es BankTransaction\n */\n if (\n isset($options->filterBy) &&\n isset($options->filterBy->foreign) &&\n isset($options->filterBy->reference) &&\n isset($model->{$options->filterBy->foreign}) // Verificamos que el campo definido en foreign se encuentre en el Cfdi\n ) {\n $filterBy = $model->{$options->filterBy->foreign};\n debug($filterBy->toDateString());\n }\n // Load Model from Relation \"BankTransaction\"\n /** @var Model $model */\n $model = app($options->model);\n\n $skip = $on_page * ($page - 1);\n\n $additional_attributes = $model->additional_attributes ?? [];\n\n // Apply local scope if it is defined in the relationship-options\n if (isset($options->scope) && $options->scope != '' && method_exists($model, 'scope'.ucfirst($options->scope))) {\n $model = $model->{$options->scope}();\n }\n\n // If search query, use LIKE to filter results depending on field label\n if ($search) {\n // If we are using additional_attribute as label\n if (in_array($options->label, $additional_attributes)) {\n debug(\"searching\");\n if(isset($filterBy)) {\n // Vamos a optar ciegamente en que el campo indicado en \"reference\",\n // realmente existe en la relación en este caso \"BankTransfer\"\n $model = $model->whereMonth($options->filterBy->reference, \"=\", $filterBy->month);\n }\n $relationshipOptions = $model->get();\n $relationshipOptions = $relationshipOptions->filter(function ($model) use ($search, $options) {\n //debug($model->{$options->label});\n return stripos($model->{$options->label}, $search) !== false;\n });\n $total_count = $relationshipOptions->count();\n $relationshipOptions = $relationshipOptions->forPage($page, $on_page);\n } else {\n debug('What a fuck? Maybe from server search?');\n if(isset($filterBy)) {\n // Vamos a optar ciegamente en que el campo indicado en \"reference\",\n // realmente existe en la relación en este caso \"BankTransfer\"\n $model = $model->whereMonth($options->filterBy->reference, \"=\", $filterBy->month);\n }\n $total_count = $model->where($options->label, 'LIKE', '%'.$search.'%')->count();\n $relationshipOptions = $model->take($on_page)->skip($skip)\n ->where($options->label, 'LIKE', '%'.$search.'%')\n ->get();\n }\n } else {\n $total_count = $model->count();\n if(isset($filterBy)) {\n // Vamos a optar ciegamente en que el campo indicado en \"reference\",\n // realmente existe en la relación en este caso \"BankTransfer\"\n $model = $model->whereMonth($options->filterBy->reference, \"=\", $filterBy->month);\n }\n $relationshipOptions = $model->take($on_page)->skip($skip)->get();\n debug($relationshipOptions);\n }\n\n $results = [];\n\n if (!$row->required && !$search && $page == 1) {\n $results[] = [\n 'id' => '',\n 'text' => __('voyager::generic.none'),\n ];\n }\n\n // Sort results\n if (!empty($options->sort->field)) {\n if (!empty($options->sort->direction) && strtolower($options->sort->direction) == 'desc') {\n $relationshipOptions = $relationshipOptions->sortByDesc($options->sort->field);\n } else {\n $relationshipOptions = $relationshipOptions->sortBy($options->sort->field);\n }\n }\n\n foreach ($relationshipOptions as $relationshipOption) {\n $results[] = [\n 'id' => $relationshipOption->{$options->key},\n 'text' => $relationshipOption->{$options->label},\n ];\n }\n\n return response()->json([\n 'results' => $results,\n 'pagination' => [\n 'more' => ($total_count > ($skip + $on_page)),\n ],\n ]);\n }\n }\n\n // No result found, return empty array\n return response()->json([], 404);\n }", "public function filterByHasOne($query, HasOne $relationship, array $ids): void;", "public function findTipoContrato(){\n $query = \"call sp_maeMaestrosConsultas(:flag,:criterio);\";\n \n $parms = array(\n \":flag\" => 16,\n \":criterio\" => $this->_idTipoContrato\n );\n $data = $this->queryOne($query,$parms);\n return $data;\n }", "public function scopeNombretipoproducto($query, $tipoProducto){\n if (trim($tipoProducto) != \"\"){\n $query->whereIn('tbl_producto.idTipoProducto',\n TipoProducto::where('tbl_tipo_producto.nombre', 'like', '%' . $tipoProducto . '%')->select('tbl_tipo_producto.id')->get()->toArray()\n );\n //dd($query->get()->toArray());\n //dd($query->toSql() . ' valor: ' . $tipoProducto);\n }\n }", "public function getOnlyBeneficio()\r\n {\r\n $db = $this->getAdapter();\r\n $sql = $db->select()\r\n ->from(array('benef' => $this->_name), array(\"*\",\r\n 'cat_nombre' => new Zend_Db_Expr(\r\n \"(SELECT GROUP_CONCAT(c.nombre ORDER BY c.id ASC SEPARATOR ' - ')\r\n FROM categoria c \r\n INNER JOIN categoria_beneficio cb ON cb.categoria_id = c.id\r\n WHERE cb.beneficio_id=benef.id)\"\r\n ),\r\n 'cat_slug' => new Zend_Db_Expr(\r\n \"(SELECT GROUP_CONCAT(c.slug ORDER BY c.id ASC SEPARATOR '--')\r\n FROM categoria c \r\n INNER JOIN categoria_beneficio cb ON cb.categoria_id = c.id\r\n WHERE cb.beneficio_id=benef.id)\"\r\n ),\r\n ))\r\n ->where('benef.activo = ?', 1);\r\n //->where('benef.sin_stock = ?',0); \r\n //se mostrara los beneficios que no tengan stock, indicado con un estado\r\n /*->where(\r\n 'CURRENT_DATE() BETWEEN benefv.fecha_inicio_vigencia AND benefv.fecha_fin_vigencia'\r\n );*/\r\n\r\n $sql->join(\r\n array('benefv' => 'beneficio_version'), 'benef.id = benefv.beneficio_id', \r\n array('fecha_inicio_vigencia', 'fecha_fin_vigencia', 'stock_actual', 'stock')\r\n )->where('benefv.activo = ?', 1);\r\n\r\n $sql->join(\r\n array('tbenef' => 'tipo_beneficio'), 'tbenef.id = benef.tipo_beneficio_id', \r\n array('abreviado',\"tbenef_id\"=>\"id\",\"tbenef_slug\"=>\"slug\")\r\n );\r\n\r\n $sql->join(\r\n array('catbenef' => 'categoria_beneficio'), 'catbenef.beneficio_id = benef.id ', \r\n array()\r\n );\r\n\r\n// $sql->join(\r\n// array('cat' => 'categoria'), 'cat.id = catbenef.categoria_id ', \r\n// array('cat_nombre' => 'nombre','cat_id' => 'id','cat_slug' => 'slug')\r\n// );\r\n\r\n $sql->join(\r\n array('est' => 'establecimiento'), 'est.id = benef.establecimiento_id', \r\n array('est_nombre' => 'nombre')\r\n );\r\n \r\n if(!empty($this->_publicado)):\r\n $sql->where('benef.publicado = ?', $this->getPublicado());\r\n endif;\r\n \r\n if (!empty($this->_fechaPublicacion)) {\r\n $sql->where($this->getFecha_publicacion().\r\n ' BETWEEN benefv.fecha_inicio_publicacion AND benefv.fecha_fin_publicacion');\r\n }\r\n if (!empty($this->_id)) {\r\n $sql->where('benef.id = ?', $this->getId());\r\n //$rs = $db->fetchRow($sql);\r\n } else {\r\n //$rs = $db->fetchAll($sql);\r\n }\r\n $sql->order('benefv.fecha_inicio_publicacion DESC');\r\n //echo $sql->assemble(); exit;\r\n $rs = $db->fetchRow($sql);\r\n return $rs;\r\n }", "public function pagina(){\n return $this->hasMany('App\\Models\\Pregunta','fk_pagina');\n }", "public function select($tipo_proyecto);", "public function preguntas(){\n return $this->belongsToMany('ChecklistSilfa\\Entities\\Pregunta', 'preguntas_formulario', 'formulario_id', 'pregunta_id')->where('preguntas.estado','=','1');\n }", "public function searchListaDeposito()\r\n\t\t{\r\n\t\t\t$query = Deposito::find();\r\n\r\n\t\t\t$dataProvider = New ActiveDataProvider([\r\n\t\t\t\t\t\t\t\t\t'query' => $query,\r\n\t\t\t\t]);\r\n\r\n\t\t\t$query->where('id_contribuyente =:id_contribuyente',\r\n\t\t\t\t\t\t\t\t\t[':id_contribuyente' => $this->id_contribuyente])\r\n\t\t\t\t ->andWhere('R.estatus =:estatus',\r\n\t\t\t\t \t\t\t\t\t[':estatus' => $this->estatus]);\r\n\r\n\t\t\t$query->alias('R')\r\n\t\t\t\t ->joinWith('condicion', true, 'INNER JOIN');\r\n\r\n\t\t\treturn $dataProvider;\r\n\r\n\t\t}", "public function filterByIdTipotripa($idTipotripa = null, $comparison = null)\n\t{\n\t\tif (is_array($idTipotripa)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idTipotripa['min'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $idTipotripa['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idTipotripa['max'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $idTipotripa['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $idTipotripa, $comparison);\n\t}", "public function filterByUser(int $id);", "public function filterByHasMany($query, HasMany $relationship, array $ids): void;", "function find( $relationName, Filter $filter_1 );", "public function buscar($tipo)\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ingresoEgreso',$tipo);\n\n\t\treturn self::model()->findAll($criteria\n\t\t);\n\t}", "public function filtrar(&$filtro) {\n parent::filtrar($filtro);\n $filtro_sql = '';\n if ($filtro->filtro('id'))\n $filtro_sql .= \" AND {$this->getTableName()}.id like '%{$filtro->filtro('id')}%' \";\n if ($filtro->filtro('nombre'))\n $filtro_sql .= \" AND {$this->getTableName()}.nombre like '%{$filtro->filtro('nombre')}%' \";\n if ($filtro->filtro('descripcion'))\n $filtro_sql .= \" AND {$this->getTableName()}.descripcion like '%{$filtro->filtro('descripcion')}%' \";\n return $filtro_sql;\n }", "public function filter(){\n\t\t\t$this->filtroSQL = \"SELECT art.*, cat.categoria, fam.familia, sfam.subfamilia, autor\n\t\t\t\t,date_format(art.fmodificacion,'%d-%m-%Y %H:%i:%s') ffmodificacion\n\t\t\t\t,format(art.precio,2,'de_DE') fprecio\n\t\t\t\t,format(art.oferta,2,'de_DE') foferta\n\t\t\t\t,(select nombre from os_administradores adm where adm.id=art.id_administrador) gestor\n\t\t\t\t,(CASE art.estado WHEN 'ON' THEN 'Online' WHEN 'OFF' THEN 'Offline' ELSE 'Elimado/a' END) festado\t\t\t\t\n\t\t\t\tFROM articulos art\n\t\t\t\tLEFT JOIN subfamilias sfam ON art.id_subfamilia=sfam.id\n\t\t\t\tLEFT JOIN familias fam ON sfam.id_familia=fam.id\n\t\t\t\tLEFT JOIN categorias cat ON fam.id_categoria=cat.id\n\t\t\t\tLEFT JOIN autores aut ON art.id_autor=aut.id\n\t\t\t\tWHERE art.estado IN ('ON','OFF')\";\n\t\t\t\t\t\t\n\t\t\tif ( $_REQUEST['_articulo'] )\n\t\t\t\t$this->filtroSQL .= \" AND art.articulo LIKE '%$this->filtro_articulo%'\";\n\t\t\tif ( $_REQUEST['_categoria'] )\n\t\t\t\t$this->filtroSQL .= \" AND categoria LIKE '%$this->filtro_categoria%'\";\n\t\t\tif ( $_REQUEST['_familia'] )\n\t\t\t\t$this->filtroSQL .= \" AND familia LIKE '%$this->filtro_familia%'\";\n\t\t\tif ( $_REQUEST['_subfamilia'] )\n\t\t\t\t$this->filtroSQL .= \" AND subfamilia LIKE '%$this->filtro_subfamilia%'\";\n\t\t\tif ( $_REQUEST['_autor'] )\n\t\t\t\t$this->filtroSQL .= \" AND autor LIKE '%$this->filtro_autor%'\";\n\t\t\t\n\t\t\tif ( $this->filtro_campo )\n\t\t\t\t$this->filtroSQL .=\" ORDER BY $this->filtro_campo\".($this->filtro_orden==\"up\"?\"\":\" desc\");\n\t\t}", "private function getModelGeneralVehiculo()\r\n\t\t{\r\n\t\t\t$findModelVehiculo = null;\r\n\t\t\t$findModel = self::getModelGeneral();\r\n\t\t\tif ( count($findModel) > 0 ) {\r\n\t\t\t\t$findModelVehiculo = $findModel->andWhere('D.impuesto =:impuesto',[':impuesto' => 3]);\r\n\t\t\t}\r\n\t\t\treturn $findModelVehiculo;\r\n\t\t}", "function findOne( $relationName, Filter $filter_1 );", "public function admin_imprimir( $filtro = '' ){\n \t// verificar permisos\n \tif( $this->checkPermissions( 'administracion', 'imprimir' ) === FALSE && $this->checkPermissions( 'reporte', 'usuarios' ) === FALSE ):\n \t\t$this->iraBuscar('alert-danger','<strong>Acceso denegado: </strong> usted no ha sido autorizado a acceder a esta secci&oacute;n.');\n \tendif;\n\t\t\t\n\t\t\t$this->set('personas',$this->Persona->find('all',array(\n\t\t\t\t'fields' => array('Persona.*','Usuario.*'),\n\t\t\t\t'conditions' => array('OR' => array('Persona.primer_nombre LIKE'=>\"{$filtro}%\",'Persona.primer_apellido LIKE'=>\"{$filtro}%\",'Persona.correo_electronico LIKE'=>\"{$filtro}%\",'Usuario.usuario LIKE'=>\"{$filtro}%\")),\n\t\t\t\t'joins' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'alias' => 'Usuario',\n\t\t\t\t\t\t'table' => 'usuarios',\n\t\t\t\t\t\t'type' => 'INNER',\n\t\t\t\t\t\t'conditions' => 'Persona.id = Usuario.persona_id'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'sort' => array('Persona.primer_nombre ASC','Persona.primer_apellido ASC')\n\t\t\t)));\n $this->layout = 'impresion';\n }", "public function getObjetivoEspecificos()\n {\n return $this->hasMany(ObjetivoEspecifico::className(), ['id_pext' => 'id_pext']);\n }", "private function getModelGeneralActividadEconomica()\r\n\t\t{\r\n\t\t\t$findModelAct = null;\r\n\t\t\t$findModel = self::getModelGeneral();\r\n\t\t\tif ( count($findModel) > 0 ) {\r\n\t\t\t\t$findModelAct = $findModel->andWhere('D.impuesto =:impuesto',[':impuesto' => 1])\r\n\t\t\t\t\t\t\t\t\t ->andWhere('P.id_contribuyente =:id_contribuyente',\r\n\t\t\t\t\t\t\t\t\t \t\t\t[':id_contribuyente' => $this->_id_contribuyente]);\r\n\t\t\t}\r\n\t\t\treturn $findModelAct;\r\n\t\t}", "public function getImpuesto()\n {\n return $this->hasOne(Impuestos::className(), ['Id' => 'impuesto_id']);\n }", "public function precios() {\n return $this->belongsToMany('Tipo_Precio', 'producto_precio', 'producto_id', 'tipo_precio_id');\n }", "public static function getTblproductoByFiltrosAll($idtblcolonia,$idtbltipodeservicio,$fechapedido,$hora,$idtblcategproduct,$idtblclasifproduct){\n \n $activado=1;\n \n $fechapedidoingresada = new DateTime($fechapedido);\n $fechahoy = new DateTime(\"now\");\n $interval= $fechahoy->diff($fechapedidoingresada);\n $diasMinimos= $interval->format('%d');\n \n $diasemana= $fechapedidoingresada->format('l');\n \n $tipopedidoCompleto=3;\n $tipodeservicioCompleto=3;\n \n \n if($fechapedidoingresada == $fechahoy){ \n $tipodepedido= 1; //pedidoparahoy\n $stock=1;\n }else{\n $tipodepedido= 2; //pedidoparaotrodia\n $stock=0;\n }\n \n \n if($idtbltipodeservicio==1){ //Entrega en Pasteleria\n \n $consulta = \"SELECT TPR.*,TP.*,TPI.*, TPRD.* FROM tblproducto TPR\n\t\t INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n\t\t INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n\t\t INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n\t\t INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n\t\t INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n\t\t INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n\t\t INNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n\t\t INNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n\t\t INNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n\t\t INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n\t\t WHERE TP.tblproveedor_activado = ?\n\t\t \tAND (TP.tbltiposervicio_idtbltiposervicio = ? OR TP.tbltiposervicio_idtbltiposervicio = ? ) \n\t\t\t AND TP.tblcolonia_idtblcolonia = ?\n\t\t\t AND TPR.tblproducto_activado = ?\n\t\t\t AND TCLP.tblclasifproduct_activado = ?\n\t\t\t AND TPR.tblcategproduct_idtblcategproduct = ?\n\t\t\t AND TPR.tblclasifproduct_idtblclasifproduct= ?\n\t\t\t AND TPRD.tblproductdetalle_activado = ?\n\t\t\t AND TPRD.tblproductdetalle_stock >= ?\n\t\t\t AND TPRD.tblproductdetalle_diaselaboracion <= ?\n\t\t\t AND TDS.tbldiasemana_dia = ?\n\t\t\t AND CAST(? AS TIME ) BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n\t\t\t GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$idtbltipodeservicio,PDO::PARAM_INT);\n $resultado->bindParam(3,$tipodeservicioCompleto,PDO::PARAM_INT);\n $resultado->bindParam(4,$idtblcolonia,PDO::PARAM_INT);\n $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(8,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(9,$activado,PDO::PARAM_INT);\n $resultado->bindParam(10,$stock,PDO::PARAM_INT);\n $resultado->bindParam(11,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(12,$diasemana,PDO::PARAM_STR);\n $resultado->bindParam(13,$hora,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }else{//Entrega en Domicilio\n \n \n $consulta=\"SELECT TPR.*, TP.* ,TPI.*,TPRD.* FROM tblproducto TPR\n\t INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n\t INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n\t INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n\t INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n\t INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n\t WHERE TP.tblproveedor_activado = ? \n AND TPR.tblproducto_activado = ?\n AND TCLP.tblclasifproduct_activado = ?\n AND TPR.tblcategproduct_idtblcategproduct = ?\n AND TPR.tblclasifproduct_idtblclasifproduct= ?\n AND TPRD.tblproductdetalle_activado = ?\n AND TPRD.tblproductdetalle_stock >= ?\n AND TPRD.tblproductdetalle_diaselaboracion <= ?\n AND TDS.tbldiasemana_dia = ?\n GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$activado,PDO::PARAM_INT);\n $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n $resultado->bindParam(4,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(5,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$stock,PDO::PARAM_INT);\n $resultado->bindParam(8,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(9,$diasemana,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }\n \n }", "public function prune($impresion = null)\n\t{\n\t\tif ($impresion) {\n\t\t\t$this->addUsingAlias(ImpresionPeer::ID, $impresion->getId(), Criteria::NOT_EQUAL);\n\t }\n\t \n\t\treturn $this;\n\t}", "public function perfis()\n {\n return $this->belongsToMany(Perfil::class);\n }" ]
[ "0.54378134", "0.5373625", "0.53113127", "0.52820116", "0.5229512", "0.5211378", "0.520739", "0.5205728", "0.51850915", "0.5111583", "0.51026356", "0.5095927", "0.50949144", "0.5041111", "0.50357056", "0.5028131", "0.5013891", "0.5012487", "0.49791658", "0.49670705", "0.4962473", "0.4961722", "0.49564892", "0.49511775", "0.49500254", "0.4949724", "0.49451342", "0.49306282", "0.49251083", "0.49214792" ]
0.6046834
0
Adds a JOIN clause to the query using the Tipoimpresion relation
public function joinTipoimpresion($relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Tipoimpresion'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'Tipoimpresion'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array());", "public function join($type, $table, $on)\n {\n $this->join .= ' ' . $type . ' JOIN ' . $table . ' ON ' . $on;\n }", "protected function join($joinTable,$connection,$type=\"inner\"){\n\t\tforeach($connection as $col=>$val){\n\t\t\t$cond = \"$this->table.$col = $joinTable.$val\";\n\t\t}\n\t\tif(!$this->sql_join){\n\t\t\t$this->sql_join =\" $type JOIN $joinTable ON $cond\";\n\t\t}else{\n\t\t\t$this->sql_join .=\" $type JOIN $joinTable ON $cond\";\n\t\t}\n\t\treturn $this;\n\t}", "public function join($table, $condicion, $type=\"\")\n\t\t{\n\t\t\t////JOIN comentarios ON comentarios.id = blogs.id\n\t\t\tif(is_string($table) and is_string($condicion) and is_string($type)){\n\t\t\t\t$this->join .= addslashes($type).' JOIN '.addslashes($table).' ON '.addslashes($condicion);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshowErrors('2AS', 'Type value icorrecto in the parameter');\n\t\t\t}\n\t\t}", "function addJoin($table, $on, $type) {\n\t\t$this->_joinCount++;\n\t\tarray_push($this->_joinOrder, array(\n\t\t\t'table' => $table,\n\t\t\t'on' \t=> $on,\n\t\t\t'type' \t=> $type\n\t\t));\n\t}", "public function joinImpresion($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Impresion');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Impresion');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function join($association, $on = '', $type = null)\n {\n }", "public function useTipoimpresionQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinTipoimpresion($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Tipoimpresion', 'TipoimpresionQuery');\n\t}", "function &join($table, $cond = false, $type = '')\n\t{\n\t\t$this->q_cached = false;\n\t\t\n\t\tif($cond == false)\n\t\t{\n\t\t\t$obj = new IgnitedQuery();\n\t\t\t$obj->q_parent =& $this;\n\t\t\t$obj->q_only_where = true;\n\t\t\t\n\t\t\t$this->q_join[$table] = array('type' => $type, 'cond' => &$obj);\n\t\t\treturn $obj;\n\t\t}\n\t\telseif(is_a($cond,'IgnitedQuery'))\n\t\t{\n\t\t\t$cond->q_only_where = true;\n\t\t\t\n\t\t\t$this->q_join[$table] = array('type' => $type, 'cond' => &$cond);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->q_join[$table] = array('type' => $type, 'cond' => $cond);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function join($clause);", "private function join($type, $table, $on)\n {\n $sql = clone $this;\n $sql->setJoin($table, $type, $on);\n\n return $sql;\n }", "abstract function appendJoin(AbstractQuery &$query, $sourceAlias, $targetAlias, $left_join = false);", "protected function addJoin($onTable, $secondColumn, $firstColumn, $type)\n {\n // If the 2nd parameter is empty whe assume that the column name is referencing the table with the _id convention.\n if (! isset($secondColumn)) {\n $secondColumn = $this->table . \"_id\";\n }\n\n $this->joins[] = trim(sprintf(\"%s JOIN %s ON %s.%s = %s.%s\", $type, $onTable, $this->table, $firstColumn, $onTable, $secondColumn));\n }", "public function join($table, $type = '') {\n\t\t\tif(!isset($this->baseQueryType) || $this->baseQueryType == '')\n\t\t\t\treturn false;\n\n\t\t\t$this->join = true;\n\n\t\t\tif($type == '')\n\t\t\t\t$this->query .= ' INNER JOIN';\n\n\t\t\t$this->query .= ' ' . $table;\n\n\t\t\treturn $this;\n\t\t}", "public function join($table, $cond, $type = '')\n\t{\n\t\tif ($type != '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( !in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t/* If a DB prefix is used we might need to add it to the column names */\n\t\tif ($this->dbprefix)\n\t\t{\n\t\t\t$this->_track_aliases($table);\n/* When prefix is part of field name, it produces error, for eample: g_ */\n#$this->oDb->join( 'st.tag_crc32u = mts.tag_crc32u' );\n\t\t\t// First we remove any existing prefixes in the condition to avoid duplicates\n\t\t\t#$cond = preg_replace('|('.$this->dbprefix.')([\\w\\.]+)([\\W\\s]+)|', \"$2$3\", $cond);\n\n\t\t\t// Next we add the prefixes to the condition\n\t\t\t#$cond = preg_replace('|([\\w\\.]+)([\\W\\s]+)(.+)|', $this->dbprefix . \"$1$2\" . $this->dbprefix . \"$3\", $cond);\n\t\t}\n\n\t\t$join = $type.'JOIN '.$this->_protect_identifiers($this->dbprefix.$table, TRUE).' ON '.$cond;\n\n\t\t$this->ar_join[] = $join;\n\n\t\treturn $this;\n\t}", "public function join($table, $alias = NULL, $condition = NULL, $arguments = array());", "protected function myJoinTable($query, $table, $one, $operator, $two, $type = 'inner', $where = false)\n {\n // obtém os joins da query\n $joins = $query->getQuery()->joins;\n if ($joins) {\n // para cada join\n // verifica se a tabela já está no relacionamento\n foreach ($joins as $join) {\n if ($join->table == $table) {\n return $query;\n }\n }\n }\n // efetua o join na query\n return $query->join($table, $one, $operator, $two, $type, $where);\n }", "public function join($table, $cond, $type = '')\n {\n if ($type != '')\n {\n $type = strtoupper(trim($type));\n $type = (!in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER')))? '':$type.' ' ;\n }\n\n $join = $type.'JOIN '.$this->_protect_identifiers($table).' ON '.$this->_protect_identifiers($cond);\n $this->ar_join[] = $join;\n\n return $this;\n }", "public function joinTipocaratula($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Tipocaratula');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Tipocaratula');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function joinParroquia($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Parroquia');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Parroquia');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function joinNotificacion($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Notificacion');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Notificacion');\n }\n\n return $this;\n }", "public function join($join_with, $join_on) {\n\n\t}", "public function getJoinOn()\n {\n return $this->joinOn;\n }", "public function join(string $table, string $first = null, string $operator = '=', string $second = null, string $type = 'INNER'): self\n {\n }", "public function joinAssegnamentiPostazione($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('AssegnamentiPostazione');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'AssegnamentiPostazione');\n }\n\n return $this;\n }", "public function joinOuterUsing(string $joinType, string $tableName, string $criteria): static;", "public function joinTbaluno($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Tbaluno');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Tbaluno');\n }\n\n return $this;\n }", "abstract function appendContextJoin(AbstractQuery &$query, $mainAlias, $contextAlias);", "public function joinPromociondetalle($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Promociondetalle');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Promociondetalle');\n }\n\n return $this;\n }", "public function joinPessoa($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Pessoa');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Pessoa');\n }\n\n return $this;\n }" ]
[ "0.6282923", "0.62218684", "0.6107877", "0.6089673", "0.6024786", "0.60223025", "0.60090053", "0.5991784", "0.5962511", "0.5910458", "0.582967", "0.5819908", "0.58156157", "0.57960224", "0.5777474", "0.57743376", "0.5768051", "0.5762859", "0.5756841", "0.5744526", "0.5727589", "0.5719688", "0.5713664", "0.57037014", "0.56997347", "0.5674138", "0.56683594", "0.5662256", "0.56446016", "0.5639119" ]
0.668714
0
Use the Tipoimpresion relation Tipoimpresion object
public function useTipoimpresionQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this ->joinTipoimpresion($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'Tipoimpresion', 'TipoimpresionQuery'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImpuesto()\n {\n return $this->hasOne(Impuestos::className(), ['Id' => 'impuesto_id']);\n }", "public function getTipo0()\n {\n return $this->hasOne(Tipos::className(), ['id' => 'tipo']);\n }", "public function impPotencial()\n {\n return $this->belongsTo('App\\Models\\ImpPotencial','imp_potencial_id','id');\n }", "public function impReal()\n {\n return $this->belongsTo('App\\Models\\ImpReal','imp_real_id','id');\n }", "public function genero()\n {\n return $this->belongsTo('Genero');\n }", "public function tipoOrigen()\n {\n return $this->belongsTo('crmcomercial\\Entities\\TipoOrigen', 'pro_tiporig');\n }", "public function tipoTarea() {\n return $this->belongsTo('App\\TiposProyecto','tipo_proyecto_id');\n }", "public function responsabile()\n {\n return $this->belongsTo(Personale::class,'id_ab_resp','id_ab');\n }", "public function relOperasi()\n {\n return $this->belongsTo('Operasi', 'id_operasi');\n }", "public function tipobollo()\n {\n return $this->belongsTo('App\\TipoBollo','tipobolli_codice','codice');\n }", "public function prodi(){\n return $this->belongsTo('App\\Prodi');\n }", "public function intensidadImpacto()\n {\n return $this->belongsTo('App\\Models\\IntensidadImpacto','intensidad_impacto_id','id');\n }", "public function tpostion()\n {\n return $this->belongsTo(Tpostion::class);\n }", "public function piloto() {\n return $this->belongsTo('App\\Piloto');\n }", "public function perfis()\n {\n return $this->belongsToMany(Perfil::class);\n }", "public function tipo(): BelongsTo\n {\n return $this->belongsTo(TipoModel::class, 'tipo_id', 'id');\n }", "public function model()\n {\n return ProfessorTipo::class;\n }", "public function filterByTipoimpresion($tipoimpresion, $comparison = null)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(ImpresionPeer::ID_TIPOIMPRESION, $tipoimpresion->getId(), $comparison);\n\t}", "public function GetIdTipo()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"fk_tipo_dispositivo\");\n\t}", "public function natureprojet()\n {\n $this->hasMany('App\\Model\\Natureprojet', 'TPJ_NUM', 'TPJ_NUM');\n }", "public function lnImpacto()\n {\n return $this->belongsTo('App\\Models\\LnImpacto','reg_impacto_id','id');\n }", "public function getFkPatrimonioTipoNatureza()\n {\n return $this->fkPatrimonioTipoNatureza;\n }", "public function tipodeproducto()\n\t{\n\t\treturn $this->belongsTo(TiposDeProductos::class, 'id_tipo_producto', 'id_tipo');\n\t}", "public function entity()\n {\n return Prova::class;\n }", "public function pagina(){\n return $this->hasMany('App\\Models\\Pregunta','fk_pagina');\n }", "public function model()\n {\n return TipoExigencia::class;\n }", "public function produto()\n {\n return $this->BelongsTo('App\\Models\\produtos');\n }", "public function etiquetas(){\n\t\treturn $this->belongsToMany('App\\Etiqueta');\n\t}", "public function matenimientoTipoContrato(){\n $query = \"call sp_maeTipoContratoMantenimiento(:flag,:idTipoContrato,:contrato,:contenido,:activo,:usuario);\";\n $parms = array(\n ':flag' => $this->_flag,\n ':idTipoContrato' => $this->_idTipoContrato,\n ':contrato' => $this->_contrato,\n ':contenido' => $this->_contenido,\n ':activo' => (!empty($this->_activo))?$this->_activo:'I',\n ':usuario' => $this->_usuario\n );\n $data = $this->queryOne($query,$parms);\n return $data;\n }", "public function getTipo(){\n return $this->tipo;\n }" ]
[ "0.6311264", "0.5831701", "0.57679963", "0.5712776", "0.5545974", "0.55448246", "0.55122954", "0.5463949", "0.5445576", "0.543734", "0.54299146", "0.54155403", "0.54019326", "0.5375299", "0.5370171", "0.5334978", "0.5320524", "0.53170455", "0.530595", "0.5296394", "0.5281306", "0.52424884", "0.524215", "0.5238756", "0.523468", "0.5234201", "0.5205862", "0.5204337", "0.51933616", "0.51884" ]
0.5949623
1
Filter the query by a related Tipoencuadernacion object
public function filterByTipoencuadernacion($tipoencuadernacion, $comparison = null) { return $this ->addUsingAlias(ImpresionPeer::ID_TIPOENCUADERNACION, $tipoencuadernacion->getId(), $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filter(){\n\t\t\t$this->filtroSQL = \"SELECT art.*, cat.categoria, fam.familia, sfam.subfamilia, autor\n\t\t\t\t,date_format(art.fmodificacion,'%d-%m-%Y %H:%i:%s') ffmodificacion\n\t\t\t\t,format(art.precio,2,'de_DE') fprecio\n\t\t\t\t,format(art.oferta,2,'de_DE') foferta\n\t\t\t\t,(select nombre from os_administradores adm where adm.id=art.id_administrador) gestor\n\t\t\t\t,(CASE art.estado WHEN 'ON' THEN 'Online' WHEN 'OFF' THEN 'Offline' ELSE 'Elimado/a' END) festado\t\t\t\t\n\t\t\t\tFROM articulos art\n\t\t\t\tLEFT JOIN subfamilias sfam ON art.id_subfamilia=sfam.id\n\t\t\t\tLEFT JOIN familias fam ON sfam.id_familia=fam.id\n\t\t\t\tLEFT JOIN categorias cat ON fam.id_categoria=cat.id\n\t\t\t\tLEFT JOIN autores aut ON art.id_autor=aut.id\n\t\t\t\tWHERE art.estado IN ('ON','OFF')\";\n\t\t\t\t\t\t\n\t\t\tif ( $_REQUEST['_articulo'] )\n\t\t\t\t$this->filtroSQL .= \" AND art.articulo LIKE '%$this->filtro_articulo%'\";\n\t\t\tif ( $_REQUEST['_categoria'] )\n\t\t\t\t$this->filtroSQL .= \" AND categoria LIKE '%$this->filtro_categoria%'\";\n\t\t\tif ( $_REQUEST['_familia'] )\n\t\t\t\t$this->filtroSQL .= \" AND familia LIKE '%$this->filtro_familia%'\";\n\t\t\tif ( $_REQUEST['_subfamilia'] )\n\t\t\t\t$this->filtroSQL .= \" AND subfamilia LIKE '%$this->filtro_subfamilia%'\";\n\t\t\tif ( $_REQUEST['_autor'] )\n\t\t\t\t$this->filtroSQL .= \" AND autor LIKE '%$this->filtro_autor%'\";\n\t\t\t\n\t\t\tif ( $this->filtro_campo )\n\t\t\t\t$this->filtroSQL .=\" ORDER BY $this->filtro_campo\".($this->filtro_orden==\"up\"?\"\":\" desc\");\n\t\t}", "public function filterByIdTipoencuadernacion($idTipoencuadernacion = null, $comparison = null)\n\t{\n\t\tif (is_array($idTipoencuadernacion)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idTipoencuadernacion['min'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOENCUADERNACION, $idTipoencuadernacion['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idTipoencuadernacion['max'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOENCUADERNACION, $idTipoencuadernacion['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ImpresionPeer::ID_TIPOENCUADERNACION, $idTipoencuadernacion, $comparison);\n\t}", "public function relation(Request $request)\n {\n $slug = $this->getSlug($request);\n $page = $request->input('page');\n $on_page = 50;\n $search = $request->input('search', false);\n $dataType = Voyager::model('DataType')->where('slug', '=', $slug)->first();\n\n $method = $request->input('method', 'add');\n\n $model = app($dataType->model_name);\n if ($method != 'add') {\n $model = $model->find($request->input('id'));\n }\n\n $this->authorize($method, $model);\n\n $rows = $dataType->{$method.'Rows'};\n /** @var Carbon $filterBy */\n $filterBy = null;\n foreach ($rows as $key => $row) {\n if ($row->field === $request->input('type')) {\n\n $options = $row->details;\n /**\n * En esta sección, el valor de $model es el valor del Objeto a editar\n * que en este caso es Cfdi y del cual vamos a obtener su relación que\n * es BankTransaction\n */\n if (\n isset($options->filterBy) &&\n isset($options->filterBy->foreign) &&\n isset($options->filterBy->reference) &&\n isset($model->{$options->filterBy->foreign}) // Verificamos que el campo definido en foreign se encuentre en el Cfdi\n ) {\n $filterBy = $model->{$options->filterBy->foreign};\n debug($filterBy->toDateString());\n }\n // Load Model from Relation \"BankTransaction\"\n /** @var Model $model */\n $model = app($options->model);\n\n $skip = $on_page * ($page - 1);\n\n $additional_attributes = $model->additional_attributes ?? [];\n\n // Apply local scope if it is defined in the relationship-options\n if (isset($options->scope) && $options->scope != '' && method_exists($model, 'scope'.ucfirst($options->scope))) {\n $model = $model->{$options->scope}();\n }\n\n // If search query, use LIKE to filter results depending on field label\n if ($search) {\n // If we are using additional_attribute as label\n if (in_array($options->label, $additional_attributes)) {\n debug(\"searching\");\n if(isset($filterBy)) {\n // Vamos a optar ciegamente en que el campo indicado en \"reference\",\n // realmente existe en la relación en este caso \"BankTransfer\"\n $model = $model->whereMonth($options->filterBy->reference, \"=\", $filterBy->month);\n }\n $relationshipOptions = $model->get();\n $relationshipOptions = $relationshipOptions->filter(function ($model) use ($search, $options) {\n //debug($model->{$options->label});\n return stripos($model->{$options->label}, $search) !== false;\n });\n $total_count = $relationshipOptions->count();\n $relationshipOptions = $relationshipOptions->forPage($page, $on_page);\n } else {\n debug('What a fuck? Maybe from server search?');\n if(isset($filterBy)) {\n // Vamos a optar ciegamente en que el campo indicado en \"reference\",\n // realmente existe en la relación en este caso \"BankTransfer\"\n $model = $model->whereMonth($options->filterBy->reference, \"=\", $filterBy->month);\n }\n $total_count = $model->where($options->label, 'LIKE', '%'.$search.'%')->count();\n $relationshipOptions = $model->take($on_page)->skip($skip)\n ->where($options->label, 'LIKE', '%'.$search.'%')\n ->get();\n }\n } else {\n $total_count = $model->count();\n if(isset($filterBy)) {\n // Vamos a optar ciegamente en que el campo indicado en \"reference\",\n // realmente existe en la relación en este caso \"BankTransfer\"\n $model = $model->whereMonth($options->filterBy->reference, \"=\", $filterBy->month);\n }\n $relationshipOptions = $model->take($on_page)->skip($skip)->get();\n debug($relationshipOptions);\n }\n\n $results = [];\n\n if (!$row->required && !$search && $page == 1) {\n $results[] = [\n 'id' => '',\n 'text' => __('voyager::generic.none'),\n ];\n }\n\n // Sort results\n if (!empty($options->sort->field)) {\n if (!empty($options->sort->direction) && strtolower($options->sort->direction) == 'desc') {\n $relationshipOptions = $relationshipOptions->sortByDesc($options->sort->field);\n } else {\n $relationshipOptions = $relationshipOptions->sortBy($options->sort->field);\n }\n }\n\n foreach ($relationshipOptions as $relationshipOption) {\n $results[] = [\n 'id' => $relationshipOption->{$options->key},\n 'text' => $relationshipOption->{$options->label},\n ];\n }\n\n return response()->json([\n 'results' => $results,\n 'pagination' => [\n 'more' => ($total_count > ($skip + $on_page)),\n ],\n ]);\n }\n }\n\n // No result found, return empty array\n return response()->json([], 404);\n }", "public function filtrar(&$filtro) {\n parent::filtrar($filtro);\n $filtro_sql = '';\n if ($filtro->filtro('id'))\n $filtro_sql .= \" AND {$this->getTableName()}.id like '%{$filtro->filtro('id')}%' \";\n if ($filtro->filtro('nombre'))\n $filtro_sql .= \" AND {$this->getTableName()}.nombre like '%{$filtro->filtro('nombre')}%' \";\n if ($filtro->filtro('descripcion'))\n $filtro_sql .= \" AND {$this->getTableName()}.descripcion like '%{$filtro->filtro('descripcion')}%' \";\n return $filtro_sql;\n }", "public function Filter($filter=null){\n $results = $this->where(function($query) use ($filter){\n if($filter){\n $query->where('cliente','LIKE',\"%{$filter}%\" or 'vendedor','LIKE',\"%{$filter}%\" or 'data','LIKE',\"%{$filter}%\")->orderBy(\"%{$filter}%\", 'desc')->get() ;\n }\n });\n return $results;\n }", "public function childQuery(){\n return ImportCargamasivadet::find()->\n where(['cargamasiva_id' =>$this->id]);\n }", "public function buscar($tipo)\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ingresoEgreso',$tipo);\n\n\t\treturn self::model()->findAll($criteria\n\t\t);\n\t}", "function conf__filtro (toba_ei_filtro $filtro){\n if(count($this->s__horarios_libres)>0){\n $this->s__filtro=new Filtro($this->s__horarios_libres);\n return ;\n }\n if(count($this->s__horarios_disponibles)>0){\n $this->s__filtro=new Filtro($this->s__horarios_disponibles);\n return ;\n }\n }", "public function filterByVenta($venta, $comparison = null)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(EdicionPeer::ID, $venta->getIdEdicion(), $comparison);\n\t}", "public function getByFilter($filter)\n {\n $filter = json_decode($filter);\n\n return Empleado::join('cargo', 'empleado.idcargo', '=', 'cargo.idcargo')\n ->select('empleado.nombre', 'empleado.apellido', 'empleado.telefonoprincipal',\n 'empleado.celular', 'empleado.documentoidentidadempleado',\n 'cargo.nombrecargo')\n ->orderBy('empleado.apellido', 'asc')\n ->whereRaw(\n \"empleado.documentoidentidadempleado LIKE '%\" . $filter->text .\n \"%' OR empleado.nombre LIKE '%\" . $filter->text .\n \"%' OR empleado.apellido LIKE '%\" . $filter->text . \"%' \")\n ->get();\n }", "public function getFiltrados($filtroNombre){\r\n\t\treturn R::find('tamano','where nombre like ? order by nombre',['%'.$filtroNombre.'%']);\r\n\t}", "public function tipoOrigen()\n {\n return $this->belongsTo('crmcomercial\\Entities\\TipoOrigen', 'pro_tiporig');\n }", "public function show($anio, $filter=null)\n {\n if($filter!=null){\n $data = modelArrendamientos::where('arr_anio','=',$anio)\n ->where('tipoarrendamiento_id','=',$filter)\n ->get();\n }else {\n $data = modelArrendamientos::where('arr_anio','=',$anio)->get();\n }\n $filter = modelTipoArrendamiento::get();\n // dd($data);\n return view('arrendamientos.show',compact('data','filter','anio'));\n }", "public function searchListaDeposito()\r\n\t\t{\r\n\t\t\t$query = Deposito::find();\r\n\r\n\t\t\t$dataProvider = New ActiveDataProvider([\r\n\t\t\t\t\t\t\t\t\t'query' => $query,\r\n\t\t\t\t]);\r\n\r\n\t\t\t$query->where('id_contribuyente =:id_contribuyente',\r\n\t\t\t\t\t\t\t\t\t[':id_contribuyente' => $this->id_contribuyente])\r\n\t\t\t\t ->andWhere('R.estatus =:estatus',\r\n\t\t\t\t \t\t\t\t\t[':estatus' => $this->estatus]);\r\n\r\n\t\t\t$query->alias('R')\r\n\t\t\t\t ->joinWith('condicion', true, 'INNER JOIN');\r\n\r\n\t\t\treturn $dataProvider;\r\n\r\n\t\t}", "public function filterByVenta($venta, $comparison = null)\n {\n if ($venta instanceof Venta) {\n return $this\n ->addUsingAlias(ClientePeer::IDCLIENTE, $venta->getIdcliente(), $comparison);\n } elseif ($venta instanceof PropelObjectCollection) {\n return $this\n ->useVentaQuery()\n ->filterByPrimaryKeys($venta->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByVenta() only accepts arguments of type Venta or PropelCollection');\n }\n }", "public function tipoContenidos(){\n return $this->hasMany(TipoContenido::class);\n }", "protected function filter()\n {\n $request = $this->getRequest();\n $session = $request->getSession();\n $usuario = $this->getUser();\n $filtroService = $this->get('contadores.servicios.filtro');\n $filterForm = $this->createForm(new TareaFilterType($filtroService));\n $em = $this->getDoctrine()->getManager();\n if($usuario->getRol()->getNombre() == Rol::$contador) {\n $contador = $em->getRepository('ContadoresBundle:Contador')->find($usuario->getEntidadId());\n\n if ($contador) {\n /**\n * @var @queryBuilder \\Doctrine\\ORM\\QueryBuilder\n */\n $queryBuilder = $em->getRepository('ContadoresBundle:Tarea')->createQueryBuilder('e')\n\n ->where('e.contador = ?1')\n ->orWhere('e.usuario = ?2')\n ->andWhere('e.activo = ?3')\n ->setParameter(1, $contador->getId())\n ->setParameter(2, $usuario)\n ->setParameter(3, true);\n }else{\n //TODO: manejo de error\n }\n }elseif($usuario->getRol()->getNombre() == Rol::$cliente) {\n $cliente = $em->getRepository('ContadoresBundle:Cliente')->find($usuario->getEntidadId());\n\n if ($cliente) {\n $queryBuilder = $em->getRepository('ContadoresBundle:Tarea')->createQueryBuilder('e')\n ->where('e.cliente = ?1')\n ->andWhere('e.activo = ?2')\n ->setParameter(1, $cliente->getId())\n ->setParameter(2, true);\n }else{\n //TODO: manejo de error\n }\n }else{\n $queryBuilder = $em->getRepository('ContadoresBundle:Tarea')->createQueryBuilder('e')\n ->andWhere('e.activo = ?1')\n ->setParameter(1, true);\n }\n\n // Reset filter\n if ($request->get('filter_action') == 'reset') {\n $session->remove('TareaControllerFilter');\n }\n\n // Filter action\n if ($request->get('filter_action') == 'filter') {\n // Bind values from the request\n $filterForm->bind($request);\n\n if ($filterForm->isValid()) {\n // Build the query from the given form object\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n // Save filter to session\n $filterData = $filterForm->getData();\n $session->set('TareaControllerFilter', $filterData);\n }\n } else {\n // Get filter from session\n if ($session->has('TareaControllerFilter')) {\n $filterData = $session->get('TareaControllerFilter');\n $filtroService = $this->get('contadores.servicios.filtro');\n $filterForm = $this->createForm(new TareaFilterType($filtroService), $filterData);\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n }\n }\n\n return array($filterForm, $queryBuilder);\n }", "public function filter()\n {\n\n $query = self::find()\n ->select([\n 'ac_tran.id tran_id',\n 'ac_tran.accounting_date',\n 'acc_label' => 'CASE\n `ac_tran`.`debit_rec_acc_id`\n WHEN :account_id\n THEN `c`.`label` \n ELSE `d`.`label` \n END',\n 'ac_tran.code',\n 'ac_tran.notes',\n 'ac_tran.t_datetime',\n 'ac_tran.t_user_id',\n 'ac_tran.ref_table',\n 'ac_tran.ref_id'\n ])\n ->innerJoin(\n 'ac_rec_acc AS d',\n '`ac_tran`.`debit_rec_acc_id` = `d`.`id`'\n )\n ->innerJoin(\n 'ac_rec_acc AS c',\n '`ac_tran`.`credit_rec_acc_id` = `c`.`id`'\n )\n ->where([\n 'ac_tran.period_id' => $this->filterPeriodId,\n 'ac_tran.sys_company_id' => $this->sys_company_id,\n ])\n ->andWhere(\n '(d.account_id = :account_id OR c.account_id = :account_id)',\n [':account_id' => $this->filterAccountId]\n )\n ->andFilterWhere(['ac_tran.code' => $this->filterCode])\n ->orderBy(['ac_tran.t_datetime' => SORT_ASC]);\n\n if ($this->filterWithDim) {\n if ($this->filterDimId) {\n $query\n ->addSelect([\n 'amount' => 'CASE `d`.`account_id`\n WHEN :account_id\n THEN - `ac_tran_dim`.`amt`\n ELSE + `ac_tran_dim`.`amt`\n END',\n 'dim_notes' => '`ac_tran_dim`.`notes`'\n ])\n ->innerJoin(\n 'ac_tran_dim',\n '`ac_tran_dim`.`tran_id` = `ac_tran`.`id`'\n )\n ->andWhere(['ac_tran_dim.dim_id' => $this->filterDimId])\n ->addParams([\n ':account_id' => $this->filterAccountId\n ]);\n } else {\n $query\n ->addSelect([\n 'amount' => '\n CASE `d`.`account_id`\n WHEN :account_id\n THEN - `ac_tran`.`amount`\n ELSE + `ac_tran`.`amount`\n END\n ',\n 'dim_notes' => new Expression('NULL')\n ])\n ->leftJoin(\n 'ac_tran_dim',\n '`ac_tran_dim`.`tran_id` = `ac_tran`.`id`'\n )\n ->andWhere([\n '`ac_tran_dim`.`dim_id`' => $this->filterDimId,\n '`ac_tran_dim`.`id`' => null\n ])\n ->addParams([\n ':account_id' => $this->filterAccountId\n ]);\n }\n } else {\n $query\n ->addSelect([\n 'amount' => '\n CASE `d`.`account_id`\n WHEN :account_id\n THEN - `ac_tran`.`amount`\n ELSE + `ac_tran`.`amount`\n END\n ',\n 'dim_notes' => new Expression('NULL')\n ]);\n }\n $query\n ->addSelect([\n 'username' => '`user`.`username`'\n ])\n ->leftJoin(\n 'user',\n '`user`.`id` = `ac_tran`.`t_user_id`'\n );\n $tran = $query->asArray()->all();\n if ($this->filterAddStartBalance) {\n $balanceRow = new self();\n $balanceRow->amount = AcPeriodBalance::accPeriodBalanceById($this->filterAccountId, $this->filterPeriodId);\n array_unshift($tran, $balanceRow);\n }\n return $tran;\n }", "public function search($queryFilter) {\n $search;\n if($queryFilter->query('term') === null) {\n $search = $this->model->all(); \n } else {\n $searchQuery = trim($queryFilter->query('term'));\n $requestData = ['description'];\n $this->share = $queryFilter->query('term');\n $search = $this->model->with([\n 'share' => function($query){\n $query->select('id', 'share_number'); \n }, \n 'transaction' => function($query){\n $query->select('id', 'description');\n }, \n 'partner' => function($query){\n $query->select('id', 'name', 'last_name');\n },\n 'titular' => function($query){\n $query->select('id', 'name', 'last_name');\n },\n 'currency' => function($query){\n $query->select('id', 'description');\n }\n ])->where(function($q) use($requestData, $searchQuery) {\n foreach ($requestData as $field) {\n $q->orWhere($field, 'like', \"{$searchQuery}%\");\n }\n\n $shares = $this->shareModel->query()->where('share_number','like', '%'.$this->share.'%')->get(); \n if(count($shares)) {\n foreach ($shares as $key => $value) {\n $q->orWhere('share_id', $value->id);\n }\n }\n\n $personData = ['name', 'last_name'];\n $persons = $this->personModel->query()->where(function($q) use($personData, $searchQuery) {\n foreach ($personData as $field) {\n $q->orWhere($field, 'like', \"%{$searchQuery}%\");\n }\n })->get();\n if(count($persons)) {\n foreach ($persons as $key => $value) {\n $q->orWhere('people_id', $value->id);\n }\n }\n if(count($persons)) {\n foreach ($persons as $key => $value) {\n $q->orWhere('id_titular_persona', $value->id);\n }\n }\n\n $transactionTypes = $this->transactionTypeModel->query()->where('description','like', \"%{$searchQuery}%\")->get();\n if(count($transactionTypes)) {\n foreach ($transactionTypes as $key => $value) {\n $q->orWhere('transaction_type_id', $value->id);\n }\n }\n })->orderBy('created', 'DESC')->paginate(8);\n }\n foreach ($search as $key => $value) {\n $search[$key]->number_sale_price = number_format((float)$search[$key]->number_sale_price,2);\n }\n return $search;\n }", "function getAnunciosWithEstadoFilterAndNoParams($estadosFilter, $marcasFilter, $startYearFilter, $endYearFilter, $currentPage, $itemsPerPage, $sortByOption) {\n\n // Define Pagination settings\n $results_per_page = $itemsPerPage;\n $start_from = ($currentPage-1) * $results_per_page;\n $sortedQuery = '';\n $whereClause = '';\n\n // set Where clause \n if($estadosFilter !== '' && $marcasFilter !== '' ) {\n $whereClause = $estadosFilter.\" AND \". $marcasFilter. \" AND vehiculos.year >= {$startYearFilter} AND vehiculos.year <= {$endYearFilter} \" ;\n\n // echo $whereClause;\n }\n else if($estadosFilter === '' && $marcasFilter !== '') {\n $whereClause = $marcasFilter. \" AND vehiculos.year >= {$startYearFilter} AND vehiculos.year <= {$endYearFilter} \" ;\n }\n\n else if($estadosFilter !== '' && $marcasFilter == '') {\n $whereClause = $estadosFilter. \" AND vehiculos.year >= {$startYearFilter} AND vehiculos.year <= {$endYearFilter} \" ;\n }\n else if($estadosFilter == '' && $marcasFilter == '' && $startYearFilter > 0 && $endYearFilter > 0) {\n $whereClause = \"vehiculos.year >= {$startYearFilter} AND vehiculos.year <= {$endYearFilter} \" ;\n\n }\n\n \n\n // Set Query\n \n $query = \" SELECT anuncios.id as 'id_anuncio', \n anuncios.titulo, \n tipo_anuncio.tipo_anuncio,\n anuncios.Descripcion as shortDescription,\n anuncios.imagen_destacada,\n anuncios.precio,\n vehiculos.id,\n vehiculos.year,\n vehiculos.kilometraje,\n vehiculos.equipamento,\n vehiculos.transmision,\n vehiculos.estilo_carroceria,\n anuncios.created_at\n FROM `anuncios` \n INNER JOIN vehiculos \n ON vehiculos.id = anuncios.id_vehiculo\n INNER JOIN tipo_anuncio\n ON tipo_anuncio.id = anuncios.id_tipo_anuncio WHERE \" .$whereClause.\"\n ORDER BY tipo_anuncio.prioridad\";\n \n \n // Sort Options\n switch($sortByOption) {\n case 'tituloAsc' : \n // echo $sortByOption;\n $sortedQuery = $query.\", anuncios.titulo LIMIT {$start_from}, {$results_per_page} \";\n \n break;\n case 'highDate' : \n // echo $sortByOption;\n $sortedQuery = $query.\", anuncios.created_at LIMIT {$start_from}, {$results_per_page} \";\n break;\n\n case 'tituloDesc' : \n // echo $sortByOption;\n $sortedQuery = $query.\", anuncios.created_at DESC LIMIT {$start_from}, {$results_per_page} \";\n break;\n case 'lowPrice' : \n // echo $sortByOption;\n $sortedQuery = $query.\", anuncios.precio ASC LIMIT {$start_from}, {$results_per_page} \"; \n break;\n case 'HighPrice' : \n // echo $sortByOption;\n $sortedQuery = $query.\", anuncios.precio DESC LIMIT {$start_from}, {$results_per_page} \"; \n default : \n $sortedQuery = $query.\", anuncios.titulo LIMIT {$start_from}, {$results_per_page} \";\n \n }\n\n \n \n // echo $sortedQuery;\n\n // prepare query statement\n $stmt = $this->conn->prepare($sortedQuery);\n // // execute query\n $stmt->execute();\n return $stmt;\n\n\n \n }", "public function searchDepositoPlanilla()\r\n\t\t{\r\n\t\t\t$query = DepositoPlanilla::find();\r\n\r\n\t\t\t$dataProvider = New ActiveDataProvider([\r\n\t\t\t\t\t\t\t\t\t'query' => $query,\r\n\t\t\t\t]);\r\n\r\n\t\t\t$query->where('id_contribuyente =:id_contribuyente',\r\n\t\t\t\t\t\t\t\t\t[':id_contribuyente' => $this->id_contribuyente]);\r\n\t\t\tif ( $this->recibo > 0 ) {\r\n\t\t\t\t$query->andWhere('DP.recibo =:recibo',[':recibo' => $this->recibo]);\r\n\t\t\t}\r\n\r\n\t\t\t$query->alias('DP')\r\n\t\t\t\t ->joinWith('deposito R', true, 'INNER JOIN')\r\n\t\t\t\t ->joinWith('condicion C', true, 'INNER JOIN');\r\n\r\n\t\t\treturn $dataProvider;\r\n\r\n\t\t}", "public function finFormasPagamento()\n {\n return $this->belongsTo('Serbinario\\Entities\\FinFormasPagamento','forma_pagamento_id','id');\n }", "public static function getTblproductoByFiltros($idtblcolonia,$idtbltipodeservicio,$fechapedido,$hora,$idtblcategproduct,$idtblclasifproduct,$ingrediente){\n \n $activado=1;\n \n $fechapedidoingresada = new DateTime($fechapedido);\n $fechahoy = new DateTime(\"now\");\n $interval= $fechahoy->diff($fechapedidoingresada);\n $diasMinimos= $interval->format('%d');\n \n $diasemana= $fechapedidoingresada->format('l');\n \n $tipopedidoCompleto=3;\n $tipodeservicioCompleto=3;\n \n \n if($fechapedidoingresada == $fechahoy){ \n $tipodepedido= 1; //pedidoparahoy\n $stock=1;\n }else{\n $tipodepedido= 2; //pedidoparaotrodia\n $stock=0;\n }\n \n \n if($idtbltipodeservicio==1){ //Entrega en Pasteleria\n \n $consulta = \"SELECT TPR.*, TPI.* FROM tblproducto TPR\n INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n INNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n INNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n INNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n WHERE TP.tblproveedor_activado = ? \n AND TP.tblcolonia_idtblcolonia = ?\n AND TPR.tblproducto_activado = ?\n AND TCP.tblcategproduct_activado = ?\n AND TCLP.tblclasifproduct_activado = ?\n AND TPR.tblcategproduct_idtblcategproduct = ?\n AND TPR.tblclasifproduct_idtblclasifproduct= ?\n AND TPRD.tblproductdetalle_activado = ?\n AND TPRD.tblproductdetalle_stock >= ?\n AND TPRD.tblproductdetalle_diaselaboracion <= ?\n AND TPRD.tblespecificingrediente_idtblespecificingrediente = ?\n AND TDS.tbldiasemana_dia = ?\n AND CAST(? AS TIME ) BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$idtblcolonia,PDO::PARAM_INT);\n $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n $resultado->bindParam(4,$activado,PDO::PARAM_INT);\n $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n $resultado->bindParam(6,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(7,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(8,$activado,PDO::PARAM_INT);\n $resultado->bindParam(9,$stock,PDO::PARAM_INT);\n $resultado->bindParam(10,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(11,$ingrediente,PDO::PARAM_INT);\n $resultado->bindParam(12,$diasemana,PDO::PARAM_STR);\n $resultado->bindParam(13,$hora,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n } else{//Entrega en Domicilio\n \n \n $consulta=\"SELECT TPR.*, PRI.* FROM tblproducto TPR\n INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n INNER JOIN tblcoloniaprovservicio TCPS ON TCPS.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tblhrsprovdom THS ON THS.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n INNER JOIN tblhora TH ON TH.idtblhora = THS.tblhora_idtblhora\n INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n WHERE TP.tblproveedor_activado = ? \n AND TCPS.tblcolonia_idtblcolonia=?\n AND TH.tblhora_hora = ?\n AND TPR.tblproducto_activado = ?\n AND TCP.tblcategproduct_activado = ?\n AND TCLP.tblclasifproduct_activado = ?\n AND TPR.tblcategproduct_idtblcategproduct = ?\n AND TPR.tblclasifproduct_idtblclasifproduct= ? \n AND TPRD.tblproductdetalle_activado = ?\n AND TPRD.tblproductdetalle_stock >= ?\n AND TPRD.tblproductdetalle_diaselaboracion <= ?\n AND TPRD.tblespecificingrediente_idtblespecificingrediente = ?\n AND TDS.tbldiasemana_dia = ?\n GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$idtblcolonia,PDO::PARAM_INT);\n $resultado->bindParam(3,$hora,PDO::PARAM_STR);\n $resultado->bindParam(4,$activado,PDO::PARAM_INT);\n $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(8,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(9,$activado,PDO::PARAM_INT);\n $resultado->bindParam(10,$stock,PDO::PARAM_INT);\n $resultado->bindParam(11,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(12,$ingrediente,PDO::PARAM_INT);\n $resultado->bindParam(13,$diasemana,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }\n \n }", "public static function getTblproductoByFiltrosAll($idtblcolonia,$idtbltipodeservicio,$fechapedido,$hora,$idtblcategproduct,$idtblclasifproduct){\n \n $activado=1;\n \n $fechapedidoingresada = new DateTime($fechapedido);\n $fechahoy = new DateTime(\"now\");\n $interval= $fechahoy->diff($fechapedidoingresada);\n $diasMinimos= $interval->format('%d');\n \n $diasemana= $fechapedidoingresada->format('l');\n \n $tipopedidoCompleto=3;\n $tipodeservicioCompleto=3;\n \n \n if($fechapedidoingresada == $fechahoy){ \n $tipodepedido= 1; //pedidoparahoy\n $stock=1;\n }else{\n $tipodepedido= 2; //pedidoparaotrodia\n $stock=0;\n }\n \n \n if($idtbltipodeservicio==1){ //Entrega en Pasteleria\n \n $consulta = \"SELECT TPR.*,TP.*,TPI.*, TPRD.* FROM tblproducto TPR\n\t\t INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n\t\t INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n\t\t INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n\t\t INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n\t\t INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n\t\t INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n\t\t INNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n\t\t INNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n\t\t INNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n\t\t INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n\t\t WHERE TP.tblproveedor_activado = ?\n\t\t \tAND (TP.tbltiposervicio_idtbltiposervicio = ? OR TP.tbltiposervicio_idtbltiposervicio = ? ) \n\t\t\t AND TP.tblcolonia_idtblcolonia = ?\n\t\t\t AND TPR.tblproducto_activado = ?\n\t\t\t AND TCLP.tblclasifproduct_activado = ?\n\t\t\t AND TPR.tblcategproduct_idtblcategproduct = ?\n\t\t\t AND TPR.tblclasifproduct_idtblclasifproduct= ?\n\t\t\t AND TPRD.tblproductdetalle_activado = ?\n\t\t\t AND TPRD.tblproductdetalle_stock >= ?\n\t\t\t AND TPRD.tblproductdetalle_diaselaboracion <= ?\n\t\t\t AND TDS.tbldiasemana_dia = ?\n\t\t\t AND CAST(? AS TIME ) BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n\t\t\t GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$idtbltipodeservicio,PDO::PARAM_INT);\n $resultado->bindParam(3,$tipodeservicioCompleto,PDO::PARAM_INT);\n $resultado->bindParam(4,$idtblcolonia,PDO::PARAM_INT);\n $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(8,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(9,$activado,PDO::PARAM_INT);\n $resultado->bindParam(10,$stock,PDO::PARAM_INT);\n $resultado->bindParam(11,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(12,$diasemana,PDO::PARAM_STR);\n $resultado->bindParam(13,$hora,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }else{//Entrega en Domicilio\n \n \n $consulta=\"SELECT TPR.*, TP.* ,TPI.*,TPRD.* FROM tblproducto TPR\n\t INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n\t INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n\t INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n\t INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n\t INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n\t WHERE TP.tblproveedor_activado = ? \n AND TPR.tblproducto_activado = ?\n AND TCLP.tblclasifproduct_activado = ?\n AND TPR.tblcategproduct_idtblcategproduct = ?\n AND TPR.tblclasifproduct_idtblclasifproduct= ?\n AND TPRD.tblproductdetalle_activado = ?\n AND TPRD.tblproductdetalle_stock >= ?\n AND TPRD.tblproductdetalle_diaselaboracion <= ?\n AND TDS.tbldiasemana_dia = ?\n GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$activado,PDO::PARAM_INT);\n $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n $resultado->bindParam(4,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(5,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$stock,PDO::PARAM_INT);\n $resultado->bindParam(8,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(9,$diasemana,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }\n \n }", "public function getObjetivoEspecificos()\n {\n return $this->hasMany(ObjetivoEspecifico::className(), ['id_pext' => 'id_pext']);\n }", "public function getOnlyBeneficio()\r\n {\r\n $db = $this->getAdapter();\r\n $sql = $db->select()\r\n ->from(array('benef' => $this->_name), array(\"*\",\r\n 'cat_nombre' => new Zend_Db_Expr(\r\n \"(SELECT GROUP_CONCAT(c.nombre ORDER BY c.id ASC SEPARATOR ' - ')\r\n FROM categoria c \r\n INNER JOIN categoria_beneficio cb ON cb.categoria_id = c.id\r\n WHERE cb.beneficio_id=benef.id)\"\r\n ),\r\n 'cat_slug' => new Zend_Db_Expr(\r\n \"(SELECT GROUP_CONCAT(c.slug ORDER BY c.id ASC SEPARATOR '--')\r\n FROM categoria c \r\n INNER JOIN categoria_beneficio cb ON cb.categoria_id = c.id\r\n WHERE cb.beneficio_id=benef.id)\"\r\n ),\r\n ))\r\n ->where('benef.activo = ?', 1);\r\n //->where('benef.sin_stock = ?',0); \r\n //se mostrara los beneficios que no tengan stock, indicado con un estado\r\n /*->where(\r\n 'CURRENT_DATE() BETWEEN benefv.fecha_inicio_vigencia AND benefv.fecha_fin_vigencia'\r\n );*/\r\n\r\n $sql->join(\r\n array('benefv' => 'beneficio_version'), 'benef.id = benefv.beneficio_id', \r\n array('fecha_inicio_vigencia', 'fecha_fin_vigencia', 'stock_actual', 'stock')\r\n )->where('benefv.activo = ?', 1);\r\n\r\n $sql->join(\r\n array('tbenef' => 'tipo_beneficio'), 'tbenef.id = benef.tipo_beneficio_id', \r\n array('abreviado',\"tbenef_id\"=>\"id\",\"tbenef_slug\"=>\"slug\")\r\n );\r\n\r\n $sql->join(\r\n array('catbenef' => 'categoria_beneficio'), 'catbenef.beneficio_id = benef.id ', \r\n array()\r\n );\r\n\r\n// $sql->join(\r\n// array('cat' => 'categoria'), 'cat.id = catbenef.categoria_id ', \r\n// array('cat_nombre' => 'nombre','cat_id' => 'id','cat_slug' => 'slug')\r\n// );\r\n\r\n $sql->join(\r\n array('est' => 'establecimiento'), 'est.id = benef.establecimiento_id', \r\n array('est_nombre' => 'nombre')\r\n );\r\n \r\n if(!empty($this->_publicado)):\r\n $sql->where('benef.publicado = ?', $this->getPublicado());\r\n endif;\r\n \r\n if (!empty($this->_fechaPublicacion)) {\r\n $sql->where($this->getFecha_publicacion().\r\n ' BETWEEN benefv.fecha_inicio_publicacion AND benefv.fecha_fin_publicacion');\r\n }\r\n if (!empty($this->_id)) {\r\n $sql->where('benef.id = ?', $this->getId());\r\n //$rs = $db->fetchRow($sql);\r\n } else {\r\n //$rs = $db->fetchAll($sql);\r\n }\r\n $sql->order('benefv.fecha_inicio_publicacion DESC');\r\n //echo $sql->assemble(); exit;\r\n $rs = $db->fetchRow($sql);\r\n return $rs;\r\n }", "public function consultar_horas_extras_filtro($id){\n\t\t$sql=\"SELECT \n\t\t\t\ta.id as id_horas_extras_enc,\n\t\t\t\ta.id_trabajador,\n\t\t\t\tc.nombres||' '||c.apellidos as nombres,\n\t\t\t\tc.cedula as cedula,\n\t\t\t\tb.cargo,\n\t\t\t\ta.mes,\n\t\t\t\ta.motivo, \n\t\t\t\ta.total, \n\t\t\t\ta.estatus,\n\t\t\t\td.descripcion,\n\t\t\t\ta.id_tipo_hora,\n\t\t\t\te.descripcion,\n\t\t\t\ta.anio,\n\t\t\t\tb.id_unidad_administrativa\n\t\t\t FROM \n\t\t\t\ttbl_horas_extras_enc a\n\t\t\t INNER JOIN\n\t\t\t\ttbl_trabajador b\n\t\t\t ON \n\t\t\t\ta.id_trabajador = b.id\n\t\t\t INNER JOIN\n\t\t\t\ttbl_personas c\n\t\t\t ON \n\t\t\t \tb.id_persona = c.id\n\t\t\t INNER JOIN \n\t\t\t\ttbl_estatus d\n\t\t\t ON\n\t\t\t\td.id=a.estatus\n\t\t\t INNER JOIN\n\t\t\t\ttbl_tipo_hora e\n\t\t\t ON \n\t\t\t\te.id=a.id_tipo_hora\t\n\t\t\t WHERE\n\t\t\t\tc.id_estatus=1\n\t\t\t AND \n\t\t\t \ta.id = '\".$id.\"'\t\n\t\t\t ORDER BY \n\t\t\t \ta.mes DESC, \n\t\t\t \ta.anio,\n\t\t\t \ta.estatus ;\";\n\t\t$this->rs = $this->procesarQuery($sql);\t\n\t\treturn $this->rs;\t\n\t}", "public function filtreBarreRecherche(){\n try {\n $mysqli=$this->connexion();\n $stmt=$mysqli->prepare(\"select * from utilisateurs inner join voyages on utilisateurs.id = voyages.id\");\n $stmt->execute();\n $rs=$stmt->get_result();\n $filtre=$rs->fetch_all(MYSQLI_ASSOC);\n $mysqli->close();\n return $filtre;\n } catch (mysqli_sql_exception $m) {\n throw new DaoException($m->getMessage(), $m->getCode());\n }\n }", "public function findTipoContrato(){\n $query = \"call sp_maeMaestrosConsultas(:flag,:criterio);\";\n \n $parms = array(\n \":flag\" => 16,\n \":criterio\" => $this->_idTipoContrato\n );\n $data = $this->queryOne($query,$parms);\n return $data;\n }", "public function GetByFilter($filters)\n\t{\n\t\t$q\t=\tDoctrine_Query::create()\n\t\t\t\t\t//->select('*, '.$subselect)\n\t\t\t\t\t->select('*')\n ->from('Cobranza c')\n ->innerJoin('c.Cliente cl');\n \n if(isset($filters['CobranzaId']) and is_numeric($filters['CobranzaId']))\n {\n \t$CobranzaId\t=\t$filters['CobranzaId'];\n \t\n $q->andWhere('c.Id = ?', $CobranzaId);\n \n }\n \n\t\t\tif(isset($filters['FechaDesde']) and ($filters['FechaDesde'] != 'Fecha desde'))\n {\n \t$FechaDesde\t=\t$filters['FechaDesde'];\n \tif($FechaDesde != '')\n \t{\n \n $dateHelper = new Classes_DateHelper();\n \n $q->andWhere('c.Fecha >= ?', $dateHelper->fromViewFormat($FechaDesde));\n \t}\n }\n \n \n if(isset($filters['FechaHasta']) and ($filters['FechaHasta'] != 'Fecha hasta'))\n {\n $FechaHasta = $filters['FechaHasta'];\n \n \tif($FechaHasta != '')\n \t{\n \n $dateHelper = new Classes_DateHelper();\n\n $q->andWhere('c.Fecha <= ?', $dateHelper->fromViewFormat($FechaHasta));\n \t}\n }\n \n \n \tif(isset($filters['ClienteId']) and is_numeric($filters['ClienteId']))\n \t{\n \t\t$ClienteId\t=\t$filters['ClienteId'];\n \t\t\n \t\t\t$q->andWhere('c.ClienteId = ?', $ClienteId); \t\t\n \t}\n \t\n \tif(isset($filters['Numero']) and is_numeric($filters['Numero']))\n \t{\n \t\t$Numero\t=\t$filters['Numero'];\n \t\n \t\t$q->andWhere('c.Numero = ?', $Numero);\n \t\t \n \t}\n \t//echo $q->getSqlQuery();\n return $q;\n\t}" ]
[ "0.57239634", "0.5493088", "0.5477086", "0.5469171", "0.5424602", "0.5363672", "0.53568166", "0.53249925", "0.5314889", "0.53065884", "0.5233135", "0.5226777", "0.51868844", "0.51759034", "0.51745325", "0.51538134", "0.51531047", "0.5149649", "0.5149635", "0.51388496", "0.51369125", "0.51311314", "0.5118543", "0.51116544", "0.5096499", "0.5094068", "0.50928015", "0.50921065", "0.5081309", "0.50747323" ]
0.58214134
0
Adds a JOIN clause to the query using the Tipoencuadernacion relation
public function joinTipoencuadernacion($relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Tipoencuadernacion'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'Tipoencuadernacion'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array());", "public function join($clause);", "function join($table, $condition, $direction = '') {\n $this->join[] = $direction . ' JOIN ' . $table . ' ON ' . $condition;\n return $this; \n }", "public function join($table, $condicion, $type=\"\")\n\t\t{\n\t\t\t////JOIN comentarios ON comentarios.id = blogs.id\n\t\t\tif(is_string($table) and is_string($condicion) and is_string($type)){\n\t\t\t\t$this->join .= addslashes($type).' JOIN '.addslashes($table).' ON '.addslashes($condicion);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshowErrors('2AS', 'Type value icorrecto in the parameter');\n\t\t\t}\n\t\t}", "public function join($type, $table, $on)\n {\n $this->join .= ' ' . $type . ' JOIN ' . $table . ' ON ' . $on;\n }", "public function join($table, $cond, $type = '')\n\t{\n\t\tif ($type != '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( !in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t/* If a DB prefix is used we might need to add it to the column names */\n\t\tif ($this->dbprefix)\n\t\t{\n\t\t\t$this->_track_aliases($table);\n/* When prefix is part of field name, it produces error, for eample: g_ */\n#$this->oDb->join( 'st.tag_crc32u = mts.tag_crc32u' );\n\t\t\t// First we remove any existing prefixes in the condition to avoid duplicates\n\t\t\t#$cond = preg_replace('|('.$this->dbprefix.')([\\w\\.]+)([\\W\\s]+)|', \"$2$3\", $cond);\n\n\t\t\t// Next we add the prefixes to the condition\n\t\t\t#$cond = preg_replace('|([\\w\\.]+)([\\W\\s]+)(.+)|', $this->dbprefix . \"$1$2\" . $this->dbprefix . \"$3\", $cond);\n\t\t}\n\n\t\t$join = $type.'JOIN '.$this->_protect_identifiers($this->dbprefix.$table, TRUE).' ON '.$cond;\n\n\t\t$this->ar_join[] = $join;\n\n\t\treturn $this;\n\t}", "function addJoin($table, $on, $type) {\n\t\t$this->_joinCount++;\n\t\tarray_push($this->_joinOrder, array(\n\t\t\t'table' => $table,\n\t\t\t'on' \t=> $on,\n\t\t\t'type' \t=> $type\n\t\t));\n\t}", "public function join($table, $cond, $type = '')\n {\n if ($type != '')\n {\n $type = strtoupper(trim($type));\n $type = (!in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER')))? '':$type.' ' ;\n }\n\n $join = $type.'JOIN '.$this->_protect_identifiers($table).' ON '.$this->_protect_identifiers($cond);\n $this->ar_join[] = $join;\n\n return $this;\n }", "public function joinEdicion($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Edicion');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Edicion');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function join($table, $alias = NULL, $condition = NULL, $arguments = array());", "protected function join($joinTable,$connection,$type=\"inner\"){\n\t\tforeach($connection as $col=>$val){\n\t\t\t$cond = \"$this->table.$col = $joinTable.$val\";\n\t\t}\n\t\tif(!$this->sql_join){\n\t\t\t$this->sql_join =\" $type JOIN $joinTable ON $cond\";\n\t\t}else{\n\t\t\t$this->sql_join .=\" $type JOIN $joinTable ON $cond\";\n\t\t}\n\t\treturn $this;\n\t}", "protected function _buildJoin()\n {\n if (empty ($this->_join))\n return;\n\n foreach ($this->_join as $data) {\n list ($joinType, $joinTable, $joinCondition) = $data;\n\n if (is_object($joinTable))\n $joinStr = $this->_buildPair(\"\", $joinTable);\n else\n $joinStr = $joinTable;\n\n $this->_query .= \" \" . $joinType . \" JOIN \" . $joinStr . \" on \" . $joinCondition;\n\n // Add join and query\n if (!empty($this->_joinAnd) && isset($this->_joinAnd[$joinStr])) {\n foreach ($this->_joinAnd[$joinStr] as $join_and_cond) {\n list ($concat, $varName, $operator, $val) = $join_and_cond;\n $this->_query .= \" \" . $concat . \" \" . $varName;\n $this->conditionToSql($operator, $val);\n }\n }\n }\n }", "public function useTipoencuadernacionQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinTipoencuadernacion($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Tipoencuadernacion', 'TipoencuadernacionQuery');\n\t}", "public function joinPedidomayorista($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Pedidomayorista');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Pedidomayorista');\n }\n\n return $this;\n }", "public function join( $table1, $table2=FALSE, $join_type=FALSE, $foreign_key=FALSE ){\r\n if( !$table2 ){\r\n $table2 = $this->table;\r\n }\r\n \r\n $join = array( 'join_type' => $join_type, 'foreign_key' => $foreign_key );\r\n\r\n $join_arr = array( $table1 => array( $table2 => $join ) );\r\n\r\n $this->join_arr = array_merge( $this->join_arr, $join_arr );\r\n \r\n return $this;\r\n }", "public function InnerJoin($clause);", "public function joinTbestado($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Tbestado');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Tbestado');\n }\n\n return $this;\n }", "public function join($association, $on = '', $type = null)\n {\n }", "public function join($table, $type = '') {\n\t\t\tif(!isset($this->baseQueryType) || $this->baseQueryType == '')\n\t\t\t\treturn false;\n\n\t\t\t$this->join = true;\n\n\t\t\tif($type == '')\n\t\t\t\t$this->query .= ' INNER JOIN';\n\n\t\t\t$this->query .= ' ' . $table;\n\n\t\t\treturn $this;\n\t\t}", "public function joinComentario($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Comentario');\n\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Comentario');\n\t\t}\n\n\t\treturn $this;\n\t}", "public function join($table)\n {\n /**\n * \n * rewrite data table\n */\n if(preg_match('/join/', self::$sql['table']))\n {\n self::$sql['table'] .= self::$sql['condition'].\" join \".$table.\" \";\n }else{\n self::$sql['table'] = self::$sql['table'].\" join \".$table.\" \";\n }\n\n return new self;\n }", "public function join($join_type, $table, $as=null) {\n \n $join = strtoupper($join_type);\n\n $join_type_list = Array('INNER','NATURAL','CROSS','LEFT','RIGHT','LEFT OUTER','RIGHT OUTER','FULL OUTER',null);\n\n if ( !in_array($join, $join_type_list) OR empty($table) ) throw new DatabaseException('Invalid parameters for database join',1019);\n\n if ( is_null($as) ) {\n\n $join_pattern = \" %sJOIN %s\";\n\n if ( is_null($this->join) ) $this->join = sprintf($join_pattern, $join.\" \", $table);\n\n else $this->join .= \" \".sprintf($join_pattern, $join.\" \", $table);\n\n } else {\n\n $join_pattern = \" %sJOIN %s AS %s\";\n\n if ( is_null($this->join) ) $this->join = sprintf($join_pattern, $join.\" \", $table, $as);\n\n else $this->join .= \" \".sprintf($join_pattern, $join.\" \", $table, $as);\n\n }\n \n return $this;\n\n }", "public function add_join($table, $condition){\n $this->query['joins'][count($this->query['joins'])] = array($table, $condition);\n return $this;\n }", "public function joinFactura($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Factura');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Factura');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function joinFeria($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Feria');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Feria');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "abstract function appendJoin(AbstractQuery &$query, $sourceAlias, $targetAlias, $left_join = false);", "public function joinTbaluno($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Tbaluno');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Tbaluno');\n }\n\n return $this;\n }", "function &join($table, $cond = false, $type = '')\n\t{\n\t\t$this->q_cached = false;\n\t\t\n\t\tif($cond == false)\n\t\t{\n\t\t\t$obj = new IgnitedQuery();\n\t\t\t$obj->q_parent =& $this;\n\t\t\t$obj->q_only_where = true;\n\t\t\t\n\t\t\t$this->q_join[$table] = array('type' => $type, 'cond' => &$obj);\n\t\t\treturn $obj;\n\t\t}\n\t\telseif(is_a($cond,'IgnitedQuery'))\n\t\t{\n\t\t\t$cond->q_only_where = true;\n\t\t\t\n\t\t\t$this->q_join[$table] = array('type' => $type, 'cond' => &$cond);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->q_join[$table] = array('type' => $type, 'cond' => $cond);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function join($join_with, $join_on) {\n\n\t}", "public function joinTipocaratula($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Tipocaratula');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Tipocaratula');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}" ]
[ "0.6520899", "0.6309563", "0.62581265", "0.6230454", "0.61824286", "0.61686915", "0.61686116", "0.6135458", "0.6080655", "0.60605115", "0.60032934", "0.5996926", "0.5996567", "0.5968078", "0.5927892", "0.59224594", "0.5916415", "0.59114224", "0.59051", "0.5896591", "0.5890331", "0.5876872", "0.5854233", "0.5854131", "0.58119917", "0.5810439", "0.57773167", "0.5762614", "0.5753213", "0.57373106" ]
0.6634506
0
Filter the query by a related Tipotripa object
public function filterByTipotripa($tipotripa, $comparison = null) { return $this ->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $tipotripa->getId(), $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByIdTipotripa($idTipotripa = null, $comparison = null)\n\t{\n\t\tif (is_array($idTipotripa)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idTipotripa['min'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $idTipotripa['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idTipotripa['max'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $idTipotripa['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $idTipotripa, $comparison);\n\t}", "public function filterByVenta($venta, $comparison = null)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(EdicionPeer::ID, $venta->getIdEdicion(), $comparison);\n\t}", "public function buscar($tipo)\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ingresoEgreso',$tipo);\n\n\t\treturn self::model()->findAll($criteria\n\t\t);\n\t}", "public function filterByVenta($venta, $comparison = null)\n {\n if ($venta instanceof Venta) {\n return $this\n ->addUsingAlias(ClientePeer::IDCLIENTE, $venta->getIdcliente(), $comparison);\n } elseif ($venta instanceof PropelObjectCollection) {\n return $this\n ->useVentaQuery()\n ->filterByPrimaryKeys($venta->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByVenta() only accepts arguments of type Venta or PropelCollection');\n }\n }", "public function filterByVenta($venta, $comparison = null)\n {\n if ($venta instanceof Venta) {\n return $this\n ->addUsingAlias(SucursalPeer::IDSUCURSAL, $venta->getIdsucursal(), $comparison);\n } elseif ($venta instanceof PropelObjectCollection) {\n return $this\n ->useVentaQuery()\n ->filterByPrimaryKeys($venta->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByVenta() only accepts arguments of type Venta or PropelCollection');\n }\n }", "private function oportunidadesFilter($columnas = array(),$rango=array(),$filter=array())\n {\n if (count($rango)>0) {\n return Oportunidad::where($filter[0],$filter[1],$filter[2])->\n whereBetween('created_at',$rango)->get($columnas);\n }\n else{\n return Oportunidad::where($filter[0],$filter[1],$filter[2])->get($columnas);\n }\n }", "static function etapas_tipo_proceso($idTipoProceso){\n return $etapas=Etapa::where('tipo_procesos_id', $idTipoProceso)->orderBy('indice', 'asc')->get();\n }", "public function findTipoContrato(){\n $query = \"call sp_maeMaestrosConsultas(:flag,:criterio);\";\n \n $parms = array(\n \":flag\" => 16,\n \":criterio\" => $this->_idTipoContrato\n );\n $data = $this->queryOne($query,$parms);\n return $data;\n }", "public function pagina(){\n return $this->hasMany('App\\Models\\Pregunta','fk_pagina');\n }", "public function preguntas(){\n return $this->belongsToMany('ChecklistSilfa\\Entities\\Pregunta', 'preguntas_formulario', 'formulario_id', 'pregunta_id')->where('preguntas.estado','=','1');\n }", "public static function tramite($id){ \n return TiposTramites::where('id','=',$id)\n ->get();\n }", "public function filtrar(&$filtro) {\n parent::filtrar($filtro);\n $filtro_sql = '';\n if ($filtro->filtro('id'))\n $filtro_sql .= \" AND {$this->getTableName()}.id like '%{$filtro->filtro('id')}%' \";\n if ($filtro->filtro('nombre'))\n $filtro_sql .= \" AND {$this->getTableName()}.nombre like '%{$filtro->filtro('nombre')}%' \";\n if ($filtro->filtro('descripcion'))\n $filtro_sql .= \" AND {$this->getTableName()}.descripcion like '%{$filtro->filtro('descripcion')}%' \";\n return $filtro_sql;\n }", "public function filterByTbaluno($tbaluno, $comparison = null)\n {\n if ($tbaluno instanceof Tbaluno) {\n return $this\n ->addUsingAlias(TbpaisPeer::ID_PAIS, $tbaluno->getNacionalidade(), $comparison);\n } elseif ($tbaluno instanceof PropelObjectCollection) {\n return $this\n ->useTbalunoQuery()\n ->filterByPrimaryKeys($tbaluno->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByTbaluno() only accepts arguments of type Tbaluno or PropelCollection');\n }\n }", "public static function getTblproductoByFiltrosAll($idtblcolonia,$idtbltipodeservicio,$fechapedido,$hora,$idtblcategproduct,$idtblclasifproduct){\n \n $activado=1;\n \n $fechapedidoingresada = new DateTime($fechapedido);\n $fechahoy = new DateTime(\"now\");\n $interval= $fechahoy->diff($fechapedidoingresada);\n $diasMinimos= $interval->format('%d');\n \n $diasemana= $fechapedidoingresada->format('l');\n \n $tipopedidoCompleto=3;\n $tipodeservicioCompleto=3;\n \n \n if($fechapedidoingresada == $fechahoy){ \n $tipodepedido= 1; //pedidoparahoy\n $stock=1;\n }else{\n $tipodepedido= 2; //pedidoparaotrodia\n $stock=0;\n }\n \n \n if($idtbltipodeservicio==1){ //Entrega en Pasteleria\n \n $consulta = \"SELECT TPR.*,TP.*,TPI.*, TPRD.* FROM tblproducto TPR\n\t\t INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n\t\t INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n\t\t INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n\t\t INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n\t\t INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n\t\t INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n\t\t INNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n\t\t INNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n\t\t INNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n\t\t INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n\t\t WHERE TP.tblproveedor_activado = ?\n\t\t \tAND (TP.tbltiposervicio_idtbltiposervicio = ? OR TP.tbltiposervicio_idtbltiposervicio = ? ) \n\t\t\t AND TP.tblcolonia_idtblcolonia = ?\n\t\t\t AND TPR.tblproducto_activado = ?\n\t\t\t AND TCLP.tblclasifproduct_activado = ?\n\t\t\t AND TPR.tblcategproduct_idtblcategproduct = ?\n\t\t\t AND TPR.tblclasifproduct_idtblclasifproduct= ?\n\t\t\t AND TPRD.tblproductdetalle_activado = ?\n\t\t\t AND TPRD.tblproductdetalle_stock >= ?\n\t\t\t AND TPRD.tblproductdetalle_diaselaboracion <= ?\n\t\t\t AND TDS.tbldiasemana_dia = ?\n\t\t\t AND CAST(? AS TIME ) BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n\t\t\t GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$idtbltipodeservicio,PDO::PARAM_INT);\n $resultado->bindParam(3,$tipodeservicioCompleto,PDO::PARAM_INT);\n $resultado->bindParam(4,$idtblcolonia,PDO::PARAM_INT);\n $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(8,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(9,$activado,PDO::PARAM_INT);\n $resultado->bindParam(10,$stock,PDO::PARAM_INT);\n $resultado->bindParam(11,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(12,$diasemana,PDO::PARAM_STR);\n $resultado->bindParam(13,$hora,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }else{//Entrega en Domicilio\n \n \n $consulta=\"SELECT TPR.*, TP.* ,TPI.*,TPRD.* FROM tblproducto TPR\n\t INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n\t INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n\t INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n\t INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n\t INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n\t INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n\t INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n\t WHERE TP.tblproveedor_activado = ? \n AND TPR.tblproducto_activado = ?\n AND TCLP.tblclasifproduct_activado = ?\n AND TPR.tblcategproduct_idtblcategproduct = ?\n AND TPR.tblclasifproduct_idtblclasifproduct= ?\n AND TPRD.tblproductdetalle_activado = ?\n AND TPRD.tblproductdetalle_stock >= ?\n AND TPRD.tblproductdetalle_diaselaboracion <= ?\n AND TDS.tbldiasemana_dia = ?\n GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$activado,PDO::PARAM_INT);\n $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n $resultado->bindParam(4,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(5,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$stock,PDO::PARAM_INT);\n $resultado->bindParam(8,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(9,$diasemana,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }\n \n }", "public function searchDepositoPlanilla()\r\n\t\t{\r\n\t\t\t$query = DepositoPlanilla::find();\r\n\r\n\t\t\t$dataProvider = New ActiveDataProvider([\r\n\t\t\t\t\t\t\t\t\t'query' => $query,\r\n\t\t\t\t]);\r\n\r\n\t\t\t$query->where('id_contribuyente =:id_contribuyente',\r\n\t\t\t\t\t\t\t\t\t[':id_contribuyente' => $this->id_contribuyente]);\r\n\t\t\tif ( $this->recibo > 0 ) {\r\n\t\t\t\t$query->andWhere('DP.recibo =:recibo',[':recibo' => $this->recibo]);\r\n\t\t\t}\r\n\r\n\t\t\t$query->alias('DP')\r\n\t\t\t\t ->joinWith('deposito R', true, 'INNER JOIN')\r\n\t\t\t\t ->joinWith('condicion C', true, 'INNER JOIN');\r\n\r\n\t\t\treturn $dataProvider;\r\n\r\n\t\t}", "public function Filter($filter=null){\n $results = $this->where(function($query) use ($filter){\n if($filter){\n $query->where('cliente','LIKE',\"%{$filter}%\" or 'vendedor','LIKE',\"%{$filter}%\" or 'data','LIKE',\"%{$filter}%\")->orderBy(\"%{$filter}%\", 'desc')->get() ;\n }\n });\n return $results;\n }", "public function tipoTarea() {\n return $this->belongsTo('App\\TiposProyecto','tipo_proyecto_id');\n }", "public static function buscarProfesores($tipocriterio, $criterio, $idArea)\n {\n \n if($tipocriterio==1) {\n $q = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc(\"\n SELECT DISTINCT prof.idprofesor, p.idpersona, p.nombre, p.apellido, p.nrodoc FROM personas p JOIN\n profesores prof ON p.idpersona = prof.idpersona\n JOIN facultades fac ON prof.idfacultad = fac.idfacultad\n JOIN carreras car ON fac.idfacultad = car.idfacultad\n JOIN areas_carrera ac ON car.idcarrera = ac.idcarrera\n WHERE ac.idarea = \".$idArea.\" AND \n ((p.apellido LIKE '%\".$criterio.\"%') OR (p.nombre LIKE '%\".$criterio.\"%'))\n ORDER BY p.apellido ASC, p.nombre ASC\n \");\n }else{\n $q = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc(\"\n SELECT DISTINCT prof.idprofesor, p.idpersona, p.nombre, p.apellido, p.nrodoc FROM personas p JOIN\n profesores prof ON p.idpersona = prof.idpersona\n JOIN facultades fac ON prof.idfacultad = fac.idfacultad\n JOIN carreras car ON fac.idfacultad = car.idfacultad\n JOIN areas_carrera ac ON car.idcarrera = ac.idcarrera\n WHERE ac.idarea = \".$idArea.\" AND \n (p.nrodoc LIKE '%\".$criterio.\"%')\n ORDER BY p.apellido ASC, p.nombre ASC\n \");\n } \n \n return $q;\n }", "public function select($tipo_proyecto);", "public function getFiltrados($filtroNombre){\r\n\t\treturn R::find('tamano','where nombre like ? order by nombre',['%'.$filtroNombre.'%']);\r\n\t}", "public function get_traspaso_folio(){ \t\t\r\n\t\t\t$sql = \"SELECT * from productos,productos_traspasos where productos.cve=productos_traspasos.cve and folio =\".$_POST['folio'];\r\n\t\t\treturn $this->query($sql);\r\n\t\t}", "public function tipodeproducto()\n\t{\n\t\treturn $this->belongsTo(TiposDeProductos::class, 'id_tipo_producto', 'id_tipo');\n\t}", "public function creadorTiposVenta()\n {\n return $this->hasMany('App\\TipoVenta','created_by');\n }", "public static function getAllTblhorasFiltro($fechapedido,$idtblcolonia){\n\n\t\t$activado=1;\n\t\t$tipodeservicioCompleto=3;\n $tipodepedidoCompleto=3;\n\n $fechahora = $fechapedido;\n\n //se obtiene la fecha/hora actual\n $fchactual = new DateTime(\"now\", new DateTimeZone('America/Mexico_City'));\t\n //se convierte la fecha/hora en tipo objeto\n\t\t$fchpedido = new DateTime($fechahora, new DateTimeZone('America/Mexico_City'));\n\t\t$diasMinimos= $fchactual->diff($fchpedido)->format('%d');//dias\n\t\t//se obtiene el día de la semana \n\t\t$diasemana= $fchpedido->format('l');\n\t\t//echo $diasemana;\n\t\t$horaActual1= $fchactual->add(new DateInterval('PT1H'));\n\t\t$horaActual1= $horaActual1->format('H:i');\n\n\t\t$fchactual = $fchactual->format('Y-m-d');\n\t\t$fchpedido = $fchpedido->format('Y-m-d');\n\n\t\t//echo $horaActual1;\n\t\t//echo $fchactual;\n\t\t//echo $fchpedido;\n\n\t\t//se tomara en cuenta el stock dependiendo de las horas para el pedido\n\t\tif($fchactual==$fchpedido){ \n\t\t\t$tipodepedido = 1;\n $diasMinimos=0;\n $stock=1;\n }else{\n \t$tipodepedido = 2; \n $stock=0;\n }\n\n \n\n\n if($tipodepedido==1){\n\n \t$consulta =\"SELECT THs.* FROM tblhora THs , tblcolonia TCA \n \t\tINNER JOIN tblciudad TCD ON TCD.idtblciudad = TCA.tblciudad_idtblciudad\n \t\tINNER JOIN tblproveedor TPR ON TCA.idtblcolonia = TPR.tblcolonia_idtblcolonia\n \t\tINNER JOIN tblproducto TPO ON TPR.idtblproveedor = TPO.tblproveedor_idtblproveedor\n \t\tINNER JOIN tblproductdetalle TPOD ON TPO.idtblproducto = TPOD.tblproducto_idtblproducto\n \t\tINNER JOIN tbldiaprovservicio TDPS ON TDPS.tblproveedor_idtblproveedor = TPR.idtblproveedor\n \t\tINNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDPS.tbldiasemana_idtbldiasemana\n INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TPR.idtblproveedor\n INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n\t\tINNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n\t\tINNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n\t\tINNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n\t\tWHERE \n\t\t\t\tTCD.tblciudad_activado = ?\n\t\t AND TCA.tblcolonia_activado = ?\n\t\t AND TPR.tblproveedor_activado= ?\n\t\t AND TPO.tblproducto_activado = ?\n\t\t AND TPOD.tblproductdetalle_activado = ?\n\t\t AND TPOD.tblproductdetalle_stock >= ?\n\t\t AND TPOD.tblproductdetalle_diaselaboracion <= ?\n\t\t AND (TPR.tbltipopedido_idtbltipopedido = ? OR TPR.tbltipopedido_idtbltipopedido = ?)\n\t\t AND TDS.tbldiasemana_dia =?\n AND THs.tblhora_hora > CAST( ? AS TIME)\n AND THs.tblhora_hora BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n AND TCA.idtblcolonia = ?\n GROUP BY THs.tblhora_hora ASC\";\n\n try{\n \t$resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n \t$resultado->bindParam(1,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(2,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(3,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(4,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(5,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(6,$stock,PDO::PARAM_INT);\n \t$resultado->bindParam(7,$diasMinimos,PDO::PARAM_INT);\n \t$resultado->bindParam(8,$tipodepedido,PDO::PARAM_INT);\n \t$resultado->bindParam(9,$tipodepedidoCompleto,PDO::PARAM_INT);\n \t$resultado->bindParam(10,$diasemana,PDO::PARAM_STR);\n \t$resultado->bindParam(11,$horaActual1,PDO::PARAM_STR);\n \t$resultado->bindParam(12,$idtblcolonia,PDO::PARAM_INT);\n \t$resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n\n }else{\n\n\n \t$consulta =\"SELECT THs.* FROM tblhora THs , tblcolonia TCA \n \t\tINNER JOIN tblciudad TCD ON TCD.idtblciudad = TCA.tblciudad_idtblciudad\n \t\tINNER JOIN tblproveedor TPR ON TCA.idtblcolonia = TPR.tblcolonia_idtblcolonia\n \t\tINNER JOIN tblproducto TPO ON TPR.idtblproveedor = TPO.tblproveedor_idtblproveedor\n \t\tINNER JOIN tblproductdetalle TPOD ON TPO.idtblproducto = TPOD.tblproducto_idtblproducto\n \t\tINNER JOIN tbldiaprovservicio TDPS ON TDPS.tblproveedor_idtblproveedor = TPR.idtblproveedor\n \t\tINNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDPS.tbldiasemana_idtbldiasemana\n INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TPR.idtblproveedor\n INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n\t\tINNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n\t\tINNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n\t\tINNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n\t\tWHERE \n\t\t\t\tTCD.tblciudad_activado = ?\n\t\t AND TCA.tblcolonia_activado = ?\n\t\t AND TPR.tblproveedor_activado= ?\n\t\t AND TPO.tblproducto_activado = ?\n\t\t AND TPOD.tblproductdetalle_activado = ?\n\t\t AND TPOD.tblproductdetalle_stock >= ?\n\t\t AND TPOD.tblproductdetalle_diaselaboracion <= ?\n\t\t AND (TPR.tbltipopedido_idtbltipopedido = ? OR TPR.tbltipopedido_idtbltipopedido = ?)\n\t\t AND TDS.tbldiasemana_dia =?\n AND THs.tblhora_hora BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n AND TCA.idtblcolonia = ?\n GROUP BY THs.tblhora_hora ASC\";\n\n try{\n \t$resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n \t$resultado->bindParam(1,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(2,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(3,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(4,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(5,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(6,$stock,PDO::PARAM_INT);\n \t$resultado->bindParam(7,$diasMinimos,PDO::PARAM_INT);\n \t$resultado->bindParam(8,$tipodepedido,PDO::PARAM_INT);\n \t$resultado->bindParam(9,$tipodepedidoCompleto,PDO::PARAM_INT);\n \t$resultado->bindParam(10,$diasemana,PDO::PARAM_STR);\n \t$resultado->bindParam(11,$idtblcolonia,PDO::PARAM_INT);\n \t$resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n\n }\n\t}", "function filtro(\n $nomeFornecedor=NULL, \n $tipofornecedor=NULL, \n $dt_inicio=NULL, \n $dt_fim=NULL, \n $dt_venc_ini=NULL, \n $dt_venc_fim=NULL\n ){\n\n $pedido_fornecedores = array();\n $nome = \"%\".$nomeFornecedor.\"%\";\n $tipo = $tipofornecedor;\n $dt_ped_inicio = $dt_inicio;\n $dt_ped_fim = $dt_fim;\n $dt_vencimento_ini = $dt_venc_ini;\n $dt_vencimento_fim = $dt_venc_fim;\n\n $sql = \"SELECT *, \n DATE_ADD(pefo_dt_pedido, INTERVAL for_qtd_dias_pgto DAY) AS dt_venc \n FROM tb_pedido_fornecedor AS PED\n INNER JOIN tb_fornecedor AS FO\n ON PED.pefo_fk_fornecedor = FO.for_pk_id\n INNER JOIN tb_tipo_fornecedor AS TIP\n ON TIP.tifo_pk_id = FO.for_fk_tipo_fornecedor\n WHERE 1=1\";\n\n if(!empty($nome)) $sql .= \" AND FO.for_nome like :nome\";\n if(!empty($tipo)) $sql .= \" AND FO.for_fk_tipo_fornecedor like :tipo\";\n if(!empty($dt_ped_inicio) && !empty($dt_ped_fim)) $sql .= \" AND PED.pefo_dt_pedido between :dt_inicio AND :dt_fim\";\n if(!empty($dt_vencimento_ini) && !empty($dt_vencimento_fim)) $sql .= \" HAVING dt_venc BETWEEN :dt_venc_ini AND :dt_venc_fim ORDER BY dt_venc\";\n\n try{\n //Filtro para nome e tipos junto\n $stmte = $this->pdo->prepare($sql);\n\n if(!empty($nome)) $stmte->bindParam(\":nome\", $nome, PDO::PARAM_STR);\n if(!empty($tipo)) $stmte->bindParam(\":tipo\", $tipo, PDO::PARAM_STR);\n if(!empty($dt_ped_inicio) && !empty($dt_ped_fim)){\n $stmte->bindParam(\":dt_inicio\", $dt_inicio);\n $stmte->bindParam(\":dt_fim\", $dt_fim);\n }\n if(!empty($dt_vencimento_ini) && !empty($dt_vencimento_fim)){\n $stmte->bindParam(\":dt_venc_ini\", $dt_venc_ini);\n $stmte->bindParam(\":dt_venc_fim\", $dt_venc_fim);\n }\n \n if($stmte->execute()){\n if($stmte->rowCount() > 0){\n while($result=$stmte->fetch(PDO::FETCH_OBJ)){\n $pedido_fornecedor = new pedido_fornecedor();\n $pedido_fornecedor->setPkId($result->pefo_pk_id);\n $pedido_fornecedor->setValor($result->pefo_valor);\n $pedido_fornecedor->setFormaPgt($result->pefo_forma_pgt);\n $pedido_fornecedor->setDesc($result->pefo_desc);\n $pedido_fornecedor->setDtPedido($result->pefo_dt_pedido);\n $pedido_fornecedor->setFkFornecedor($result->pefo_fk_fornecedor);\n $pedido_fornecedor->fornecedorNome=$result->for_nome;\n $pedido_fornecedor->tipo_fornecedor=$result->tifo_nome;\n $pedido_fornecedor->dtVencimento=$result->for_qtd_dias_pgto;\n array_push($pedido_fornecedores, $pedido_fornecedor);\n }\n \n }\n else{\n return -1;\n }\n }\n \n return $pedido_fornecedores;\n \n }\n catch(PDOException $e){\n echo $e->getMessage();\n return -1;\n }\n\n }", "public function getPratos()\n {\n return $this->hasMany(Prato::className(), ['id_pedidos' => 'idpedido']);\n }", "public static function getTblproductoByFiltros($idtblcolonia,$idtbltipodeservicio,$fechapedido,$hora,$idtblcategproduct,$idtblclasifproduct,$ingrediente){\n \n $activado=1;\n \n $fechapedidoingresada = new DateTime($fechapedido);\n $fechahoy = new DateTime(\"now\");\n $interval= $fechahoy->diff($fechapedidoingresada);\n $diasMinimos= $interval->format('%d');\n \n $diasemana= $fechapedidoingresada->format('l');\n \n $tipopedidoCompleto=3;\n $tipodeservicioCompleto=3;\n \n \n if($fechapedidoingresada == $fechahoy){ \n $tipodepedido= 1; //pedidoparahoy\n $stock=1;\n }else{\n $tipodepedido= 2; //pedidoparaotrodia\n $stock=0;\n }\n \n \n if($idtbltipodeservicio==1){ //Entrega en Pasteleria\n \n $consulta = \"SELECT TPR.*, TPI.* FROM tblproducto TPR\n INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n INNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n INNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n INNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n WHERE TP.tblproveedor_activado = ? \n AND TP.tblcolonia_idtblcolonia = ?\n AND TPR.tblproducto_activado = ?\n AND TCP.tblcategproduct_activado = ?\n AND TCLP.tblclasifproduct_activado = ?\n AND TPR.tblcategproduct_idtblcategproduct = ?\n AND TPR.tblclasifproduct_idtblclasifproduct= ?\n AND TPRD.tblproductdetalle_activado = ?\n AND TPRD.tblproductdetalle_stock >= ?\n AND TPRD.tblproductdetalle_diaselaboracion <= ?\n AND TPRD.tblespecificingrediente_idtblespecificingrediente = ?\n AND TDS.tbldiasemana_dia = ?\n AND CAST(? AS TIME ) BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$idtblcolonia,PDO::PARAM_INT);\n $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n $resultado->bindParam(4,$activado,PDO::PARAM_INT);\n $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n $resultado->bindParam(6,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(7,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(8,$activado,PDO::PARAM_INT);\n $resultado->bindParam(9,$stock,PDO::PARAM_INT);\n $resultado->bindParam(10,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(11,$ingrediente,PDO::PARAM_INT);\n $resultado->bindParam(12,$diasemana,PDO::PARAM_STR);\n $resultado->bindParam(13,$hora,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n } else{//Entrega en Domicilio\n \n \n $consulta=\"SELECT TPR.*, PRI.* FROM tblproducto TPR\n INNER JOIN tblproveedor TP ON TP.idtblproveedor = TPR.tblproveedor_idtblproveedor\n INNER JOIN tblproductdetalle TPRD ON TPRD.tblproducto_idtblproducto = TPR.idtblproducto\n INNER JOIN tblcategproduct TCP ON TCP.idtblcategproduct = TPR.tblcategproduct_idtblcategproduct\n INNER JOIN tblclasifproduct TCLP ON TCLP.idtblclasifproduct = TPR.tblclasifproduct_idtblclasifproduct\n INNER JOIN tblcoloniaprovservicio TCPS ON TCPS.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tblhrsprovdom THS ON THS.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n INNER JOIN tblhora TH ON TH.idtblhora = THS.tblhora_idtblhora\n INNER JOIN tblproductimg TPI ON TPI.tblproducto_idtblproducto = TPR.idtblproducto\n WHERE TP.tblproveedor_activado = ? \n AND TCPS.tblcolonia_idtblcolonia=?\n AND TH.tblhora_hora = ?\n AND TPR.tblproducto_activado = ?\n AND TCP.tblcategproduct_activado = ?\n AND TCLP.tblclasifproduct_activado = ?\n AND TPR.tblcategproduct_idtblcategproduct = ?\n AND TPR.tblclasifproduct_idtblclasifproduct= ? \n AND TPRD.tblproductdetalle_activado = ?\n AND TPRD.tblproductdetalle_stock >= ?\n AND TPRD.tblproductdetalle_diaselaboracion <= ?\n AND TPRD.tblespecificingrediente_idtblespecificingrediente = ?\n AND TDS.tbldiasemana_dia = ?\n GROUP BY TPR.idtblproducto\";\n try{\n $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n $resultado->bindParam(1,$activado,PDO::PARAM_INT);\n $resultado->bindParam(2,$idtblcolonia,PDO::PARAM_INT);\n $resultado->bindParam(3,$hora,PDO::PARAM_STR);\n $resultado->bindParam(4,$activado,PDO::PARAM_INT);\n $resultado->bindParam(5,$activado,PDO::PARAM_INT);\n $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n $resultado->bindParam(7,$idtblcategproduct,PDO::PARAM_INT);\n $resultado->bindParam(8,$idtblclasifproduct,PDO::PARAM_INT);\n $resultado->bindParam(9,$activado,PDO::PARAM_INT);\n $resultado->bindParam(10,$stock,PDO::PARAM_INT);\n $resultado->bindParam(11,$diasMinimos,PDO::PARAM_INT);\n $resultado->bindParam(12,$ingrediente,PDO::PARAM_INT);\n $resultado->bindParam(13,$diasemana,PDO::PARAM_STR);\n $resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n \n }\n \n }", "public static function getAllTblproveedorByFiltro($idtblcolonia,$tipodeservicio,$fechapedido,$hora){\n \n $activado=1;\n $tipodepedidoCompleto=3;\n $tipodeservicioCompleto=3;\n\n $fechahora = $fechapedido.\" \".$hora;\n\n //se obtiene la fecha/hora actual\n $horaactual = new DateTime(\"now\", new DateTimeZone('America/Mexico_City'));\t\n\t\t//echo $horaactual->format('H:i').\"\\n\";\n //se convierte la fecha/hora en tipo objeto\n\t\t$horapedido = new DateTime($fechahora, new DateTimeZone('America/Mexico_City'));\n\t\t//echo $horapedido->format('H:i').\"\\n\";\n\t\t//se obtiene las horas por transcurrir\n\t\t$horastrascurrir = $horaactual->diff($horapedido)->format('%H');//horas\n\t\t$diasMinimos= $horaactual->diff($horapedido)->format('%d');//dias\t\t\n\t\t$totalHoras= ($diasMinimos*24)+($horastrascurrir);\n\t\t//echo $totalHoras.\"\\n\";\n\t\t//se obtiene el día de la semana \n\t\t$diasemana= $horapedido->format('l');\n\t\t//echo $diasemana;\n\n\t\t$fchactual = $horaactual->format('Y-m-d');\n\t\t$fchpedido = $horapedido->format('Y-m-d');\n\n\t\tif($fchactual==$fchpedido){\n\t\t\t$tipodepedido=1;\n\t\t}else{\n\t\t\t$tipodepedido=2;\n\t\t}\n\n\t\t//se tomara en cuenta el stock dependiendo de las horas para el pedido\n\t\tif($totalHoras<24){ \t\t\t\n $diasMinimos=0;\n $stock=1;\n }else{ \n $stock=0;\n }\n\n\n if($tipodeservicio==1){ //tipodeservicio Pasteleria (se considera al colonia)\n\n\n \t$consulta =\"SELECT TPR.* FROM tblhora THs, tblproveedor TPR \n \t\tINNER JOIN tblcolonia TCA ON TCA.idtblcolonia = TPR.tblcolonia_idtblcolonia\n INNER JOIN tblciudad TCD ON TCD.idtblciudad = TCA.tblciudad_idtblciudad\n \t\tINNER JOIN tblproducto TPO ON TPR.idtblproveedor = TPO.tblproveedor_idtblproveedor\n \t\tINNER JOIN tblproductdetalle TPOD ON TPO.idtblproducto = TPOD.tblproducto_idtblproducto\n \t\tINNER JOIN tbldiaprovservicio TDPS ON TDPS.tblproveedor_idtblproveedor = TPR.idtblproveedor\n \t\tINNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDPS.tbldiasemana_idtbldiasemana\n INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TPR.idtblproveedor\n INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n\t\tINNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n\t\tINNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n\t\tINNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n\t\tWHERE \n\t\t\t\tTCD.tblciudad_activado = ?\n\t\t AND TCA.tblcolonia_activado = ?\n\t\t AND TPR.tblproveedor_activado= ?\n\t\t AND TPO.tblproducto_activado = ?\n\t\t AND TPOD.tblproductdetalle_activado = ?\n\t\t AND TPOD.tblproductdetalle_stock >= ?\n\t\t AND TPOD.tblproductdetalle_diaselaboracion <= ?\n\t\t AND (TPR.tbltipopedido_idtbltipopedido = ? OR TPR.tbltipopedido_idtbltipopedido = ?)\n\t\t AND TDS.tbldiasemana_dia = ?\n AND TCA.idtblcolonia = ?\n AND CAST( ? AS TIME) BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n GROUP BY TPR.idtblproveedor \n ORDER BY rand()\";\n\n \n\n try{\n \t$resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n \t$resultado->bindParam(1,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(2,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(3,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(4,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(5,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(6,$stock,PDO::PARAM_INT);\n \t$resultado->bindParam(7,$diasMinimos,PDO::PARAM_INT);\n \t$resultado->bindParam(8,$tipodepedido,PDO::PARAM_INT);\n \t$resultado->bindParam(9,$tipodepedidoCompleto,PDO::PARAM_INT);\n \t$resultado->bindParam(10,$diasemana,PDO::PARAM_STR);\n \t$resultado->bindParam(11,$idtblcolonia,PDO::PARAM_INT);\n \t$resultado->bindParam(12,$hora,PDO::PARAM_STR);\n \t$resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n\n }\n\n }else{//tipodeservicio Domicilio\n\n \t$consulta =\"SELECT TPR.* FROM tblhora THs, tblproveedor TPR \n \t\tINNER JOIN tblcolonia TCA ON TCA.idtblcolonia = TPR.tblcolonia_idtblcolonia\n INNER JOIN tblciudad TCD ON TCD.idtblciudad = TCA.tblciudad_idtblciudad\n \t\tINNER JOIN tblproducto TPO ON TPR.idtblproveedor = TPO.tblproveedor_idtblproveedor\n \t\tINNER JOIN tblproductdetalle TPOD ON TPO.idtblproducto = TPOD.tblproducto_idtblproducto\n \t\tINNER JOIN tbldiaprovservicio TDPS ON TDPS.tblproveedor_idtblproveedor = TPR.idtblproveedor\n \t\tINNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDPS.tbldiasemana_idtbldiasemana\n INNER JOIN tblhrsprovtienda THP ON THP.tblproveedor_idtblproveedor = TPR.idtblproveedor\n INNER JOIN tblhraabre TA ON THP.tblhraabre_idtblhraabre = TA.idtblhraabre\n\t\tINNER JOIN tblhracierra TC ON THP.tblhracierra_idtblhracierra = TC.idtblhracierra\n\t\tINNER JOIN tblhora THa ON THa.idtblhora = TA.tblhora_idtblhora \n\t\tINNER JOIN tblhora THc ON THc.idtblhora = TC.tblhora_idtblhora\n\t\tWHERE \n\t\t\t\tTCD.tblciudad_activado = ?\n\t\t AND TCA.tblcolonia_activado = ?\n\t\t AND TPR.tblproveedor_activado= ?\n\t\t AND TPO.tblproducto_activado = ?\n\t\t AND TPOD.tblproductdetalle_activado = ?\n\t\t AND TPOD.tblproductdetalle_stock >= ?\n\t\t AND TPOD.tblproductdetalle_diaselaboracion <= ?\n\t\t AND (TPR.tbltipopedido_idtbltipopedido = ? OR TPR.tbltipopedido_idtbltipopedido = ?)\n\t\t AND TDS.tbldiasemana_dia = ?\n AND CAST( ? AS TIME) BETWEEN THa.tblhora_hora AND THc.tblhora_hora\n GROUP BY TPR.idtblproveedor \n ORDER BY rand()\";\n\n try{\n \t$resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n \t$resultado->bindParam(1,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(2,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(3,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(4,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(5,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(6,$stock,PDO::PARAM_INT);\n \t$resultado->bindParam(7,$diasMinimos,PDO::PARAM_INT);\n \t$resultado->bindParam(8,$tipodepedido,PDO::PARAM_INT);\n \t$resultado->bindParam(9,$tipodepedidoCompleto,PDO::PARAM_INT);\n \t$resultado->bindParam(10,$diasemana,PDO::PARAM_STR);\n \t$resultado->bindParam(11,$hora,PDO::PARAM_STR);\n \t$resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n\n }\n \n }", "public function tipobollo()\n {\n return $this->belongsTo('App\\TipoBollo','tipobolli_codice','codice');\n }", "function busca() {\r\n $this->Post->recursive = 1;\r\n $this->paginate['Post']['order'] = 'Post.created DESC';\r\n $this->paginate['Post']['recursive'] = -1;\r\n $this->paginate['Post']['conditions']['or']['texto like '] = '%' . $this->data['Post']['busca'] . '%';\r\n $this->paginate['Post']['conditions']['or']['titulo like '] = '%' . $this->data['Post']['busca'] . '%';\r\n $this->paginate['Post']['conditions']['tipo not'] = 'NULL';\r\n $this->paginate['Post']['limit'] = 25;\r\n $this->set('dados', $this->paginate('Post'));\r\n }" ]
[ "0.5934542", "0.57626915", "0.57407165", "0.57332116", "0.565435", "0.55667347", "0.5497845", "0.54127926", "0.54047686", "0.53817594", "0.53721297", "0.53562045", "0.5341601", "0.53327173", "0.5324124", "0.5315122", "0.5292843", "0.5290607", "0.52571005", "0.52565455", "0.5241089", "0.52400964", "0.5238426", "0.52290267", "0.52227235", "0.5216968", "0.52059746", "0.52007365", "0.5184163", "0.51737493" ]
0.6589009
0
Adds a JOIN clause to the query using the Tipotripa relation
public function joinTipotripa($relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Tipotripa'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'Tipotripa'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function joinTipocaratula($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Tipocaratula');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Tipocaratula');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array());", "public function useTipotripaQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinTipotripa($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Tipotripa', 'TipotripaQuery');\n\t}", "public function join($table, $condicion, $type=\"\")\n\t\t{\n\t\t\t////JOIN comentarios ON comentarios.id = blogs.id\n\t\t\tif(is_string($table) and is_string($condicion) and is_string($type)){\n\t\t\t\t$this->join .= addslashes($type).' JOIN '.addslashes($table).' ON '.addslashes($condicion);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshowErrors('2AS', 'Type value icorrecto in the parameter');\n\t\t\t}\n\t\t}", "public function joinTbaluno($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Tbaluno');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Tbaluno');\n }\n\n return $this;\n }", "public function joinPedidomayorista($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Pedidomayorista');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Pedidomayorista');\n }\n\n return $this;\n }", "public function joinClienteTributacao($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('ClienteTributacao');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'ClienteTributacao');\n }\n\n return $this;\n }", "public function setJoin($tabela, $campo, $tbJoin, $campoJoin){\r\n\t\t\t$this->criterio .= \" and `\" . $tabela . \"`.`\" . $campo . \"` = `\" . $tbJoin . \"`.`\" . $campoJoin . \"`\";\r\n\t\t}", "public function joinAssegnamentiPostazione($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('AssegnamentiPostazione');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'AssegnamentiPostazione');\n }\n\n return $this;\n }", "public function joinParroquia($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Parroquia');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Parroquia');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function joinVenta($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Venta');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Venta');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function join($table, $cond, $type = '')\n\t{\n\t\tif ($type != '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( !in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t/* If a DB prefix is used we might need to add it to the column names */\n\t\tif ($this->dbprefix)\n\t\t{\n\t\t\t$this->_track_aliases($table);\n/* When prefix is part of field name, it produces error, for eample: g_ */\n#$this->oDb->join( 'st.tag_crc32u = mts.tag_crc32u' );\n\t\t\t// First we remove any existing prefixes in the condition to avoid duplicates\n\t\t\t#$cond = preg_replace('|('.$this->dbprefix.')([\\w\\.]+)([\\W\\s]+)|', \"$2$3\", $cond);\n\n\t\t\t// Next we add the prefixes to the condition\n\t\t\t#$cond = preg_replace('|([\\w\\.]+)([\\W\\s]+)(.+)|', $this->dbprefix . \"$1$2\" . $this->dbprefix . \"$3\", $cond);\n\t\t}\n\n\t\t$join = $type.'JOIN '.$this->_protect_identifiers($this->dbprefix.$table, TRUE).' ON '.$cond;\n\n\t\t$this->ar_join[] = $join;\n\n\t\treturn $this;\n\t}", "public function joinTbestado($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Tbestado');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Tbestado');\n }\n\n return $this;\n }", "protected function myJoinTable($query, $table, $one, $operator, $two, $type = 'inner', $where = false)\n {\n // obtém os joins da query\n $joins = $query->getQuery()->joins;\n if ($joins) {\n // para cada join\n // verifica se a tabela já está no relacionamento\n foreach ($joins as $join) {\n if ($join->table == $table) {\n return $query;\n }\n }\n }\n // efetua o join na query\n return $query->join($table, $one, $operator, $two, $type, $where);\n }", "public function joinLugarRelatedByIdlugardestinatario($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('LugarRelatedByIdlugardestinatario');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'LugarRelatedByIdlugardestinatario');\n }\n\n return $this;\n }", "public function join($table, $cond, $type = '')\n {\n if ($type != '')\n {\n $type = strtoupper(trim($type));\n $type = (!in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER')))? '':$type.' ' ;\n }\n\n $join = $type.'JOIN '.$this->_protect_identifiers($table).' ON '.$this->_protect_identifiers($cond);\n $this->ar_join[] = $join;\n\n return $this;\n }", "public function joinTrabalho($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Trabalho');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Trabalho');\n }\n\n return $this;\n }", "public function join($table)\n {\n /**\n * \n * rewrite data table\n */\n if(preg_match('/join/', self::$sql['table']))\n {\n self::$sql['table'] .= self::$sql['condition'].\" join \".$table.\" \";\n }else{\n self::$sql['table'] = self::$sql['table'].\" join \".$table.\" \";\n }\n\n return new self;\n }", "public function join($type, $table, $on)\n {\n $this->join .= ' ' . $type . ' JOIN ' . $table . ' ON ' . $on;\n }", "public function join($table, $type = '') {\n\t\t\tif(!isset($this->baseQueryType) || $this->baseQueryType == '')\n\t\t\t\treturn false;\n\n\t\t\t$this->join = true;\n\n\t\t\tif($type == '')\n\t\t\t\t$this->query .= ' INNER JOIN';\n\n\t\t\t$this->query .= ' ' . $table;\n\n\t\t\treturn $this;\n\t\t}", "public function joinPersona($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Persona');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Persona');\n }\n\n return $this;\n }", "public function joinVenta($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Venta');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Venta');\n }\n\n return $this;\n }", "public function joinVenta($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Venta');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Venta');\n }\n\n return $this;\n }", "public function joinPais($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Pais');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Pais');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function join($clause);", "public function joinTbcidade($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Tbcidade');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Tbcidade');\n }\n\n return $this;\n }", "public function joinSubaffittiPostazione($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('SubaffittiPostazione');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'SubaffittiPostazione');\n }\n\n return $this;\n }", "function addJoin($table, $on, $type) {\n\t\t$this->_joinCount++;\n\t\tarray_push($this->_joinOrder, array(\n\t\t\t'table' => $table,\n\t\t\t'on' \t=> $on,\n\t\t\t'type' \t=> $type\n\t\t));\n\t}", "public function joinFactura($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Factura');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Factura');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function useTbalunoQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinTbaluno($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'Tbaluno', 'TbalunoQuery');\n }" ]
[ "0.63275135", "0.62256366", "0.609808", "0.59920824", "0.59761053", "0.59754264", "0.5892894", "0.58864063", "0.5860517", "0.5817329", "0.57756233", "0.577187", "0.5769066", "0.57459974", "0.5718532", "0.57165974", "0.57142997", "0.5710233", "0.56994295", "0.56753236", "0.5670201", "0.56414", "0.56414", "0.56374943", "0.56261754", "0.5626159", "0.5624112", "0.56012815", "0.5589753", "0.5589373" ]
0.6464003
0
Filter the query by a related Historico object
public function filterByHistorico($historico, $comparison = null) { return $this ->addUsingAlias(ImpresionPeer::ID, $historico->getIdImpresion(), $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByHistorico($historico, $comparison = null)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(EdicionPeer::ID, $historico->getIdEdicion(), $comparison);\n\t}", "public function historicos()\n {\n\n //dd( $this->hasMany(Historico::class));\n return $this->hasMany(Historico::class);\n }", "public function Filter($filter=null){\n $results = $this->where(function($query) use ($filter){\n if($filter){\n $query->where('cliente','LIKE',\"%{$filter}%\" or 'vendedor','LIKE',\"%{$filter}%\" or 'data','LIKE',\"%{$filter}%\")->orderBy(\"%{$filter}%\", 'desc')->get() ;\n }\n });\n return $results;\n }", "public function historia()\n {\n return $this->belongsTo(Historia::class);\n }", "function find( $relationName, Filter $filter_1 );", "abstract protected function filterQuery(Query $q);", "public function filterByHasOne($query, HasOne $relationship, array $ids): void;", "public function filter($filter)\n {\n $this->query = $this->company->filter($filter);\n\n return $this->query;\n }", "public function filterByUser(int $id);", "public function historique(){\n return $this->belongsToMany(Historique::class,'historique_personne');\n }", "public function getByFilter($filter)\n {\n $filter = json_decode($filter);\n\n return Empleado::join('cargo', 'empleado.idcargo', '=', 'cargo.idcargo')\n ->select('empleado.nombre', 'empleado.apellido', 'empleado.telefonoprincipal',\n 'empleado.celular', 'empleado.documentoidentidadempleado',\n 'cargo.nombrecargo')\n ->orderBy('empleado.apellido', 'asc')\n ->whereRaw(\n \"empleado.documentoidentidadempleado LIKE '%\" . $filter->text .\n \"%' OR empleado.nombre LIKE '%\" . $filter->text .\n \"%' OR empleado.apellido LIKE '%\" . $filter->text . \"%' \")\n ->get();\n }", "public function filter(){\n\t\t\t$this->filtroSQL = \"SELECT art.*, cat.categoria, fam.familia, sfam.subfamilia, autor\n\t\t\t\t,date_format(art.fmodificacion,'%d-%m-%Y %H:%i:%s') ffmodificacion\n\t\t\t\t,format(art.precio,2,'de_DE') fprecio\n\t\t\t\t,format(art.oferta,2,'de_DE') foferta\n\t\t\t\t,(select nombre from os_administradores adm where adm.id=art.id_administrador) gestor\n\t\t\t\t,(CASE art.estado WHEN 'ON' THEN 'Online' WHEN 'OFF' THEN 'Offline' ELSE 'Elimado/a' END) festado\t\t\t\t\n\t\t\t\tFROM articulos art\n\t\t\t\tLEFT JOIN subfamilias sfam ON art.id_subfamilia=sfam.id\n\t\t\t\tLEFT JOIN familias fam ON sfam.id_familia=fam.id\n\t\t\t\tLEFT JOIN categorias cat ON fam.id_categoria=cat.id\n\t\t\t\tLEFT JOIN autores aut ON art.id_autor=aut.id\n\t\t\t\tWHERE art.estado IN ('ON','OFF')\";\n\t\t\t\t\t\t\n\t\t\tif ( $_REQUEST['_articulo'] )\n\t\t\t\t$this->filtroSQL .= \" AND art.articulo LIKE '%$this->filtro_articulo%'\";\n\t\t\tif ( $_REQUEST['_categoria'] )\n\t\t\t\t$this->filtroSQL .= \" AND categoria LIKE '%$this->filtro_categoria%'\";\n\t\t\tif ( $_REQUEST['_familia'] )\n\t\t\t\t$this->filtroSQL .= \" AND familia LIKE '%$this->filtro_familia%'\";\n\t\t\tif ( $_REQUEST['_subfamilia'] )\n\t\t\t\t$this->filtroSQL .= \" AND subfamilia LIKE '%$this->filtro_subfamilia%'\";\n\t\t\tif ( $_REQUEST['_autor'] )\n\t\t\t\t$this->filtroSQL .= \" AND autor LIKE '%$this->filtro_autor%'\";\n\t\t\t\n\t\t\tif ( $this->filtro_campo )\n\t\t\t\t$this->filtroSQL .=\" ORDER BY $this->filtro_campo\".($this->filtro_orden==\"up\"?\"\":\" desc\");\n\t\t}", "public function filter(\\Magento\\Framework\\DataObject $params);", "function findOne( $relationName, Filter $filter_1 );", "function filterObject()\n\t{\n\t\t$this->questionsObject();\n\t}", "public function filtreBarreRecherche(){\n try {\n $mysqli=$this->connexion();\n $stmt=$mysqli->prepare(\"select * from utilisateurs inner join voyages on utilisateurs.id = voyages.id\");\n $stmt->execute();\n $rs=$stmt->get_result();\n $filtre=$rs->fetch_all(MYSQLI_ASSOC);\n $mysqli->close();\n return $filtre;\n } catch (mysqli_sql_exception $m) {\n throw new DaoException($m->getMessage(), $m->getCode());\n }\n }", "function getDadosHistorico(){\n\t\t\t$consulta = mysql_query(\"SELECT * FROM historico_cobranca WHERE idHistorico = '\".$this->getid_historico().\"' AND id = '\".$this->getid_user().\"' \");\n\t\t\t$objeto=mysql_fetch_array($consulta);\n\t\t\t$this->setdata_vencimento($objeto['data_pagamento']);\n\t\t}", "public function testFilterByAttributeInRelationship()\n {\n parse_str('filter[post.text][like]=%repudiandae%&filter[text][like]=%veniam%&sorting=id', $parameters);\n $response = $this->get(self::API_URI, $parameters);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertNotNull($resource = json_decode((string)$response->getBody()));\n\n // manually checked with\n // SELECT comments.*\n // FROM comments\n // JOIN posts ON comments.id_post = posts.id_post\n // WHERE comments.text LIKE '%veniam%' AND posts.text LIKE '%repudiandae%'\n // ORDER BY comments.id_comment;\n $this->assertCount(4, $resource->data);\n $this->assertEquals(104, $resource->data[0]->id);\n $this->assertEquals(173, $resource->data[1]->id);\n $this->assertEquals(207, $resource->data[2]->id);\n $this->assertEquals(253, $resource->data[3]->id);\n }", "public function buscarProHistorialModel($idprodu){\n\t\t//Se prepara la consulta\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM historial WHERE id_producto='$idprodu'\");\n\t\t//se ejecuta la consulta\n\t\t$stmt->execute();\n\t\t//Se devuelven todos registros encontrados\n\t\treturn $stmt->fetchAll();\n\t\t//Se cierra la consulta\n\t\t$stmt->close();\n\t}", "public function filter($request){\n return $this->qualification->where($request);\n }", "public function getFiltered($aFilter) {\n\t\t$query \t= $this->createQuery();\n\t\t$aWhere\t= array();\n\n\t\t/* Only show entries in this category */\n\t\tif(isset($aFilter['categories']) && count($aFilter['categories']) > 0) {\n\t\t\t$aTmpWhere = array();\n\t\t\tforeach($aFilter['categories'] AS $aRow) {\n\t\t\t\t$aTmpWhere[] = $query->equals('uid', (int)$aRow['uid_local']);\n\t\t\t}\n\t\t\t$aWhere[] = $query->logicalOr($aTmpWhere);\n\t\t}\n\n\t\t/* Only display this type of entries ... */\n\t\tif(isset($aFilter['typesToDisplay']) && strlen($aFilter['typesToDisplay']) > 0) {\n\t\t\t$aWhere[] = $query->in('relationType', explode(',', $aFilter['typesToDisplay']));\n\t\t}\n\n\t\t/* Search-Term */\n\t\t$aWhereSearch\t= array();\n\t\tif(isset($aFilter['searchTerm']) && strlen($aFilter['searchTerm']) > 0) {\n\t\t\t$aSearchTerms\t= explode(' ', $aFilter['searchTerm']);\n\t\t\t$aTmpWhere \t\t= array();\n\t\t\tif(count($aSearchTerms) > 0) {\n\t\t\t\tforeach($aSearchTerms AS $sVal) {\n\t\t\t\t\t$aWhereSearch[] = $query->like('company', '%' . $sVal . '%');\n\t\t\t\t\t$aWhereSearch[] = $query->like('description', '%' . $sVal . '%');\n\t\t\t\t\t$aWhereSearch[] = $query->like('city', '%' . $sVal . '%');\n\t\t\t\t\t$aWhereSearch[] = $query->like('lastname', '%' . $sVal . '%');\n\t\t\t\t\t$aWhereSearch[] = $query->like('forename', '%' . $sVal . '%');\n\t\t\t\t\t$aWhereSearch[] = $query->like('middlename', '%' . $sVal . '%');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Search-Zip */\n\t\tif(isset($aFilter['searchZip']) && strlen($aFilter['searchZip']) > 0) {\n\t\t\t$aWhereSearch[] = $query->like('zip', '%' . $aFilter['searchZip'] . '%');\n\t\t}\n\n\t\tif(count($aWhereSearch) > 0)\n\t\t\t$aWhere[] = $query->logicalOr($aWhereSearch);\n\n\t\t/* Collect all where conditions */\n\t\tif(count($aWhere) > 0) {\n\t\t\t$query->matching(\n\t\t\t\t$query->logicalAnd($aWhere)\n\t\t\t);\n\t\t}\n\n\t\t// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($aWhere);\n\n\t\t/* Order By ... */\n\t\tif(isset($aFilter['orderby']) && strlen($aFilter['orderby']) > 0) {\n\t\t\tswitch ($aFilter['orderby']) {\n\t\t\t\tcase 'relation_type1':\n\t\t\t\tdefault:\n\t\t\t\t\t$query->setOrderings(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'relationType.sorting' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING,\n\t\t\t\t\t\t\t'company' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'relation_type2':\n\t\t\t\t\t$query->setOrderings(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'relationType.sorting' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING,\n\t\t\t\t\t\t\t'crdate' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_DESCENDING\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'relation_type3':\n\t\t\t\t\t$query->setOrderings(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'relationType.sorting' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING,\n\t\t\t\t\t\t\t'sorting' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'company':\n\t\t\t\t\t$query->setOrderings(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'company' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'crdate':\n\t\t\t\t\t$query->setOrderings(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'crdate' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_DESCENDING\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'sorting':\n\t\t\t\t\t$query->setOrderings(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'sorting' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $query->execute();\n\t}", "public function filterByTbaluno($tbaluno, $comparison = null)\n {\n if ($tbaluno instanceof Tbaluno) {\n return $this\n ->addUsingAlias(TbpaisPeer::ID_PAIS, $tbaluno->getNacionalidade(), $comparison);\n } elseif ($tbaluno instanceof PropelObjectCollection) {\n return $this\n ->useTbalunoQuery()\n ->filterByPrimaryKeys($tbaluno->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByTbaluno() only accepts arguments of type Tbaluno or PropelCollection');\n }\n }", "abstract protected function filterData(ContainerInterface $container, QueryBuilder $queryBuilder, Request $request);", "public function filtrar(&$filtro) {\n parent::filtrar($filtro);\n $filtro_sql = '';\n if ($filtro->filtro('id'))\n $filtro_sql .= \" AND {$this->getTableName()}.id like '%{$filtro->filtro('id')}%' \";\n if ($filtro->filtro('nombre'))\n $filtro_sql .= \" AND {$this->getTableName()}.nombre like '%{$filtro->filtro('nombre')}%' \";\n if ($filtro->filtro('descripcion'))\n $filtro_sql .= \" AND {$this->getTableName()}.descripcion like '%{$filtro->filtro('descripcion')}%' \";\n return $filtro_sql;\n }", "public function relation(Request $request)\n {\n $slug = $this->getSlug($request);\n $page = $request->input('page');\n $on_page = 50;\n $search = $request->input('search', false);\n $dataType = Voyager::model('DataType')->where('slug', '=', $slug)->first();\n\n $method = $request->input('method', 'add');\n\n $model = app($dataType->model_name);\n if ($method != 'add') {\n $model = $model->find($request->input('id'));\n }\n\n $this->authorize($method, $model);\n\n $rows = $dataType->{$method.'Rows'};\n /** @var Carbon $filterBy */\n $filterBy = null;\n foreach ($rows as $key => $row) {\n if ($row->field === $request->input('type')) {\n\n $options = $row->details;\n /**\n * En esta sección, el valor de $model es el valor del Objeto a editar\n * que en este caso es Cfdi y del cual vamos a obtener su relación que\n * es BankTransaction\n */\n if (\n isset($options->filterBy) &&\n isset($options->filterBy->foreign) &&\n isset($options->filterBy->reference) &&\n isset($model->{$options->filterBy->foreign}) // Verificamos que el campo definido en foreign se encuentre en el Cfdi\n ) {\n $filterBy = $model->{$options->filterBy->foreign};\n debug($filterBy->toDateString());\n }\n // Load Model from Relation \"BankTransaction\"\n /** @var Model $model */\n $model = app($options->model);\n\n $skip = $on_page * ($page - 1);\n\n $additional_attributes = $model->additional_attributes ?? [];\n\n // Apply local scope if it is defined in the relationship-options\n if (isset($options->scope) && $options->scope != '' && method_exists($model, 'scope'.ucfirst($options->scope))) {\n $model = $model->{$options->scope}();\n }\n\n // If search query, use LIKE to filter results depending on field label\n if ($search) {\n // If we are using additional_attribute as label\n if (in_array($options->label, $additional_attributes)) {\n debug(\"searching\");\n if(isset($filterBy)) {\n // Vamos a optar ciegamente en que el campo indicado en \"reference\",\n // realmente existe en la relación en este caso \"BankTransfer\"\n $model = $model->whereMonth($options->filterBy->reference, \"=\", $filterBy->month);\n }\n $relationshipOptions = $model->get();\n $relationshipOptions = $relationshipOptions->filter(function ($model) use ($search, $options) {\n //debug($model->{$options->label});\n return stripos($model->{$options->label}, $search) !== false;\n });\n $total_count = $relationshipOptions->count();\n $relationshipOptions = $relationshipOptions->forPage($page, $on_page);\n } else {\n debug('What a fuck? Maybe from server search?');\n if(isset($filterBy)) {\n // Vamos a optar ciegamente en que el campo indicado en \"reference\",\n // realmente existe en la relación en este caso \"BankTransfer\"\n $model = $model->whereMonth($options->filterBy->reference, \"=\", $filterBy->month);\n }\n $total_count = $model->where($options->label, 'LIKE', '%'.$search.'%')->count();\n $relationshipOptions = $model->take($on_page)->skip($skip)\n ->where($options->label, 'LIKE', '%'.$search.'%')\n ->get();\n }\n } else {\n $total_count = $model->count();\n if(isset($filterBy)) {\n // Vamos a optar ciegamente en que el campo indicado en \"reference\",\n // realmente existe en la relación en este caso \"BankTransfer\"\n $model = $model->whereMonth($options->filterBy->reference, \"=\", $filterBy->month);\n }\n $relationshipOptions = $model->take($on_page)->skip($skip)->get();\n debug($relationshipOptions);\n }\n\n $results = [];\n\n if (!$row->required && !$search && $page == 1) {\n $results[] = [\n 'id' => '',\n 'text' => __('voyager::generic.none'),\n ];\n }\n\n // Sort results\n if (!empty($options->sort->field)) {\n if (!empty($options->sort->direction) && strtolower($options->sort->direction) == 'desc') {\n $relationshipOptions = $relationshipOptions->sortByDesc($options->sort->field);\n } else {\n $relationshipOptions = $relationshipOptions->sortBy($options->sort->field);\n }\n }\n\n foreach ($relationshipOptions as $relationshipOption) {\n $results[] = [\n 'id' => $relationshipOption->{$options->key},\n 'text' => $relationshipOption->{$options->label},\n ];\n }\n\n return response()->json([\n 'results' => $results,\n 'pagination' => [\n 'more' => ($total_count > ($skip + $on_page)),\n ],\n ]);\n }\n }\n\n // No result found, return empty array\n return response()->json([], 404);\n }", "public function toFilter();", "public function filterByGasto($gasto, $comparison = null)\n {\n if ($gasto instanceof Gasto) {\n return $this\n ->addUsingAlias(CuentaPeer::ID_CUENTA, $gasto->getFkCuenta(), $comparison);\n } elseif ($gasto instanceof PropelObjectCollection) {\n return $this\n ->useGastoQuery()\n ->filterByPrimaryKeys($gasto->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByGasto() only accepts arguments of type Gasto or PropelCollection');\n }\n }", "protected function rawFilter($filter) {\n //Log::debug('query: ',$filter);\n\t\t// Build a query based on filter $filter\n\t\t$query = Inventory::query()\n ->select('Inventory.objectID', 'Inventory.Item', 'Inventory.Quantity', 'Inventory.Created', 'Inventory.Status', 'Inventory.Order_Line', 'Inventory.UOM')\n ->orderBy('Created', 'desc');\n\t\tif(isset($filter['objectID']) && strlen($filter['objectID']) > 3) {\n\t\t\t$query->where('Inventory.objectID', 'like', $filter['objectID'] . '%');\n\t\t}\n\t\tif(isset($filter['Item']) && strlen($filter['Item']) > 3) {\n\t\t\t$query->where('Inventory.Item', 'like', $filter['Item'] . '%');\n\t\t}\n\t\tif(isset($filter['Created']) && strlen($filter['Created']) > 6) {\n\t\t\t$query->where('Inventory.Created', 'like', $filter['Created'] . '%');\n\t\t}\n if(isset($filter['Status']) && is_array($filter['Status']) > 0) {\n $query->whereRaw(\"Inventory.Status in ('\" . implode(\"','\", $filter['Status']) . \"')\");\n } elseif(isset($filter['Status']) && strlen($filter['Status']) > 1) {\n $query->where('Inventory.Status', 'like', $filter['Status'] . '%');\n }\n if(isset($filter['Order_Line']) && strlen($filter['Order_Line']) > 3) {\n $query->where('Inventory.Order_Line', 'like', $filter['Order_Line'] . '%');\n }\n if(isset($input['UOM']) && strlen($input['UOM']) > 3) {\n $query->where('Inventory.UOM', '=', $input['UOM']);\n }\n /*\n * container.parent should generate this sql request\n * select Inventory.* from Inventory join container inv on inv.objectID = Inventory.objectID where inv.parentID = 6208220881;\n */\n if(isset($filter['container.parent']) && strlen($filter['container.parent']) > 3) {\n $query\n ->join('container as inv', 'inv.objectID', '=', 'Inventory.objectID')\n ->where('inv.parentID',$filter['container.parent']);\n }\n //TODO remove this if statement, check usage first\n if(isset($filter['Location.parent']) && strlen($filter['Location.parent']) > 3) {\n $query->whereRaw('objectID in (select inv.objectID from container plt join container gc on gc.parentID = plt.objectID join container inv on inv.parentID = gc.objectID where plt.parentID = '.$filter['Location.parent'].')');\n }\n if(isset($filter['locationID']) && strlen($filter['locationID']) > 3) {\n $query->join('container as inv', 'inv.objectID', '=', 'Inventory.objectID')\n ->join('container as gc', 'gc.objectID', '=', 'inv.parentID')\n ->join('container as plt', 'plt.objectID', '=', 'gc.parentID')\n ->where('plt.parentID', $filter['locationID']);\n }\n //dd(__METHOD__.'('.__LINE__.')',compact('filter','query'));\n return $query;\n }", "public function filterByHistoryRelatedByCreatedBy($history, $comparison = null)\n {\n if ($history instanceof History) {\n return $this\n ->addUsingAlias(sfGuardUserPeer::ID, $history->getCreatedBy(), $comparison);\n } elseif ($history instanceof PropelObjectCollection) {\n return $this\n ->useHistoryRelatedByCreatedByQuery()\n ->filterByPrimaryKeys($history->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByHistoryRelatedByCreatedBy() only accepts arguments of type History or PropelCollection');\n }\n }", "public function search($queryFilter) {\n $search;\n if($queryFilter->query('term') === null) {\n $search = $this->model->all(); \n } else {\n $searchQuery = trim($queryFilter->query('term'));\n $requestData = ['description'];\n $this->share = $queryFilter->query('term');\n $search = $this->model->with([\n 'share' => function($query){\n $query->select('id', 'share_number'); \n }, \n 'transaction' => function($query){\n $query->select('id', 'description');\n }, \n 'partner' => function($query){\n $query->select('id', 'name', 'last_name');\n },\n 'titular' => function($query){\n $query->select('id', 'name', 'last_name');\n },\n 'currency' => function($query){\n $query->select('id', 'description');\n }\n ])->where(function($q) use($requestData, $searchQuery) {\n foreach ($requestData as $field) {\n $q->orWhere($field, 'like', \"{$searchQuery}%\");\n }\n\n $shares = $this->shareModel->query()->where('share_number','like', '%'.$this->share.'%')->get(); \n if(count($shares)) {\n foreach ($shares as $key => $value) {\n $q->orWhere('share_id', $value->id);\n }\n }\n\n $personData = ['name', 'last_name'];\n $persons = $this->personModel->query()->where(function($q) use($personData, $searchQuery) {\n foreach ($personData as $field) {\n $q->orWhere($field, 'like', \"%{$searchQuery}%\");\n }\n })->get();\n if(count($persons)) {\n foreach ($persons as $key => $value) {\n $q->orWhere('people_id', $value->id);\n }\n }\n if(count($persons)) {\n foreach ($persons as $key => $value) {\n $q->orWhere('id_titular_persona', $value->id);\n }\n }\n\n $transactionTypes = $this->transactionTypeModel->query()->where('description','like', \"%{$searchQuery}%\")->get();\n if(count($transactionTypes)) {\n foreach ($transactionTypes as $key => $value) {\n $q->orWhere('transaction_type_id', $value->id);\n }\n }\n })->orderBy('created', 'DESC')->paginate(8);\n }\n foreach ($search as $key => $value) {\n $search[$key]->number_sale_price = number_format((float)$search[$key]->number_sale_price,2);\n }\n return $search;\n }" ]
[ "0.65922016", "0.575697", "0.55857503", "0.5520858", "0.5451684", "0.54332757", "0.54148984", "0.5353746", "0.53432745", "0.52919966", "0.5287284", "0.5259011", "0.5216163", "0.5213876", "0.5195034", "0.51535136", "0.5150865", "0.51433134", "0.5082473", "0.50702506", "0.5052004", "0.5045963", "0.503699", "0.50363904", "0.50361705", "0.50224656", "0.50016624", "0.49930295", "0.49914002", "0.4985857" ]
0.6164103
1
This function returns the approved feedbacks of the merchant to be displayed in the frontend.
public function getMerchantFeedbacks($merchant) { $query = $this->getEntityManager() ->createQuery('SELECT f FROM GD\AdminBundle\Entity\Feedback f WHERE f.merchant = :merchant AND f.isApproved = true AND f.isRejected = false ORDER BY f.createdAt DESC') ->setParameter('merchant', $merchant->getId()); return $query->getResult(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFeedbacksForViewAttribute()\n {\n if (empty($this->feedbacks)) {\n return [];\n }\n\n $resp = [];\n foreach ($this->feedbacks as $feedback) {\n $resp[] = [\n 'rating' => $feedback->rating,\n 'attendance' => $feedback->attendance,\n 'comments' => $feedback->comments,\n 'vendor' => EventVendor::find($feedback->pivot->vendor_id)->full_name,\n ];\n }\n\n return $resp;\n }", "public function provider_feedback() {\n return array(\n 'Feedback test' => array(true),\n 'No feedback test' => array(false)\n );\n }", "public function feedbacks()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$this->left_menu\t=\t16;\r\n\t\t\t$this->data['breadcrumb'] = array(addslashes(t('Feedback Received'))=>'');\t\r\n\t\t\tob_start();\t\t\t\t\r\n\t\t\t//$id = $this->data['loggedin']['user_id'];\t\t\t \r\n\t\t\t$this->ajax_pagination_feedback_list();\r\n\t\t\t$contents = ob_get_contents();\r\n\t\t\tob_end_clean();\r\n\t\t\t\r\n\t\t\t$info = $this->mod_td->fetch_tradesman_details(decrypt($id));\r\n\t\t\t$this->data['profile_info'] = $info;\r\n\t\t\t$this->data['feedback_contents'] = $contents;\r\n\t\t\t\t\r\n\t\t\t$this->render();\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch(Exeception $e)\r\n\t\t{\r\n\t\t\tshow_error($e->getMessage());\r\n\t\t}\r\n }", "public function feedbackAction()\n {\n \t$user = $this->getUser();\n\n \t// gets the reviews in which the current user was the presenter\n \t// meaning that he got some feedback.\n $reviews = $this->getDoctrine()\n \t\t->getRepository('PxSPeerReviewingBundle:Review')\n \t\t->findBy(array('presenter'=>$user->getId()), array('assignment'=>'DESC', 'timestamp'=>'DESC'));\n\n \t// renders the feedback page with the grouped reviews.\n return $this->render('PxSPeerReviewingBundle:Reviews:feedback.html.twig', array('page'=>'feedback', 'reviews' => $this->groupReviewsByAssignment($reviews)));\n }", "public function getFeedbacks()\n {\n $result = $this->db->getRows('SELECT `name`, `message`, `email` FROM feedbacks;');\n return $result;\n }", "public function getFeedback()\n\t{\n\t\t$aFeedbacks = $this->database()\n\t\t\t->select('*, ug.title as user_group_title')\n\t\t\t->from(Phpfox::getT('user_delete_feedback'), 'udf')\n\t\t\t->leftjoin(Phpfox::getT('user_group'), 'ug', 'ug.user_group_id = udf.user_group_id') // although user groups should not change that often its safer like this\n\t\t\t->order('time_stamp DESC')\n\t\t\t->execute('getSlaveRows');\n\n\t\tif (empty($aFeedbacks))\n\t\t{\n\t\t\treturn $aFeedbacks;\n\t\t}\n\t\t\t\t\n\t\tforeach ($aFeedbacks as $iKey => $aFeedback)\n\t\t{\n\t\t\t// parse the reasons array\n\t\t\tif (isset($aFeedback['reasons_given']) && strlen($aFeedback['reasons_given']) > 4)\n\t\t\t{\n\t\t\t\t$aReasons = unserialize($aFeedback['reasons_given']);\n\t\t\t\tif (empty($aReasons))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach ($aReasons as $aReason)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$aFeedbacks[$iKey]['reasons'][] = $aReason['phrase_var'];\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $aFeedbacks;\n\t}", "public function getFeedbacks()\n {\n $sql = \"SELECT * FROM \" . DB_PREFIX . \"feedback ORDER BY date DESC\";\n \n $result = $this->db->query($sql);\n return $result->rows;\n }", "public static function getAllFeedback()\r\n {\r\n return FeedbackManagerDB::getAllFeedback();\r\n }", "public function fetchFeedback()\n {\n $feedback = Feedback::get();\n\n return response(['feedback' => $feedback], 200);\n }", "public static function getBeauticianListForApproval() {\n $userModel = new User();\n $data = array();\n $search = '';\n $approvedStatus = User::IS_APPROVAL_PENDING;\n $input = Input::all();\n if (isset($input['search']['value'])) {\n $search = $input['search']['value'];\n }\n if (!$search) {\n $results = $userModel->getBeauticianListWeb(array('user_type' => 2, 'approvedStatus' => $approvedStatus, 'limit' => $input['length'], 'offset' => $input['start']));\n } else {\n $results = $userModel->getBeauticianListWeb(array('user_type' => 2, 'approvedStatus' => $approvedStatus, 'q' => $search, 'limit' => $input['length'], 'offset' => $input['start']));\n }\n foreach ($results['result'] as $result) {\n $data[] = array(\n $result->id,\n $result->email,\n ucwords(trim($result->first_name.\" \".$result->last_name)),\n $result->admin_approval_status\n );\n }\n\n return array('data' => $data, 'recordsTotal' => $results['count'], \"recordsFiltered\" => $results['count']);\n }", "public function getFeedback()\n {\n $this->breadcrumb = ['Phản hồi'];\n return view('admin.elements.feedback.index', ['active' => 'feedback', 'breadcrumb' => $this->breadcrumb]);\n }", "public function getApprovedApprovals(){\n return 0;\n $service = Yii::$app->params['ServiceName']['RequeststoApprove'];\n $filter = [\n 'Sender_ID' => Yii::$app->user->identity->getId(),\n 'Status' => 'Approved'\n ];\n $result = Yii::$app->navhelper->getData($service,$filter);\n\n //Yii::$app->recruitment->printrr($result);\n if(is_object($result) || is_string($result)){//RETURNS AN EMPTY object if the filter result to false\n return 0;\n }\n return count($result);\n }", "protected function getDataProviderCorrect()\n {\n return [\n 'correct1' => [\n [\n 'designFormModel' => [\n 'containerDesignBlockModel' => [\n 'marginTop' => 400\n ],\n 'lineDesignBlockModel' => [\n 'marginTop' => 500\n ],\n 'submitIcon' => 'fa-lock',\n 'submitIconPosition' => 1,\n 'submitAlignment' => 1\n ],\n 'hasLabel' => true,\n 'successText' => 'Thanks!'\n ],\n [\n 'designFormModel' => [\n 'containerDesignBlockModel' => [\n 'marginTop' => 400\n ],\n 'lineDesignBlockModel' => [\n 'marginTop' => 500\n ],\n 'submitIcon' => 'fa-lock',\n 'submitIconPosition' => 1,\n 'submitAlignment' => 1\n ],\n 'hasLabel' => true,\n 'successText' => 'Thanks!'\n ],\n [\n 'designFormModel' => [\n 'containerDesignBlockModel' => [\n 'marginTop' => 300\n ],\n 'lineDesignBlockModel' => [\n 'marginTop' => 200\n ],\n 'submitIcon' => 'fa-check',\n 'submitIconPosition' => 0,\n 'submitAlignment' => 0\n ],\n 'hasLabel' => false,\n 'successText' => 'Text'\n ],\n [\n 'designFormModel' => [\n 'containerDesignBlockModel' => [\n 'marginTop' => 300\n ],\n 'lineDesignBlockModel' => [\n 'marginTop' => 200\n ],\n 'submitIcon' => 'fa-check',\n 'submitIconPosition' => 0,\n 'submitAlignment' => 0\n ],\n 'hasLabel' => false,\n 'successText' => 'Text'\n ]\n ]\n ];\n }", "public function actionAllFeedback(){\n if($_POST['limit']){\n $limit = $_POST['limit'];\n }\n if($_POST['start']){\n $start = $_POST['start'];\n }\n\n\n $photoId = $_POST['photoId'];\n //get user's id\n $user = new user;\n $userId = $user->checkLogged();\n\n $feedback = new feedback($photoId);\n $result = $feedback->getFeedbacks($photoId, $_POST['start'], $limit);\n\n\n $index= new index;\n $index->render('feedback','feedback', array(\n 'feedback' => $result,\n 'photoId' => $photoId,\n 'userId' => $userId,\n ));\n return true;\n\n }", "public static function getFeedbackList() {\n $client = self::getClient();\n $session = Session::get('session');\n $student = Session::get('contact');\n //$rootSession = $client->getRootSession();\n\n // Get feedback list\n /* $feddbacks = $client->getFullList(\n $session->root_session_id, \n 'Cases',\n array(), // Get all fields\n 'cases.student_id = \"'.$student->id.'\"',\n 'cases.date_entered ASC'\n ); */\n $relationshipsParams = array(\n 'session' => $session->root_session_id,\n 'module_name' => 'Contacts',\n 'module_id' => $student->id,\n 'link_field_name' => 'contacts_j_feedback_1', \n 'related_module_query' => 'j_feedback.type_feedback_list = \"Customer\" ' ,\n 'related_fields' => array(\n 'id', 'name', 'status', 'description', \n 'assigned_user_name', 'date_entered', 'slc_target', 'resolved_date' ,\n 'type_feedback_list','relate_feedback_list', 'feedback', 'receiver'\n ),\n 'related_module_link_name_to_fields_array' => array(),\n 'deleted'=> '0',\n 'order_by' => 'j_feedback.date_entered DESC',\n 'offset' => 0,\n 'limit' => 1000,\n );\n\n $result = $client->call(SugarMethod::GET_RELATIONSHIPS, $relationshipsParams);\n $feddbacks = $client->toSimpleObjectList($result->entry_list);\n\t\t\t\n\t\t\t //TEST API - Get Data By Entry Point - By Lap Nguyen\n $data_params = array(\n 'session' => $session->root_session_id,\n 'function' => 'getTeamList',\n 'param' => '',\n );\n $result = $client->call('entryPoint', $data_params);\n\n $data_params = array(\n 'session' => $session->root_session_id,\n 'function' => 'getSessionBooking',\n 'param' => array(\n 'student_id'=>'173fd695-524d-dc26-7a50-5710d3fbbeea',\n 'start' =>'2016-09-12',\n 'end' =>'2016-10-04',\n 'class_type'=>'',\n ),\n );\n $result = $client->call('entryPoint', $data_params);\n //END: Test API\n\n return $feddbacks; \n }", "public function reviews()\n {\n $reviews = array();\n $apiUrl = $this->getApiUrl();\n $serialized = $this->call($apiUrl);\n $elements = unserialize($serialized);\n\n if (sizeof($elements ) > 0) { \n $i = 0;\n foreach($elements as $element) {\n $reviews[$i]['rating'] = (int)$element['bewertung'];\n $reviews[$i]['comment'] = trim($element['meinung']);\n $reviews[$i]['date'] = date(DATE_ATOM);\n $reviews[$i]['reply'] = '';\n $reviews[$i]['product_article'] = (int)$element['produkt_id'];\n $reviews[$i]['provider'] = self::REVIEW_PROVIDER;\n $i++;\n }\n }\n\n return $reviews;\n }", "public function approvedCallback()\n {\n return view('common::billing/paypal-popup')->with([\n 'token' => $this->request->get('token'),\n 'status' => 'success',\n ]);\n }", "public static function getApprovedBeauticianList() {\n $userModel = new User();\n $data = array();\n $search = '';\n $approvedStatus = User::IS_APPROVED;\n $input = Input::all();\n if (isset($input['search']['value'])) {\n $search = $input['search']['value'];\n }\n if (!$search) {\n $results = $userModel->getBeauticianListWeb(array('user_type' => 2, 'approvedStatus' => $approvedStatus, 'limit' => $input['length'], 'offset' => $input['start']));\n } else {\n $results = $userModel->getBeauticianListWeb(array('user_type' => 2, 'approvedStatus' => $approvedStatus, 'q' => $search, 'limit' => $input['length'], 'offset' => $input['start']));\n }\n foreach ($results['result'] as $result) {\n $data[] = array(\n $result->id,\n $result->email,\n ucwords(trim($result->first_name.\" \".$result->last_name)),\n $result->admin_approval_status\n );\n }\n\n return array('data' => $data, 'recordsTotal' => $results['count'], \"recordsFiltered\" => $results['count']);\n }", "public function index()\n {\n $feedbacks = Feedback::all();\n return response()->json($feedbacks);\n }", "public function getAnswerFeedback()\n {\n return $this->answer_feedback;\n }", "public function getFeedbackPositiveMessages(){\n\t\t// echo out the feedback messages (errors and success messages etc.),\n\t\t// they are in $_SESSION[\"feedback_positive\"] and $_SESSION[\"feedback_negative\"]\n\t\n\t\t// get the feedback (they are arrays, to make multiple positive/negative messages possible)\n\t\t$feedback_positive = Session::get(Session::SESSION_FEEDBACK_POSITIVE);\n\t\t// delete these messages (as they are not needed anymore and we want to avoid to show them twice\n\t\tSession::set(Session::SESSION_FEEDBACK_POSITIVE, null);\n\t\treturn $feedback_positive;\n\t}", "public function feedback()\n\t{\n\t\treturn $this->find(\n\t\t\t\t'//div[contains(@class,\"seller-detail-info\")]' . \n\t\t\t\t'/span[contains(@class,\"feedback\")]'\n\t\t\t)->item(0)\n\t\t\t ->getElementsByTagName('a')\n\t\t\t ->item(0)\n\t\t\t ->textContent + 0;\n\t}", "public function list(){\n \t\t$feedbacks=Feedback::orderBy('created_at','DESC')->get();\n \t\treturn View::make('feedbackList')->with('feedbacks',$feedbacks);;\n \t}", "function displayPaymentTypesApprove($vars)\n {\n //return 'displayPaymentTypesApprove vars: <pre>'.print_r($vars,1).'</pre>';\n //check inputs\n $session_id = $vars['sell_session_id'];\n $session = true;\n include GEO_BASE_DIR . 'get_common_vars.php';\n $user_id = $session->getUserId();\n if (strlen($session_id) != 32) {\n //neither is set!\n return '';\n }\n\n if (!$this->_paypalAllowed()) {\n return '';\n }\n\n $sb = geoSellerBuyer::getInstance();\n $email = $sb->getUserSetting($user_id, 'paypal_id');\n\n //if listing id is set, see if there are current settings already set for the listing\n\n if (strlen($session_id) > 0) {\n //see if setting is set in session already\n $paypal_allow_sb = $sb->getCartItemSetting('paypal_allow_sb');\n //Possible future feature:\n //expand on ability to force user to be set up in paypal before allowed to bid or buy now\n $paypal_force = $sb->getCartItemSetting('paypal_force');\n $html = '';\n if ($paypal_allow_sb) {\n $messages = $this->_getText(11);\n $html = geoString::fromDB($messages[500187]) . \" ($email)\";\n }\n\n\n return $html;\n\n //return \"info passed: <pre>\".print_r($vars,1).\"</pre>\";\n }\n\n //sell session not known?\n return '';\n }", "public function index()\n {\n $feedbacks = feedbackAdmin::orderBy('created_at','DESC')->get();\n return view('admin.feedback.index',compact('feedbacks'));\n }", "public function getViewApprovalRequests()\n {\n return Leave::where(['approval_id' => auth()->id(), 'status' => 1])->orderBy('id', 'desc')->paginate(20);\n }", "public function forUpLinesApproval()\n {\n if(auth()->user()->hasRole(['Finance Admin']))\n {\n return CommissionRequest::where('status','for review')->get();\n }\n\n return collect($this->getCommissionRequests())->filter(function($value, $key){\n\n if(collect($value->approval)->where('id',auth()->user()->id)->whereNull('approval')->count() > 0)\n return $value->approval;\n });\n }", "public function getFeedBackList() \n {\n $out = Feedback::where('oobject_id', $this->id)->get();\n return $out;\n }", "public function index()\n {\n $feedbackform=feedback::all();\n return view ('viewfeedback',compact('feedbackform'));\n }", "function wct_user_feedback() {\n\t$feedback = wct_get_global( 'feedback' );\n\n\tif ( empty( $feedback ) || ! is_array( $feedback ) || ! empty( $feedback['admin_notices'] ) ) {\n\t\treturn;\n\t}\n\n\t$messages = wct_get_feedback_messages( $feedback );\n\n\tif ( empty( $messages ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( (array) $messages as $class => $message ) : ?>\n\t\t<div class=\"message <?php echo esc_attr( $class ); ?>\">\n\t\t\t<p>\n\t\t\t\t<?php if ( is_array( $message ) ) :\n\t\t\t\t\t\techo( join( '</p><p>', array_map( 'wct_sanitize_feedback', $message ) ) );\n\n\t\t\t\t\telse :\n\t\t\t\t\t\techo wct_sanitize_feedback( $message );\n\n\t\t\t\tendif ; ?>\n\t\t\t</p>\n\t\t</div>\n\t<?php endforeach;\n}" ]
[ "0.65447193", "0.6512737", "0.6374007", "0.598913", "0.59442955", "0.5750445", "0.5713516", "0.56987125", "0.5697182", "0.56802803", "0.56801677", "0.5672079", "0.5632202", "0.5585252", "0.55634946", "0.5554053", "0.55538124", "0.55257636", "0.55118895", "0.5509334", "0.5507931", "0.5500856", "0.5455856", "0.5454149", "0.54513633", "0.54284716", "0.54270476", "0.54099345", "0.5389377", "0.53585804" ]
0.69441587
0
Validate Rule Class to be namespaced class name and instance of yii\rbac\Rule
public function validRuleClass($attribute, $params, $validator) { $class = $this->$attribute; if (! class_exists($class)) { $this->addError($attribute, 'Not valid class name.'); return false; } else { $reflect = new \ReflectionClass($class); if (! $reflect->isSubclassOf(\yii\rbac\Rule::className())) { $this->addError($attribute, 'Class have to be extended of \\yii\\rbac\\Rule class'); return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRuleClassName()\n\t{\n\t\tif ($this->ruleName) {\n\t\t\t$rule = Yii::$app->authManager->getRule($this->ruleName);\n\t\t\treturn get_class($rule);\n\t\t}\n\t\treturn null;\n\t}", "public function getRule($className)\n\t{\n\t\t$rules = Yii::$app->authManager->getRules();\n\t\tforeach ($rules as $rule) {\n\t\t\tif (get_class($rule) === $className) {\n\t\t\t\treturn $rule;\n\t\t\t}\n\t\t}\n\n\t\t// no rule found - creating rule\n\t\t$rule = Yii::createObject(\"\\\\\" . $className);\n\t\tYii::$app->authManager->add($rule);\n\t\treturn $rule;\n\t}", "public static function rule(string $ruleName, array $arguments): RuleInterface\n {\n $ruleName = ucfirst($ruleName) . 'Rule';\n\n foreach (static::$rulesNamespaces as $ruleNamespace) {\n $ruleClass = $ruleNamespace . $ruleName;\n if (class_exists($ruleClass)) {\n return new $ruleClass(...$arguments);\n }\n }\n\n throw new ComponentException(\"Class for validator `$ruleName` not found\");\n }", "public static function validateRule($rrule, $startDate) {\n $rule = new self($rrule, $startDate);\n return TRUE;\n }", "public static function normalizeRule($rule) {\n\t\tif (is_array($rule)) {\n\t\t\t$rule = new validator\\rule\\RuleObject($rule);\n\t\t} elseif (!$rule instanceof validator\\Rule) {\n\t\t\tthrow new \\InvalidArgumentException('Rule must be an array or an instance of Rule');\n\t\t}\n\t\treturn $rule;\n\t}", "function _validateByRules() {\n\t\tforeach($this->controller->configurations->get($this->pathToRules) as $rule) {\n\t\t\tif(!preg_match($rule['pattern'], $this->get($rule['field']))) {\n\t\t\t\t$this->errors[] = array_merge(array('.type' => 'rule'), $rule);\n\t\t\t}\n\t\t}\n\t}", "public function testHasRule() {\n $c = new Container();\n\n $this->assertFalse($c->hasRule('foo'));\n\n $c->rule('foo')->setClass(self::DB);\n $this->assertTrue($c->hasRule('foo'));\n }", "public function testValidateClassSuccess()\n {\n $this->validateClass('Henk', 'henk');\n }", "public function validatedBy()\n {\n $className = (new \\ReflectionClass($this))->getShortName();\n return __NAMESPACE__.'\\Validators\\\\'.$className.'Validator';\n }", "public function validate(string $name , $value , array $rules) \n {\n foreach($rules as $rule) {\n // dah a5tsar 3lasahn asm al classes zy asm al objects aly a7na 3mlnaha f3lashan kda ana a5t al $obj o sawatw bl asm al rule\n //hydyny error 3lashan m3 kol rule ana msh 3ml ay namespace lyha\n $className = \"TechStore\\\\Classes\\\\Validations\\\\\" . $rule;\n $obj = new $className;\n\n // if($rule == \"required\") {\n // $obj = new Required;\n \n // } elseif ($rule == \"numeric\") {\n // $obj = new Numeric;\n \n // } elseif ($rule == \"max\") {\n // $obj = new Max;\n \n // } elseif ($rule == \"email\") {\n // $obj = new Email;\n \n // };\n\n //hn3ml al error property 3lashan al function dyh lo rg33t ay error n3ml push 3latol fy array al errors \n $error = $obj->check($name , $value); \n if($error !== false) {\n $this->errors[] = $error;\n break; \n }\n }\n }", "public function classExists()\n {\n if (!class_exists($this->className) || !is_subclass_of($this->className, Rule::className())) {\n $this->addError('className', \"Unknown Class: {$this->className}\");\n }\n }", "public function testSubclassHasRule() {\n $c = new Container();\n\n $c->rule(self::DB)->setClass(self::PDODB);\n\n $this->assertFalse($c->hasRule(self::PDODB));\n }", "public function testValidateClass()\n {\n $this->assertEquals('foo', Validator::validateClass('foo'));\n $this->assertEquals('foobar', Validator::validateClass('foo-bar'));\n $this->assertEquals('Foo', Validator::validateClass('Foo'));\n $this->assertEquals('foo523', Validator::validateClass('foo523'));\n\n $this->setExpectedException('ValidationException');\n Validator::validateClass('SoapClient');\n\n $this->setExpectedException('ValidationException');\n $this->assertEquals('for', Validator::validateClass('for')); // for is reserved keyword\n }", "public function validateClassName(DocumentManager $dm, $document, $className);", "public function validator()\n {\n\n return CategoryValidator::class;\n }", "public function validateRules($class_name = false)\r\r\n {\r\r\n if (!$class_name) {\r\r\n $class_name = $this->className;\r\r\n }\r\r\n\r\r\n $object = new $class_name();\r\r\n\r\r\n if (method_exists($this, 'getValidationRules')) {\r\r\n $definition = $this->getValidationRules();\r\r\n } else {\r\r\n $definition = ObjectModel::getDefinition($class_name);\r\r\n }\r\r\n\r\r\n $default_language = new Language((int) Configuration::get('PS_LANG_DEFAULT'));\r\r\n\r\r\n foreach ($definition['fields'] as $field => $def) {\r\r\n $skip = array();\r\r\n if (in_array($field, array('passwd', 'no-picture'))) {\r\r\n $skip = array('required');\r\r\n }\r\r\n\r\r\n if (isset($def['lang']) && $def['lang']) {\r\r\n if (isset($def['required']) && $def['required']) {\r\r\n $value = Tools::getValue($field . '_' . $default_language->id);\r\r\n if (empty($value)) {\r\r\n $this->errors[$field . '_' . $default_language->id] = sprintf(\r\r\n Tools::displayError('The field %1$s is required at least in %2$s.'),\r\r\n $object->displayFieldName($field, $class_name),\r\r\n $default_language->name\r\r\n );\r\r\n }\r\r\n }\r\r\n\r\r\n foreach (Language::getLanguages(false) as $language) {\r\r\n $value = Tools::getValue($field . '_' . $language['id_lang']);\r\r\n if (!empty($value)) {\r\r\n if (($error = $object->validateField(\r\r\n $field,\r\r\n $value,\r\r\n $language['id_lang'],\r\r\n $skip,\r\r\n true\r\r\n )) !== true\r\r\n ) {\r\r\n $this->errors[$field . '_' . $language['id_lang']] = $error;\r\r\n }\r\r\n }\r\r\n }\r\r\n } elseif (($error = $object->validateField($field, Tools::getValue($field), null, $skip, true)) !== true) {\r\r\n $this->errors[$field] = $error;\r\r\n }\r\r\n }\r\r\n\r\r\n\r\r\n /* Overload this method for custom checking */\r\r\n $this->_childValidation();\r\r\n\r\r\n /* Checking for multilingual fields validity */\r\r\n if (isset($rules['validateLang']) && is_array($rules['validateLang'])) {\r\r\n foreach ($rules['validateLang'] as $field_lang => $function) {\r\r\n foreach (Language::getLanguages(false) as $language) {\r\r\n if (($value = Tools::getValue($field_lang . '_' . $language['id_lang'])) !== false && !empty($value)) {\r\r\n if (Tools::strtolower($function) == 'iscleanhtml' && Configuration::get('PS_ALLOW_HTML_IFRAME')) {\r\r\n $res = Validate::$function($value, true);\r\r\n } else {\r\r\n $res = Validate::$function($value);\r\r\n }\r\r\n if (!$res) {\r\r\n $this->errors[$field_lang . '_' . $language['id_lang']] = sprintf(\r\r\n Tools::displayError('The %1$s field (%2$s) is invalid.'),\r\r\n call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),\r\r\n $language['name']\r\r\n );\r\r\n }\r\r\n }\r\r\n }\r\r\n }\r\r\n }\r\r\n }", "public function validator()\n {\n return \"Modules\\\\Documents\\\\Repositories\\\\Validators\\\\ObjectValidator\";\n }", "abstract function isValidClass($class);", "public function validate() {\n\t\t$rules = explode('|', $this->properties['rules']);\n\t\tforeach ($rules as $rule) {\n\t\t\tif (preg_match(\"/(.*?)\\[(.*?)\\]/\", $rule, $match)) {\n\t\t\t\t$rule = $match[1];\n\t\t\t\t$params = explode(',', $match[2]);\n\t\t\t\t$args = array_merge(array(Request::post($this->properties['fieldname'])), $params);\n\t\t\t} else $args = array(Request::post($this->properties['fieldname']));\n\t\t\tif (!function_exists($rule)) {\n\t\t\t\tif (file_exists(ROOT.DS.'app'.DS.'controllers'.DS.'validate'.DS.$rule.'.php'))\n\t\t\t\t\trequire(ROOT.DS.'app'.DS.'controllers'.DS.'validate'.DS.$rule.'.php');\n\t\t\t\telseif (file_exists(ROOT.DS.'vault'.DS.'controllers'.DS.'validate'.DS.$rule.'.php'))\n\t\t\t\t\trequire(ROOT.DS.'vault'.DS.'controllers'.DS.'validate'.DS.$rule.'.php');\n\t\t\t}\n\t\t\t$this->properties['error'] = call_user_func_array($rule, $args);\n\t\t\tif ($this->properties['error']) return false;\n\t\t}\n\t\treturn true;\n\t}", "private function getRuleInstance(string $class)\n {\n if (isset(self::$ruleInstance[$class]) !== false) {\n return self::$ruleInstance[$class];\n }\n\n return self::$ruleInstance[$class] = new $class;\n }", "public function validateRules($className = false)\n\t{\n\t\tif (!$className)\n\t\t\t$className = $this->className;\n\n\t\t/* Class specific validation rules */\n\t\t$rules = call_user_func(array($className, 'getValidationRules'), $className);\n\n\t\tif ((sizeof($rules['requiredLang']) OR sizeof($rules['sizeLang']) OR sizeof($rules['validateLang'])))\n\t\t{\n\t\t\t/* Language() instance determined by default language */\n\t\t\t$defaultLanguage = new Language((int)(Configuration::get('PS_LANG_DEFAULT')));\n\n\t\t\t/* All availables languages */\n\t\t\t$languages = Language::getLanguages(false);\n\t\t}\n\n\t\t/* Checking for required fields */\n\t\tforeach ($rules['required'] AS $field)\n\t\t\tif (($value = Tools::getValue($field)) == false AND (string)$value != '0')\n\t\t\t\tif (!Tools::getValue($this->identifier) OR ($field != 'passwd' AND $field != 'no-picture'))\n\t\t\t\t\t$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is required');\n\n\t\t/* Checking for multilingual required fields */\n\t\tforeach ($rules['requiredLang'] AS $fieldLang)\n\t\t\tif (($empty = Tools::getValue($fieldLang.'_'.$defaultLanguage->id)) === false OR $empty !== '0' AND empty($empty))\n\t\t\t\t$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).'</b> '.$this->l('is required at least in').' '.$defaultLanguage->name;\n\n\t\t/* Checking for maximum fields sizes */\n\t\tforeach ($rules['size'] AS $field => $maxLength)\n\t\t\tif (Tools::getValue($field) !== false AND Tools::strlen(Tools::getValue($field)) > $maxLength)\n\t\t\t\t$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')';\n\n\t\t/* Checking for maximum multilingual fields size */\n\t\tforeach ($rules['sizeLang'] AS $fieldLang => $maxLength)\n\t\t\tforeach ($languages AS $language)\n\t\t\t\tif (Tools::getValue($fieldLang.'_'.$language['id_lang']) !== false AND Tools::strlen(Tools::getValue($fieldLang.'_'.$language['id_lang'])) > $maxLength)\n\t\t\t\t\t$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].')</b> '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max, html chars including').')';\n\n\t\t/* Overload this method for custom checking */\n\t\t$this->_childValidation();\n\n\t\t/* Checking for fields validity */\n\t\tforeach ($rules['validate'] AS $field => $function)\n\t\t\tif (($value = Tools::getValue($field)) !== false AND ($field != 'passwd'))\n\t\t\t\tif (!Validate::$function($value))\n\t\t\t\t\t$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is invalid');\n\n\t\t/* Checking for passwd_old validity */\n\t\tif (($value = Tools::getValue('passwd')) != false)\n\t\t{\n\t\t\tif ($className == 'Employee' AND !Validate::isPasswdAdmin($value))\n\t\t\t\t$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), 'passwd', $className).'</b> '.$this->l('is invalid');\n\t\t\telseif ($className == 'Customer' AND !Validate::isPasswd($value))\n\t\t\t\t$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), 'passwd', $className).'</b> '.$this->l('is invalid');\n\t\t}\n\n\t\t/* Checking for multilingual fields validity */\n\t\tforeach ($rules['validateLang'] AS $fieldLang => $function)\n\t\t\tforeach ($languages AS $language)\n\t\t\t\tif (($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])) !== false AND !empty($value))\n\t\t\t\t\tif (!Validate::$function($value))\n\t\t\t\t\t\t$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].')</b> '.$this->l('is invalid');\n\t}", "public function rules()\n {\n return [\n 'name' => ['required', 'alpha_dash', 'unique:permissions,name', 'max:35', new PermissionName],\n// 'name' => 'required|alpha_dash|unique:permissions,name|max:35|',\n 'display_name' => \"nullable|regex:/^[\\_\\-a-zA-Z ]+$/|max:50\",\n 'description' => 'nullable|string|max:150'\n ];\n }", "protected function _getValidRule()\n {\n if (is_null($this->_validRule)) {\n $validRule = new Varien_Object();\n $validRules = $this->_getValidRules();\n if (count($validRules) > 0 && array_key_exists(0, $validRules)) {\n $validRule = $validRules[0];\n }\n $this->_validRule = $validRule;\n }\n return $this->_validRule;\n }", "public function validator()\n {\n\n return GameValidator::class;\n }", "public function testParseRule()\n {\n $method = 'parseRule';\n $args = ['required'];\n\n $validator = $this->getMockBuilder(\\Illuminate\\Validation\\Validator::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $parser = $this->getMockBuilder(\\Proengsoft\\JsValidation\\Support\\ValidationRuleParserProxy::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $parser->expects($this->any())\n ->method('parse')\n ->willReturn(true);\n\n $delegated = $this->getMockBuilder(\\Proengsoft\\JsValidation\\Support\\DelegatedValidator::class)\n ->setConstructorArgs([$validator, $parser])\n ->onlyMethods(['callProtected'])\n ->getMock();\n\n if (is_array($args)) {\n $v = call_user_func_array([$delegated,$method], $args);\n } else {\n $v = $delegated->$method($args);\n }\n\n $this->assertTrue($v);\n }", "public function validator()\n {\n return AssetValidator::class;\n }", "public function getRules()\n\t{\n\t\treturn [\n\t\t\t'plan_id' \t=> ['required', 'string'],\n\t\t\t'app_id' \t=> ['required', 'in:' . implode(',', SELF::APP_ID)],\n\t\t\t'max_tenant' \t=> ['required', 'number'],\n\t\t\t'max_user' \t\t=> ['required', 'number'],\n\t\t];\n\t}", "abstract public function getValidationRules(): array;", "public function rules()\n {\n // 获取要排除的id\n $id=$this->route('role');//获取路由的后缀。\n // dd($id);\n return [\n 'cn_name'=>'bail|required|string|between:2,10|unique:roles,cn_name,'.$id,\n 'name'=>'bail|required|string|regex:/^[a-zA-Z]+$/|between:2,20|unique:roles,name,'.$id,\n 'describe'=>'bail|nullable|string|between:2,80'\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required|unique:roles|max:200|string',\n 'display_name' => 'required|string|regex:/\\p{Han}/u'\n ];\n }" ]
[ "0.6422105", "0.60576046", "0.57861114", "0.5662804", "0.5579971", "0.54918385", "0.5455773", "0.54185575", "0.5412592", "0.5389218", "0.5382056", "0.5333758", "0.5302438", "0.52912587", "0.52880615", "0.5285622", "0.52674365", "0.5220438", "0.5207071", "0.52008986", "0.51828367", "0.515961", "0.51579654", "0.5134794", "0.5134317", "0.51298636", "0.5118666", "0.5116738", "0.51159155", "0.5102613" ]
0.68942297
0
Get RBAC Rule object create/register in case rule doesn't exists
public function getRule($className) { $rules = Yii::$app->authManager->getRules(); foreach ($rules as $rule) { if (get_class($rule) === $className) { return $rule; } } // no rule found - creating rule $rule = Yii::createObject("\\" . $className); Yii::$app->authManager->add($rule); return $rule; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRuleObject()\n {\n if (is_null($this->ruleObject)) {\n $this->ruleObject = new RuleObject();\n $this->ruleObject->setExpression($this->expression);\n $this->ruleObject->setJson($this->json);\n }\n return $this->ruleObject;\n }", "protected function _getValidRule()\n {\n if (is_null($this->_validRule)) {\n $validRule = new Varien_Object();\n $validRules = $this->_getValidRules();\n if (count($validRules) > 0 && array_key_exists(0, $validRules)) {\n $validRule = $validRules[0];\n }\n $this->_validRule = $validRule;\n }\n return $this->_validRule;\n }", "public function createRules()\n {\n return [];\n }", "public function getRule($name);", "public function getRule($ruleName);", "abstract public function getRules();", "public static function getCreateRules()\n {\n if (isset(static::$rules_create))\n {\n return static::$rules_create;\n }\n else if (isset(static::$rules))\n {\n return static::$rules;\n }\n else\n {\n return [];\n }\n }", "public function createRule(){\n $rule = new QueryPathReplacementRule();\n $this->rules[] = $rule;\n return $rule;\n }", "public function actionCreateRBAC() {\n if (!Yii::app()->user->checkAccess('siteCreateRBAC')) {\n Yii::app()->user->loginRequired(); //благодаря этому Yii::app()->user->returnUrl знает предыдущую страницу\n }\n\n /*\n * В каждом контроллере делаю \"checkAccess\". Если нельзя, то вызываю функцию \"Yii::app()->user->loginRequired();\"\n * Благодаря этой функции в \"Yii::app()->user->returnUrl\" записывается предыдущуя страница, которая вызвала проверку прав.\n * Автоматом юзер редиректится на Логин. В Логине проверяется, если он уже зареган, то редиректится на НеХватаетПрав, иначе покажем\n * форму логина.\n */\n\n $auth = Yii::app()->authManager;\n\n //сбрасываем все существующие правила\n $auth->clearAll();\n\n //base operation\n $bizRule = 'return ( (Yii::app()->user->id == $_GET[\"uid\"]) OR (Yii::app()->user->role == \"admin\") );';\n $auth->createTask('siteIndex', 'site Index', $bizRule);\n $auth->createOperation('siteLogin', 'site Login');\n $auth->createOperation('siteLogout', 'site Logout');\n $auth->createOperation('siteContact', 'site Contact');\n $auth->createOperation('siteCreateRBAC', 'site CreateRBAC');\n $auth->createOperation('siteCaptcha', 'site Captcha');\n\n $auth->createOperation('changeUserRole', 'change UserRole');\n\n //shop\n $auth->createOperation('viewCatalog', 'view Catalog');\n $auth->createOperation('viewProduct', 'view Product');\n $auth->createOperation('myCart', 'my Cart');\n \n $auth->createOperation('addCommentProduct', 'add Comment to Product');\n \n\n //product crud\n $auth->createOperation('productAdmin', 'product Admin');\n $auth->createOperation('productCreate', 'product Create');\n $auth->createOperation('productDelete', 'product Delete');\n $auth->createOperation('productIndex', 'product Index');\n $auth->createOperation('productUpdate', 'product Update');\n $auth->createOperation('productView', 'product View');\n $auth->createOperation('productPerformAjaxValidation', 'product performAjaxValidation');\n $auth->createOperation('productLoadModel', 'load product Model');\n\n\n //noRights operation \n $auth->createOperation('siteNorights', 'site Norights');\n\n //создаем роль для пользователя admin и указываем, какие операции он может выполнять\n $admin = $auth->createRole('admin');\n $admin->addChild('viewCatalog');\n $admin->addChild('viewProduct');\n $admin->addChild('myCart');\n\n $admin->addChild('changeUserRole');\n \n $admin->addChild('addCommentProduct');\n\n $admin->addChild('siteIndex');\n $admin->addChild('siteLogin');\n $admin->addChild('siteLogout');\n $admin->addChild('siteContact');\n $admin->addChild('siteCreateRBAC');\n $admin->addChild('siteCaptcha');\n $admin->addChild('siteNorights'); //сюда будем редиректить, если не хватает прав\n\n $admin->addChild('productAdmin');\n $admin->addChild('productCreate');\n $admin->addChild('productDelete');\n $admin->addChild('productIndex');\n $admin->addChild('productUpdate');\n $admin->addChild('productView');\n $admin->addChild('productPerformAjaxValidation');\n $admin->addChild('productLoadModel');\n\n\n //создаем роль user и добавляем операции для неё\n $client = $auth->createRole('client');\n $client->addChild('viewCatalog');\n $client->addChild('viewProduct');\n $client->addChild('myCart');\n \n $client->addChild('addCommentProduct');\n\n $client->addChild('siteIndex');\n $client->addChild('siteLogin');\n $client->addChild('siteLogout');\n $client->addChild('siteCaptcha');\n $client->addChild('siteNorights'); //сюда будем редиректить, если не хватает прав \n // \n //guest default role\n $guest = $auth->createRole('guest');\n $guest->addChild('viewCatalog');\n $guest->addChild('viewProduct');\n $guest->addChild('myCart');\n\n $guest->addChild('siteLogin');\n $guest->addChild('siteLogout');\n $guest->addChild('siteNorights'); //сюда будем редиректить, если не хватает прав\n\n\n $auth->save();\n\n $this->render('CreateRBAC');\n }", "public function getRule($id) {\r\n\t\treturn $this->rules[$id];\r\n\t}", "private function addRule($role,$resource,$value,$forward){ \n \t$res=$this->resources[$resource];\n \t$this->rules[$res[0]][$res[1]]['rules'][$role]=array('value'=>$value,'forward'=>$forward);\n }", "function getRuleArray() {\n $rule = parent::getRuleArray();\n if ($this->xacml->managementRule->isPopulated()) {\n $rule['users'] = array_unique(array_merge($rule['users'], $this->xacml->managementRule->getUsers()));\n $rule['roles'] = array_unique(array_merge($rule['roles'], $this->xacml->managementRule->getRoles()));\n }\n if ($this->xacml->datastreamRule->isPopulated()) {\n $rule['users'] = array_unique(array_merge($rule['users'], $this->xacml->datastreamRule->getUsers()));\n $rule['roles'] = array_unique(array_merge($rule['roles'], $this->xacml->datastreamRule->getRoles()));\n }\n return $rule;\n }", "public function rules()\n {\n return [\n 'permissions.*' => 'exists:permissions,id',\n ];\n }", "public function getDefinition(): RuleDefinition\n {\n }", "public function getAcl() {\n//\t\t$acl = $this->cache->get('acl-cache');\n//\t\tif (!$acl) {\n // No existe, crear objeto ACL\n\n $acl = new Phalcon\\Acl\\Adapter\\Memory();\n $acl->setDefaultAction(Phalcon\\Acl::DENY);\n//\t\t\t$acl = $this->acl;\n\n $userroles = Role::find();\n\n $modelManager = Phalcon\\DI::getDefault()->get('modelsManager');\n\n $sql = \"SELECT Resource.name AS resource, Action.name AS action \n FROM Action\n JOIN Resource ON (Action.idResource = Resource.idResource)\";\n\n $results = $modelManager->executeQuery($sql);\n\n $userandroles = $modelManager->executeQuery('SELECT Role.name AS rolename, Resource.name AS resname, Action.name AS actname\n FROM Allowed\n JOIN Role ON (Role.idRole = Allowed.idRole) \n JOIN Action ON (Action.idAction = Allowed.idAction) \n JOIN Resource ON (Action.idResource = Resource.idResource)');\n\n //Registrando roles\n foreach ($userroles as $role) {\n $acl->addRole(new Phalcon\\Acl\\Role($role->name));\n }\n\n //Registrando recursos\n $resources = array();\n foreach ($results as $key) {\n if (!isset($resources[$key['resource']])) {\n $resources[$key['resource']] = array($key['action']);\n }\n $resources[$key['resource']][] = $key['action'];\n }\n\n foreach ($resources as $resource => $actions) {\n $acl->addResource(new Phalcon\\Acl\\Resource($resource), $actions);\n }\n\n //Relacionando roles y recursos desde la base de datos\n foreach ($userandroles as $role) {\n $acl->allow($role->rolename, $role->resname, $role->actname);\n }\n\n//\t\t\t$this->cache->save('acl-cache', $acl);\n//\t\t}\n // Retornar ACL\n $this->_dependencyInjector->set('acl', $acl);\n return $acl;\n }", "public function getRule()\n {\n return $this->rule;\n }", "protected function &_getRules(Zend_Acl_Resource_Interface $resource = null, Zend_Acl_Role_Interface $role = null,\n $create = false)\n {\n // create a reference to null\n $null = null;\n $nullRef =& $null;\n\n // follow $resource\n do {\n if (null === $resource) {\n $visitor =& $this->_rules['allResources'];\n break;\n }\n $resourceId = $resource->getResourceId();\n if (!isset($this->_rules['byResourceId'][$resourceId])) {\n if (!$create) {\n return $nullRef;\n }\n $this->_rules['byResourceId'][$resourceId] = [];\n }\n $visitor =& $this->_rules['byResourceId'][$resourceId];\n } while (false);\n\n\n // follow $role\n if (null === $role) {\n if (!isset($visitor['allRoles'])) {\n if (!$create) {\n return $nullRef;\n }\n $visitor['allRoles']['byPrivilegeId'] = [];\n }\n return $visitor['allRoles'];\n }\n $roleId = $role->getRoleId();\n if (!isset($visitor['byRoleId'][$roleId])) {\n if (!$create) {\n return $nullRef;\n }\n $visitor['byRoleId'][$roleId]['byPrivilegeId'] = [];\n $visitor['byRoleId'][$roleId]['allPrivileges'] = ['type' => null, 'assert' => null];\n }\n return $visitor['byRoleId'][$roleId];\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function rules()\n {\n $label = $this->label;\n\n if ($this->requestToCreate()) {\n return [\n 'label' => [\n 'required',\n Rule::unique('roles')\n ->where(function ($query) use ($label) {\n $query->where('label', strtolower($label));\n })\n ],\n 'permissions' => 'array',\n 'permissions.*' => 'exists:permissions,id',\n ];\n }\n\n if ($this->requestToUpdate()) {\n return [\n 'label' => [\n 'required',\n Rule::unique('roles')\n ->where(function ($query) use ($label) {\n $query->where('label', strtolower($label));\n })->ignore($this->route()->parameter('role')->id, 'id')\n ],\n 'permissions' => 'array',\n 'permissions.*' => 'exists:permissions,id',\n ];\n }\n\n if ($this->requestToDelete()) {\n return [];\n }\n\n }", "function createRule(Array $rule, Array $criteria, Array $actions) {\n global $DB;\n\n // Avoid duplicate - Need to be improved using a rule uuid of other\n if (countElementsInTable('glpi_rules', ['name' => $DB->escape($rule['name'])])) {\n return 0;\n }\n $rule['comment'] = sprintf(__('Test %s'), $this->version);\n $rule['description'] = '';\n\n // Compute ranking\n $sql = \"SELECT MAX(`ranking`) AS rank\n FROM `glpi_rules`\n WHERE `sub_type` = '\".$rule['sub_type'].\"'\";\n $result = $DB->query($sql);\n\n $ranking = 1;\n if ($DB->numrows($result) > 0) {\n $datas = $DB->fetch_assoc($result);\n $ranking = $datas[\"rank\"] + 1;\n }\n\n // The rule itself\n $fields = \"`ranking`\";\n $values = \"'$ranking'\";\n foreach ($rule as $field => $value) {\n $fields .= \", `$field`\";\n $values .= \", '\".$DB->escape($value).\"'\";\n }\n $sql = \"INSERT INTO `glpi_rules`\n ($fields)\n VALUES ($values)\";\n $DB->queryOrDie($sql);\n $rid = $DB->insert_id();\n\n // The rule criteria\n foreach ($criteria as $criterion) {\n $fields = \"`rules_id`\";\n $values = \"'$rid'\";\n foreach ($criterion as $field => $value) {\n $fields .= \", `$field`\";\n $values .= \", '\".$DB->escape($value).\"'\";\n }\n $sql = \"INSERT INTO `glpi_rulecriterias`\n ($fields)\n VALUES ($values)\";\n $DB->queryOrDie($sql);\n }\n\n // The rule criteria actions\n foreach ($actions as $action) {\n $fields = \"`rules_id`\";\n $values = \"'$rid'\";\n foreach ($action as $field => $value) {\n $fields .= \", `$field`\";\n $values .= \", '\".$DB->escape($value).\"'\";\n }\n $sql = \"INSERT INTO `glpi_ruleactions`\n ($fields)\n VALUES ($values)\";\n $DB->queryOrDie($sql);\n }\n }", "public function getRule()\n {\n return $this->rule;\n }", "protected function getAccessChecker()\r\n {\r\n return Podium::getInstance()->rbac;\r\n }", "abstract public function getRules(): array;", "private function getRule($sid)\n {\n $this->updateSIDlist();\n if (!array_key_exists($sid, $this->sid_list)) {\n $rule = $this->rules->rule->Add();\n $rule->sid = $sid;\n $this->sid_list[$sid] = $rule;\n }\n return $this->sid_list[$sid];\n }", "public static function addRule(Rule $obj)\n {\n self::$rules_map[$obj->name] = $obj->action;\n }", "public function getSecondRule(): RuleInterface\n {\n return $this->secondRule;\n }", "abstract protected function getRules() : array;", "public function getRule() {\n return $this->rule;\n }", "public function getRule() {\n return $this->rule;\n }" ]
[ "0.60164297", "0.59061104", "0.5702072", "0.5663495", "0.56472206", "0.5623921", "0.55903846", "0.55326456", "0.55169797", "0.5487666", "0.544133", "0.54120326", "0.53594273", "0.53583103", "0.53561693", "0.53418094", "0.5332909", "0.5332026", "0.5332026", "0.5325373", "0.5305927", "0.5301443", "0.52999234", "0.528869", "0.52845526", "0.52692425", "0.52599245", "0.52529263", "0.5252671", "0.5252671" ]
0.6016982
0
Find rule namespaced class name by current ruleName
public function getRuleClassName() { if ($this->ruleName) { $rule = Yii::$app->authManager->getRule($this->ruleName); return get_class($rule); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRule($ruleName);", "public static function getClassNameFromNamespace()\n {\n $classArray = explode(\"\\\\\", self::$namespace);\n return $classArray[count($classArray) - 1];\n }", "public function getRule($name);", "public static function resolverClassName();", "public static function className()\n {\n $className = get_called_class();\n // For namespaces: DaftSearch\\Query etc.\n if ($postfixName = strrchr($className, '\\\\')) {\n $className = substr($postfixName, 1);\n }\n // convert Camel case to underscore lowercase: SearchSale -> search_sale\n $name = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $className));\n return $name;\n }", "public function getRule($className)\n\t{\n\t\t$rules = Yii::$app->authManager->getRules();\n\t\tforeach ($rules as $rule) {\n\t\t\tif (get_class($rule) === $className) {\n\t\t\t\treturn $rule;\n\t\t\t}\n\t\t}\n\n\t\t// no rule found - creating rule\n\t\t$rule = Yii::createObject(\"\\\\\" . $className);\n\t\tYii::$app->authManager->add($rule);\n\t\treturn $rule;\n\t}", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getRule($name)\n {\n // first, check for exact match\n $normalname = self::normalizeName($name);\n\n if (isset($this->rules[$normalname])) {\n return $this->rules[$normalname];\n }\n\n // next, look for a rule where:\n foreach ($this->rules as $key => $rule) {\n if ($key !== '*' // it's not the default rule,\n && \\is_subclass_of($name, $key) // its name is a parent class of what we're looking for,\n && empty($rule['instanceOf']) // it's not a named instance,\n && (!array_key_exists('inherit', $rule) || $rule['inherit'] === true) // and it applies to subclasses\n ) {\n return $rule;\n }\n }\n\n // if we get here, return the default rule if it's set\n return (isset($this->rules['*'])) ? $this->rules['*'] : [];\n }", "private function namespaceOf($className)\n {\n return substr($className, 0, strrpos($className, '\\\\'));\n }", "public abstract function getClassName();", "public function getNameSpace()\n {\n $reflection = new \\ReflectionClass(get_class($this));\n\n return $reflection->getNamespaceName();\n }", "function getClassName()\r\n\t{\r\n\t\treturn Clazz::getQualifiedName($this);\r\n\t}", "public function getFqcn()\n {\n $prefix = $this->getNamespace() ? $this->getNamespace() . '\\\\' : '';\n return $prefix . $this->className;\n }", "public function getResolvedClass(): Name;", "protected function getCurrentNamespace()\n {\n $namespace = get_class($this);\n return substr($namespace, 0, strrpos($namespace, '\\\\'));\n }", "private static function getClassName() {\n $className = self::getCompleteClassName();\n $path = explode('\\\\', $className);\n\n return strtolower(array_pop($path));\n }", "private function getClassNameSpace()\n {\n $split = explode(\"\\\\\", $this->className);\n return implode(\"\\\\\", array_splice($split, 0, -1));\n }", "public function getClassName()\n {\n if (false !== $pos = strrpos($this->class, '\\\\')) {\n return substr($this->class, $pos + 1);\n }\n\n return $this->class;\n }", "abstract public static function getClassName();", "public function getResolvedName(string $namespace): string;", "public function getClassName(){\n \n $ret_str = '';\n \n if($type = $this->findType()){\n \n $ret_str = $this->findClassName($type);\n \n }//if\n \n return $ret_str;\n \n }", "private function getClassName($constraint)\n {\n if ($pos = strrpos($constraint, '\\\\')) {\n return substr($constraint, $pos + 1);\n }\n\n return $pos;\n }", "protected function parseName() {\n $class = get_class($this);\n $x = strpos($class, \"_\");\n if ($x)\n $class = substr($class, 0, $x);\n return classToDir($class);\n }", "function get_class_name();", "public static function getNamespace($className) {\n if (is_object($className))\n $className = get_class($className);\n if (strpos($className, '\\\\') === false)\n return '';\n return preg_replace('/\\\\\\\\[^\\\\\\\\]+$/', '', $className);\n }", "private function getClassFromName(string $name)\n {\n return substr($name, strrpos('\\\\', $name));\n }", "public function resolve($name, $currentNamespace = '\\\\')\n {\n // already namespaced\n if ('\\\\' == $name[0]) {\n return $name;\n }\n\n // anonymous class\n if('class@anonymous' == $name ) {\n return $name;\n }\n\n // use xxx as yyy\n if (isset($this->aliases[$name])) {\n return $this->aliases[$name];\n }\n\n // use xxx;\n foreach (array_keys($this->aliases) as $alias) {\n $parts = preg_split('![^\\w]!', $alias);\n $last = $parts[sizeof($parts, COUNT_NORMAL) - 1];\n if ($last === $name) {\n return $alias;\n }\n }\n\n if ($currentNamespace === null) {\n return $name;\n }\n return rtrim($currentNamespace, '\\\\').'\\\\'.$name;\n\n }" ]
[ "0.6304797", "0.621237", "0.60623187", "0.59636974", "0.59048337", "0.58104664", "0.57922953", "0.57922953", "0.57922953", "0.57922953", "0.579101", "0.5779671", "0.5768072", "0.5726928", "0.5704949", "0.5681841", "0.56685185", "0.56570655", "0.56418234", "0.562319", "0.5595654", "0.5585917", "0.55566734", "0.5532724", "0.55276096", "0.55122924", "0.54916483", "0.54644346", "0.54527974", "0.5450067" ]
0.7125428
0
Retorna el identificador del Trabajo de Grado
public function getIdTrabajoGrado( ){ return $this->idTrabajoGrado; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGradoId()\n {\n return $this->grado_id;\n }", "public function getNombreTrabajoGrado( ){\n\t\treturn $this->nombre;\n\t}", "public function getIdDocumentoGrado( ){\n\t\treturn $this->idDocumentoGrado;\n\t}", "public function getRegistroGrado( ){\n\t\treturn $this->registroGrado;\n\t}", "function get_id_for() {\r\n\r\n\t\t$sql=\"SELECT id_for\r\n\t\t\t FROM les_classes C\r\n\t\t\t WHERE id_cla='$this->id_cla' \";\t \t\t \r\n\r\n\t\t$result = $this->bdd->executer($sql);\r\n\t\t\t\r\n\t\tif ($ligne = mysql_fetch_assoc($result)) {\r\n\t\t\treturn $ligne['id_for'];\r\n\t\t}\r\n\t\t\t\r\n\t}", "public static function getUserGIdentifier()\n {\n static $id;\n\n if (!isset($id)) {\n $str = UserUtil::getGroupListForUser(null, '_');\n $id = $str == '-1' ? 'guest' : 'groups_'.$str;\n }\n\n return $id;\n }", "public function getId()\n {\n return $this->usercode.\"@@\".$this->unitname;\n }", "function getId(){\n\t\treturn $this->idTriagem;\n\t}", "public static function getIdentificador(): string\n {\n return 'CORPO';\n }", "public function getGruposervicioId() {\n return $this->gruposervicio_id;\n }", "function getId()\n {\n return $this->_gid;\n }", "function getIdtrabajador() {return $this->idtrabajador;}", "public function getRemesa() {\n \n $remesa = '';\n\n if ((($this->Origen == '3') or ($this->Origen == '5')) and ($this->Entidad != '') and ($this->IDEntidad != '')) {\n $recibo = new $this->Entidad($this->IDEntidad);\n $remesa = $recibo->getIDRemesa();\n unset($recibo);\n }\n\n return $remesa;\n }", "public function getSumberGajiId()\n {\n return $this->sumber_gaji_id;\n }", "function getCurrentRegNo(){\n\t\t$regno = '';\n\t\t$session = SessionWrapper::getInstance();\n\t\t$prefix = FARMGROUP_REG_PREFIX;\n\t\tif(isKenya()){\n\t\t\t$prefix = FARMGROUP_REG_PREFIX_KE;\n\t\t}\n\t\t$regno = $prefix.$this->generateRefNo();\n\t\t//debugMessage($prefix);\n\t\treturn $regno;\n\t}", "protected function getID()\n {\n return $this->idremessa;\n }", "function dame_IDG($nombre){\n\t$query = \"SELECT DISTINCT id_g FROM grupos WHERE nombre='\".$nombre.\"'\";\n\t$connection =conectarBD();\n\t$result = $connection -> query($query)\n\t\t\t\t\tor die ($connection->error.\" en la linea\".(__LINE__-1));\n\tdesconectarDB($connection);\n\treturn $result;\n}", "public function getID();", "public function getID();", "public function getID();", "public function getID();", "public function getID();", "function get_groups_regId($regId) {\n \n }", "public function getIdGenero()\n {\n return $this->idGenero;\n }", "public function get_gsauid() {\n return $this->gsauid;\n }", "public function getGradoNombre()\n {\n return $this->grado_nombre;\n }", "public function getIdFamilia(){\n return $this->idFamilia;\n }", "function get_id_prof_principal() {\r\n\t\t\t\r\n\t\t$sql=\"SELECT id_ens\r\n\t\t\t\t FROM les_classes\r\n\t\t\t\t WHERE id_cla='$this->id_cla'\";\t \t\t \r\n\r\n\t\t$result = $this->bdd->executer($sql);\r\n\t\t\t\r\n\t\tif ($ligne = mysql_fetch_assoc($result)) {\r\n\t\t\treturn\t$ligne['id_ens'];\r\n\t\t}\r\n\t\telse return 0;\r\n\t\t\t\r\n\t}", "public function getGrado($id)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('GRADO');\n\t\t$this->db->where('id_grado', $id);\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function get_id();" ]
[ "0.76729536", "0.7126759", "0.6929561", "0.6785122", "0.6569205", "0.64802235", "0.6461657", "0.6461289", "0.63892996", "0.63851064", "0.6382263", "0.6355873", "0.63530093", "0.6283525", "0.6227389", "0.62112725", "0.6196732", "0.6192694", "0.6192694", "0.6192694", "0.6192694", "0.6192694", "0.6191944", "0.6177003", "0.6171109", "0.6139402", "0.6136272", "0.6131319", "0.61284024", "0.6105604" ]
0.8135599
0
Modifica el nombre del Trabajo de Grado
public function setNombreTrabajoGrado( $nombre ){ $this->nombre = $nombre; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNombreTrabajoGrado( ){\n\t\treturn $this->nombre;\n\t}", "public function getGradoNombre()\n {\n return $this->grado_nombre;\n }", "public function CercadaNomeGratis()\n {\n $view = new VRicerca();\n $nome = $view->getNomericerca();\n $controller = new CGestioneEvento();\n $eventi = $controller->CercadaNomeGratis($nome);\n $view2 = new VAmministratore();\n $view2->GestioneEventi($eventi);\n }", "public function getIdTrabajoGrado( ){\n\t\treturn $this->idTrabajoGrado;\n\t}", "function nama_gbr_baru($id_artikel, $nama_gambar){\n\t\t\treturn ($id_artikel.\"_\".$nama_gambar);\n\t\t}", "public function ConstruirNombre()\n {\n $res = 'Acta ' . $this->getSubTipo() . ' Nº ' . $this->getNumero();\n return $res;\n }", "function nombrecampo($numcampo){\n\t\treturn mysql_field_name($this->consulta_ID, $numcampo);\n\t}", "function nombrecampo($numcampo){\n\t\treturn mysql_field_name($this->consulta_ID, $numcampo);\n\t}", "function nombrecampo($numcampo) {\r\nreturn mysql_field_name($this->Consulta_ID, $numcampo);\r\n}", "public function getTrinomialName() : string;", "function nombre_fase($tipo_Luna){\n\n if ( $tipo_Luna == 'New Moon' ) {\n\n $tipo_Luna = 'Nueva';\n }\n elseif ( $tipo_Luna == 'First Quarter' ) {\n\n $tipo_Luna = 'Creciente';\n }\n elseif ( $tipo_Luna == 'Full Moon' ) {\n\n $tipo_Luna = 'LLena';\n }\n else{\n\n $tipo_Luna = 'Menguante';\n }\n\n return $tipo_Luna;\n}", "public function genero($tipo) {\t\t\t\t\t\n\t\t\tif (strtoupper($tipo) == 'M') {\n\t\t\t\treturn \"Masculino\";\n\t\t\t} else if (strtoupper($tipo) == 'F') {\t\n\t\t\t\treturn \"Feminino\";\n\t\t\t}\t\n\t\t}", "public function geraName()\n {\n $name = 'VPS-'.rand (1,254);\n if(MVps::where('str_vps_name', $name)->first()) {\n return $this->geraName(); \n } else {\n return $name;\n } \n }", "function LisGrupoUsuario($nombre) {\n $ocado = new cado();\n $sql = \"select * from conf_usuario_grupo where estado=0 and nombre like '$nombre%' order by nombre asc\";\n $ejecutar = $ocado->ejecutar($sql);\n return $ejecutar;\n }", "public function GetNombre()\n {\n return $this->_legajo;\n }", "public function getGradoId()\n {\n return $this->grado_id;\n }", "function cl_grupocaracteristica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"grupocaracteristica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function miFuncion(){\n\n //mostrar un nombre \n return 'Este es un nombre';\n }", "function tamcolumna($nom){\n \n switch ($nom){\n case \"Estudiante\":\n $tam='25%';\n break;\n case \"Codigo_Sis\":\n $tam='15%';\n break;\n case \"Nombre_Proyecto\":\n $tam='30%';\n break;\n case \"Pro\":\n $tam='6%';\n break;\n case \"Apro\":\n $tam='7%';\n break;\n default :\n $tam='5%';\n }\n return $tam; \n }", "public function buscarTGradoEstudiante( ) {\n\t\t$sql = \"SELECT\n\t\t\t\t\tidtrabajodegrado, nombretrabajodegrado\n\t\t\t\tFROM\n\t\t\t\t\ttrabajodegrado\n\t\t\t\tWHERE\n\t\t\t\t\tcodigoestudiante = ?\n\t\t\t\tAND codigoestado LIKE '1%'\";\n\t\t$this->persistencia->crearSentenciaSQL( $sql );\n\t\t$this->persistencia->setParametro( 0 , $this->getEstudiante( )->getCodigoEstudiante( ) , false );\n\t\t$this->persistencia->ejecutarConsulta( );\n\t\tif( $this->persistencia->getNext( ) ){\n\t\t\t$this->setIdTrabajoGrado( $this->persistencia->getParametro( \"idtrabajodegrado\" ) );\n\t\t\t$this->setNombreTrabajoGrado( $this->persistencia->getParametro( \"nombretrabajodegrado\" ) );\n\t\t}\n\t\t//echo $this->persistencia->getSQLListo( );\n\t\t$this->persistencia->freeResult( );\n\t\t\n\t}", "public function getNameAttribute($valor)\n {\n //return ucfirst($valor); //primera letra en mayuscula\n return ucwords($valor); //primera de cada palabra en mayuscula \n }", "protected function getGameName( )\r\n {\r\n return \"briscolasuperamici\";\r\n }", "function nombre($cod_programa) {\n if ($cod_programa == '0')\n return 'TODOS';\n return TPrograma::get($cod_programa, \"nombre\");\n }", "function nomi_terapia($nome)\n{\n\tif ( ($nome == 'id') || ($nome == 'id_paziente') );\n\n\telse if ( $nome == 'rt_conformazionale') \t\n\t\treturn ('Conformational RT');\n\telse if ( $nome == 'data_rt_conformazionale') \t\n\t\treturn ('Conformational RT Date');\t\n\telse if ( $nome == 'radiochirurgia') \t\n\t\treturn ('Radiosurgery');\n\telse if ( $nome == 'data_radiochirurgia') \t\n\t\treturn ('Date of Radiosurgery');\t\n\t\n\telse\n\t\treturn ucfirst($nome);\n}", "public function getNom();", "public function setIdTrabajoGrado( $idTrabajoGrado ){\n\t\t$this->idTrabajoGrado = $idTrabajoGrado;\n\t}", "public function getNombreTratamiento() {\r\n\t\treturn $this->tratamiento;\r\n\t}", "public function makeGrupnumber()\n {\n return $this->randomNumber(4).date('dmy');\n }", "function verificacion_nombre_grupo_field($grupo_field_id, $nombre) {\n\t\t//O sino chequeamos que se esten editando otros datos de un grupo que no sea su nombre\n\t\tif($this->is_nombre_grupo_fields_disponible($nombre) || $this->is_mismo_grupo($nombre, $grupo_field_id)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getName()\n {\n return 'personne';\n }" ]
[ "0.77896625", "0.68447626", "0.6351023", "0.63266027", "0.6125311", "0.60934144", "0.60626125", "0.60626125", "0.60526496", "0.59873545", "0.586134", "0.5858869", "0.5851527", "0.5851427", "0.5848988", "0.5776541", "0.57281184", "0.5665559", "0.56478626", "0.5644181", "0.5608398", "0.55982965", "0.5580182", "0.55710024", "0.55607605", "0.5557889", "0.5550172", "0.55282164", "0.5518552", "0.54996586" ]
0.7241583
1
Retorna el nombre del Trabajo de Grado
public function getNombreTrabajoGrado( ){ return $this->nombre; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGradoNombre()\n {\n return $this->grado_nombre;\n }", "public function getIdTrabajoGrado( ){\n\t\treturn $this->idTrabajoGrado;\n\t}", "function nombrecampo($numcampo){\n\t\treturn mysql_field_name($this->consulta_ID, $numcampo);\n\t}", "function nombrecampo($numcampo){\n\t\treturn mysql_field_name($this->consulta_ID, $numcampo);\n\t}", "public function getTrinomialName() : string;", "public function getNom_distribuidor()\n {\n return $this->nom_distribuidor;\n }", "public function getNombreTratamiento() {\r\n\t\treturn $this->tratamiento;\r\n\t}", "function nombrecampo($numcampo) {\r\nreturn mysql_field_name($this->Consulta_ID, $numcampo);\r\n}", "public function ConstruirNombre()\n {\n $res = 'Acta ' . $this->getSubTipo() . ' Nº ' . $this->getNumero();\n return $res;\n }", "public function getGradoId()\n {\n return $this->grado_id;\n }", "public function GetNombre()\n {\n return $this->_legajo;\n }", "public function getNombreRelacionado()\n {\n switch (get_class($this->userable)) {\n case 'App\\Empresa':\n return $this->userable->razon_social;\n break;\n case 'App\\Centro':\n return $this->userable->empresa->razon_social . \" \" . $this->userable->nombre;\n break;\n case 'App\\CompassRole':\n return __('Compass');\n break;\n default:\n return '';\n break;\n }\n }", "function nama_gbr_baru($id_artikel, $nama_gambar){\n\t\t\treturn ($id_artikel.\"_\".$nama_gambar);\n\t\t}", "public function makeGrupnumber()\n {\n return $this->randomNumber(4).date('dmy');\n }", "public function getNom();", "public function geraName()\n {\n $name = 'VPS-'.rand (1,254);\n if(MVps::where('str_vps_name', $name)->first()) {\n return $this->geraName(); \n } else {\n return $name;\n } \n }", "public function getNombreCompleto() {\n return $this->profesional_nombre . \" \" . $this->profesional_apellido_paterno . \" \" . $this->profesional_apellido_materno;\n }", "public function getRegistroGrado( ){\n\t\treturn $this->registroGrado;\n\t}", "public function getNombreComunidad()\n {\n return $this->nombreComunidad;\n }", "public function getNomenclatura()\n {\n return $this->nomenclatura;\n }", "public function setNombreTrabajoGrado( $nombre ){\n\t\t$this->nombre = $nombre;\n\t}", "public function genero($tipo) {\t\t\t\t\t\n\t\t\tif (strtoupper($tipo) == 'M') {\n\t\t\t\treturn \"Masculino\";\n\t\t\t} else if (strtoupper($tipo) == 'F') {\t\n\t\t\t\treturn \"Feminino\";\n\t\t\t}\t\n\t\t}", "protected function _getPlanTipoNome()\n {\n $plan = new Plan();\n $tiposArray = $plan->getTipos();\n\n return $tiposArray[ $this->_properties['plan_tipo'] ];\n }", "public function getNombreTeatro()\n {\n return $this->nombreTeatro;\n }", "public function getnombre()\r\n\t{\r\n\t\treturn $this->nombre;\r\n\t}", "private function obtener_grupo_nombre()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t$query = $em->createQuery('SELECT DISTINCT g.nombre FROM AppBundle:grupos g ORDER BY g.nombre ASC');\n\t\t$grupos = $query->getResult();\n\t\treturn $grupos;\n\t}", "function getNombreFamilia($idfamily){\n $manager = new ManageFamily($this->getDataBase());\n return $manager->getNameFamily($idfamily);\n }", "public function getGroupName() {\n return $this->group->bezeichnung;\n }", "public function getGanhadorSegundo()\n {\n if ($this->getTimeCasaPlacarSegundo() > $this->getTimeForaPlacarSegundo()) {\n return 'casa';\n } else if ($this->getTimeCasaPlacarSegundo() < $this->getTimeForaPlacarSegundo()) {\n return 'fora';\n } else {\n return 'empate';\n }\n }", "public function getRelacionamentoNome()\n {\n return $this->RelacionamentoNome;\n }" ]
[ "0.7572951", "0.7037197", "0.6695505", "0.6695505", "0.661271", "0.6528516", "0.65044075", "0.6502834", "0.64598745", "0.6400132", "0.639314", "0.6310599", "0.62326837", "0.6181268", "0.6176602", "0.61670524", "0.61655843", "0.615882", "0.61517274", "0.61207044", "0.6116298", "0.6106406", "0.610104", "0.6050138", "0.6048404", "0.6046653", "0.6026556", "0.6024903", "0.60125023", "0.59992224" ]
0.8399416
0
Busca si existe Trabajo de Grado por Estudiante
public function buscar( ) { $sql = "SELECT COUNT( idtrabajodegrado ) as existe FROM trabajodegrado WHERE codigoestudiante = ? AND codigoestado LIKE '1%'"; $this->persistencia->crearSentenciaSQL( $sql ); $this->persistencia->setParametro( 0 , $this->getEstudiante( )->getCodigoEstudiante( ) , false ); $this->persistencia->ejecutarConsulta( ); if( $this->persistencia->getNext( ) ){ return $this->persistencia->getParametro( "existe" ); } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buscarTGradoEstudiante( ) {\n\t\t$sql = \"SELECT\n\t\t\t\t\tidtrabajodegrado, nombretrabajodegrado\n\t\t\t\tFROM\n\t\t\t\t\ttrabajodegrado\n\t\t\t\tWHERE\n\t\t\t\t\tcodigoestudiante = ?\n\t\t\t\tAND codigoestado LIKE '1%'\";\n\t\t$this->persistencia->crearSentenciaSQL( $sql );\n\t\t$this->persistencia->setParametro( 0 , $this->getEstudiante( )->getCodigoEstudiante( ) , false );\n\t\t$this->persistencia->ejecutarConsulta( );\n\t\tif( $this->persistencia->getNext( ) ){\n\t\t\t$this->setIdTrabajoGrado( $this->persistencia->getParametro( \"idtrabajodegrado\" ) );\n\t\t\t$this->setNombreTrabajoGrado( $this->persistencia->getParametro( \"nombretrabajodegrado\" ) );\n\t\t}\n\t\t//echo $this->persistencia->getSQLListo( );\n\t\t$this->persistencia->freeResult( );\n\t\t\n\t}", "private function testGroupe()\r\n\t{\r\n\t\t$var=$this->monUtilisateur->recupGroupes();\r\n\t\tif ($var[0] == DIEU ) return 1;\r\n\t\telse return 0;\r\n\t}", "function LisGrupoUsuario($nombre) {\n $ocado = new cado();\n $sql = \"select * from conf_usuario_grupo where estado=0 and nombre like '$nombre%' order by nombre asc\";\n $ejecutar = $ocado->ejecutar($sql);\n return $ejecutar;\n }", "function verificarCruce($retorno,$horarioEstudiante,$horarioGrupo) {\n //verifica si hay cruce de horario\n $cruce=$this->validacion->verificarCruceHorarios($horarioEstudiante,$horarioGrupo);\n if($cruce==1)\n {\n $retorno['mensaje']=\"El horario del espacio académico presenta cruce con el horario del estudiante. No se ha realizado la inscripción\";\n $this->enlaceNoAdicion($retorno);\n exit;\n }\n }", "function verificarCruce($retorno,$horarioEstudiante,$horarioGrupo) {\n //verifica si hay cruce de horario\n $cruce=$this->validacion->verificarCruceHorarios($horarioEstudiante,$horarioGrupo);\n if($cruce==1)\n {\n $retorno['mensaje']=\"El horario del espacio académico presenta cruce con el horario del estudiante. No se ha realizado la inscripción\";\n $this->enlaceNoAdicion($retorno);\n exit;\n }\n }", "function classe_existante($niveau, $groupe)\n{\n\tinclude'./inc/db.php';\n\t$classe_existe = false;\n\t\n\t$classes = $bdd->prepare('SELECT niveau, groupe FROM classes WHERE niveau= ? AND groupe = ?');\n\t$classes->execute(array($niveau, $groupe));\n\t$donnees_classes = $classes ->fetch();\n\t\n\tif($donnees_classes){\n\t\t$classe_existe = true;\n\t}\n\t\n\treturn $classe_existe;\t\n}", "function ultimoGrupo($arregloDatos) \n\n {\n\n $sql=\" SELECT lev_cuenta_grupo as cantidad\n\n FROM inventario_maestro_movimientos\n\n WHERE codigo =$arregloDatos[id_levante]\"; \n\n $this->query($sql);\n\n if($this->_lastError) {\n\n echo\n\n $sql;\n\n return TRUE;\n\n }\n\n \n\n $this->fetch();\n\n $arregloDatos[cuenta_grupos]=$this->cantidad;\n\n return $arregloDatos[cuenta_grupos];\n\n //echo \"xxx\";\n\n }", "function fetchGrupos(){\n\n\t$sql; //variable que alberga la sentencia sql\n $resultado; //almacena la consulta sql\n $result; //almacena el valor de la variable resultado\n\n\t//Se crea la sentecia para recoger todos los grupos\n\t$sql = \"SELECT * FROM `GRUPO` \";\n\n\tif (!($resultado = $this->mysqli->query($sql))){ //si al ejecutar la queryno se encuentra el resultado\n\t\treturn 'It does not exist in DB'; // mensaje de que no existe en la bd\n\t}\n\telse{ // si existe se devuelve la tupla resultado\n\t\t$result = $resultado;\n\t\treturn $result;\n\t}\n}", "function fetchGruposUsu(){\n\n\t$sql; //variable que alberga la sentencia sql\n $resultado; //almacena la consulta sql\n $result; //almacena el valor de la variable resultado\n\n\t//Se crea la sentecia para recoger todos los grupos al que pertence el usuario\n\t$sql = \"SELECT IdGrupo FROM `USU_GRUPO` WHERE (login = '\".$this->login.\"')\";\n\t\n\tif (!($resultado = $this->mysqli->query($sql))){ //si al ejecutar la queryno se encuentra el resultado\n\t\treturn 'It does not exist in DB'; //mensaje de que no existe en la bd\n\t}\n\telse{ // si existe se devuelve la tupla resultado\n\t\t$result = $resultado;\n\t\treturn $result;\n\t}\n}", "function getSumaGrupo($arregloDatos) {\n\n $sql=\" SELECT im.cod_maestro,\n\n SUM(im.cantidad_naci) as sum_cant_naci\n\n FROM inventario_movimientos im,inventario_maestro_movimientos imm,inventario_declaraciones declaracion\n\n WHERE im.cod_maestro = imm.codigo\n\n AND declaracion.num_levante =im.num_levante\n\n AND im.cod_maestro = '$arregloDatos[id_levante]'\n\n AND declaracion.grupo = '$arregloDatos[id_grupo]'\n\n GROUP BY im.cod_maestro\";\n\n //echo $sql;\n\n $this->query($sql);\n\n if($this->_lastError) {\n\n echo $sql;\n\n return TRUE;\n\n } \n\n }", "function existeRegra() {\n $query = \"SELECT id_regra FROM `regras` WHERE nome_regra = '$this->nome_regra'\";\n $resultado = $this->bd->executarQuery($query);\n if ($this->bd->teveRetorno($resultado)):\n return true;\n else:\n return false;\n endif;\n }", "public function issetEstudiante($login, $clave) {\n if ($login == \"\" || $clave == \"\")\n return false;\n $activo = Objectbase::STATUS_AC;\n $sql = \"select * , a.id as estudiante_id , u.id as usuario_id from \" . $this->getTableName() . \" as a , \" . $this->getTableName('usuario') . \" as u where u.login = '$login' and u.clave = '$clave' and a.usuario_id = u.id and u.estado = '$activo' and a.estado = '$activo' \";\n //echo $sql; \n $resultado = mysql_query($sql);\n if (!$resultado)\n return false;\n $user = mysql_fetch_object($resultado);\n //grabamos en la tabla pertenece si es que no tiene \n leerClase('Grupo');\n leerClase('Pertenece');\n $grupo = new Grupo('', Grupo::GR_ES);\n if ($grupo->id && isset($user->usuario_id) && $user->usuario_id )\n {\n $pertenece = new Pertenece('',$grupo->id,$user->usuario_id );\n if (!$pertenece->id)\n {\n $pertenece->usuario_id = $user->usuario_id;\n $pertenece->grupo_id = $grupo->id;\n $pertenece->estado = Objectbase::STATUS_AC;\n $pertenece->save();\n }\n }\n return $user;\n }", "public function AddGrado($usuario){\n\t\t\t$this->usuario=$usuario;\n\t\t\t$this->grado=$this->db->real_escape_string($_POST['grado']);\n\t\t\t$this->grado=trim(strtolower($this->grado));\n\t\t\t$sql=$this->db->query(\"SELECT * FROM grado WHERE grado='$this->grado' LIMIT 1;\");\n\t\t\tif($this->db->rows($sql)==0){\n\t\t\t\t$this->db->query(\"INSERT INTO grado(grado) VALUES('$this->grado');\");\n\t\t\t\t$indicesServer = array('REMOTE_ADDR',);\n\t\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t\t\t$evento=\"Agrego el grado \".$this->grado;\n\t\t\t\t$this->db->query(\"INSERT INTO registro_eventos(ip, usuario, evento, fecha, operacion) VALUES('$ip', '$this->usuario', '$evento', NOW(), 'INSERT');\");\n\t\t\t\t$this->db->liberar($sql);\n\t\t\t\theader(\"location: ?view=config&mode=GradoSecciones&success=1\");\n\t\t\t}else{\n\t\t\t\t$this->db->liberar($sql);\n\t\t\t\theader(\"location: ?view=config&mode=GradoSecciones&error=2\");\n\t\t\t}\n\t\t}", "function existeFicheFrais( $unMois, $unIdVisiteur) {\n $unMois = filtrerChainePourBD($unMois);\n $requete = \"select idVisiteur from FicheFrais where idVisiteur='\" . $unIdVisiteur . \n \"' and mois='\" . $unMois . \"'\";\n $idJeuRes = PdoGsb::$monPdo->query($requete); \n if($idJeuRes->rowCount() == 1)\n return true;\n else\n return false;\n}", "function evaluaTipoGrafico($idIndicador,$idDocente){\n $tipoGrafico = null;\n if($idIndicador == '' && $idDocente != ''){\n $tipoGrafico = DOCENTE_GENERAL;\n } else if($idIndicador != '' && $idDocente != ''){\n $tipoGrafico = DOCENTE_INDICADOR;\n } else if($idIndicador != '' && $idDocente == ''){\n $tipoGrafico = INDICADOR_GENERAL;\n }\n return $tipoGrafico;\n }", "function ultimoGrupoCreado($arregloDatos) \n\n {\n\n $sql=\" SELECT max(grupo) as cantidad\n\n FROM inventario_declaraciones\n\n WHERE cod_maestro =$arregloDatos[id_levante]\"; \n\n \n\n $this->query($sql);\n\n if($this->_lastError) {\n\n echo $sql;\n\n return TRUE;\n\n }\n\n \n\n $this->fetch();\n\n $arregloDatos[cuenta_grupos]=$this->cantidad;\n\n return $arregloDatos[cuenta_grupos];\n\n }", "public function ValidaEstadoDepto($usuid,$estgenerico){\n $jsonresponse = array();\n $msg='';\n $estadomemo = 0;\n try{\n $consultamemoestado = \"SELECT me.memo_estado_id\n FROM usuario as usu\n INNER JOIN dpto_tiene_usu AS dtu ON dtu.dpto_tiene_usu_usuario_id = usu.usuario_id\n INNER JOIN memo_estado AS me ON me.memo_estado_depto_id = dtu.dpto_tiene_usu_depto_id\n WHERE usu.usuario_id = \".$usuid. \" AND dtu.dpto_tiene_usu_principal = 1 AND me.memo_estado_memo_estadogenerico_id = \".$estgenerico;\n $res = $this->pdo->query($consultamemoestado);\n $estadomemo = $res->fetchColumn();\n if($estadomemo == NULL || $estadomemo == ''){\n // $msg='NO existe estado para el Depto. del usuario, no esta autorizado para ingresar Documentos ';\n $msg='NO está autorizado para ingresar Documentos, consulte con el Administrador del Sistema ';\n }else{\n $msg='Estado del Depto para usuario existe';\n }\n $jsonresponse['success'] = true;\n $jsonresponse['message'] = $msg; \n $jsonresponse['estadoinicial'] = $estadomemo;\n } catch (Exception $Exception){\n $jsonresponse['success'] = false;\n $jsonresponse['message'] = 'Error al validar estado depto del usuario';\n $jsonresponse['errorQuery'] = $Exception->getMessage();\n $logs = new modelologs();\n $trace=$Exception->getTraceAsString();\n $logs->GrabarLogs($Exception->getMessage(),$trace);\n $logs = null; \n }\n return $jsonresponse;\n }", "public function pontGrupo($procod,$grucod,$seqticms){\n $iretpont = 0;\n \n $sSql = \"select count(*) as cont from widl.prod01(nolock) \"\n .\"where procod =\".$procod.\" and grucod =\".$grucod.\" group by procod\"; \n $result =$this->getObjetoSql($sSql);\n $row = $result->fetch(PDO::FETCH_OBJ);\n if($row->cont > 0){\n $sSql = \"select icmspesgru from widl.ICMS(nolock) \"\n .\"where icmsseq =\".$seqticms.\" and icmsgrucod =\".$grucod; \n $result =$this->getObjetoSql($sSql);\n $row = $result->fetch(PDO::FETCH_OBJ);\n $iretpont = $row->icmspesgru;\n \n }\n \n \n return $iretpont;\n \n }", "function validarLeccion($leccion, $usuario){\n $db = new Bd();\n $db->conectar();\n $sql_select_mlv = $db->consulta(\"SELECT * FROM mandino_lecciones_visto WHERE fk_usuario = :fk_usuario AND fk_ml = :fk_ml\", array(\":fk_usuario\" => $usuario, \":fk_ml\" => $leccion));\n $db->desconectar();\n return $sql_select_mlv['cantidad_registros'];\n }", "public function getIdAgrupadorLibre(){\n $id_agrupador_max = 0;\n $flag_existe_agrupador = false;\n //para ZonaSesion\n foreach($this->_ZonaSesion_arr as $ZonaSesion){\n if($ZonaSesion->getIdAgrupador()>$id_agrupador_max){\n $id_agrupador_max=$ZonaSesion->getIdAgrupador();\n $flag_existe_agrupador=true; \n }\n //los descuentos\n $descuento_arr = $ZonaSesion->getIdDescuentoArr();\n foreach($descuento_arr as $descuento){\n if($descuento[\"id_agrupador\"]>$id_agrupador_max){\n $descuento[\"id_agrupador\"];\n $flag_existe_agrupador=true; \n }\n }\n }\n //para EspecialButacaSesion\n foreach($this->_EspecialButacaSesion_arr as $EspecialButacaSesion){\n if($EspecialButacaSesion->getIdAgrupador()>$id_agrupador_max){\n $id_agrupador_max=$EspecialButacaSesion->getIdAgrupador();\n $flag_existe_agrupador=true; \n }\n //los descuentos\n $descuento_arr = $EspecialButacaSesion->getIdDescuentoArr();\n foreach($descuento_arr as $descuento){\n if($descuento[\"id_agrupador\"]>$id_agrupador_max){\n $descuento[\"id_agrupador\"];\n $flag_existe_agrupador=true; \n }\n }\n }\n //para CanalesSesion\n foreach($this->_CanalesSesion_arr as $CanalesSesion){\n if($CanalesSesion->getIdAgrupador()>$id_agrupador_max){\n $id_agrupador_max=$CanalesSesion->getIdAgrupador();\n $flag_existe_agrupador=true; \n }\n //los descuentos\n $descuento_arr = $CanalesSesion->getIdDescuentoArr();\n foreach($descuento_arr as $descuento){\n if($descuento[\"id_agrupador\"]>$id_agrupador_max){\n $descuento[\"id_agrupador\"];\n $flag_existe_agrupador=true; \n }\n }\n }\n if($flag_existe_agrupador=true)$id_agrupador_max = $id_agrupador_max+1;//si no se ha cambiado tiene qeu ser cero para que id_agrupador vaya de 0 a n\n return $id_agrupador_max;\n }", "protected function validarExistencia()\n {\n $detalles = $this->articulo->getDetalle();\n $disponibles = 0;\n \n foreach ($detalles as $detalle) {\n if ($detalle->getEstado() === 'D') {\n $disponibles++;\n }\n }\n \n if (!isset($this->data['cantidad'])) {\n $this->status = false;\n $this->errorMessages[] = 'No se especifico la cantidad';\n return;\n }\n \n if ($this->data['cantidad'] > $disponibles) {\n $this->status = false;\n $this->errorMessages[] = 'No existe la cantidad de articulos solicitada';\n }\n }", "private function verificar_seguimiento_grupo($usuario, $deleted) {\n //puede ser que se tenga que eliminar un grupo de la lista\n //de grupos que controla para revisar detalle.\n $u = Doctrine::getTable('UsuarioBackend')->findOneByUsuarioAndCuentaId($usuario->usuario, $usuario->cuenta_id);\n // if ($u && $u->rol == 'seguimiento'){\n if ($u && UsuarioBackend::user_has_rol($u->id, 'seguimiento')) {\n\n //se elimino el usuario del front end\n if ($deleted) {\n $u->seg_alc_grupos_usuarios = NULL;\n $u->save();\n } else {\n\n $save_u = NULL;\n $seg_alc_grupos_usuarios = $u->seg_alc_grupos_usuarios;\n foreach ($seg_alc_grupos_usuarios as $key => $value) {\n if ($value == 'todos') {\n continue;\n }\n $encontre = false;\n foreach ($usuario->GruposUsuarios as $key1 => $value1) {\n if ($value == $value1->id) {\n $encontre = true;\n break;\n }\n }\n\n if (!$encontre) {\n //se tiene que eliminar\n unset($seg_alc_grupos_usuarios[$key]);\n $save_u = TRUE;\n }\n }\n\n if ($save_u == TRUE) {\n $u->seg_alc_grupos_usuarios = $seg_alc_grupos_usuarios;\n $u->save();\n }\n\n //si el usuario no tiene grupos entonces se deja null\n if (count($usuario->GruposUsuarios) == 0) {\n $u->seg_alc_grupos_usuarios = NULL;\n $u->save();\n }\n }\n }\n }", "function getEdificioEstacionamientosGrandes(){\n\t\t$this->resultado = pg_query($this->con,\"SELECT edificios.nombre,ST_AsText(ST_CENTROID(edificios.geom)) as edificioPos,ST_AsText(estacionamientos.geom) as estacionamientoPos FROM estacionamientos, edificios WHERE estacionamientos.tamanio = 2 AND estacionamientos.edif = edificios.id\");\t\n\t}", "public function esSesionAgotada(){\n $this->_ButacaSesion_arr;\n foreach($this->_ButacaSesion_arr as $ButacaSesion){\n if($ButacaSesion->getEstado()==\"libre\"){\n return 0;\n }\n }\n return 1;\n }", "function tieneAistencia($id_nom, $aId_activ)\n{\n // Comprobar que no tienen alguna actividad ya asignada como propia\n $GesAsistentes = new asistentes\\GestorAsistenteDl();\n $cAsistentes = $GesAsistentes->getAsistentesDl(array('id_nom' => $id_nom, 'propio' => 't'));\n foreach ($cAsistentes as $oAsistente) {\n $id_activ = $oAsistente->getId_activ();\n if (array_key_exists($id_activ, $aId_activ)) {\n return TRUE;\n }\n }\n $GesAsistentesOut = new asistentes\\GestorAsistenteOut();\n $cAsistentesOut = $GesAsistentesOut->getAsistentesOut(array('id_nom' => $id_nom, 'propio' => 't'));\n foreach ($cAsistentesOut as $oAsistente) {\n $id_activ = $oAsistente->getId_activ();\n if (array_key_exists($id_activ, $aId_activ)) {\n return TRUE;\n }\n }\n return FALSE;\n}", "function consultarGrupos() {\n\t\t\tglobal $res;\n\t\t\t$cnx = conectar_mysql(\"Suministros\");\n\t\t\t$cons = \"SELECT DISTINCT(Agrupacion) FROM Suministros.Movimientos\";\n\t\t\t$res = mysql_query($cons);\n\t\t\treturn $res; \n\t\t\n\t\t}", "function db_conplano_grupo($anousu = null, $estrut = \"\", $grupo = 0) {\n\n if ($anousu == \"\" || $anousu == null) {\n $anousu = db_getsession(\"DB_anousu\");\n }\n\n $sql_result = analiseQueryPlanoOrcamento(\"select fc_conplano_grupo($anousu, '$estrut', $grupo) as retorno\");\n $result = db_query($sql_result);\n $numrows = pg_numrows($result);\n if ($numrows != 0) {\n $retorno = pg_result($result, 0, 0);\n if ($retorno == 't') {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "function VerificarIntegridad($idantibiotico)\r\n{\r\n $con = new ConexionBD;\r\n if($con->conectar()==true)\r\n {\r\n $query = \"SELECT * FROM lab_antibioticosportarjeta WHERE idantibiotico='$idantibiotico'\";\r\n $result = pg_query($query);\r\n\t $cuenta = pg_num_rows($result);\r\n\t \r\n if ($cuenta > 0)\r\n return true;\r\n else\r\n return false;\r\n }\r\n}", "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }", "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }" ]
[ "0.6993624", "0.6506359", "0.61965156", "0.6073526", "0.6073526", "0.5953309", "0.59403324", "0.5940321", "0.5937088", "0.5925361", "0.5917719", "0.591563", "0.59067905", "0.5893661", "0.58532774", "0.5836181", "0.581449", "0.57524836", "0.5751792", "0.57467014", "0.574635", "0.5735918", "0.5726457", "0.5706704", "0.57057273", "0.5705666", "0.5690934", "0.5689512", "0.5640604", "0.5640604" ]
0.6509205
1
Busca Trabajo de Grado por Estudiante
public function buscarTGradoEstudiante( ) { $sql = "SELECT idtrabajodegrado, nombretrabajodegrado FROM trabajodegrado WHERE codigoestudiante = ? AND codigoestado LIKE '1%'"; $this->persistencia->crearSentenciaSQL( $sql ); $this->persistencia->setParametro( 0 , $this->getEstudiante( )->getCodigoEstudiante( ) , false ); $this->persistencia->ejecutarConsulta( ); if( $this->persistencia->getNext( ) ){ $this->setIdTrabajoGrado( $this->persistencia->getParametro( "idtrabajodegrado" ) ); $this->setNombreTrabajoGrado( $this->persistencia->getParametro( "nombretrabajodegrado" ) ); } //echo $this->persistencia->getSQLListo( ); $this->persistencia->freeResult( ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNombreTrabajoGrado( ){\n\t\treturn $this->nombre;\n\t}", "function getEdificioEstacionamientosGrandes(){\n\t\t$this->resultado = pg_query($this->con,\"SELECT edificios.nombre,ST_AsText(ST_CENTROID(edificios.geom)) as edificioPos,ST_AsText(estacionamientos.geom) as estacionamientoPos FROM estacionamientos, edificios WHERE estacionamientos.tamanio = 2 AND estacionamientos.edif = edificios.id\");\t\n\t}", "function buscarHorarioGrupo() {\n $variables=array(array('CODIGO'=>$this->datosInscripcion['codEspacio'],\n 'GRUPO'=>$this->datosInscripcion['grupo']));\n $horarioGrupo=$this->procedimientos->buscarHorario($variables);\n return $horarioGrupo;\n }", "function buscarHorarioGrupo() {\n $variables=array(array('CODIGO'=>$this->datosInscripcion['codEspacio'],\n 'ID_GRUPO'=>$this->datosInscripcion['id_grupo'],\n 'HOR_ALTERNATIVO'=>$this->datosInscripcion['hor_alternativo'])\n );\n $horarioGrupo=$this->procedimientos->buscarHorario($variables);\n return $horarioGrupo;\n }", "function consultarGrupos() {\n\t\t\tglobal $res;\n\t\t\t$cnx = conectar_mysql(\"Suministros\");\n\t\t\t$cons = \"SELECT DISTINCT(Agrupacion) FROM Suministros.Movimientos\";\n\t\t\t$res = mysql_query($cons);\n\t\t\treturn $res; \n\t\t\n\t\t}", "public function getIdTrabajoGrado( ){\n\t\treturn $this->idTrabajoGrado;\n\t}", "function BuscarEstado($reg){\n if($reg->Estado_idEstado=='1' || $reg->Estado_idEstado==1 ){\n return '<div class=\"badge badge-success\">'.$reg->nombreEstado.'</div>';\n }elseif($reg->Estado_idEstado=='2' || $reg->Estado_idEstado==2){\n return '<div class=\"badge badge-danger\">'.$reg->nombreEstado.'</div>';\n }else{\n return '<div class=\"badge badge-primary\">'.$reg->nombreEstado.'</div>';\n }\n }", "function getSumaGrupo($arregloDatos) {\n\n $sql=\" SELECT im.cod_maestro,\n\n SUM(im.cantidad_naci) as sum_cant_naci\n\n FROM inventario_movimientos im,inventario_maestro_movimientos imm,inventario_declaraciones declaracion\n\n WHERE im.cod_maestro = imm.codigo\n\n AND declaracion.num_levante =im.num_levante\n\n AND im.cod_maestro = '$arregloDatos[id_levante]'\n\n AND declaracion.grupo = '$arregloDatos[id_grupo]'\n\n GROUP BY im.cod_maestro\";\n\n //echo $sql;\n\n $this->query($sql);\n\n if($this->_lastError) {\n\n echo $sql;\n\n return TRUE;\n\n } \n\n }", "public function pontGrupo($procod,$grucod,$seqticms){\n $iretpont = 0;\n \n $sSql = \"select count(*) as cont from widl.prod01(nolock) \"\n .\"where procod =\".$procod.\" and grucod =\".$grucod.\" group by procod\"; \n $result =$this->getObjetoSql($sSql);\n $row = $result->fetch(PDO::FETCH_OBJ);\n if($row->cont > 0){\n $sSql = \"select icmspesgru from widl.ICMS(nolock) \"\n .\"where icmsseq =\".$seqticms.\" and icmsgrucod =\".$grucod; \n $result =$this->getObjetoSql($sSql);\n $row = $result->fetch(PDO::FETCH_OBJ);\n $iretpont = $row->icmspesgru;\n \n }\n \n \n return $iretpont;\n \n }", "public function asignValueGrado($grado)\n {\n\n $categoryValue = '';\n switch ($grado) {\n case 'Cinturón Marrón':\n $categoryValue = 0;\n break;\n case 'Cinturón Negro':\n $categoryValue = 1;\n break;\n case 'Primer Dan':\n $categoryValue = 2;\n break;\n case 'Segundo Dan':\n $categoryValue = 3;\n break;\n case 'Tercer Dan':\n $categoryValue = 4;\n break;\n case 'Cuarto Dan':\n $categoryValue = 5;\n break;\n case 'Quinto Dan':\n $categoryValue = 6;\n break;\n case 'Sexto Dan':\n $categoryValue = 7;\n break;\n case 'Séptimo Dan':\n $categoryValue = 8;\n break;\n case 'Octavo Dan':\n $categoryValue = 9;\n break;\n case 'Noveno Dan':\n $categoryValue = 10;\n break;\n case 'Décimo Dan':\n $categoryValue = 11;\n break;\n }\n return $categoryValue;\n }", "function ultimoGrupo($arregloDatos) \n\n {\n\n $sql=\" SELECT lev_cuenta_grupo as cantidad\n\n FROM inventario_maestro_movimientos\n\n WHERE codigo =$arregloDatos[id_levante]\"; \n\n $this->query($sql);\n\n if($this->_lastError) {\n\n echo\n\n $sql;\n\n return TRUE;\n\n }\n\n \n\n $this->fetch();\n\n $arregloDatos[cuenta_grupos]=$this->cantidad;\n\n return $arregloDatos[cuenta_grupos];\n\n //echo \"xxx\";\n\n }", "public function getRegistroGrado( ){\n\t\treturn $this->registroGrado;\n\t}", "public function getGradoId()\n {\n return $this->grado_id;\n }", "function consultarSumaGastos($conexion,$fechaInicial,$fechaFinal){\n\t\ttry {\n\n\t\t\t$stmt=$conexion->prepare('SELECT SUM(Coste) AS SUMAGASTOS FROM gastos G WHERE (G.FechaPago between to_date(:fechaInicial,\\'YYYY/MM/DD\\') and to_date(:fechaFinal,\\'YYYY/MM/DD\\')+1)');\n\t\t\t$stmt->bindParam(':fechaInicial',$fechaInicial);\n\t\t\t$stmt->bindParam(':fechaFinal',$fechaFinal);\n\t\t\t$stmt->execute();\n\t\t\t$fila = $stmt->fetch();\n\n\t\t\tif($fila[\"SUMAGASTOS\"]==null){\n\t\t\t\t$sumaGastos=0;\n\t\t\t} else{\n\t\t\t\t$sumaGastos = $fila[\"SUMAGASTOS\"];\n\t\t\t}\n\n\t\t\treturn $sumaGastos;\n\n\t\t} catch(PDOException $e) {\n\t\t\treturn \"\";\n\t\t}\n\t}", "static public function crtMostrarGanaciasTotal(){\n\n\t\t\t$ventasTotal = ControladorVentas::ctrSumaTotalVentas();\n\t\t\t$comprasTotal = ControladorProductos::ctrMostrarSumaCompras();\n\n\t\t\t$compras = (number_format($comprasTotal[\"comprasTotal\"],2));// compras\n\t\t\t$ventas = ( number_format($ventasTotal[\"total\"],2));// ventas\n\n\t\t\treturn $gananciasTotal = $ventas - $compras;\n\n\t\t}", "public function getGradoNombre()\n {\n return $this->grado_nombre;\n }", "public function estados($tipo) {\t\t\t\t\t\n\t\t\tif (strtoupper($tipo) == 'AC') {\n\t\t\t\treturn \"Acre\";\n\t\t\t} else if (strtoupper($tipo) == 'AL') {\t\n\t\t\t\treturn \"Alagoas\";\n\t\t\t} else if (strtoupper($tipo) == 'AP') {\t\n\t\t\t\treturn \"Amapá\";\t\n\t\t\t} else if (strtoupper($tipo) == 'BA') {\t\n\t\t\t\treturn \"Bahia\";\t\t\n\t\t\t} else if (strtoupper($tipo) == 'CE') {\t\n\t\t\t\treturn \"Ceara\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'DF') {\t\n\t\t\t\treturn \"Distrito Federal\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'ES') {\t\n\t\t\t\treturn \"Espirito Santo\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'GO') {\t\n\t\t\t\treturn \"Goias\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'MA') {\t\n\t\t\t\treturn \"Maranhao\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'MT') {\t\n\t\t\t\treturn \"Mato Grosso\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'MS') {\t\n\t\t\t\treturn \"Mato Grosso do Sul\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'MG') {\t\n\t\t\t\treturn \"Minas Gerais\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'PA') {\t\n\t\t\t\treturn \"Para\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'PB') {\t\n\t\t\t\treturn \"Paraiba\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'PR') {\t\n\t\t\t\treturn \"Parana\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'PE') {\t\n\t\t\t\treturn \"Pernambuco\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'PI') {\t\n\t\t\t\treturn \"Piaui\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'RJ') {\t\n\t\t\t\treturn \"Rio de Janeiro\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'RN') {\t\n\t\t\t\treturn \"Rio Grande do Norte\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'RS') {\t\n\t\t\t\treturn \"Rio Grande do Sul\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'RO') {\t\n\t\t\t\treturn \"Rondonia\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'RR') {\t\n\t\t\t\treturn \"Roraima\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'SC') {\t\n\t\t\t\treturn \"Santa Catarina\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'SP') {\t\n\t\t\t\treturn \"Sao Paulo\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'SE') {\t\n\t\t\t\treturn \"Sergipe\";\t\t\t\n\t\t\t} else if (strtoupper($tipo) == 'TO') {\t\n\t\t\t\treturn \"Tocantins\";\t\t\t\n\t\t\t}\t\n\t\t}", "function consultarGrupoApoyo($idCompania, $fechaInicial, $fechaFinal, $año)\n {\n\n //**********************\n // C R E A C I O N \n // D E L A S \n // T A R E A S \n //*********************\n\n $grupoapoyo = DB::Select(\n ' SELECT nombreGrupoApoyo as descripcionTarea, \n idGrupoApoyo as idConcepto, \n IF(fechaConstitucionConformacionGrupoApoyo >= fechaCreacionCompania, fechaConstitucionConformacionGrupoApoyo, fechaCreacionCompania) as fechaCreacionCompania,\n valorFrecuenciaMedicion, unidadFrecuenciaMedicion\n FROM grupoapoyo GA\n left join conformaciongrupoapoyo CGA \n on GA.idGrupoApoyo = CGA.GrupoApoyo_idGrupoApoyo\n left join frecuenciamedicion FM\n on GA.FrecuenciaMedicion_idFrecuenciaMedicion = FM.idFrecuenciaMedicion\n LEFT JOIN compania c \n ON GA.Compania_idCompania = c.idCompania\n Where GA.Compania_idCompania = '.$idCompania .' \n group by idGrupoApoyo\n ');\n\n $datos = array();\n \n\n //and nombreCompletoTercero like \"'.$letra.'%\"\n for($i= 0; $i < count($grupoapoyo); $i++)\n {\n $registro = get_object_vars($grupoapoyo[$i]);\n $pos = buscarGrupoApoyo($registro[\"idConcepto\"], $datos);\n\n if($pos == -1)\n {\n $pos = count($datos);\n for($mes = 1; $mes <= 12; $mes++)\n {\n $datos[$pos][str_pad($mes, 2, '0', STR_PAD_LEFT).'T'] = 0;\n $datos[$pos][str_pad($mes, 2, '0', STR_PAD_LEFT).'C'] = 0;\n }\n }\n $datos[$pos]['idGrupoApoyo'] = $registro[\"idConcepto\"];\n $datos[$pos]['Nombre'] = $registro[\"descripcionTarea\"];\n\n // las tareas semanales o diarias deben crear 4 o 30 tareas en cada periodo respectivamente\n // las tareas expresadas en meses o años, solo deben poner una tarea en el periodo\n $frecuencia = ($registro['valorFrecuenciaMedicion'] == 0 ? 1 : $registro['valorFrecuenciaMedicion']);\n $multiplo = (( $registro['unidadFrecuenciaMedicion'] == 'Años' or \n $registro['unidadFrecuenciaMedicion'] == 'Meses') \n ? 1 \n : (($registro['unidadFrecuenciaMedicion'] == 'Semanas' ? 4 : 30) / $frecuencia)) ;\n\n \n $periodicidad = $registro['valorFrecuenciaMedicion'] * ($registro['unidadFrecuenciaMedicion'] == 'Años' ? 12 : 1);\n\n // si la empresa se creó antes del año que estamos consultando, se debe pintar las tareas (fecha inicio enero del año consultado)\n // pero si su creación es posterior, no se deben pintar (fecha de inicio toma la de la compania)\n $fechaInicio = date(\"Y\",strtotime($registro[\"fechaCreacionCompania\"])) < $año \n ? date($año.\"-01-01\")\n : date(\"Y-m-d\",strtotime($registro[\"fechaCreacionCompania\"]));\n \n $fechaInicio = date(\"Y-m-d\",strtotime(\"+ \".$periodicidad.\" MONTH\", strtotime($fechaInicio)));\n $fechaFin = date($año.\"-12-31\");\n\n while($fechaInicio <= date(\"Y-12-31\") and $fechaInicio < $fechaFin)\n {\n $datos[$pos][str_pad(date(\"m\",strtotime($fechaInicio)), 2, '0', STR_PAD_LEFT).'T'] += (1*$multiplo); \n \n $fechaInicio = date(\"Y-m-d\",strtotime(\"+ \".$periodicidad.\" MONTH\", strtotime($fechaInicio)));\n }\n\n }\n\n //**********************\n // C R E A C I O N \n // D E L O S \n // C U M P L I M I E N T O S\n //*********************\n\n $grupoapoyo = DB::Select(\n ' SELECT GrupoApoyo_idGrupoApoyo as idConcepto,\n fechaActaGrupoApoyo, fechaCreacionCompania\n FROM actagrupoapoyo A\n LEFT JOIN compania c \n ON A.Compania_idCompania = c.idCompania\n Where A.Compania_idCompania = '.$idCompania .' and DATE_FORMAT(fechaActaGrupoApoyo,\"%Y\") = '.$año.' \n ');\n\n // si la empresa se creó antes del año que estamos consultando, se debe pintar las tareas (fecha inicio enero del año consultado)\n // pero si su creación es posterior, no se deben pintar (fecha de inicio toma la de la compania)\n \n\n for($i= 0; $i < count($grupoapoyo); $i++)\n {\n $registro = get_object_vars($grupoapoyo[$i]);\n \n $fechaInicio = date(\"Y\",strtotime($registro[\"fechaCreacionCompania\"])) < $año \n ? date($año.\"-01-01\")\n : date(\"Y-m-d\",strtotime($registro[\"fechaCreacionCompania\"]));\n\n $pos = buscarGrupoApoyo($registro[\"idConcepto\"], $datos);\n\n $datos[$pos]['idGrupoApoyo'] = $registro[\"idConcepto\"];\n // CUMPLIMIENTO\n if($registro[\"fechaActaGrupoApoyo\"] != '0000-00-00' and \n date(\"Y\",strtotime($registro[\"fechaActaGrupoApoyo\"])) == date(\"Y\", strtotime($fechaInicio)) and \n $registro[\"fechaActaGrupoApoyo\"] >= $registro[\"fechaCreacionCompania\"])\n {\n \n $datos[$pos][date(\"m\",strtotime($registro[\"fechaActaGrupoApoyo\"])).'C'] += 1;\n }\n }\n\n $tabla = '';\n\n $tabla .= ' \n <div class=\"panel panel-primary\" style=\"border:1px solid\">\n <div class=\"panel-heading\">\n <h4 class=\"panel-title\">\n <a data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#actagrupoapoyo\">Acta de Reunión de Grupos de Apoyo</a>\n </h4>\n </div>';\n \n $tabla .= '\n <div id=\"actagrupoapoyo\" class=\"panel-collapse\"> \n <div class=\"panel-body\" style=\"overflow:auto;\">\n <table class=\"table table-striped table-bordered table-hover\">\n <thead class=\"thead-inverse\">\n <tr class=\"table-info\">\n <th scope=\"col\" width=\"30%\">&nbsp;</th>\n <th>Enero</th>\n <th>Febrero</th>\n <th>Marzo</th>\n <th>Abril</th>\n <th>Mayo</th>\n <th>Junio</th>\n <th>Julio</th>\n <th>Agosto</th>\n <th>Septiembre</th>\n <th>Octubre</th>\n <th>Noviembre</th>\n <th>Diciembre</th>\n <th>Presupuesto</th>\n <th>Costo Real</th>\n <th>Cumplimiento</th>\n <th>Meta</th>\n <th>Observación</th>\n </tr>\n </thead>\n <tbody>';\n for ($i=0; $i <count($datos); $i++) \n { \n $tabla .= \n '<tr align=\"center\">\n <input type=\"hidden\" id=\"idPlanTrabajoDetalle\" name=\"idPlanTrabajoDetalle[]\" value=\"null\">\n <input type=\"hidden\" id=\"Modulo_idModulo\" name=\"Modulo_idModulo[]\" value=\"9\">\n <input type=\"hidden\" id=\"idConcepto\" name=\"idConcepto[]\" value=\"'.$datos[$i][\"idGrupoApoyo\"].'\">\n <input type=\"hidden\" id=\"TipoExamenMedico_idTipoExamenMedico\" name=\"TipoExamenMedico_idTipoExamenMedico[]\" value=\"\">\n\n\n <td scope=\"row\">'\n .$datos[$i][\"Nombre\"].\n '<input type=\"hidden\" id=\"nombreConceptoPlanTrabajoDetalle\" name=\"nombreConceptoPlanTrabajoDetalle[]\" value=\"'.$datos[$i][\"Nombre\"].'\">\n </td>';\n\n \n for($mes = 1; $mes <= 12; $mes++)\n {\n $cMes = str_pad($mes,2,'0',STR_PAD_LEFT);\n $fechaMes = date(\"Y-\".$cMes.\"-01\");\n $tabla .= \n '<td>'.colorTarea($datos[$i][$cMes.'T'],$datos[$i][$cMes.'C']).\n '<input type=\"hidden\" id=\"'.nombreMesMinuscula($fechaMes).'PlanTrabajoDetalle\" name=\"'.nombreMesMinuscula($fechaMes).'PlanTrabajoDetalle[]\" \n value=\"'.valorTarea($datos[$i][$cMes.'T'],$datos[$i][$cMes.'C']).'\">\n </td>';\n }\n \n $tabla .= \n '<td>\n 0\n <input type=\"hidden\" id=\"presupuestoPlanTrabajoDetalle\" name=\"presupuestoPlanTrabajoDetalle[]\" value=\"0\">\n </td>\n <td>\n 0\n <input type=\"hidden\" id=\"costoRealPlanTrabajoDetalle\" name=\"costoRealPlanTrabajoDetalle[]\" value=\"0\">\n </td>\n <td>\n 0\n <input type=\"hidden\" id=\"cumplimientoPlanTrabajoDetalle\" name=\"cumplimientoPlanTrabajoDetalle[]\" value=\"0\">\n </td>\n <td>\n <input type=\"text\" id=\"metaPlanTrabajoDetalle\" name=\"metaPlanTrabajoDetalle[]\" value=\"0\">\n </td>\n <td>\n <textarea id=\"observacionPlanTrabajoDetalle\" name=\"observacionPlanTrabajoDetalle[]\">\n </textarea>\n </td>\n \n </tr>';\n\n }\n $tabla .= '\n </tbody>\n </table>\n </div> \n </div>\n </div>';\n\n return $tabla;\n }", "function LisGrupoUsuario($nombre) {\n $ocado = new cado();\n $sql = \"select * from conf_usuario_grupo where estado=0 and nombre like '$nombre%' order by nombre asc\";\n $ejecutar = $ocado->ejecutar($sql);\n return $ejecutar;\n }", "function selecionaVendaTotal(){\n}", "function obtenerGraficasEstado($idCliente, $idEstado,$tipoGrafica, $area=2)\n {\n return $this->db->query(\"SELECT AVG(asignaInmueble.porcentajeValor) as porcentajeValor, S.nombre as nombreNorma FROM asignaInmueble JOIN CentrosDeTrabajo Trabajo on asignaInmueble.idCentroTrabajo = Trabajo.idCentroTrabajo JOIN Formato F on Trabajo.idFormato = F.idFormato JOIN serviciosSubservicios S2 on asignaInmueble.idProyecto = S2.idControl JOIN Subservicios S on S2.idSubservicio = S.idSubservicio JOIN Proyectos P on S2.idServicio = P.idProyecto JOIN regiones r on Trabajo.idColonia = r.idRegiones JOIN municipios m on r.municipio = m.idMunicipio JOIN estados e on m.estado = $idEstado JOIN Clientes C on F.idCliente = $idCliente WHERE P.idArea=$area AND (asignaInmueble.normaInvalida IS NULL OR asignaInmueble.normaInvalida!=3) GROUP BY S.idSubservicio ORDER BY S.nombre;\")->result_array();\n }", "function consultarActividadGrupoApoyo($idCompania, $fechaInicial, $fechaFinal)\n\t{\n // Segun el rango de fechas del filtro, creamos para cada Mes o cada Año una columna \n // independiente\n // ------------------------------------------------\n // Enero Febrero Marzo Abril......\n // ------------------------------------------------\n $inicio = $fechaInicial;\n $anioAnt = date(\"Y\", strtotime($inicio));\n $columnas = '';\n while($inicio < $fechaFinal)\n {\n\n // adicionamos la columna del mes\n \n $columnas .= \"SUM(IF((MONTH(fechaPlaneadaActaGrupoApoyoDetalle) = '\".date(\"m\", strtotime($inicio)).\"' AND YEAR(fechaPlaneadaActaGrupoApoyoDetalle) = '\".date(\"Y\", strtotime($inicio)).\"'), 1, 0)) as \". nombreMes($inicio).date(\"Y\", strtotime($inicio)).'T, ';\n\n $columnas .= \"SUM(IF((MONTH(fechaPlaneadaActaGrupoApoyoDetalle) = '\".date(\"m\", strtotime($inicio)).\"' AND YEAR(fechaPlaneadaActaGrupoApoyoDetalle) = '\".date(\"Y\", strtotime($inicio)).\"'), IF(fechaEjecucionGrupoApoyoDetalle IS NULL, 0, 1), 0)) as \". nombreMes($inicio).date(\"Y\", strtotime($inicio)).'C, ';\n \n\n //Avanzamos al siguiente mes\n $inicio = date(\"Y-m-d\", strtotime(\"+1 MONTH\", strtotime($inicio)));\n }\n\n // Quitamos la ultima coma del concatenado de columnas\n $columnas = substr($columnas,0, strlen($columnas)-2);\n\n\t\t\n $actividadesgrupoapoyo = DB::select(\n 'SELECT CONCAT(actividadGrupoApoyoDetalle) as descripcionTarea,\n idActaGrupoApoyoDetalle as idConcepto,\n '.$columnas.',\n SUM(recursoPlaneadoActaGrupoApoyoDetalle) as PresupuestoT,\n SUM(recursoEjecutadoActaGrupoApoyoDetalle) as PresupuestoC\n From actagrupoapoyodetalle agpd\n left join actagrupoapoyo agp\n on agpd.ActaGrupoApoyo_idActaGrupoApoyo = agp.idActaGrupoApoyo\n left join grupoapoyo ga\n on ga.idGrupoApoyo = agp.GrupoApoyo_idGrupoApoyo\n left join compania c \n on agp.Compania_idCompania = c.idCompania\n Where agp.Compania_idCompania = '.$idCompania .' \n and fechaEjecucionGrupoApoyoDetalle >= fechaCreacionCompania and fechaEjecucionGrupoApoyoDetalle >= fechaCreacionCompania\n Group by ga.idGrupoApoyo, idActaGrupoApoyoDetalle');\n\n\t\t\treturn imprimirTabla('Acta Reunión - Actividades', $actividadesgrupoapoyo, 'actividadesgrupoapoyo', $fechaInicial, $fechaFinal, 43);\n\t}", "public function gurupiket()\n\t{\n\t\t$bulan=date('m');\n\t\tif($bulan<7){\n\t\t\t$smt=2;\n\t\t\t//jika th 2(1-6) maka tahun-1/tahun-2 2012/2013\n\t\t\t$th_ajar=(date('Y')-1).'/'.date('Y');\n\t\t}else if($bulan<13 && $bulan>6){\n\t\t\t$smt=1;\n\t\t\t//jika th 1(7-12) maka tahun/tahun+1 2012/2013\n\t\t\t$th_ajar=date('Y').'/'.(date('Y')+1);\n\t\t}\n\t\t$criteria = new CDbCriteria(array(\n\t\t\t\t'condition' => \"th_ajar='\".$th_ajar.\"'\",\n\t\t));\n\t\n\t\t$criteria->compare('nis',$this->nis);\n\t\t$criteria->compare('kelas',$this->kelas);\n\t\t$criteria->compare('lokal',$this->lokal,true);\n\t\t$criteria->compare('th_ajar',$th_ajar,true);\n\t\t$criteria->compare('id_penempatan_kls',$this->id_penempatan_kls);\n\t\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function buscarEstudiante($codigoEstudiante,$numeroActa,$idGrupo)\n {\n $sql = \"SELECT idEstudiante FROM estudiante join actaconcertacion on idEstudiante = Estudiante_idEstudiante join grupo on idGrupo = Grupo_idGrupo where codigoEstudiante = \".$codigoEstudiante.\" and numeroActaConcertacion = \".$numeroActa.\" and idGrupo =\".$idGrupo.\" and periodoAcademico_idPeriodo = (SELECT MAX( id ) FROM periodoacademico)\";\n \n $consulta = $this->query($sql);\n $datos=array();\n $i=0;\n while($dato = $consulta->fetch(PDO::FETCH_ASSOC))\n {\n $datos[$i] = $dato['idEstudiante'];\n $i++;\n }\n return $datos;\n }", "function total_cierre_familia($id_cierre, $id_proveedor) {\n $this->db->select_sum('monto');\n $this->db->from($this->table);\n $this->db->where('id_cierre', $id_cierre);\n $this->db->where('id_proveedor', $id_proveedor);\n $query = $this->db->get();\n $result = $query->result();\n return $result[0]->total;\n }", "public function getGrado($id)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('GRADO');\n\t\t$this->db->where('id_grado', $id);\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "function buscaTipo(){\n\t//AVERIGUAR VENTA O POSTVENTA\n\t$queryUsuario = sprintf(\"SELECT id_usuario, nombre_usuario,\n\t\t\t\t\t\t\t CONCAT_WS(' ', nombre_empleado, apellido) AS nombre,\n\t\t\t\t\t\t\t clave_filtro,\n\t\t\t\t\t\t\t\t\t(CASE clave_filtro\n\t\t\t\t\t\t\t\t\t\t WHEN 1 THEN 'Ventas'\n\t\t\t\t\t\t\t WHEN 2 THEN 'Ventas'\n\t\t\t\t\t\t\t\t\t\t WHEN 4 THEN 'Postventa'\n\t\t\t\t\t\t\t WHEN 5 THEN 'Postventa'\n\t\t\t\t\t\t\t WHEN 6 THEN 'Postventa'\n\t\t\t\t\t\t\t WHEN 7 THEN 'Postventa'\n\t\t\t\t\t\t\t WHEN 8 THEN 'Postventa'\n\t\t\t\t\t\t\t WHEN 26 THEN 'Postventa'\n\t\t\t\t\t\t\t WHEN 400 THEN 'Postventa'\n\t\t\t\t\t\t\t\t\tEND) AS tipo\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFROM pg_usuario\n\t\t\t\t\t\t\t\t\tINNER JOIN pg_empleado ON pg_usuario.id_empleado = pg_empleado.id_empleado\n\t\t\t\t\t\t\t\t\tINNER JOIN pg_cargo_departamento ON pg_empleado.id_cargo_departamento = pg_cargo_departamento.id_cargo_departamento\n\t\t\t\t\t\t\t\tWHERE id_usuario = %s \",\n\t\t\t\t\t\tvalTpDato($_SESSION['idUsuarioSysGts'],\"int\"));\n\n\t$rsUsuario = mysql_query($queryUsuario);\n\tif (!$rsUsuario) return array(false, mysql_error().\"\\nError Nro: \".mysql_errno().\"\\nLine: \".__LINE__.\"\\n\".$queryUsuario);\n\t$row = mysql_fetch_array($rsUsuario);\n\n\treturn array(true, $row['tipo']);\n}", "function formatos(){\n\t\t\t$this->vista->setTitle('Formatos de Asistencia');\n\t\t\tif(isset($this->params['cod_curso'])){\n\t\t\t\t$sql = \"SELECT cedula, apellidos, nombres, nombre_grupo \".\n\t\t\t\t\t\t\t\" FROM \".Config::get('TEstudiante','TGrupo') .\n\t\t\t\t\t\t\t\" INNER JOIN \".Config::Get('TPersona') . \" p USING (cod_interno, cedula)\".\n\t\t\t\t\t\t\t\" WHERE p.cod_estado = \".COD_ESTADO_ACTIVO . \" AND \";\n\t\t\t\tif($this->params['cod_curso'] == '0')\n\t\t\t\t\t$sql .= \"cod_programa = '{$this->params['cod_programa']}'\";\n\t\t\t\telse\n\t\t\t\t\t$sql .= \"cod_grupo = '{$this->params['cod_curso']}'\";\n\t\t\t\t$cursos = DB::table_query($sql, 'nombre_grupo');\n\t\t\t\t$this->vista->set('cursos', $cursos);\n\t\t\t}\n\t\t\t$this->vista->display();\n\t\t}", "public function AddGrado($usuario){\n\t\t\t$this->usuario=$usuario;\n\t\t\t$this->grado=$this->db->real_escape_string($_POST['grado']);\n\t\t\t$this->grado=trim(strtolower($this->grado));\n\t\t\t$sql=$this->db->query(\"SELECT * FROM grado WHERE grado='$this->grado' LIMIT 1;\");\n\t\t\tif($this->db->rows($sql)==0){\n\t\t\t\t$this->db->query(\"INSERT INTO grado(grado) VALUES('$this->grado');\");\n\t\t\t\t$indicesServer = array('REMOTE_ADDR',);\n\t\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t\t\t$evento=\"Agrego el grado \".$this->grado;\n\t\t\t\t$this->db->query(\"INSERT INTO registro_eventos(ip, usuario, evento, fecha, operacion) VALUES('$ip', '$this->usuario', '$evento', NOW(), 'INSERT');\");\n\t\t\t\t$this->db->liberar($sql);\n\t\t\t\theader(\"location: ?view=config&mode=GradoSecciones&success=1\");\n\t\t\t}else{\n\t\t\t\t$this->db->liberar($sql);\n\t\t\t\theader(\"location: ?view=config&mode=GradoSecciones&error=2\");\n\t\t\t}\n\t\t}", "function get_gasto_por_servicio($ejercicio)\n {\n if(empty($ejercicio))\n {\n $sqltext = \"\n SELECT \n `c`.`color_grafica`,\n `c`.`titulo_grafica` AS `nombre_servicio_categoria`,\n IFNULL((SELECT \n SUM(`d`.`monto_desglose`)\n FROM\n (`inai`.`vact_facturas_desglose` `d`\n JOIN `inai`.`vact_facturas` `e`)\n WHERE\n ((`d`.`id_factura` = `e`.`id_factura`)\n AND (`d`.`id_servicio_categoria` = `c`.`id_servicio_categoria`))),\n 0) AS `monto`\n FROM `inai`.`cat_servicios_categorias` `c`\n ORDER BY `c`.`id_servicio_categoria`\n \";\n }else\n {\n $sqltext = \"\n SELECT \n `c`.`color_grafica`,\n `c`.`titulo_grafica` AS `nombre_servicio_categoria`,\n IFNULL((SELECT \n SUM(`d`.`monto_desglose`)\n FROM\n (`inai`.`vact_facturas_desglose` `d`\n JOIN `inai`.`vact_facturas` `e`)\n WHERE\n ((`d`.`id_factura` = `e`.`id_factura`)\n AND (`d`.`id_servicio_categoria` = `c`.`id_servicio_categoria`)\n AND (`e`.`id_ejercicio` = \" . $ejercicio . \"))),\n 0) AS `monto`\n FROM `inai`.`cat_servicios_categorias` `c`\n ORDER BY `c`.`id_servicio_categoria`\n \";\n }\n\n $query = $this->db->query( $sqltext );\n $colores = [];\n $categorias = [];\n $montos = [];\n\n if($query->num_rows() > 0)\n {\n $cont = 0;\n foreach ($query->result_array() as $row) {\n $categorias[$cont] = $row['nombre_servicio_categoria'];\n $montos[$cont] = floatval($row['monto']);\n $colores[$cont] = $row['color_grafica'];\n $cont++;\n }\n } \n\n return array(\n 'categorias' => $categorias,\n 'montos' => $montos,\n 'colores' => $colores,\n 'total' => 0\n );\n\n }" ]
[ "0.6450779", "0.63011247", "0.6247035", "0.6161449", "0.6150986", "0.60623735", "0.60613275", "0.60420364", "0.6031722", "0.6026257", "0.5998087", "0.5959395", "0.5945947", "0.5928261", "0.59217274", "0.5895006", "0.5885082", "0.58802605", "0.58749926", "0.5872746", "0.5851636", "0.58492374", "0.58340365", "0.5819562", "0.58141446", "0.5790925", "0.5785507", "0.57667965", "0.57664675", "0.57483214" ]
0.7630718
0
set_view(v, time) Method: Set's the type (view) of calendar
function set_view($v, $time=NULL) { if($time == NULL) $time = $this->time ; switch($this->view[$v]) { case 0: $this->calendar = new DayCalendar($time) ; break ; case 1: $this->calendar = new WeekCalendar($time) ; break ; case 3: $this->calendar = new TermCalendar($time) ; break ; case 4: $this->calendar = new UpcomingCalendar($time) ; break ; default: $this->calendar = new MonthCalendar($time) ; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setViewType($type)\n {\n self::$instance->setViewType($type);\n }", "protected function setCalendarDefaultView($view)\n {\n $allowed = ['day','week', 'month'];\n\n if(!in_array($view, $allowed)){\n $this->errors = ['tipo' => $this->typeError[6], 'bad' => $view, 'permitidos' => $allowed];\n }\n\n $this->defaultCalendarView = $view;\n }", "function hook_date_ical_feed_ical_vcalendar_render_alter(&$vcalendar, $view) {\n\n}", "public function setCalendarView(?array $value): void {\n $this->getBackingStore()->set('calendarView', $value);\n }", "public function setView( \\Aimeos\\MW\\View\\Iface $view );", "abstract public function setView($view);", "protected function set_type() {\n\t\t$this->type = 'kirki-date';\n\t}", "protected function setView($view, $options = [])\n {\n $allowed = ['table', 'calendar'];\n\n if(!in_array($view, $allowed)){\n $this->errors = ['tipo' => $this->typeError[5], 'bad' => $view, 'permitidos' => $allowed];\n }\n\n if ($view == 'calendar' && !empty($options)) {\n $allowedOptions = ['public'];\n $this->allowed($options, $allowedOptions, $this->typeError[3]);\n $this->viewOptions = $options;\n }\n\n $this->view = $view;\n }", "public function setView(Yaf\\View_Interface $view) {}", "public function setTimeaccessioned($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->timeaccessioned !== null || $dt !== null) {\n $currentDateAsString = ($this->timeaccessioned !== null && $tmpDt = new DateTime($this->timeaccessioned)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->timeaccessioned = $newDateAsString;\n $this->modifiedColumns[] = FeaturePeer::TIMEACCESSIONED;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setView($view)\n {\n $this->view = $view;\n }", "function setTime($date){\r\n\r\n\t}", "public function set_type ($type) {}", "public function setView(string $view)\n {\n $this->view = $view;\n }", "public function setView(string $view)\n {\n $this->view = $view;\n }", "protected function setView ($view)\n {\n $this->_view = $view;\n }", "protected function setGeneralVariablesView($view)\n\t{\n\t\t// date\n\t\t$view->date = $this->strDate;\n\t\t$oDate = new Piwik_Date($this->strDate);\n\t\t$view->prettyDate = $oDate->get(\"l jS F Y\");\n\n\t\t// period\n\t\t$currentPeriod = Piwik_Common::getRequestVar('period');\n\t\t$otherPeriodsAvailable = array('day','week','month','year');\n\n\t\t$found = array_search($currentPeriod,$otherPeriodsAvailable);\n\t\tif($found !== false)\n\t\t{\n\t\t\tunset($otherPeriodsAvailable[$found]);\n\t\t}\n\n\t\t$view->period = $currentPeriod;\n\t\t$view->otherPeriods = $otherPeriodsAvailable;\n\n\t\t// other\n\t\t$view->idSite = Piwik_Common::getRequestVar('idSite');\n\n\t\t$view->userLogin = Piwik::getCurrentUserLogin();\n\t\t$view->sites = Piwik_SitesManager_API::getSitesWithAtLeastViewAccess();\n\t\t$view->url = Piwik_Url::getCurrentUrl();\n\t}", "public function setView(View $view)\n {\n $this->_view = $view;\n }", "public function setCurrentTime($time)\n {\n $this->time = $time;\n }", "public function set_view($view)\n {\n return $this->set_views($view);\n }", "static function setView( Frame_View $view )\n\t{\n\t\tself::getInstance()->__view = $view;//guarda referencia\n\t}", "public function setTime($time)\r\n {\r\n $this->_time = $time;\r\n }", "public function index ($view_type = 'list') {\n // If we have no valid parameter we take the default.\n if (!array_key_exists($view_type, self::$view_types)) {\n $view_type = self::$view_types[0];\n }\n\n $view_variables = [];\n\n $view_variables['override_types'] = [];\n if (Input::has('hideByType') && is_array(Input::get('hideByType')) && (count(Input::get('hideByType')) > 0 )) {\n $view_variables['override_types'] = Input::get('hideByType');\n $view_variables['override_types'] = array_intersect(self::getDateTypes(), $view_variables['override_types']); // Because never trust the client!\n }\n\n $view_variables['override_statuses'] = [];\n if (Input::has('hideByStatus') && is_array(Input::get('hideByStatus')) && (count(Input::get('hideByStatus')) > 0 )) {\n $view_variables['override_statuses'] = Input::get('hideByStatus');\n $view_variables['override_statuses'] = array_intersect(self::getDateStatuses(), $view_variables['override_statuses']); // Because never trust the client!\n }\n\n // showAll overrides all hideBy's\n $view_variables['override_show_all'] = Input::has('showAll') && 'true' === Input::get('showAll');\n\n // Prepare rest of view variables.\n // Always show calender with old dates, too.\n $view_variables = array_merge($view_variables, [\n 'date_types' => $this->getDateTypes(),\n 'date_statuses' => $this->getDateStatuses(),\n 'view_types' => $this->getViewTypes(),\n ]);\n\n // Generate new view by calling view type index.\n $view = call_user_func_array(\n [\n $this,\n self::$view_types[$view_type]\n ],\n [\n 'dates' => $this->getDates(self::$date_types, 'calendar' === $view_type, true),\n 'view_variables' => $view_variables\n ]\n );\n\n // If the call didn't work out: Redirect to date index with errors.\n if (false !== $view) {\n return $view;\n } else {\n return redirect()->route('index', $view_variables)->withErrors(trans('date.view_type_not_found'));\n }\n }", "private function getView(string $view): string {\n\t\tswitch ($view) {\n\t\t\tcase 'agendaDay':\n\t\t\t\treturn 'timeGridDay';\n\n\t\t\tcase 'agendaWeek':\n\t\t\t\treturn 'timeGridWeek';\n\n\t\t\tcase 'month':\n\t\t\t\treturn 'dayGridMonth';\n\n\t\t\tdefault:\n\t\t\t\treturn $view;\n\t\t}\n\t}", "function hook_date_ical_feed_ical_vevent_render_alter($vevent, $view, $event_array) {\n\n}", "public function setTime($time)\n {\n $this->time = $time;\n }", "public function setTime($time)\n {\n $this->time = $time;\n }", "public function setTime($value = null)\r\n {\r\n switch ($value) {\r\n case 'today':\r\n $this->_params['time'] = 'today';\r\n break;\r\n case 'this_week':\r\n $this->_params['time'] = 'this_week';\r\n break;\r\n case 'this_month':\r\n $this->_params['time'] = 'this_month';\r\n break;\r\n case 'all_time':\r\n $this->_params['time'] = 'all_time';\r\n break;\r\n case null:\r\n unsert($this->_params['time']);\r\n default:\r\n require_once 'Zend/Gdata/App/Exception.php';\r\n throw new Zend_Gdata_App_Exception('Unknown time value');\r\n break;\r\n }\r\n return $this;\r\n }", "public function set_type(string $type);", "public function setType($type);" ]
[ "0.648586", "0.6264322", "0.6188865", "0.616412", "0.61379737", "0.6131997", "0.6124006", "0.60896903", "0.581863", "0.58166456", "0.5717766", "0.5709594", "0.57032186", "0.5661767", "0.5661767", "0.56516254", "0.55397886", "0.5478657", "0.5463993", "0.5443723", "0.5409059", "0.5404495", "0.5395737", "0.5356067", "0.53317386", "0.530206", "0.530206", "0.52697736", "0.52268946", "0.5182259" ]
0.84073395
0
/ Generating automated group names if project inserted successfully
private function generateGroups(int $groupsTotal, int $projectId): bool { for ($i = 1; $i <= $groupsTotal; $i++) { $stmt = $this->pdo->prepare("INSERT INTO project_groups (name, project_id) VALUES (:name, :project_id)"); $groupName = 'Group #' . $i; $stmt->bindParam(':name', $groupName); $stmt->bindParam(':project_id', $projectId); $result = $stmt->execute(); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProjectGroup();", "function add_group() {\r\n\r\n\t\tgreen::$watches['pageHeading'] = 'Create template group';\r\n\r\n\t\tgreen::$watches['toggleSidebar'] = TRUE;\r\n\r\n\t\t\r\n\r\n\t\t$this->display('templates/add_group');\r\n\r\n\t}", "function testGroupRename()\r\n {\r\n // Instantiate IC controller\r\n $icController = new InfocenterController($this->ant, $this->user);\r\n $icController->debug = true;\r\n \r\n $params['name'] = \"UnitTest GroupName\";\r\n $params['color'] = \"eeeeee\";\r\n \r\n // create group data\r\n $gid = $icController->groupAdd($params);\r\n $this->assertTrue($gid > 0);\r\n \r\n $params['gid'] = $gid;\r\n \r\n // test group rename\r\n $params['name'] = \"UnitTest GroupRename\";\r\n $name = $icController->groupRename($params);\r\n $this->assertTrue(count($name) > 0);\r\n $this->assertEquals($name, $params['name']);\r\n \r\n // clear data \r\n $ret = $icController->groupDelete($params);\r\n $this->assertTrue($ret > 0);\r\n $this->assertEquals($gid, $ret);\r\n }", "public function run()\n {\n $group = new \\CALwebtool\\Group();\n $group->name = \"College of Arts and Letters\";\n $group->description =\"Default Team for the CAL Alumni Awards Board\";\n $group->save();\n\n $group->makeAdmin(User::find(1));\n }", "public function run()\n {\n $num_created_parent_groups = 10;\n\n $faker = Faker\\Factory::create();\n\n \\Protestwit\\Group\\Models\\Group::truncate();\n\n $groups = [\n [\n 'name' => 'No Dakota Access Pipeline',\n 'slug' => 'nodapl',\n 'public_tag' => 'nodapl',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'Water Is Life',\n 'slug' => 'waterislife',\n 'public_tag' => 'wil',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n\n [\n 'name' => 'Stop Kinder Morgan',\n 'slug' => 'km',\n 'public_tag' => 'kindermorgan',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'Lancaster Pipeline',\n 'slug' => 'lancasterstand',\n 'public_tag' => 'lancasterstand',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'Antifa',\n 'slug' => 'antifa',\n 'public_tag' => 'antifa',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'Protest',\n 'slug' => 'protest',\n 'public_tag' => 'protest',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'flintwater',\n 'slug' => 'flintwater',\n 'public_tag' => 'flintwater',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'donnabrazile',\n 'slug' => 'donnabrazile',\n 'public_tag' => 'donna brazile',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'trump',\n 'slug' => 'trump',\n 'public_tag' => 'trump',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'AnonyOps',\n 'slug' => 'AnonyOps',\n 'public_tag' => 'AnonyOps',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'TheYoungTurks',\n 'slug' => 'TheYoungTurks',\n 'public_tag' => 'TheYoungTurks',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n [\n 'name' => 'UR_Ninja',\n 'slug' => 'UR_Ninja',\n 'public_tag' => 'UR_Ninja',\n 'private_tag' => null,\n 'access_password' => null,\n 'allow_public_subgroups' => 1,\n 'is_public' => 1,\n ],\n ];\n \n foreach($groups as $group) {\n \\Protestwit\\Group\\Models\\Group::create([\n 'name' => $group['name'],\n 'slug' => $group['slug'],\n 'public_tag' => $group['public_tag'],\n 'private_tag' => $group['private_tag'],\n 'access_password' => $group['access_password'],\n 'allow_public_subgroups' => $group['allow_public_subgroups'],\n 'is_public' => $group['is_public'],\n ]);\n }\n }", "abstract public function createGroup($group_name);", "public function run()\n {\n $qg = new QuestGroup();\n $qg->name = 'Komplexní větev';\n $qg->active = true;\n $qg->save();\n\n $qg = new QuestGroup();\n $qg->name = '1. den (drak)';\n $qg->active = false;\n $qg->save();\n\n $qg = new QuestGroup();\n $qg->name = '2. den (drak je nesmrtelný)';\n $qg->active = false;\n $qg->save();\n }", "public function addusersTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken(['get', 'post']);\n\n\t\tif (!User::authorise('core.edit', $this->_option))\n\t\t{\n\t\t\tApp::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));\n\t\t}\n\n\t\t$project_id = Request::getInt('project', 0);\n\n\t\t// Load the group page\n\t\t$this->model = new Project($project_id);\n\n\t\t// Incoming\n\t\t$newm = Request::getString('newmember', '', 'post');\n\t\tif (is_string($newm))\n\t\t{\n\t\t\t$newm = trim(urldecode($newm));\n\t\t\t$newm = preg_split(\"/[,;]/\", $newm);\n\t\t\t$newm = array_filter($newm);\n\t\t}\n\t\t$newm = (array)$newm;\n\t\t$groups = urldecode(trim(Request::getString('newgroup', '')));\n\t\t$role = Request::getInt('role', 0);\n\n\t\t// Result collectors\n\t\t$m_added = 0; // count of individual members added\n\t\t$g_added = 0; // count of members from new group\n\t\t$uids = array(); // ids/emails of added people\n\t\t$invalid = array(); // collector for invalid names\n\n\t\t// Setup stage?\n\t\t$setup = $this->model->inSetup();\n\n\t\t// Get owner class\n\t\t$objO = $this->model->table('Owner');\n\n\t\t// Do we have new authors?\n\t\tif (!empty($newm))\n\t\t{\n\t\t\tfor ($i=0, $n=count($newm); $i < $n; $i++)\n\t\t\t{\n\t\t\t\t$cid = strtolower(trim($newm[$i]));\n\n\t\t\t\tif (!$cid)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$validUser = User::getInstance($cid);\n\t\t\t\t$uid = $validUser->get('id');\n\n\t\t\t\tif (!$uid)\n\t\t\t\t{\n\t\t\t\t\t$invalid[] = $cid;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Save new author\n\t\t\t\t$native = ($this->model->access('owner')) ? 1 : 0;\n\n\t\t\t\tif ($objO->saveOwners($this->model->get('id'), User::get('id'), $uid, 0, $role, $status = 1, $native))\n\t\t\t\t{\n\t\t\t\t\t$uids[] = $uid;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($groups)\n\t\t{\n\t\t\t// Save new authors from group\n\t\t\t$g_added = $objO->saveOwners($this->model->get('id'), User::get('id'), 0, $groups, $role, $status = 1, $native = 0);\n\n\t\t\tif ($objO->getError())\n\t\t\t{\n\t\t\t\tNotify::error($objO->getError());\n\t\t\t}\n\n\t\t\tif ($g_added)\n\t\t\t{\n\t\t\t\t$uids = array_merge($uids, $g_added);\n\t\t\t}\n\t\t}\n\n\t\tif (count($uids) > 0)\n\t\t{\n\t\t\t// Sync with system group\n\t\t\t$objO->sysGroup($this->model->get('alias'), $this->config->get('group_prefix', 'pr-'));\n\t\t}\n\n\t\tif (!Request::getInt('no_html', 0))\n\t\t{\n\t\t\t$this->cancelTask();\n\t\t}\n\t}", "public function run()\n\t{\n\t\tGroup::create([\n\t\t\t'name'\t\t=>\t'Администратор',\n\t\t\t'alias'\t\t=>\t'admin'\n\t\t]);\n\n\t\tGroup::create([\n\t\t\t'name'\t\t=>\t'Разработчик',\n\t\t\t'alias'\t\t=>\t'developer'\n\t\t]);\n\t}", "public function createGroup()\n {\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BA9 begin\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BA9 end\n }", "public function creategroupAction() {\n if ($this->getRequest()->isPost()) {\n $groupName = $_POST['groupName'];\n $groupType = $_POST['groupType'];\n $user = $_SESSION['Incite']['USER_DATA'];\n\n $group = new InciteGroup;\n $group->name = $groupName;\n $group->creator_id = $user->id;\n $group->group_type = $groupType;\n $group->instructions = \"\";\n $group->save();\n\n $groups_users = new InciteGroupsUsers;\n $groups_users->user_id = $user->id;\n $groups_users->group_id = $group->id;\n $groups_users->group_privilege = 0;\n $groups_users->seen_instruction = 1;\n $groups_users->save();\n\n $groupId = $group->id;\n\n if ($groupId > 0) {\n echo $groupId;\n } else {\n system_log('failed to create group');\n echo 'false';\n }\n }\n }", "public function run()\n {\n //\n \n Group::create(\n [\n 'code' => 'ICT',\n 'name' => 'Information Communication and Technology Group',\n ],\n );\n\n Group::create(\n [\n 'name' => 'Federal Road Safety Corps Group',\n 'code' => 'FRSC',\n ]\n );\n\n Group::create(\n [\n 'name' => 'Corps Legal Aid Group',\n 'code' => 'CLAG',\n ]\n );\n\n Group::create(\n [\n 'name' => 'Sports Group',\n 'code' => \"\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Culture and Tourism Group',\n 'code' => \"\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Education Development Group',\n 'code' => \"EDG\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Environmental protection and Sanitation Group',\n 'code' => \"Ecovanguard, NESREA\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Editorial/Publicity Group',\n 'code' => \"\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Road Safety Group',\n 'code' => \"\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Reproductive Health & HIV/AIDS Group',\n 'code' => \"\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Anti-Corruption Group',\n 'code' => \"EFCC & ICPC\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'State Delivery Group',\n 'code' => \"\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Medical and Health Services Group',\n 'code' => \"\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Drug Free and Quality Control Group',\n 'code' => \"NDLEA, NAFDAC, SON\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Agro Allied Group',\n 'code' => \"\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Charity Services and Gender Group',\n 'code' => \"\",\n ]\n );\n\n Group::create(\n [\n 'name' => 'Disaster Management Group',\n 'code' => \"\",\n ]\n );\n }", "function insert_into_project(&$project) {\n // Create a WRMS request for this step..\n $wrms = new qams_request();\n $wrms->chtype = \"create\";\n $_POST[\"submit\"] = \"create\";\n $_POST['send_no_email'] = \"on\"; // Stop WRMS spam\n\n // Some settings always in common with master project..\n $wrms->org_code = $project->org_code;\n $wrms->system_id = $project->system_id;\n $wrms->requester_id = $project->requester_id;\n $wrms->last_status = $project->last_status;\n $wrms->urgency = $project->urgency;\n $wrms->importance = $project->importance;\n $wrms->entered_by = $project->entered_by;\n $wrms->status_code = \"I\"; // In Progress\n\n // Give it our brief, plus the step decription..\n $wrms->brief = \"$project->brief: $this->qa_step_desc\";\n\n // Assemble the detailed blurb..\n $s = \"\";\n\n // Condign notes pertaining to this QA step. Hopefully the\n // QA gurus will have populated the database with some very\n // useful guidance here (hint, hint!) ;-)\n if ($this->qa_step_notes != \"\") {\n $s .= \"$this->qa_step_notes\";\n }\n\n // Para covering the document requirement..\n if ($this->qa_document_title != \"\") {\n $s .= \"\\n\\nThis QA step is concerned with a document entitled '$this->qa_document_title'. \"\n . \"Please attach any and all versions of that document to this work request \"\n . \"so that it is available for approval/review.\"\n ;\n if ($this->qa_document_desc != \"\") {\n $s .= \" $this->qa_document_desc\";\n }\n }\n\n // Boilerplate gumph..\n $s .= \"\\n\\nThis work request has been automatically created by QAMS, to \"\n . \"facilitate the '$this->qa_step_desc' quality assurance step, in the \"\n . \"'$this->qa_phase_desc' phase of the project.\"\n ;\n\n $wrms->detailed = $s;\n\n // Save our newly built QA step request..\n $wrms->save_request();\n\n if ($wrms->request_id > 0) {\n $this->request_id = $wrms->request_id;\n $wrms->chtype = \"update\";\n $_POST[\"submit\"] = \"update\";\n\n // Now link it to our main project WRMS..\n $_POST[\"link_type\"] = \"P\"; // Precedes\n $_POST[\"parent_request_id\"] = $project->request_id;\n $wrms->AddParent();\n\n // Make sure allocations are the same..\n if (count($project->allocated) > 0) {\n $_POST[\"new_allocations\"] = array_keys($project->allocated);\n $wrms->NewAllocations();\n }\n\n // Make sure interested users are the same..\n if (count($project->interested) > 0) {\n $_POST[\"new_subscription\"] = array_keys($project->interested);\n $wrms->NewSubscriptions();\n }\n\n // Finally, create the project step record itself..\n $q = \"INSERT INTO qa_project_step (\";\n $q .= \" project_id, qa_step_id, request_id \";\n $q .= \") \";\n $q .= \"VALUES(?, ?, ?);\";\n $qry = new PgQuery(\n $q,\n $project->request_id,\n $this->qa_step_id,\n $this->request_id\n );\n $qry->Exec(\"qa_project_step::insert_into_project\");\n\n\n // And its default project step approval records too..\n foreach ($this->approvals_default() as $qa_type_id => $qa_type_desc) {\n $q = \"INSERT INTO qa_project_step_approval (\";\n $q .= \" project_id, qa_step_id, qa_approval_type_id \";\n $q .= \") \";\n $q .= \"VALUES(?, ?, ?);\";\n $qry = new PgQuery(\n $q,\n $project->request_id,\n $this->qa_step_id,\n $qa_type_id\n );\n $qry->Exec(\"qa_project_step::insert_into_project\");\n } // foreach\n\n // The data is now valid..\n $this->valid = true;\n }\n // Clear out for next step..\n $_POST = array();\n\n }", "public function CreateGroupOrgAdmin()\n {\n // Test user login\n $user = ['email' => 'testorgadminuno@unomaha.edu', 'password' => 'Password!23'];\n $this->browse(function ($browser) use ($user) {\n $newSkeletalElement = ''.rand(10000,99999);\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->assertSee('Welcome');\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(1000)\n ->press('@se-menu')\n ->pause(1000)\n ->press('@se-new-group')\n ->pause(1000)\n\n // Create new specimen group\n ->assertPathIs('/skeletalelements/createbygroup')\n ->select('@se-grouping','Shoulder')\n ->type('@se-designator',$newSkeletalElement)\n ->select('@side-group','Left')\n ->select('@completeness-group','Complete')\n ->select('@se-trauma-select','18')\n ->select('@se-pathology-select','2')\n ->select('@se-taphonomy-select','4')\n ->click('@se-bone-group-save')\n ->pause(1000)\n\n // Verify the New Group was Created\n ->assertPathIs('/skeletalelements/storebygroup')\n ->assertSee('Specimens Created by Articulations Group')\n ->pause(1000)\n //->assertInputValue('@se-accession','55555')\n //->assertInputValue('@se-provenance1','134136')\n //->assertInputValue('@se-provenance2','4674567467')\n ->assertInputValue('@se-designator',$newSkeletalElement)\n ->assertSee('Left')\n ->assertSee('Complete')\n ->assertSee('Shoulder')\n ->assertSee('Clavicle')\n ->assertSee('Scapula')\n ->assertSee('Possible perimortem-Sharp force')\n ->assertSee('Density-Osteoporosis')\n ->assertSee('Bio-Adherent Materials-Crystals')\n\n ->logoutUser();\n });\n }", "function testGroupAdd()\r\n {\r\n // Instantiate IC controller\r\n $icController = new InfocenterController($this->ant, $this->user);\r\n $icController->debug = true;\r\n \r\n $params['name'] = \"UnitTest GroupName\";\r\n $params['color'] = \"eeeeee\";\r\n \r\n $gid = $icController->groupAdd($params);\r\n $this->assertTrue($gid > 0);\r\n \r\n // clear data\r\n $params['gid'] = $gid;\r\n $ret = $icController->groupDelete($params);\r\n $this->assertTrue($ret > 0);\r\n $this->assertEquals($gid, $ret);\r\n }", "public function updateProjectName()\n {\n try\n {\n $project = EcrProjectHelper::getProject();\n $this->response->message = EcrProjectHelper::formatFileName(\n $project, JFactory::getApplication()->input->getString('cst_format'));\n }\n catch(Exception $e)\n {\n $this->response->status = 1;\n $this->response->message = $e->getMessage();\n $this->response->debug = $e->getTraceAsString();\n }\n\n echo $this->response;\n\n jexit();\n }", "function create_group() {\n $this->data['title'] = $this->lang->line('create_group_title');\n\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin()) {\n redirect($this->_home, 'refresh');\n }\n\n //validate form input\n $this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'required|alpha_dash|xss_clean');\n $this->form_validation->set_rules('description', $this->lang->line('create_group_validation_desc_label'), 'xss_clean');\n\n if ($this->form_validation->run() == TRUE) {\n $new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\n if ($new_group_id) {\n // check to see if we are creating the group\n // redirect them back to the admin page\n $this->session->set_flashdata('message', $this->ion_auth->messages());\n redirect($this->_home, 'refresh');\n }\n } else {\n //display the create group form\n //set the flash data error message if there is one\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n $this->data['group_name'] = array(\n 'name' => 'group_name',\n 'id' => 'group_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('group_name'),\n );\n $this->data['description'] = array(\n 'name' => 'description',\n 'id' => 'description',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('description'),\n );\n\n $this->_render_page('ipphone/create_group', $this->data);\n }\n }", "function nt_add_group( $thisgroup ) {\n\tglobal $wpdb;\n\tglobal $debug;\n\n\tif ( ! $debug ){\n\t\t\techo \"[nt_add_group] \";\n\t\t\techo \"<pre>\"; print_r($_POST); echo \"</pre>\";\n\t}\n\t\n\t$rows_affected = $wpdb->insert( $wpdb->prefix . constant( \"GROUP_TABLE_NAME\" ), $thisgroup );\n\t\n\tif ( 0 == $rows_affected ) {\n\t\techo \"INSERT ERROR for \" . $thisgroup[ 'nt_group_name' ] ;\n\t\tif ( $debug ){\n\t\t\techo \"[nt_add_group] Fail \";\n\t\t\techo \"<pre>\"; print_r($_POST); echo \"</pre>\";\n\t\t}\n\t\treturn false;\n\t}\n\t$thisgroup[ 'nt_group_id' ] = $wpdb->insert_id;\n\n\tif( $debug ) {\n\t\techo \"[nt_add_group] success $rows_affected\";\n\t}\n\n\tif ( 0 == nt_add_match_placeholder ( $thisgroup ) ){\n\t\tif ( $debug ){\n\t\t\techo \"[nt_add_group] Failed adding placeholder match \";\n\t\t\techo \"<pre>\"; print_r($_POST); echo \"</pre>\";\n\t\t}\n\t\treturn false;\n\t}\n\n\tif( $debug ) {\n\t\techo \"[nt_add_group] nt_add_match_placeholder success \";\n\t}\n\n\treturn $rows_affected;\n\n}", "public function process()\n {\n $cli = Modules_Communigate_Custom_Accounts::ConnectToCG();\n $request = new Zend_Controller_Request_Http();\n $domain = $request->getCookie('domain');\n\n // Проверка дали потребителя не е въвел и домейна към акаунта\n // ако е въвел то въведеното си остава, ако не е то домейна се добавя\n if (strpos($this->getValue('groupMail'), \"@$domain\")) {\n $groupMail = $this->getValue('groupMail');\n } else {\n $groupMail = $this->getValue('groupMail') . \"@$domain\";\n }\n \n $groupName = $this->getValue('groupName');\n\n Modules_Communigate_Custom_Groups::createGroup($groupName, $groupMail);\n }", "public function collectProjects() {\n \n $em = EventManager::instance();\n\n $dao = $this->_getDao();\n $dar = $dao->searchAllGroups();\n foreach($dar as $row) {\n //We start the transaction, it is not stored in the DB unless we COMMIT\n //With START TRANSACTION, autocommit remains disabled until we end the transaction with COMMIT or ROLLBACK. \n $sql = db_query('START TRANSACTION');\n $this->storeForGroup($row['group_id'], 'svn', $GLOBALS['svn_prefix'].\"/\".$row['unix_group_name']);\n $this->storeForGroup($row['group_id'], 'cvs', $GLOBALS['cvs_prefix'].\"/\".$row['unix_group_name']);\n $this->storeForGroup($row['group_id'], 'frs', $GLOBALS['ftp_frs_dir_prefix'].\"/\".$row['unix_group_name']);\n $this->storeForGroup($row['group_id'], 'ftp', $GLOBALS['ftp_anon_dir_prefix'].\"/\".$row['unix_group_name']);\n $this->storeForGroup($row['group_id'], self::GRP_HOME, $GLOBALS['grpdir_prefix'].\"/\".$row['unix_group_name']);\n $this->storeForGroup($row['group_id'], 'wiki', $GLOBALS['sys_wiki_attachment_data_dir'].\"/\".$row['group_id']);\n // Fake plugin for webdav/subversion\n $this->storeForGroup($row['group_id'], 'plugin_webdav', '/var/lib/codendi/webdav'.\"/\".$row['unix_group_name']);\n \n $params = array('DiskUsageManager' => $this, 'project_row' => $row);\n $em->processEvent('plugin_statistics_disk_usage_collect_project', $params);\n \n $sql = db_query('COMMIT');\n }\n $this->collectMailingLists();\n }", "public function step1()\n\t{\n\t\t/* Do we even need to do this? */\n\t\t$count = \\IPS\\Db::i()->select( 'COUNT(*)', 'nexus_packages', array( \"p_group!=? AND \" . \\IPS\\Db::i()->in( 'p_group', iterator_to_array( \\IPS\\Db::i()->select( 'pg_id', 'nexus_package_groups' ) ), TRUE ), 0 ) )->first();\n\t\t\n\t\tif ( $count )\n\t\t{\n\t\t\t/* Create a new group */\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$position = (int) \\IPS\\Db::i()->select( 'MAX(pg_position)', 'nexus_package_groups' )->first();\n\t\t\t\t$position++;\n\t\t\t}\n\t\t\tcatch( \\Exception $e )\n\t\t\t{\n\t\t\t\t/* Technically shouldn't happen but... */\n\t\t\t\t$position = 1;\n\t\t\t}\n\t\t\t\n\t\t\t$group = new \\IPS\\nexus\\Package\\Group;\n\t\t\t$group->position = $position;\n\t\t\t$group->save();\n\t\t\t\\IPS\\Lang::saveCustom( 'nexus', \"nexus_pgroup_{$group->id}\", \"Products\" );\n\t\t\t\n\t\t\tforeach( new \\IPS\\Patterns\\ActiveRecordIterator( \\IPS\\Db::i()->select( '*', 'nexus_packages', array( \"p_group!=? AND \" . \\IPS\\Db::i()->in( 'p_group', iterator_to_array( \\IPS\\Db::i()->select( 'pg_id', 'nexus_package_groups' ) ), TRUE ), 0 ) ), 'IPS\\nexus\\Package' ) AS $pkg )\n\t\t\t{\n\t\t\t\t$pkg->group = $group->id;\n\t\t\t\t$pkg->save();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function CreateGroup()\n {\n // Test user login\n $user = ['email' => 'testuno@unomaha.edu', 'password' => 'Password!23'];\n $this->browse(function ($browser) use ($user) {\n $newSkeletalElement = ''.rand(10000,99999);\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->assertSee('Welcome');\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(1000)\n ->press('@se-menu')\n ->pause(1000)\n ->press('@se-new-group')\n ->pause(1000)\n\n // Create new specimen group\n ->assertPathIs('/skeletalelements/createbygroup')\n ->select('@se-grouping','Shoulder')\n ->type('@se-designator',$newSkeletalElement)\n ->select('@side-group','Left')\n ->select('@completeness-group','Complete')\n ->select('@se-trauma-select','18')\n ->select('@se-pathology-select','2')\n ->select('@se-taphonomy-select','4')\n ->click('@se-bone-group-save')\n ->pause(1000)\n\n // Verify the New Group was Created\n ->assertPathIs('/skeletalelements/storebygroup')\n ->assertSee('Specimens Created by Articulations Group')\n ->pause(1000)\n //->assertInputValue('@se-accession','55555')\n //->assertInputValue('@se-provenance1','134136')\n //->assertInputValue('@se-provenance2','4674567467')\n ->assertInputValue('@se-designator',$newSkeletalElement)\n ->assertSee('Left')\n ->assertSee('Complete')\n ->assertSee('Shoulder')\n ->assertSee('Clavicle')\n ->assertSee('Scapula')\n ->assertSee('Possible perimortem-Sharp force')\n ->assertSee('Density-Osteoporosis')\n ->assertSee('Bio-Adherent Materials-Crystals')\n\n ->logoutUser();\n });\n }", "public function registerGroup()\n {\n $this->loadFixtures('GroupTbl');\n $reflectionMethod = new ReflectionMethod('App\\Controller\\GroupRegistController', 'registerGroup');\n $reflectionMethod->setAccessible(true);\n\n // NG - AddressData Table doesn't exist, addressList parameter = 1\n $this->assertEquals(\"グループの登録に失敗しました。\", $reflectionMethod->invokeArgs(new GroupRegistController(), [$this->testUserSeq, 'newName', 200, 1]));\n }", "function create_group_registration() {\n\t\t$Itemid = JRequest::getInt('Itemid');\n\t\t$model = & $this->getModel('register');\n\t\t$post = JRequest::get('post');\t\t\n\t\t$model->createBothGroupAndMembers($post) ;\n\t\t$groupId = JRequest::getInt('group_id', 0);\t\t\t\t\n\t\t$url = JRoute::_('index.php?option=com_eventbooking&task=group_billing&group_id='.$groupId.'&Itemid='.$Itemid, false) ;\n\t\t$this->setRedirect($url) ;\t\t\n\t}", "public function run()\n {\n \n\n \\DB::table('groups')->delete();\n \n \\DB::table('groups')->insert(array (\n 0 => \n array (\n 'id' => 2,\n 'name' => '任务启动',\n ),\n 1 => \n array (\n 'id' => 3,\n 'name' => '行人检测与让行',\n ),\n 2 => \n array (\n 'id' => 4,\n 'name' => '交叉路口通行',\n ),\n 3 => \n array (\n 'id' => 5,\n 'name' => '汇入交通流',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => '施工路段行驶',\n ),\n 5 => \n array (\n 'id' => 7,\n 'name' => '换道超车',\n ),\n 6 => \n array (\n 'id' => 8,\n 'name' => '无GPS信号隧道通行',\n ),\n 7 => \n array (\n 'id' => 9,\n 'name' => '雨雾天气行驶',\n ),\n 8 => \n array (\n 'id' => 10,\n 'name' => '任务终点停车',\n ),\n 9 => \n array (\n 'id' => 11,\n 'name' => '任务启动',\n ),\n 10 => \n array (\n 'id' => 12,\n 'name' => '高速匝道通行',\n ),\n 11 => \n array (\n 'id' => 13,\n 'name' => '执行 U-TURN 掉头',\n ),\n 12 => \n array (\n 'id' => 14,\n 'name' => '通过收费站',\n ),\n 13 => \n array (\n 'id' => 15,\n 'name' => '障碍车检测',\n ),\n 14 => \n array (\n 'id' => 16,\n 'name' => '任务终点停车',\n ),\n ));\n \n \n }", "public function run()\n {\n $project = new Project;\n\n for($i = 0; $i < 1000; $i++) {\n $randStrTime = mt_rand(1152005681,1262055681);\n $randDay = mt_rand(1, 10);\n $date = strtotime('+'.$randDay.' days', $randStrTime);\n\n $textRandom = str_random(mt_rand(1, 15));\n for($x = 0; $x < 70; $x++) {\n $textRandom .= ' '.str_random(mt_rand(1, 15));\n }\n\n DB::table('projects')->insert([\n 'title' => str_random(10),\n 'descrription' => $textRandom,\n 'organization' => str_random(mt_rand(4, 10)),\n 'start' => date('Y-m-d', $randStrTime),\n 'end' => date(\"Y-m-d\", $date),\n 'role' => array_rand(['admin' => 'admin', 'user' => 'user'], 1),\n 'link' => 'http://'.str_random(10).'.com',\n 'type' => array_rand($project->getTypes(), 1),\n ]);\n }\n }", "function _contributors_fieldgroup_default_groups() {\n $groups = array();\n\n // Exported group: group_assigned_volunteers\n $groups[] = array(\n 'group_type' => 'standard',\n 'type_name' => 'project',\n 'group_name' => 'group_assigned_volunteers',\n 'label' => 'Assigned Volunteers',\n 'settings' => array(\n 'form' => array(\n 'style' => 'fieldset',\n 'description' => '',\n ),\n 'display' => array(\n 'weight' => '46',\n 'label' => 'above',\n 'teaser' => array(\n 'format' => 'simple',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'simple',\n 'exclude' => 0,\n ),\n 'description' => '',\n '5' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n '2' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n '3' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n 'token' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n ),\n ),\n 'weight' => '46',\n 'fields' => array(\n '0' => 'field_av_image',\n '1' => 'field_av_name',\n '2' => 'field_av_location',\n '3' => 'field_av_profile',\n ),\n );\n\n // Exported group: group_customer_impact\n $groups[] = array(\n 'group_type' => 'standard',\n 'type_name' => 'project',\n 'group_name' => 'group_customer_impact',\n 'label' => 'Customer Impact',\n 'settings' => array(\n 'form' => array(\n 'style' => 'fieldset',\n 'description' => '',\n ),\n 'display' => array(\n 'weight' => '33',\n 'label' => 'above',\n 'teaser' => array(\n 'format' => 'simple',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'simple',\n 'exclude' => 0,\n ),\n 'description' => '',\n '5' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n '2' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n '3' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n 'token' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n ),\n ),\n 'weight' => '33',\n 'fields' => array(\n '0' => 'field_image',\n '1' => 'field_customer_impact_descriptio',\n ),\n );\n\n // Exported group: group_mentor\n $groups[] = array(\n 'group_type' => 'standard',\n 'type_name' => 'project',\n 'group_name' => 'group_mentor',\n 'label' => 'Mentor',\n 'settings' => array(\n 'form' => array(\n 'style' => 'fieldset',\n 'description' => '',\n ),\n 'display' => array(\n 'weight' => '39',\n 'label' => 'above',\n 'teaser' => array(\n 'format' => 'simple',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'simple',\n 'exclude' => 0,\n ),\n 'description' => '',\n '5' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n '2' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n '3' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n 'token' => array(\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n ),\n ),\n 'weight' => '39',\n 'fields' => array(\n '0' => 'field_mentor_image',\n '1' => 'field_mentor_name',\n '2' => 'field_mentor_location',\n '3' => 'field_mentor_profile',\n ),\n );\n\n // Translatables\n array(\n t('Assigned Volunteers'),\n t('Customer Impact'),\n t('Mentor'),\n );\n\n return $groups;\n}", "public function run()\n {\n $groups = [\n 'deposito',\n 'cajera',\n 'profesionales',\n 'mantenimiento',\n 'markenting',\n 'atención al cliente'\n ];\n\n foreach($groups as $group) {\n Group::create([\n 'name' => $group,\n 'description' => $group\n ]);\n }\n }", "function functionAddProject($postedArray){\n\t\tglobal $db;\n\t\textract($postedArray);\n\t\t$sql\t= \"INSERT into `projects` SET `project_name` = '\".mysql_real_escape_string($project_name).\"', `sender_name` = '\".mysql_real_escape_string($sender_name).\"', date='\".CURRENT_DATE.\"' \";\n\t\t$project_id = $db->insert($sql);\n\t\tif($project_id){\n\t\t\tif($sender_name_check){\n\t\t\t sendMailToServiceProvider($sender_name,$receivename,$receivermail);\n\t\t\t}\n\t\t\t$sql_user\t= \"INSERT into `users` SET `pfirstname`='\".getExploded($project_name,' ','0').\"' , `plastname`='\".getExploded($project_name,' ','1').\"', `is_project_user` = '\".$project_id.\"', `email`='\".mysql_real_escape_string($email).\"', `password`='\".md5Hash($password).\"', `phone`='\".$phone.\"',groupid = '1', user_type='Project-\".$project_id.\"', active_status='1', date='\".CURRENT_DATE.\"' \";\n\t\t\t$insert_user_id = $db->insert($sql_user);\n\t\t\tif($insert_user_id){\n\t\t\t\t$sql_privacy\t= \"INSERT into `user_privacy_settings` SET `user_id` ='\".$insert_user_id.\"', `user_type_setting` = '1', `parent_category_setting` ='1', `sub_category_setting` = '1', date='\".CURRENT_DATE.\"' \";\n\t\t\t\t$insert = $db->insert($sql_privacy);\n\t\t\t}\n\t\t}\n\t\treturn $project_id;\n\t}", "function add_project_to_client($client_name, $data) {\n $job_code = $data['JobCode']['code'];\n\t\tif ($this->project_exists($client_name, $data['JobCode']['code'])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t# make sure [[NewProject]] exists in $client_name's page\n\t\t$projects = file_get_contents(WIKI_CLIENTS_PATH . $client_name . '.txt');\n\t\tif (!stristr($projects, \"[[NewProject]]\") ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$projects = file_get_contents(WIKI_CLIENTS_PATH . $client_name . '.txt');\n\t\t$projects = str_ireplace(\"[[NewProject]]\", \"[[$job_code]]\\n * [[NewProject]]\", $projects);\n\n\t\t$handle = fopen(WIKI_CLIENTS_PATH . $client_name . '.txt', 'w');\n\t\tfwrite($handle, $projects);\n\n\t\tfclose($handle);\n\n\t\t$this->project_topic_create($client_name, $data); \n\t\treturn true;\n\n\t\t\n\t\t\n\t}" ]
[ "0.62314713", "0.5972075", "0.5901913", "0.57937855", "0.57929426", "0.57843626", "0.5746992", "0.5738046", "0.5734437", "0.571573", "0.5715605", "0.5698844", "0.5642549", "0.5640564", "0.56319344", "0.56309354", "0.5624124", "0.5616909", "0.5613589", "0.56052625", "0.5586889", "0.55775553", "0.5565699", "0.5562326", "0.5557038", "0.55542195", "0.55429775", "0.55362934", "0.55310047", "0.55220157" ]
0.6051442
1
Copy the value(ID) of LeadType
private function replaceLeadType(){ $leads = Lead::all(); foreach($leads as $lead){ if($lead->LeadType == "Flight"){ $lead->lead_type_id = 1; } else if($lead->LeadType == "Hotel"){ $lead->lead_type_id = 2; } else if($lead->LeadType == "Visa"){ $lead->lead_type_id = 3; } else if($lead->LeadType == "Insurance"){ $lead->lead_type_id = 4; } else if($lead->LeadType == "Tour"){ $lead->lead_type_id = 5; } else if($lead->LeadType == "Umrah"){ $lead->lead_type_id = 6; } else if($lead->LeadType == "Hajj"){ $lead->lead_type_id = 7; } $lead->save(); } dump('Leads Done'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getID_Type(){\n return $this->ID_Type;\n }", "public function setTypeId($value){\n\t\t$this->typeId = $value;\n\t}", "public function id() {\n return $this->type;\n }", "function setTypeId($typeId) {\n\t\treturn $this->setData('typeId', $typeId);\n\t}", "public function byType(string $type): LeadType;", "public function __clone()\r\n\t\t{\r\n\t\t\t$this->intId = NULL;\r\n\t\t}", "public function setIdType($new_idType)\n {\n $this->idType = $new_idType;\n }", "public function getIDField( $type ) {\r\n\t\treturn \"id\";\r\n\t}", "public function getTypeId()\n {\n return $this->type_id;\n }", "function getTypeId() {\n\t\treturn $this->getData('typeId');\n\t}", "public function getTypeId() {\n return $this->type_id;\n }", "public function getType_id()\n {\n return $this->type_id;\n }", "public function getType_id()\n {\n return $this->type_id;\n }", "public function getType_id()\n {\n return $this->type_id;\n }", "public function first(): LeadType;", "abstract public function getTypeId () : string;", "public function __clone()\n {\n $this->setId(null);\n }", "private function change_type_make_new_field_id(){\n if(!$query=$this->uCore->query('uCat',\"SELECT\n `field_id`\n FROM\n `u235_fields`\n WHERE\n `site_id`='\".site_id.\"'\n ORDER BY\n `field_id` DESC\n LIMIT 1\n \")) $this->uFunc->error(322);\n $id=$query->fetch_object();\n if(mysqli_num_rows($query)>0) $field_id=$id->field_id+1;\n else $field_id=1;\n\n //create new column in fields\n if(!$this->uCore->query(\"uCat\",\"ALTER TABLE\n `u235_items`\n ADD\n `field_\".$field_id.\"`\n \".$this->field_sql_type.\" NULL \")) $this->uFunc->error(423);\n\n return $field_id;\n }", "public function getTypeId();", "private function change_type_get_new_field_id() {\n if(!$query=$this->uCore->query(\"uCat\",\"SELECT DISTINCT\n `field_id`\n FROM\n `u235_fields`\n WHERE\n `site_id`='\".site_id.\"'\n \")) $this->uFunc->error(120);\n while($qr=$query->fetch_object()) $cur_site_field_id[$qr->field_id]=1;\n\n //get list of field_id for all sites with needed sql_type\n if(!$query=$this->uCore->query(\"uCat\",\"SELECT DISTINCT\n `field_id`\n FROM\n `u235_fields`,\n `u235_fields_types`\n WHERE\n `u235_fields`.`field_type_id`=`u235_fields_types`.`field_type_id` AND\n `field_sql_type`='\".$this->field_sql_type.\"'\n \")) $this->uFunc->error(221);\n if(!mysqli_num_rows($query)) return $this->change_type_make_new_field_id();\n\n while($qr=$query->fetch_object()) {\n if(!isset($cur_site_field_id[$qr->field_id])) {\n return $qr->field_id;\n }\n }\n return $this->change_type_make_new_field_id();\n }", "public function TypeID() {\n\treturn $this->Value('ID_Type');\n }", "public function getLinkTypeId () {\n\t\t$val = $this->cacheGetPlain('link_type_id');\n \tif (is_null($val))\n \t\treturn $this->cacheSetPlain('link_type_id', $this->getOffering()->getLinkTypeId());\n \telse\n \t\treturn $val;\n\t}", "public function getIdType()\n {\n return $this->idType;\n }", "function setId($id) {\n\t\t// Set type id and wipe data\n\t\t$this->_id\t = $id;\n\t}", "public function getTypeId()\n {\n return $this->type_id;\n }", "public function getTypeId()\n {\n return $this->type_id;\n }", "public function getTypeId()\n {\n return $this->type_id;\n }", "public function __clone() {\n\n if ($this->getId()) {\n $this->setId(null);\n }\n }", "public function add() {\n\n\t\t$parent = (isset($this->parent)) ? $this->parent : \"NULL\";\n\t\t$query = \"INSERT INTO \" . TB_INDUSTRY_TYPE . \" (type, parent) VALUES ( \" .\n\t\t\t\t\"'{$this->db->sqltext($this->type)}', \" .\n\t\t\t\t\"{$this->db->sqltext($parent)}\" .\n\t\t\t\t\")\";\n\n\t\t$this->db->query($query);\n\t\t$id = $this->db->getLastInsertedID();\n\t\t$this->id = $id;\n\t\treturn $id;\n\t}", "function getIdValue()\n {\n }" ]
[ "0.55681926", "0.5451286", "0.54099447", "0.53938514", "0.5377225", "0.52554613", "0.52159697", "0.52054536", "0.5198669", "0.5193992", "0.5183067", "0.5182844", "0.5182844", "0.5182844", "0.51724184", "0.5151393", "0.5144384", "0.5123139", "0.51186633", "0.5102795", "0.50823164", "0.50588", "0.50559556", "0.50465626", "0.50319266", "0.50319266", "0.50319266", "0.49969366", "0.499166", "0.49904254" ]
0.63295776
0
Copy and Replace BranchId
private function replaceBranches(){ $branches = Branch::all(); foreach($branches as $branch){ if($branch->BranchRestrict == "HDQ"){ $branch->branch_id = 1; } $branch->save(); } dump('Leads Done'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function branch ( $id );", "public function alter($branch_id,string $name): Branch\r\n {\r\n $branch = $this->findById($branch_id);\r\n $branch->branch_id = $branch_id;\r\n $branch->name = $name;\r\n $branch->save();\r\n\r\n echo \"<pre>\";\r\n var_dump($branch);\r\n echo \"</pre>\";\r\n return $branch;\r\n }", "public function assignBranch($branch_ID) {\n $this -> getBranches();\n // Check if the branch is not assigned as offered by this course\n if ($this -> branches[$branch_ID]['courses_ID'] == \"\") {\n eF_insertTableData(\"module_hcd_course_to_branch\", array(\"branches_ID\" => $branch_ID, \"courses_ID\" => $this -> course['id']));\n $this -> branches[$branch_ID]['courses_ID'] = $this -> course['id'];\n $newBranch = new EfrontBranch($branch_ID);\n $employees = $newBranch ->getEmployees(false,true); //get data flat\n $this -> addUsers($employees['login'], $employees['user_type']);\n }\n return true;\n }", "public function setBranch($value)\n {\n $this->branch = $value;\n }", "public function getNewSubmissionBranchId()\n\t{\n\t\treturn $this->new_submission_branch_id;\n\t}", "public function assigntobranchAction()\r\n\t{\r\n\t\r\n\t\t$data = $this->_model->getAssignedToBranchDojoData();\r\n\t\t$this->_helper->autoCompleteDojo($data);\r\n\t}", "public function removeBranch($branchId);", "function create_branch(){\n $inputs = $this->input->post();\n $cust_branch_id = get_autoincrement_no(CUSTOMER_BRANCHES);\n if(isset($inputs['status'])){\n $inputs['status'] = 1;\n } else{\n $inputs['status'] = 0;\n }\n \n $data = array(\n 'id' => $cust_branch_id,\n 'customer_id' => $inputs['customer_id'],\n 'branch_name' => $inputs['branch_name'],\n 'branch_short_name' => $inputs['branch_short_name'],\n 'contact_person' => $inputs['contact_person'],\n 'sales_person_id' => $inputs['sales_person_id'],\n 'description' => $inputs['description'],\n 'mailing_address' => $inputs['mailing_address'],\n 'billing_address' => $inputs['billing_address'],\n 'phone' => $inputs['phone'],\n 'fax' => $inputs['fax'],\n 'email' => $inputs['email'],\n 'status' => $inputs['status'],\n 'added_on' => date('Y-m-d'),\n 'added_by' => $this->session->userdata(SYSTEM_CODE)['ID'],\n );\n \n// echo '<pre>'; print_r($data); die;\n\t\t$add_stat = $this->Customers_model->add_db_branch($data);\n \n\t\tif($add_stat[0]){ \n //update log data\n $new_data = $this->Customers_model->get_single_row_branch($add_stat[1]);\n add_system_log(CUSTOMER_BRANCHES, $this->router->fetch_class(), __FUNCTION__, '', $new_data);\n $this->session->set_flashdata('warn',RECORD_ADD);\n redirect(base_url($this->router->fetch_class().'/edit/'.$inputs['customer_id'])); \n }else{\n $this->session->set_flashdata('warn',ERROR);\n redirect(base_url($this->router->fetch_class()));\n } \n\t}", "public function get_Branch_Autogen_ID() {\n $result = $this->db->mod_select(\"SELECT MAX(id_outlet_has_branch) As id FROM tbl_outlet_has_branch\");\n $num_rows = $result[0]->id;\n if ($num_rows == 0) {\n return \"BR0001\";\n } else {\n if ($num_rows >= 1 && $num_rows < 10) {\n return \"BR000\" . $num_rows;\n } else if ($num_rows >= 10 && $num_rows < 100) {\n return \"BR00\" . $num_rows;\n } else if ($num_rows >= 100 && $num_rows < 1000) {\n return \"BR0\" . $num_rows;\n } else if ($num_rows >= 1000 && $num_rows < 10000) {\n return \"BR\" . $num_rows;\n }\n }\n }", "public function save_branch() {\n\t\tcheck_ajax_referer( $this->plugin->meta_prefix, 'nonce' );\n\n\t\tif ( ! isset( $_POST['content'], $_POST['id'] ) ) { // WPCS: input var okay.\n\t\t\twp_send_json_error( 'Save branch failed.' );\n\t\t}\n\n\t\t$content = wp_unslash( $_POST['content'] ); // WPCS: input var okay. Cannot sanitize text field without losing linebreaks.\n\t\t$id = intval( wp_unslash( $_POST['id'] ) ); //WPCS: input var okay.\n\n\t\t// Save the content in the post meta.\n\t\tupdate_post_meta( $id, 'branch_content', $content );\n\t\twp_send_json_success( 'saved' );\n\t}", "public function updateLoadedRevisionId();", "function insert_detail_hutang($branch_id, $data)\n {\n // lihat account code untuk credit hutang\n if ($data['credit'] == 0) {\n $data['acc_code'] = $this->db->get_where(\n \"m_journal_mapping\",\n array(\n \"JOURNAL_CD\" => \"P\",\n \"SEQ_LINE\" => 1,\n \"BRANCH_ID\" => $branch_id\n )\n )->row()->ACCOUNT_CODE;\n } else {\n $data['acc_code'] = $this->db->get_where(\n \"m_journal_mapping\",\n array(\n \"JOURNAL_CD\" => \"P\",\n \"SEQ_LINE\" => 2,\n \"BRANCH_ID\" => $branch_id\n )\n )->row()->ACCOUNT_CODE;\n }\n\n $this->insert_detail($data);\n }", "public function update(BranchRequest $request, Branch $branch)\n {\n if(!empty($request['password'])){\n $request['password'] = bcrypt($request['password']);\n }\n $branch->update($request->all());\n\n $city=collect($request->city)->pluck('id');\n $city=$city->flatten();\n $branch->city()->sync($city);\n $district=collect($request->district)->pluck('id');\n $district=$district->flatten();\n $branch->district()->sync($district);\n/*\n activity()->causedBy(Auth::user())->performedOn($branch)\n ->withProperties(['action' => 'update', 'status' => 'success'])\n ->log($branch->name.' branch successfully updated');\n*/\n return response()->json('success');\n }", "public function __construct($branch)\n {\n //\n $this->branch = Branch::where('id', $branch)->first();\n }", "function insert_detail_piutang($branch_id, $data)\n {\n if ($data['credit'] == 0) {\n $data['acc_code'] = $this->db->get_where(\n \"m_journal_mapping\",\n array(\n \"JOURNAL_CD\" => \"POS\",\n \"SEQ_LINE\" => 1,\n \"BRANCH_ID\" => $branch_id\n )\n )->row()->ACCOUNT_CODE;\n } else {\n $data['acc_code'] = $this->db->get_where(\n \"m_journal_mapping\",\n array(\n \"JOURNAL_CD\" => \"POS\",\n \"SEQ_LINE\" => 2,\n \"BRANCH_ID\" => $branch_id\n )\n )->row()->ACCOUNT_CODE;\n }\n\n $this->insert_detail($data);\n }", "public function copyAction()\n {\n $request = $this->getRequest();\n if ($request->isPost() && $request->isXmlHttpRequest()) {\n $treeId = $request->getParam('TreeId');\n $newTreeId = Streamwide_Web_Model::call('Tree.Copy', array($treeId));\n $pagination = array(\n 'CurrentPage' => $request->getParam('CurrentPage', SwIRS_Web_Request::CURRENT_PAGE),\n 'ItemsPerPage' => $request->getParam('ItemsPerPage', SwIRS_Web_Request::ITEMS_PER_PAGE)\n );\n\n $this->view->assign(array(\n 'Result' => $newTreeId,\n 'CustomerUserId' => $request->getParam('CustomerUserId'),\n 'CustomerAccountId' => $request->getParam('CustomerAccountId'),\n 'Pagination' => $pagination,\n ));\n $this->gethelper('ViewRenderer')->direct('copy-ack');\n }\n }", "function setCopyedId($copyedId) {\n\t\treturn $this->setData('copyedId', $copyedId);\n\t}", "public function get_branch_name($id){\n\t\t$data = $this->HrEmployee->HrBranch->findById($id, array('fields' => 'branch_name'));\t\t\n\t\t$this->set('branch_data', $data);\n\t}", "public function update(BranchRequest $request, $id)\n {\n $branch = Branch::find($id);\n\n $branch->name_branch = $request->name_branch; \n $branch->director_branch = $request->director_branch;\n $branch->email_branch = $request->email_branch;\n $branch->phone_branch = $request->phone_branch;\n $branch->local_branch = $request->local_branch;\n\n $fileImage = $request->image_branch;\n if(!empty($fileImage)){\n $branch->image_branch = $fileImage->getClientOriginalName();\n \n }\n if($branch->save()){\n if(!empty($fileImage)){\n $fileImage->move('project_asset/images/image_branch',$fileImage->getClientOriginalName());\n }\n return redirect('branch')->with('success', 'Cập nhập thành công chi nhánh!');\n }\n }", "public function getCurrentBranch();", "public function getCurrentBranch();", "public static function SWITCH_ID(int $branchId)\n {\n $auth_user = auth()->user();\n\n $update = User::where('id', '=', $auth_user->id)->update([\n 'LoggedInBranchID' => $branchId,\n ]);\n\n return $update;\n }", "public function insertBranch($project, string $branch, string $ref): array\n {\n return $this->post($this->projectURL . $project . '/repository/' . $this->branchURL, [\n 'branch' => $branch,\n 'ref' => $ref\n ]);\n }", "public function branch_create($args, $assoc_args) {\n $site = SiteFactory::instance($assoc_args['site']);\n $branch = preg_replace('#[-_\\s]+#',\"\",@$assoc_args['branch']);\n $branch = $site->createBranch($branch);\n }", "function setbranchrootwsid($wsid, $branchrootwsid, &$trees) {\n\tif (!$trees[$wsid][\"closed\"]) {\n\t\t$trees[$wsid][\"branchrootwsid\"] = $branchrootwsid;\n\t\tforeach ($trees[$wsid][\"children\"] as $childid) {\n\t\t\tsetbranchrootwsid($childid, $branchrootwsid, $trees);\n\t\t}\n\t}\n}", "public function load_branch() {\n\t\tcheck_ajax_referer( $this->plugin->meta_prefix, 'nonce' );\n\n\t\tif ( ! isset( $_POST['id'] ) ) { // WPCS: input var okay.\n\t\t\twp_send_json_error( 'Load branch failed.' );\n\t\t}\n\n\t\t$id = intval( wp_unslash( $_POST['id'] ) ); //WPCS: input var okay.\n\n\t\t// Load the content from the post meta.\n\t\t$content = get_post_meta( $id, 'branch_content', true );\n\n\t\twp_send_json_success( $content );\n\t}", "public function branch(\\Sakwa\\Utils\\Guid $branch_point = null)\n {\n if (is_null($branch_point)) {\n $branch_point = new Guid();\n }\n\n $this->current_branch_point = $branch_point;\n\n foreach ($this->entity_references_by_guid as $entity) {\n if ($entity instanceof Variable) {\n $entity->commit($branch_point);\n }\n }\n\n return $branch_point;\n }", "function wpbb_copy_block($source_stack_id, $source_block_id, $target_stack_id) {\n\n\tglobal $wpdb;\n\n\t$source_page_blocks = wpbb_get_blocks($source_stack_id);\n\t$target_page_blocks = wpbb_get_blocks($target_stack_id);\n\n\tif ($source_page_blocks == null) $source_page_blocks = array();\n\tif ($target_page_blocks == null) $target_page_blocks = array();\n\n\tforeach ($source_page_blocks as $i => $source_page_block) {\n\n\t\tif ($source_page_block['block_id'] == $source_block_id) {\n\n\t\t\t$source_page_block['stack_id'] = $target_stack_id;\n\t\t\t$source_page_block['super_id'] = 0;\n\t\t\t$source_page_block['space_id'] = 0;\n\n\t\t\t$post = get_post($source_page_block['block_id']);\n\n\t\t\t$args = array(\n\t\t\t\t'post_content' => $post->post_content,\n\t\t\t\t'post_excerpt' => $post->post_excerpt,\n\t\t\t\t'post_name' => $post->post_name,\n\t\t\t\t'post_parent' => $post->post_parent,\n\t\t\t\t'post_password' => $post->post_password,\n\t\t\t\t'post_status' => $post->post_status,\n\t\t\t\t'post_title' => $post->post_title,\n\t\t\t\t'post_type' => $post->post_type,\n\t\t\t);\n\n\t\t\t$target_block_id = wp_insert_post($args);\n\n\t\t\t$source_metas = $wpdb->get_results(\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$source_block_id\");\n\n\t\t\tif (count($source_metas)) {\n\n\t\t\t\t$sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) \";\n\n\t\t\t\tforeach ($source_metas as $source_meta) {\n\n\t\t\t\t\t$key = $source_meta->meta_key;\n\t\t\t\t\t$val = $source_meta->meta_value;\n\t\t\t\t\t$val = addslashes($val);\n\n\t\t\t\t\t$sql_query_sel[] = \"SELECT $target_block_id, '$key', '$val'\";\n\t\t\t\t}\n\n\t\t\t\t$sql_query .= implode(\" UNION ALL \", $sql_query_sel);\n\n\t\t\t\t$wpdb->query($sql_query);\n\t\t\t}\n\n\t\t\t$source_page_block['block_id'] = $target_block_id;\n\n\t\t\t$target_page_blocks[] = $source_page_block;\n\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tupdate_post_meta($target_stack_id, '_wpbb_blocks', $target_page_blocks);\n}", "function generateReferenceNo($branch_id){\n $year = date('Y');\n $branch_code = Branch::find($branch_id)->branch_code;\n\n $last = Transaction::where('reference_no', 'LIKE', $branch_code.'-'.$year.'-%')\n ->orderBy('id','DESC')\n ->get()->first();\n if(isset($last['id'])){\n $reference_no = $last['reference_no'];\n $str = explode(\"-\", $reference_no);\n return $branch_code . '-' . $year . '-' . str_pad(($str[2]+1), 8,\"0\",STR_PAD_LEFT);\n }\n return $branch_code . '-' . $year . '-' . str_pad(1, 8,\"0\",STR_PAD_LEFT);\n }", "static function addBranch($params)\n {\n\t$con =$params['dbconnection'];\n\t$coordinator_id=\"\";\n\t$start_1_timing='';\n\t$end_1_timing='';\n\t$start_2_timing='';\n\t$end_2_timing='';\n\t$start_3_timing='';\n\t$end_3_timing='';\n\t\n\tif(!empty($params['coordinator_id'])){ $coordinator_id=\" `admin_id`='{$params['coordinator_id']}' ,\"; }\n\tif(!empty($params['start_1_timing'])){ $start_1_timing=\" `start_1_timing`='{$params['start_1_timing']}' ,\"; }\n\tif(!empty($params['end_1_timing'])){ $end_1_timing=\" `end_1_timing`='{$params['end_1_timing']}' ,\"; }\n\tif(!empty($params['start_2_timing'])){ $start_2_timing=\" `start_2_timing`='{$params['start_2_timing']}' ,\"; }\n\tif(!empty($params['end_2_timing'])){ $end_2_timing=\" `end_2_timing`='{$params['end_2_timing']}' ,\"; }\n\tif(!empty($params['start_3_timing'])){ $start_3_timing=\" `start_3_timing`='{$params['start_3_timing']}' ,\"; }\n\tif(!empty($params['end_3_timing'])){ $end_3_timing=\" `end_3_timing`='{$params['end_3_timing']}' ,\"; }\n\t\n\t//if(DbMethods::checkBranchName($params)=='alreadyexist') return 'alreadyexist';\n\t$queryi = \"INSERT INTO `branches` SET \n\t`name`='{$params['name']}',\n\t`name_ar`='{$params['name_ar']}',\n\t`address`='{$params['address']}',\n\t\".$coordinator_id.\"\n\t\".$start_1_timing.\"\n\t\".$end_1_timing.\"\n\t\".$start_2_timing.\"\n\t\".$end_2_timing.\"\n\t\".$start_3_timing.\"\n\t\".$end_3_timing.\"\n\t`latitude`='{$params['latitude']}',\n\t`longitude`='{$params['longitude']}'\" ;\n\tmysqli_query($con,$queryi) ;\n\tif (mysqli_error($con) != '')\n\treturn \"mysql_Error:-\".mysqli_error($con);\n\tif(mysqli_affected_rows($con)==0)\n\treturn \"\";\n\t$id=mysqli_insert_id($con);\n\treturn array(\"id\"=>(int)$id) ;\n\t\n }" ]
[ "0.623125", "0.58103573", "0.55475813", "0.55400574", "0.5491584", "0.5406257", "0.536469", "0.5220051", "0.5169354", "0.51301646", "0.5123887", "0.51068825", "0.50694174", "0.50474536", "0.5044209", "0.50427103", "0.49988383", "0.4952105", "0.4945788", "0.49425325", "0.49425325", "0.49236062", "0.49218208", "0.49006116", "0.48909503", "0.48789915", "0.4856525", "0.48558128", "0.48492375", "0.48240203" ]
0.64016116
0
Update CreatedBy,TakenBy,ClosedBy in CRM_Leads
private function UpdatedallUsersInLeads(){ $leads = \App\Lead::all(); foreach ($leads as $lead) { $createdBy = \App\User::where('user_name',$lead->CreatedBy)->first(); $takenOverBy = \App\User::where('user_name',$lead->TakenOverBy)->first(); $ClosedBy = \App\User::where('user_name',$lead->ClosedBy)->first(); $LastUpdatedBy = \App\User::where('user_name',$lead->LastUpdateBy)->first(); $branch = \App\Branch::where('name',$lead->BranchRestrict)->first(); if($createdBy) $lead->user_id = $createdBy->id; if($takenOverBy) $lead->taken_over_by = $takenOverBy->id; if($ClosedBy) $lead->closed_by = $ClosedBy->id; if($LastUpdatedBy) $lead->last_updated_by = $LastUpdatedBy->id; if($branch) $lead->branch_id = $branch->id; $lead->save(); } dump('UpdatedallUsersInLeads'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updated(Lead $lead)\n {\n //\n }", "public function updateOpportunities(){\n }", "public function update() {\n $ad = $this->ad_protected_for_current_user($this->params['id']);\n $type = $ad->type;\n\n $ad->update([\n 'city' => $this->params['city'],\n 'description' => $this->params['description'],\n 'price' => $this->params['price'],\n 'type' => $type,\n 'author_id' => $this->current_user->id,\n 'console_id' => $this->params['console_id'],\n \"{$type}_id\" => $this->params[$type . '_id'],\n 'published' => $this->params['published']\n ]);\n\n $this->notify_subscribed_users($ad);\n\n redirect(\n '/ads/edit',\n ['notice' => 'Ad updated successfully'],\n ['id' => $ad->id]\n );\n }", "function wyzi_subscription_update_user_priveleges_to_business_owner ($user_id) {\n\n if ( current_user_can( 'maage_options' ) )\n return;\n\n $wyzi_subscription_options = get_option ('wyzi_pmpro_subscription_options');\n\n $u = new WP_User( $user_id );\n\n $u->remove_role( 'client' );\n $u->add_role( 'business_owner' );\n\n $points_available = get_user_meta( $user_id, 'points_available', true );\n if ( '' == $points_available ) {\n $points_available = 0;\n } else {\n $points_available = intval( $points_available );\n }\n\n $membership_level = pmpro_getMembershipLevelForUser($user_id);\n \n $points_available = intval($points_available) + intval($wyzi_subscription_options[$membership_level->id]['wyzi_sub_points_added']);\n update_user_meta ($user_id, 'points_available',$points_available);\n\n if( 'on' == get_option( 'wyz_can_become_vendor' ) && WyzHelpers::wyz_sub_can_bus_owner_do( $user_id, 'wyzi_sub_auto_vendorship' ) ) {\n WyzHelpers::make_user_vendor( $u );\n }\n\n WyzHelpers::add_extra_points( $user_id );\n\n }", "public function update(Request $request,$owner)\n {\n $last = minted::latest(\"id\")->first();\n if($last!=null){\n $last->block=$request->block;\n $last->update();\n }\n\n\n }", "public function updating($model)\n {\n if(in_array(\"created_by\", $model->getFillable()))\n {\n if(isset(auth(\"admin\")->user()->admin_id))\n {\n $model->updated_by = auth(\"admin\")->user()->admin_id;\n }\n }\n }", "public function update(Request $request, $id)\n {\n //DB::beginTransaction();\n //\n $today = $this->getDate($request);\n $tomorrow = $today->copy()->addWeekDay();\n $activity = Activities::find($request->ActionType);\n\n // change referral status to attendance taken and set the activity type id accordingly\n $referral = Referrals::find($id);\n $referral->RefferalStatus = 1;\n $referral->ActivityTypeId = $request->ActionType;\n $referral->save();\n\n $useraction = Useractions::create([\n 'ActionDate' => $today,\n 'ActionByUserId' => $this->userId,\n 'ActionType' => $request->ActionType,\n 'ActionToUserId' => $referral->StudentId,\n 'Comment' => $request->Comment]);\n\n\n $counters = Counters::find($referral->StudentId);\n // present for lunch\n if ($request->ActionType == 31) {\n $msg = 'Student Was Present';\n $counters->decrement('LunchDetentionsToBeServed');\n\n $pendingLunchs = Referrals\n ::where('Date', $today)\n ->where('RefferalStatus', 0)// pending\n ->where('ReferralTypeId', 9)\n ->where('RefferalStatus','!=',99)\n ->where('StudentId', $referral->StudentId)\n ->update(['date' => $tomorrow]);\n } // ditch for lunch\n else if ($request->ActionType == 32 || $request->ActionType == 35 || $request->ActionType == 36) {\n $msg = 'Student Ditched Lunch Detention, Assigning Oroom for Today';\n $counters->LunchDetentionsToBeServed = 0;\n $useraction = Useractions::create([\n 'ActionDate' => $today,\n 'ActionByUserId' => $this->userId,\n 'ActionType' => 44,\n 'ActionToUserId' => $referral->StudentId,\n 'Comment' => 'Student Ditched Lunch Detention on ' . Carbon::now()\n . ' Assigning Oroom for Today (System)']);\n\n// $referralCopy = $referral->replicate();\n// $referralCopy->Date = $tomorrow;\n// $referralCopy->save();\n// $referralCopy->created_at = $referral->created_at;\n// $referralCopy->save();\n\n\n\n $consequence = Referrals::create([\n 'UserId' => $this->userId,\n 'StudentId' => $referral->StudentId,\n 'TeacherId' => 0,\n 'ReferralTypeId' => 2,// lunch -> ORM\n 'Date' => Carbon::today()\n ]);\n $referral->update(['RefferalStatus'=>1, 'ActivityTypeId'=> $request->ActionType, 'ConsequenceId'=>$consequence->Id]);\n // set lunch detention refs status to 13 = lunch -> oroom => lunchs = 0\n $pendingLunchs = Referrals\n ::where('Date', $today)\n ->where('RefferalStatus', 0)// pending\n ->where('ReferralTypeId', 9)\n ->where('StudentId', $referral->StudentId);\n // ->update(['RefferalStatus' => 13]);\n $counters->increment('ORoomsToBeServed');\n }\n else {\n $msg = 'Rescheduling Lunch Detention For Tomorrow';\n $useraction = Useractions::create([\n 'ActionDate' => $today,\n 'ActionByUserId' => $this->userId,\n 'ActionType' => $request->ActionType,\n 'ActionToUserId' => $referral->StudentId,\n 'Comment' => 'Rescheduling Lunch Detention For Tomorrow(System)']);\n\n// $referralCopy = $referral->replicate();\n// $referralCopy->Date = $tomorrow;\n// $referralCopy->save();\n// $referralCopy->created_at = $referral->created_at;\n// $referralCopy->save();\n\n $referral->update(['RefferalStatus'=>1, 'ActivityTypeId'=> $request->ActionType]);\n\n $pendingLunchs = Referrals\n ::where('Date', $today)\n ->where('RefferalStatus', 0)// pending\n ->where('ReferralTypeId', 9)\n ->where('StudentId', $referral->StudentId);\n // ->update(['date' => $tomorrow]);\n }\n $counters->save();\n $referral->load('activity');\n return compact('msg', 'useraction', 'referral', 'counters', 'consequence');\n }", "public function updateUserLastAccess()\n {\n $user = Doctrine::getTable('User')->find($this->getUserId());\n if ($user)\n {\n // not using the date formatter because this method can be called before the formatter exists\n $user->setLastAccessAt(date('Y-m-d H:i:s'));\n $user->save();\n }\n }", "public function updatelead()\n {\n $return_data = ['status' => 0];\n $user_id = \\Auth::id();\n $ukey = md5(rand().'-'.time().'-'.rand());\n\n $rules = \\Config::get('validation.leadupdate');\n $messages = [];\n $attributeNames = [\n 'other_info.title' => 'Lead Title',\n 'other_info.city' => 'City'\n ];\n $validator = \\Validator::make(Input::all(), $rules, $messages);\n $validator->setAttributeNames($attributeNames);\n\n if (!$validator->fails()) {\n $data = ['user_id' => $user_id, 'status' => 0, 'other_info' => []];\n $fields = ['first_name', 'last_name', 'email', 'phone', 'other_info.city' => 'city', 'other_info.title' => \"title\", 'company_name'];\n $other_fields = ['city' => 'other_info', 'title' => 'other_info'];\n foreach ($fields as $form_field => $field) {\n if (array_key_exists($field, $other_fields)) {\n $data[$other_fields[$field]][$field] = $this->secure_data(Input::get($form_field));\n } else {\n $data[$field] = $this->secure_data(Input::get($field));\n }\n }\n\n $data['other_info'] = json_encode($data['other_info']);\n\n $id = $this->secure_data(Input::get('id', ''));\n if ($id == '' && !$id) {\n $data['ukey'] = $ukey;\n $lead_data = Lead::create($data);\n $msg = 'Lead inserted successfully.';\n $type = 'insert';\n } else {\n // Update\n Lead::where('id', $id)->update($data);\n $lead_data = Lead::where('id', $id)->first();\n $msg = 'Lead updated successfully.';\n $type = 'update';\n }\n\n $lead_data['other_info'] = ($lead_data['other_info'] !== '') ? json_decode($lead_data['other_info'], true) : [];\n $return_data['status'] = 1;\n $return_data['type'] = $type;\n $return_data['lead_data'] = $lead_data;\n $return_data['message'] = $msg;\n }\n else {\n $return_data['message'] = implode(\"<br>\", $validator->errors()->all());\n }\n\n return $return_data;\n }", "public function update(Request $request, AffiliateAdUnderwritten $affiliateAdUnderwritten)\n {\n //\n }", "public function update()\n { if (is_null($this->id))\n trigger_error(\"Contributor::update(): Attempt to update a Contributor object that does not have its ID property set.\", E_USER_ERROR);\n\n // Update the Contributor\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"UPDATE contributor SET FirstName=:firstname, FamilyName=:familyname, UserID=:userID, Orcid=:orcid, OrcidCode=:orcidcode, OrcidAccessToken=:orcidaccesstoken WHERE ContributorID = :id\";\n $st = $conn->prepare($sql);\n \n \n $st->bindValue(\":firstname\", $this->firstName, PDO::PARAM_STR);\n $st->bindValue(\":familyname\", $this->familyName, PDO::PARAM_STR); \n $st->bindValue(\":userID\", $this->userID, PDO::PARAM_INT);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR);\n $st->bindValue(\":orcidcode\", $this->orcidCode, PDO::PARAM_STR);\n $st->bindValue(\":orcidaccesstoken\", $this->orcidAccessToken, PDO::PARAM_STR);\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }", "public function Update()\n\t{\n\t\ttry\n\t\t{\n\t\t\t\t\t\t\n\t\t\t$json = json_decode(RequestUtil::GetBody());\n\n\t\t\tif (!$json)\n\t\t\t{\n\t\t\t\tthrow new Exception('The request body does not contain valid JSON');\n\t\t\t}\n\n\t\t\t$pk = $this->GetRouter()->GetUrlParam('id');\n\t\t\t$lead = $this->Phreezer->Get('Lead',$pk);\n\n\t\t\t// TODO: any fields that should not be updated by the user should be commented out\n\n\t\t\t// this is a primary key. uncomment if updating is allowed\n\t\t\t// $lead->Id = $this->SafeGetVal($json, 'id', $lead->Id);\n\n\t\t\t$lead->Status = $this->SafeGetVal($json, 'status', $lead->Status);\n\t\t\t$lead->StateId = $this->SafeGetVal($json, 'stateId', $lead->StateId);\n\t\t\t$lead->CustomerId = $this->SafeGetVal($json, 'customerId', $lead->CustomerId);\n\t\t\t$lead->AccountId = $this->SafeGetVal($json, 'accountId', $lead->AccountId);\n\t\t\t$lead->AccountTypeId = $this->SafeGetVal($json, 'accountTypeId', $lead->AccountTypeId);\n\t\t\t$lead->CreatedDate = date('Y-m-d H:i:s',strtotime($this->SafeGetVal($json, 'createdDate', $lead->CreatedDate)));\n\t\t\t$lead->UpdatedDate = date('Y-m-d H:i:s',strtotime($this->SafeGetVal($json, 'updatedDate', $lead->UpdatedDate)));\n\t\t\t$lead->ServiceId = $this->SafeGetVal($json, 'serviceId', $lead->ServiceId);\n\n\t\t\t$lead->Validate();\n\t\t\t$errors = $lead->GetValidationErrors();\n\n\t\t\tif (count($errors) > 0)\n\t\t\t{\n\t\t\t\t$this->RenderErrorJSON('Please check the form for errors',$errors);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$lead->Save();\n\t\t\t\t$this->RenderJSON($lead, $this->JSONPCallback(), true, $this->SimpleObjectParams());\n\t\t\t}\n\n\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\n\n\t\t\t$this->RenderExceptionJSON($ex);\n\t\t}\n\t}", "public static function update_contributor(){\n\t\t\n\t}", "protected function _update()\n {\n $this->_setModificationInfo();\n $this->_protectCreatedInfo();\n }", "public function changeAgentLead()\n\t{\n\t\t$customers = LeadDetails::where('active', 1)->where('agent.name', 'like', 'direct%')->get();\n\t\t$cunt = 0;\n\t\tforeach ($customers as $customer) {\n\t\t\tLeadDetails::where(\n\t\t\t\t'_id',\n\t\t\t\tnew ObjectId($customer->_id)\n\t\t\t)->update(array('agent.name' => 'Direct', 'agent.id' => new ObjectID('5c30bc1eb8ace01d08691f32'), 'agent.empid' => 'B-0001'));\n\n\t\t\tLeadDetails::where(\n\t\t\t\t'_id',\n\t\t\t\tnew ObjectId($customer->_id)\n\t\t\t)->update(array('dispatchDetails.agent' => 'Direct'));\n\t\t\t$cunt++;\n\t\t}\n\n\t\techo \"AGENT : \" . $cunt;\n\n\t\t$caseManagers = LeadDetails::where('active', 1)->where('caseManager.name', 'like', 'direct%')->get();\n\t\t$cuntCase = 0;\n\t\tforeach ($caseManagers as $case) {\n\t\t\tLeadDetails::where(\n\t\t\t\t'_id',\n\t\t\t\tnew ObjectId($case->_id)\n\t\t\t)->update(array('caseManager.name' => 'Direct', 'caseManager.id' => new ObjectID('5c30bc1eb8ace01d08691f32')));\n\n\t\t\tLeadDetails::where(\n\t\t\t\t'_id',\n\t\t\t\tnew ObjectId($case->_id)\n\t\t\t)->update(array('dispatchDetails.caseManager' => 'Direct'));\n\t\t\t$cuntCase++;\n\t\t}\n\t\techo \"CASE \" . $cuntCase;\n\n\t\t$assignto = LeadDetails::where('active', 1)->where('employee.name', 'like', 'direct%')->get();\n\t\t$cuntAssign = 0;\n\t\tforeach ($assignto as $assign) {\n\t\t\tLeadDetails::where(\n\t\t\t\t'_id',\n\t\t\t\tnew ObjectId($assign->_id)\n\t\t\t)->update(array(\n\t\t\t\t'employee.name' => 'Direct', 'employee.id' => new ObjectID('5c30bc1eb8ace01d08691f32'),\n\t\t\t\t'employee.empId' => 'B-0001'\n\t\t\t));\n\n\t\t\tLeadDetails::where(\n\t\t\t\t'_id',\n\t\t\t\tnew ObjectId($assign->_id)\n\t\t\t)->update(array(\n\t\t\t\t'dispatchDetails.employee.name' => 'Direct', 'dispatchDetails.employee.id' => new ObjectID('5c30bc1eb8ace01d08691f32'),\n\t\t\t\t'dispatchDetails.employee.empId' => 'B-0001'\n\t\t\t));\n\t\t\t$cuntAssign++;\n\t\t}\n\t\techo \"ASSIGN TO \" . $cuntAssign;\n\t}", "public function update(User $user, LeadSource $leadSource)\n {\n return $user->role->permissions->contains('key','update-lead-sources') ||\n $user->id == $leadSource->created_id ||\n $user->id == $leadSource->updated_id;\n }", "public function updateDamagedBuilding($buildingId, $sectorId, $remainingHealth, $level, $dateStarted=null, $dateStopped=null) {\n\n $connection = $this->getConnection();\n $query = \"UPDATE Building SET building_level=\".$level.\",\n building_remainingHealth=\".$remainingHealth;\n if ($dateStarted && $dateStopped)\n $query .= \", building_dateStarted=\".$dateStarted.\", building_dateStopped=\".$dateStopped;\n $query .= \" WHERE building_buildingClassId=\".$buildingId.\" AND building_sectorId=\".$sectorId;\n $result = $connection->Execute ($query);\n return ($result);\n}", "public function updateOORequest($request, $status, $bookingType, $fromDate, $untilDate, $halfDaysAM, $halfDaysPM, $originatorComment, $autoAssignWorktimeCredit=null) {\n\t\t\t\n\t\t// get db connection (for TX operations, it is best practice to specify connection explicitly)\n\t\t$con = \\Propel::getConnection(\\OORequestPeer::DATABASE_NAME);\n\t\t\n\t\t// start TX\n\t\t$con->beginTransaction();\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t//\n\t\t\t// update the request\n\t\t\t\n\t\t\t$request->setStatus($status);\n\t\t\t$request->setOriginatorComment($originatorComment);\t\n\t\t\t\n\t\t\t// update the associated oo booking\n\t\t\t$this->updateOOBooking(\t\t\n\t\t\t\t\t\t\t\t\t\t$request->getOOBooking(),\n\t\t\t\t\t\t\t\t\t\t$bookingType,\n\t\t\t\t\t\t\t\t\t\t$fromDate,\n\t\t\t\t\t\t\t\t\t\t$untilDate,\n\t\t\t\t\t\t\t\t\t\t$halfDaysAM,\n\t\t\t\t\t\t\t\t\t\t$halfDaysPM,\n\t\t\t\t\t\t\t\t\t\t$autoAssignWorktimeCredit\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t//\n\t\t\t// persist\n\t\t\t$request->save();\n\t\t\n\t\t\t// commit TX\n\t\t\t$con->commit();\n\t\t\t\n\t\t\t// log at level \"info\"\n\t\t\tlog_message('info', \"OOManager:updateOORequest() - updated oo request with ID: \" . $request->getId());\t\n\t\t}\n\t\tcatch (\\PropelException $ex) {\n\t\t\t// roll back\n\t\t\t$con->rollback();\n\t\t\t// rethrow\n\t\t\tthrow new MomoException(\"OOManager:updateOORequest() - a database error has occurred while while attempting to update the oo request with id: \" . $request->getId(), 0, $ex);\n\t\t}\n\t\t\n\t\treturn $request;\n\t}", "function agent_put()\n { \n $agent = new agent($this->put('id'));\n\n $agent->date_modified = date('Y-m-d H:i:s');\n $agent->modifiedbypk = $this->get_user()->user_id;\n\n $this->response($this->_agent_save($agent, 'put'));\n }", "public function update(Request $request, int $leadID)\n {\n $this->validate($request, [\n 'company' => 'required|max:255',\n 'address' => 'required',\n 'service_area_id' => 'required',\n 'contact_name' => 'required|max:255',\n 'contact_email' => 'required|email|max:255',\n 'account_num' => 'required|max:255',\n 'hauler_id' => 'required|integer',\n 'msw_qty' => 'integer',\n 'msw_yards' => 'numeric',\n 'msw_per_week' => 'numeric',\n 'rec_qty' => 'integer',\n 'rec_yards' => 'numeric',\n 'rec_per_week' => 'numeric',\n 'msw2_qty' => 'integer',\n 'msw2_yards' => 'numeric',\n 'msw2_per_week' => 'numeric',\n 'rec2_qty' => 'integer',\n 'rec2_yards' => 'numeric',\n 'rec2_per_week' => 'numeric',\n 'monthly_price' => 'numeric'\n ]);\n\n try\n {\n $this->leads\n ->setCompany($request->input('company'))\n ->setAddress($request->input('address'))\n ->setServiceAreaID($request->input('service_area_id'))\n ->setContactName($request->input('contact_name'))\n ->setContactEmail($request->input('contact_email'))\n ->setAccountNum($request->input('account_num'))\n ->setHaulerID($request->input('hauler_id'))\n ->setWaste(\n $request->input('msw_qty'),\n $request->input('msw_yards'),\n $request->input('msw_per_week')\n )\n ->setWaste2(\n $request->input('msw2_qty'),\n $request->input('msw2_yards'),\n $request->input('msw2_per_week')\n )\n ->setRecycling(\n $request->input('rec_qty'),\n $request->input('rec_yards'),\n $request->input('rec_per_week')\n )\n ->setRecycling2(\n $request->input('rec2_qty'),\n $request->input('rec2_yards'),\n $request->input('rec2_per_week')\n )\n ->setMonthlyPrice($request->input('monthly_price'))\n ->setNotes($request->input('notes'))\n ->update($leadID);\n\n return redirect()->route('leads::show', ['id' => $leadID])->with(['message' => trans('messages.leadUpdated')]);\n } catch(LeadExists $e)\n {\n return redirect()->back()->with(['message' => $e->getMessage()]);\n }\n }", "public function update(Request $request, LawyerInformation $lawyerInformation)\n {\n //\n }", "public function update_user() {\r\n \r\n }", "public function update()\n\t\t{\n\t\t\t$post \t\t\t\t\t\t= $this->input->post();\n\t\t\t$this->id \t\t\t\t\t= $post['id'];\n\t\t\t$this->employee_code\t\t= $post['employee_code'];\n\t\t\t$this->employee_entry_date\t= $post['employee_entry_date'];\n\t\t\t$this->leave_period \t\t= $post['leave_period'];\n\t\t\t$this->effective_date \t\t= $post['effective_date'];\n\t\t\t$this->valid_until \t\t\t= $post['valid_until'];\n\t\t\t$this->total \t\t\t\t= $post['total'];\n\t\t\t// $this->leave_taken \t\t\t= $post['leave_taken'];\n\t\t\t// $this->mass_leave \t\t\t= $post['mass_leave'];\n\t\t\t// $this->remaining_days_off \t= $post['remaining_days_off'];\n\n\t\t\t$this->db->update('ms_leave_rights', $this, array('id'=>$post['id']));\n\t\t}", "public function testUpdateInviteWithCreatedUser()\n {\n\n $response = $this->loginAs($this->createUser([ 'email' => 'invited.user@mailinator.com' ]))\n ->put($this->url('invites/1'), [\n 'message' => 'Okay, do not come anymore'\n ]);\n\n $response->assertStatus(200);\n }", "public function updateResponsible(array $data) {\n\t\t// priprava dat\n\t\t$defaults = array(\n\t\t\t\t\"resp_type\" => Deadline_Form_Deadline::RESP_GUARD,\n\t\t\t\t\"responsible_id\" => 0\n\t\t\t\t);\n\t\t\n\t\t$data = array_merge($defaults, $data);\n\t\t\n\t\t// vyhodnoceni, jestli je zodpovedna osoba z G7 nebo od klienta\n\t\t$this->responsible_id = null;\n\t\t$this->responsible_user_id = null;\n\t\t$this->responsible_external_name = null;\n\t\t$this->anonymous_employee = 0;\n $this->anonymous_guard = 0;\n\t\t\n\t\tswitch ($data[\"resp_type\"]) {\n\t\t\tcase Deadline_Form_Deadline::RESP_CLIENT:\n\t\t\t\t// kontrola, jestli je zadano id\n\t\t\t\tif ($data[\"responsible_id\"])\n\t\t\t\t\t$this->responsible_id = $data[\"responsible_id\"];\n\t\t\t\telse\n\t\t\t\t\t$this->anonymous_employee = 1;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase Deadline_Form_Deadline::RESP_GUARD:\n if ($data[\"responsible_id\"])\n $this->responsible_user_id = $data[\"responsible_id\"];\n else {\n $this->anonymous_guard = 1;\n }\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t$this->responsible_external_name = $data[\"responsible_external_name\"];\n\t\t}\n\t}", "public function update()\n {\n // run the update SQL script to update alter existing tables and create existing ones\n \n // update existing users to add affiliate id\n \n // return back();\n }", "public function testAdministrator_is_able_to_update_users()\n {\n $user = factory(\\App\\User::class)->create();\n\n $existing = factory(\\App\\User::class)->create(['name' => 'Holaholo']);\n\n $this->actingAs($user)\n ->visit('/users/'.$existing->id.'/edit')\n ->see($existing->name)\n ->type('Foo bar', 'name')\n ->press('Submit')\n ->seeInDatabase('users', ['id' => $existing->id, 'name' => 'Foo bar'])\n ->see('Data has been updated successfully');\n }", "public function updateTimestamps()\n {\n\n $this->setDateModified(new DateTime(date('Y-m-d H:i:s')));\n\n if ($this->getDateCreated() == null) {\n $this->setDateCreated(new DateTime(date('Y-m-d H:i:s')));\n }\n }", "public function setAddedBy($addedBy) {\n if ($addedBy instanceof UserApi) {\n $addedBy = $addedBy->getId();\n }\n\n $this->addedBy = NULL;\n $this->addedBy_id = $addedBy;\n $this->toSave['addedBy.id'] = $addedBy;\n }", "public function setUpdatedBy()\n {\n if (!isset($this->updated_by) || is_null($this->updated_by)) {\n $this->updated_by = Auth::check() ? Auth::user()->id : 0;\n }\n }" ]
[ "0.5682421", "0.5429461", "0.52758163", "0.52446055", "0.51822895", "0.51617074", "0.5141699", "0.5102746", "0.5062273", "0.5038503", "0.500924", "0.4993985", "0.49864212", "0.49739298", "0.4969714", "0.4968534", "0.4966776", "0.4958874", "0.49544588", "0.49328297", "0.49204642", "0.49052578", "0.48930708", "0.48442262", "0.4841543", "0.48406675", "0.48319498", "0.48195451", "0.48185146", "0.48158395" ]
0.6517807
0
Create stream context and set context options like certificate file
protected function _createContext() { if (is_resource($this->_streamContext)) { return $this; } $this->_streamContext = stream_context_create(); stream_context_set_option($this->_streamContext, 'ssl', 'local_cert', $this->_apnsCertificateFilePath); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stream_context_create (array $options = null, array $params = null) {}", "public static function create_default_context(\n string $purpose,\n ?string $name = None,\n $context = [],\n ?string $capath = None,\n ?string $cafile = None,\n array $caSelfDetails = []\n ) {\n $options = new self($context);\n\n if ($purpose === \\CLIENT_AUTH) {\n $method = \\STREAM_CRYPTO_METHOD_SSLv23_CLIENT\n | \\STREAM_CRYPTO_METHOD_TLS_CLIENT\n | \\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT\n | \\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;\n\n if ((float) \\phpversion() >= 7.4)\n $method |= \\STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT;\n\n $options->ciphers('HIGH:!SSLv2:!SSLv3')\n ->allow_self_signed(true)\n ->disable_compression(true)\n ->capture_peer_cert(true)\n ->verify_peer(true)\n ->set_crypto(\\CLIENT_AUTH, $method);\n } elseif ($purpose === \\SERVER_AUTH) {\n if (!self::$secured) {\n yield self::certificate($name, $capath, $cafile, $caSelfDetails);\n }\n\n $selfSigned = yield await(exist, self::$caPath . self::$hostname . '.local');\n $method = \\STREAM_CRYPTO_METHOD_SSLv23_SERVER\n | \\STREAM_CRYPTO_METHOD_TLS_SERVER\n | \\STREAM_CRYPTO_METHOD_TLSv1_1_SERVER\n | \\STREAM_CRYPTO_METHOD_TLSv1_2_SERVER;\n\n if ((float) \\phpversion() >= 7.4)\n $method |= \\STREAM_CRYPTO_METHOD_TLSv1_3_SERVER;\n\n $options->local_cert(self::$certificate)\n ->local_pk(self::$privatekey)\n ->capath(self::$caPath)\n ->passphrase()\n ->allow_self_signed($selfSigned)\n ->verify_peer(true)\n ->verify_peer_name(!$selfSigned)\n ->SNI_enabled(true)\n ->disable_compression(true)\n ->capture_peer_cert(true)\n ->set_crypto(\\SERVER_AUTH, $method);\n }\n\n return $options;\n }", "private function setSSLContext () {\n $ssl_opts = $this->getSSLContextOptions();\n if(stream_context_set_option($this->conn, $ssl_opts)) {\n debug(8, \"stream SSL context options set\");\n } else {\n throw new RODSException('Cannot set stream SSL context options');\n };\n }", "function stream_context_get_options ($stream_or_context) {}", "public function __construct($options = null)\n {\n if (!\\is_resource($options) && \\is_array($options))\n $options = \\stream_context_create($options);\n elseif ($options instanceof OptionsInterface)\n $options = $options();\n elseif (!\\is_resource($options))\n $options = \\stream_context_create();\n\n if (\\is_resource($options) && \\get_resource_type($options) === 'stream-context')\n $this->options = $options;\n }", "private function initialize() {\n $this->options->merge(\\stream_context_get_options($this->context));\n $this->options->attach('set',function($sender,$e) {\n \\stream_context_set_option(\n $this->context,\n $this->wrapper,\n $e->offset,\n $e->value\n );\n });\n \n $this->data->merge(\\stream_context_get_params($this->context));\n $this->data->attach('set',function($sender,$e) {\n \\stream_context_set_params(\n $this->context, \n $this->data->toArray()\n );\n });\n }", "function stream_context_set_default (array $options) {}", "public function __construct() {\n parent::__construct();\n\n // The context options for ctx.\n // Prevents peer verification from occuring, \n // because peer verification was failing.\n $arrContextOptions = array(\n \"ssl\" => array(\n \"verify_peer\" => false,\n \"verify_peer_name\" => false,\n ),\n );\n \n $this->ctx = stream_context_create($arrContextOptions);\n }", "function stream_context_set_option ($stream_or_context, $wrapper, $option, $value) {}", "public function getStreamContext();", "private function getSSLContextOptions () {\n /* context parameters from iRODS ssl network plugin */\n $ssl_opts = array('ssl' => array(\n 'ciphers' => SSL_CIPHER_LIST,\n 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,\n 'single_dh_use' => true,\n ));\n\n if (array_key_exists('ssl', $GLOBALS['PRODS_CONFIG'])) {\n $ssl_conf = $GLOBALS['PRODS_CONFIG']['ssl'];\n debug(10, \"using ssl: has ssl config \", $ssl_conf);\n\n if (array_key_exists('verify_peer', $ssl_conf)) {\n $ssl_opts['ssl']['verify_peer'] = strcasecmp(\"true\", $ssl_conf['verify_peer']) == 0;\n } elseif (array_key_exists('verify_server', $ssl_conf)) {\n // from json environment\n // none -> SSL_VERIFY_NONE; cert or hostname -> SSL_VERIFY_PEER\n $ssl_opts['ssl']['verify_peer'] = strcasecmp(\"none\", $ssl_conf['verify_server']) != 0;\n }\n\n if (array_key_exists('verify_peer_name', $ssl_conf)) {\n $ssl_opts['ssl']['verify_peer_name'] = strcasecmp(\"true\", $ssl_conf['verify_peer_name']) == 0;\n } elseif (array_key_exists('verify_server', $ssl_conf)) {\n // from json environment\n // none -> SSL_VERIFY_NONE; cert or hostname -> SSL_VERIFY_PEER\n $ssl_opts['ssl']['verify_peer_name'] = strcasecmp(\"none\", $ssl_conf['verify_server']) != 0;\n }\n\n if (array_key_exists('allow_self_signed', $ssl_conf)) {\n $ssl_opts['ssl']['allow_self_signed'] = strcasecmp(\"true\", $ssl_conf['allow_self_signed']) == 0;\n }\n\n /* cafile */\n if (array_key_exists('cafile', $ssl_conf)) {\n $ssl_opts['ssl']['cafile'] = $ssl_conf['cafile'];\n } elseif (array_key_exists('ca_certificate_file', $ssl_conf)) {\n // from json environment\n $ssl_opts['ssl']['cafile'] = $ssl_conf['ca_certificate_file'];\n }\n\n /* capath */\n if (array_key_exists('capath', $ssl_conf)) {\n $ssl_opts['ssl']['capath'] = $ssl_conf['capath'];\n } elseif (array_key_exists('ca_certificate_path', $ssl_conf)) {\n // from json environment\n $ssl_opts['ssl']['capath'] = $ssl_conf['ca_certificate_path'];\n\n }\n }\n\n debug(10, \"Created SSL context options \", $ssl_opts);\n return $ssl_opts;\n }", "private function getTlsStreamContextDefaults()\n {\n // They will be set in the getOptionsForUrl() method which receives a URL.\n //\n // \"cafile\" or \"capath\" can be overridden by passing in those options to\n // constructor.\n $options = array(\n 'ssl' => array(\n 'ciphers' => implode(':', self::$ciphers),\n 'verify_peer' => true,\n 'verify_depth' => 7,\n 'SNI_enabled' => true,\n ),\n );\n\n if (is_dir($this->cafile)) {\n $options['ssl']['capath'] = $this->cafile;\n } else {\n $options['ssl']['cafile'] = $this->cafile;\n }\n\n // Disable TLS compression to prevent CRIME attacks where supported.\n if (version_compare(PHP_VERSION, '5.4.13') >= 0) {\n $options['ssl']['disable_compression'] = true;\n }\n\n return $options;\n }", "public function setStreamContext($stream_context);", "function stream_context_set_params ($stream_or_context, array $params) {}", "function libxml_set_streams_context($context) {}", "protected function getDefaultStreamContext()\n {\n $streamContext = new StreamContext();\n $streamContext->addOption('http.ignore_errors', true);\n\n if (null !== $this->proxyName && null !== $this->file->getUrl()) {\n $streamContext->addOption('http.proxy', $this->proxyName);\n }\n\n return $streamContext;\n }", "private function __construct(array $options)\n {\n $this->certificatePath = $options['certificate_path'] ;\n $this->certificateSecret = $options['certificate_secret'];\n $this->appBundleId = $options['app_bundle_id'];\n }", "public function setContextFile($fileName) {}", "public static function createStreamContext(StreamInterface $stream)\n {\n return stream_context_create([\n 'guzzle' => ['stream' => $stream],\n ]);\n }", "protected function buildStreamContextOptions(Customweb_Core_Http_Request $request){\n\t\t$options = array(\n\t\t\t'http' => array(),\n\t\t\t'ssl' => array()\n\t\t);\n\n\t\tif ($request->isSecureConnection()) {\n\t\t\t$options['ssl']['verify_host'] = true;\n\t\t\t$options['ssl']['allow_self_signed'] = false;\n\t\t\t$options['ssl']['verify_peer'] = false;\n\n\t\t\tif ($this->isCertificateAuthorityCheckEnabled()) {\n\t\t\t\t$options['ssl']['verify_peer'] = true;\n\t\t\t\t$options['ssl']['cafile'] = $this->getCertificateAuthorityFilePath();\n\t\t\t}\n\t\t\tif ($this->getClientCertificate() !== null) {\n\t\t\t\t$options['ssl']['local_cert'] = $this->getClientCertificateLocalFilePath();\n\t\t\t\t$passphrase = $this->getClientCertificatePassphrase();\n\t\t\t\tif (!empty($passphrase)) {\n\t\t\t\t\t$options['ssl']['passphrase'] = $passphrase;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$ipVersion = $this->getForcedInternetProtocolAddressVersion();\n\t\tif ($ipVersion !== null) {\n\t\t\tif ($ipVersion == self::IP_ADDRESS_VERSION_V4) {\n\t\t\t\t$options['socket'] = array(\n\t\t\t\t\t'bindto' => '0.0.0.0:0'\n\t\t\t\t);\n\t\t\t}\n\t\t\telseif ($ipVersion == self::IP_ADDRESS_VERSION_V6) {\n\t\t\t\t$options['socket'] = array(\n\t\t\t\t\t'bindto' => '[::]:0'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ($this->isProxyActive()) {\n\t\t\t$options['http']['proxy'] = $this->getProxyUrl()->toString();\n\t\t\t$options['http']['request_fulluri'] = true;\n\t\t}\n\n\t\treturn $options;\n\t}", "function libxml_set_streams_context($streams_context)\n{\n}", "public function __construct($disableTls = false, $cafile = null)\n {\n $this->tls = !$disableTls;\n $this->cafile = $cafile;\n\n if ($this->tls) {\n if (empty($this->cafile)) {\n $this->cafile = self::detectSystemCaFile();\n } elseif (!is_readable($this->cafile)) {\n throw new RuntimeException(sprintf(\n 'The configured cafile (%s) was not valid.',\n $this->cafile\n ));\n } elseif (!self::validateCaFile(file_get_contents($this->cafile))) {\n throw new RuntimeException(sprintf(\n 'The configured cafile (%s) could not be read.',\n $this->cafile\n ));\n }\n\n // No system CA file detected. Create one.\n if (empty($this->cafile)) {\n $this->cafile = self::getHomeDirectory().'/cacert.pem';\n\n self::installDefaultCaFile($this->cafile);\n }\n\n $this->options = array_replace_recursive(\n $this->options,\n $this->getTlsStreamContextDefaults()\n );\n }\n }", "function stream_context_get_params ($stream_or_context) {}", "public function setStreamContext(array $options) {\n if (!count($options)) {\n return FALSE;\n }\n $context = stream_context_create($options);\n libxml_set_streams_context($context);\n return TRUE;\n }", "public function getFileableContext();", "function stream_context_get_default (array $options = null) {}", "public function setContext($context)\n {\n if (! is_resource($context) || 'stream-context' != get_resource_type($context)) {\n throw new \\InvalidArgumentException('Context must be a resource of `stream-context` type');\n }\n\n $this->context = $context;\n\n return $this;\n }", "protected function _setSslContext(string $host): void\n {\n foreach ($this->_config as $key => $value) {\n if (!str_starts_with($key, 'ssl_')) {\n continue;\n }\n $contextKey = substr($key, 4);\n if (empty($this->_config['context']['ssl'][$contextKey])) {\n $this->_config['context']['ssl'][$contextKey] = $value;\n }\n unset($this->_config[$key]);\n }\n if (!isset($this->_config['context']['ssl']['SNI_enabled'])) {\n $this->_config['context']['ssl']['SNI_enabled'] = true;\n }\n if (empty($this->_config['context']['ssl']['peer_name'])) {\n $this->_config['context']['ssl']['peer_name'] = $host;\n }\n if (empty($this->_config['context']['ssl']['cafile'])) {\n $this->_config['context']['ssl']['cafile'] = CaBundle::getBundledCaBundlePath();\n }\n if (!empty($this->_config['context']['ssl']['verify_host'])) {\n $this->_config['context']['ssl']['CN_match'] = $host;\n }\n unset($this->_config['context']['ssl']['verify_host']);\n }", "private function getMergedStreamContext($url)\n {\n $options = $this->options;\n\n // Handle system proxy\n if (!empty($_SERVER['HTTP_PROXY']) || !empty($_SERVER['http_proxy'])) {\n // Some systems seem to rely on a lowercased version instead...\n $proxy = parse_url(!empty($_SERVER['http_proxy']) ? $_SERVER['http_proxy'] : $_SERVER['HTTP_PROXY']);\n }\n\n if (!empty($proxy)) {\n $proxyURL = isset($proxy['scheme']) ? $proxy['scheme'].'://' : '';\n $proxyURL .= isset($proxy['host']) ? $proxy['host'] : '';\n\n if (isset($proxy['port'])) {\n $proxyURL .= ':'.$proxy['port'];\n } elseif ('http://' === substr($proxyURL, 0, 7)) {\n $proxyURL .= ':80';\n } elseif ('https://' === substr($proxyURL, 0, 8)) {\n $proxyURL .= ':443';\n }\n\n // http(s):// is not supported in proxy\n $proxyURL = str_replace(array('http://', 'https://'), array('tcp://', 'ssl://'), $proxyURL);\n\n if (0 === strpos($proxyURL, 'ssl:') && !extension_loaded('openssl')) {\n throw new RuntimeException('You must enable the openssl extension to use a proxy over https');\n }\n\n $options['http'] = array(\n 'proxy' => $proxyURL,\n );\n\n // enabled request_fulluri unless it is explicitly disabled\n switch (parse_url($url, PHP_URL_SCHEME)) {\n case 'http': // default request_fulluri to true\n $reqFullUriEnv = getenv('HTTP_PROXY_REQUEST_FULLURI');\n if ($reqFullUriEnv === false || $reqFullUriEnv === '' || (strtolower($reqFullUriEnv) !== 'false' && (bool) $reqFullUriEnv)) {\n $options['http']['request_fulluri'] = true;\n }\n break;\n case 'https': // default request_fulluri to true\n $reqFullUriEnv = getenv('HTTPS_PROXY_REQUEST_FULLURI');\n if ($reqFullUriEnv === false || $reqFullUriEnv === '' || (strtolower($reqFullUriEnv) !== 'false' && (bool) $reqFullUriEnv)) {\n $options['http']['request_fulluri'] = true;\n }\n break;\n }\n\n if (isset($proxy['user'])) {\n $auth = urldecode($proxy['user']);\n if (isset($proxy['pass'])) {\n $auth .= ':'.urldecode($proxy['pass']);\n }\n $auth = base64_encode($auth);\n\n $options['http']['header'] = \"Proxy-Authorization: Basic {$auth}\\r\\n\";\n }\n }\n\n if (isset($options['http']['header'])) {\n $options['http']['header'] .= \"Connection: close\\r\\n\";\n } else {\n $options['http']['header'] = \"Connection: close\\r\\n\";\n }\n if (extension_loaded('zlib')) {\n $options['http']['header'] .= \"Accept-Encoding: gzip\\r\\n\";\n }\n $options['http']['header'] .= \"User-Agent: Puli Installer\\r\\n\";\n $options['http']['protocol_version'] = 1.1;\n\n return stream_context_create($options);\n }", "private function createStreamContext($method, array $headers, array $content = array(), array $files = array())\n {\n if (!empty($files)) {\n throw new HttpAdapterException(sprintf('The \"%s\" does not support files.', __CLASS__));\n }\n\n $contextOptions = array('http' => array('method' => $method));\n\n if (!empty($headers)) {\n $contextOptions['http']['header'] = '';\n\n foreach ($this->fixHeaders($headers) as $header) {\n $contextOptions['http']['header'] .= sprintf(\"%s\\r\\n\", $header);\n }\n }\n\n if ($this->getMaxRedirects() > 0) {\n $contextOptions['http']['follow_location'] = 1;\n $contextOptions['http']['max_redirects'] = $this->getMaxRedirects();\n }\n\n if ($method === 'POST') {\n $contextOptions['http']['content'] = $this->fixContent($content);\n }\n\n return stream_context_create($contextOptions);\n }" ]
[ "0.71480095", "0.6689009", "0.6592172", "0.6507048", "0.6415508", "0.63939095", "0.6367796", "0.63641566", "0.6324356", "0.6194057", "0.6153138", "0.6110914", "0.60739523", "0.59864104", "0.59592015", "0.5950216", "0.57579464", "0.56772184", "0.56723773", "0.55849797", "0.556154", "0.55017626", "0.54811573", "0.5457145", "0.5442955", "0.5438819", "0.54172206", "0.54157007", "0.53853786", "0.53095096" ]
0.7193522
0
Renders bylines on a post. Checks post metadata for either contributors or authors. Prioritises contributors. Optionally can link the rendered bylines. Reverts to Novara Reporters if nothing found.
function render_bylines($post_id, $is_linked = false) { $contributors_posts_array = get_contributors_array($post_id); $author = get_post_meta($post_id, '_cmb_author', true); $twitter = get_post_meta($post_id, '_cmb_author_twitter', true); $twitter_url = false; if ($twitter &&(!is_array($twitter) || count($twitter) === 1)) { // if twitter is set and it either isn't an array (old support) or it only has 1 value then we can display it if (is_array($twitter)) { $twitter_url = $twitter[0]; } else { $twitter_url = $twitter; } } if ($contributors_posts_array) { $number_of_contributors = count($contributors_posts_array); foreach($contributors_posts_array as $index => $contributor) { if ($number_of_contributors > 1) { if ($number_of_contributors === $index + 1) { echo ' & '; } else if ($index !== 0) { echo ', '; } } echo $is_linked ? '<a href="' . get_the_permalink($contributor->ID) . '">' . $contributor->post_title . '</a>' : $contributor->post_title; } } else if (!empty($author)) { if ($twitter_url && $is_linked) { echo '<a href="https://twitter.com/' . $twitter_url . '" target="_blank" rel="nofollow">' . $author . '</a>'; } else { echo $author; } } else { echo 'Novara Reporters'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tuu_authors_posts_links($between = null, $betweenLast = null, $before = null, $after = null, $echo = true) {\n if ( function_exists( 'coauthors' ) ) {\n coauthors_posts_links($between, $betweenLast, $before, $after, $echo);\n } else {\n the_author_posts_link();\n }\n}", "function get_meta_author() {\n global $post,$coauthors_plus;\n \n/* First pref - ACF custom field. First check if it exists*/ \n if ( function_exists('get_field') ) {\n /*Has an ACF relationship been set?*/\n $coop_author = get_field('coop_author');\n if($coop_author){\n echo '<div class=\"d-flex flex-row\">';\n foreach( $coop_author as $post):\n setup_postdata($post); \n get_template_part( 'loop-templates/author', 'byline-small' );\n endforeach;\n wp_reset_postdata();\n echo '</div>';\n }\n /* No ACF? Then try co-authors */\n elseif ( function_exists( 'coauthors_posts_links' ) ) {\n $coop_author = get_coauthors($post->ID);\n if($coop_author) {\n echo '<div class=\"d-flex flex-row\">';\n foreach( $coop_author as $coauthor):\n $guess = (str_replace(' ', '-', strtolower($coauthor->display_name))); \n $post = get_page_by_path($guess, OBJECT, 'person');\n $suffix = array('-msp','-mp','cllr-','-am'); \n $guess2 = (str_replace($suffix, '', str_replace(' ', '-', strtolower($coauthor->display_name)))); \n $post2 = get_page_by_path($guess2, OBJECT, 'person');\n if($post){\n setup_postdata($post); \n get_template_part( 'loop-templates/author', 'byline-small' );\n }\n elseif($post2) {\n $post = get_page_by_path($guess2, OBJECT, 'person');\n if($post){\n setup_postdata($post); \n get_template_part( 'loop-templates/author', 'byline-small' );\n } \n }\n else {\n echo '<a href=\"' . get_author_posts_url( $coauthor->ID, $coauthor->user_nicename ) . '\">' . $coauthor->display_name . '</a>';\n echo '<p class=\"small\">' . $coauthor->description . '</p>';\n \n }\n endforeach;\n wp_reset_postdata();\n echo '</div>';\n } \n}\n /* end function */\n}}", "function zakra_posted_by() {\r\n\r\n\t\t$meta_style = get_theme_mod( 'zakra_blog_archive_meta_style', 'tg-meta-style-one' );\r\n\r\n\t\t/* translators: %s: post author. */\r\n\t\t$author_text = ( 'tg-meta-style-one' === $meta_style ) ? esc_html_x( 'By %s', 'post author', 'zakra' ) : '%s';\r\n\r\n\t\t$byline = sprintf(\r\n\t\t\t$author_text,\r\n\t\t\t'<span class=\"author vcard\"><a class=\"url fn n\" href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\">' . esc_html( get_the_author() ) . '</a></span>'\r\n\t\t);\r\n\r\n\r\n\t\techo '<span class=\"byline\"> ' . $byline . '</span>'; // WPCS: XSS OK.\r\n\r\n\t}", "function smash_get_author_post_link( Array $args = array() ) {\n\n\t$author_id = get_the_author_meta( 'ID' );\n\n\t// if the Author has 0 Posts, the $authordata is NULL, so we have to use the queried_object_id() to get the author_id.\n\tif ( $author_id === '' ) {\n\t\t$author_id = get_queried_object_id();\n\t}\n\n\t$author = get_userdata( $author_id );\n\n\tif ( ! $author ) {\n\t\treturn '';\n\t}\n\t$default_args = array(\n\t\t'link' => '<a rel=\"author\" class=\"poa\" href=\"%1$s\" title=\"%2$s\">%3$s</a>',\n\t\t'title' => __( 'Posts by %s', 'smashing' ),\n\t\t'link_text' => smash_get_user_name( $author )\n\t);\n\t$args = wp_parse_args( $args, $default_args );\n\n\t$post_author_url = get_author_posts_url( $author->ID, $author->user_nicename ) . '?rel=author';\n\t$title = sprintf( $args[ 'title' ], $author->display_name );\n\n\treturn sprintf( $args[ 'link' ], $post_author_url, esc_attr( $title ), $args[ 'link_text' ] );\n\n}", "function bbp_author_link($args = array())\n{\n}", "function codeandbeauty_posted_by() {\n\n\t\t// Get the author name; wrap it in a link.\n\t\t$byline = sprintf(\n\t\t\t/* translators: %s: post author */\n\t\t\t__( 'by %s', 'TEXTDOMAIN' ),\n\t\t\t'<span class=\"author vcard\"><a class=\"url fn n\" href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\">' . get_the_author() . '</a></span>'\n\t\t);\n\n\t\techo '<span class=\"byline\"> ' . $byline . '</span>';\n\t}", "function generatePostCardView ($conn, $post, $postAuthor = null) {\n // get author info if not provided by user\n if ($postAuthor === null)\n $postAuthor = getUserInfoById($conn, $post['created_by']);\n\n // if found\n if ($postAuthor !== false) {\n ?>\n <a href=\"post.php?id=<?=$post['id']?>\" style=\"text-decoration: none; color: black;\">\n <div class=\"card\">\n <!-- Post thumbnail -->\n <div class=\"p-2\">\n <img src=\"<?=getAssetsPath()?>post/thumbnail/<?=$post[\"thumbnail\"]?>\" class=\"card-img-top\" style=\"height: 250px\" alt=\"...\">\n </div>\n\n <!-- Post Author Details -->\n <div class=\"card-body\">\n <h5 class=\"card-title mb-3\" style=\"color: #505050\"><?=$post['title']?></h5>\n <p class=\"card-text\" style=\"color: #444444\">\n <a href=\"user.php?id=<?=$postAuthor['id']?>\">\n <img class=\"mh-100 mw-100 img-circle\" style=\"height: 20px; width: 20px\" src=\"<?=getAssetsPath()?>profile/<?=$postAuthor['profile_image']?>\" alt=\"User Image\">\n <span class=\"username\" style=\"color:grey\"><?=$postAuthor['fullname']?></span>\n </a>\n </p>\n </div>\n\n <!-- Post Creation Date -->\n <div class=\"card-footer\">\n <small class=\"text-muted\">Posted on <?=date('F jS, Y', strtotime($post['created_at']))?></small>\n </div>\n </div>\n </a>\n <?php\n }\n}", "function smarty_function_mtentryauthorlink($args, &$ctx) {\n $entry = $ctx->stash('entry');\n if (!$entry) return '';\n\n $type = $args['type'];\n $displayname = encode_html( $entry->author()->nickname );\n if (isset($args['show_email']))\n $show_email = $args['show_email'];\n else\n $show_email = 0;\n if (isset($args['show_url']))\n $show_url = $args['show_url'];\n else\n $show_url = 1;\n\n require_once(\"MTUtil.php\");\n # Open the link in a new window if requested (with new_window=\"1\").\n $target = $args['new_window'] ? ' target=\"_blank\"' : '';\n if (!$type) {\n if ($show_url && $entry->author()->url && ($displayname != '')) {\n $type = 'url';\n } elseif ($show_email && $entry->author()->email && ($displayname != '')) {\n $type = 'email';\n }\n }\n if ($type == 'url') {\n if ($entry->author()->url && ($displayname != '')) {\n $hcard = $args[show_hcard] ? ' class=\"fn url\"' : '';\n return sprintf('<a%s href=\"%s\"%s>%s</a>', $hcard, encode_html( $entry->author()->url ), $target, $displayname);\n }\n } elseif ($type == 'email') {\n if ($entry->author()->email && ($displayname != '')) {\n $str = \"mailto:\" . encode_html( $entry->author()->email );\n if ($args['spam_protect'])\n $str = spam_protect($str);\n $hcard = $args[show_hcard] ? ' class=\"fn email\"' : '';\n return sprintf('<a%s href=\"%s\">%s</a>', $hcard, $str, $displayname);\n }\n } elseif ($type == 'archive') {\n require_once(\"function.mtarchivelink.php\");\n $link = smarty_function_mtarchivelink(array('type' => 'Author'), $ctx);\n if ($link) {\n return sprintf('<a href=\"%s\"%s>%s</a>', $link, $target, $displayname);\n }\n }\n return $displayname;\n}", "function aquila_posted_by() {\n\t$byline = sprintf(\n\t\tesc_html_x( ' by %s', 'post author', 'aquila' ),\n\t\t'<span class=\"author vcard\"><a href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\">' . esc_html( get_the_author() ) . '</a></span>'\n\t);\n\n\techo '<span class=\"byline text-secondary\">' . $byline . '</span>';\n}", "function post_author_link($class, $after, $linkToProfile) {\n\tglobal $post;\n\t$temps = $post;\n\t$people = wp_get_object_terms( $post->ID, 'people' );\n\tforeach($people as $author) :\n\t\t$name = $author->name;\n\t if ($author) {\n\t \tif($linkToProfile) {\n\t\t\t\t$post = get_post_by_title($name);\n\t\t\t\t$person_link = get_permalink();\n\t\t \t} else { // link to archive page\n\t\t \t$person_link = get_term_link( $name, 'people' );\n\t\t \t}\n\t\t\techo \"<a href='$person_link' class='$class' title='$name'>$name</a>$after\";\n\t\t}\n\tendforeach;\n\t$post = $temps;\n}", "function authors( $author )\r\n{ ?>\r\n\t<title>Author : @<?php echo( $author ); ?> - <?php showOption( 'name' ); ?></title><?php\r\n\t$posts = $GLOBALS['JBLDB'] -> select( 'posts', '*', array( 'state' => 'published', 'ilk' => 'article', 'author' => $author ), array( 'created', 'DESC') );\r\n\tif ( !isset( $post['error'] ) ) {\r\n\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/archive.php' );\r\n\t} else {\r\n\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/404.php' );\r\n\t}\r\n}", "function childtheme_override_postmeta_authorlink() {\n\t \n\t global $authordata;\n\t\n\t $authorlink .= '<span class=\"author vcard\">'. '<a class=\"url fn n\" href=\"';\n\t $authorlink .= get_author_posts_url($authordata->ID, $authordata->user_nicename);\n\t $authorlink .= '\" title=\"' . __('View all posts by ', 'thematic') . get_the_author_meta( 'display_name' ) . '\">';\n\t $authorlink .= get_the_author_meta( 'display_name' );\n\t $authorlink .= '</a></span>';\n\t \n\t return apply_filters('childtheme_override_postmeta_authorlink', $authorlink);\n\t}", "function genese_posted_by() {\n\t\t$byline = sprintf(\n\t\t\t/* translators: %s: post author. */\n\t\t\tesc_html_x( 'by %s', 'post author', 'genese' ),\n\t\t\t'<span class=\"author vcard\" itemprop=\"author\" itemscope itemtype=\"http://schema.org/Person\"><a class=\"url fn n\" href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\"><span itemprop=\"name\">' . esc_html( get_the_author() ) . '</span></a></span>'\n\t\t);\n\n\t\techo '<span class=\"byline\"> ' . $byline . '</span>'; // WPCS: XSS OK.\n\n\t}", "function inkpro_author_info_blox() {\r\n\r\n\tif (\r\n\t\tis_single()\r\n\t\t&& get_the_author_meta( 'description' )\r\n\t\t&& ! wolf_get_theme_mod( 'blog_hide_author' )\r\n\t\t&& 'post' == get_post_type() || 'review' == get_post_type()\r\n\t)\r\n\t{\r\n\t\tget_template_part( 'partials/author-bio' );\r\n\t}\r\n}", "function dss_post_author_link($name = false, $classes = false, $echo = true){\n\n\n\n\t// If first arg is an array, then ignore other args and get them from array\n\n\tif( is_array( $name ) ){\n\n\t\t$name = ( !empty($name['name']) ) ? $name['name'] : false;\n\n\t\t$classes = ( !empty($name['classes']) ) ? $name['classes'] : false;\n\n\t\t$echo = ( !empty($name['echo']) ) ? $name['echo'] : false;\n\n\t}\n\n\n\n\t//Get field\n\n\tif( ! is_string( $name ) || empty($name) ){\n\n\t\t$name = 'display_name';\n\n\t}\n\n\n\n\t// Get CSS classes\n\n\tif( ! $class = dss_html_class_attr($classes) ){\n\n\t\t$class = '';\n\n\t}\n\n\n\n\t$link = '<a href=\"'. get_author_posts_url( get_the_author_meta( 'ID' ) ) .'\"'. $class .' itemprop=\"author\">' . get_the_author_meta( $name ) .'</a>';\n\n\tif( $echo ){\n\n\t\techo $link;\n\n\t}\n\n\telse{\n\n\t\treturn $link;\n\n\t}\n\n\n\n}", "function bbp_get_author_link($args = array())\n{\n}", "function bbp_reply_author_link($args = array())\n{\n}", "function btalk_posted_on() {\n\t\tglobal $post;\n\n\n\t\t// If BP active fetch the BP user domain url\n\t\t// else we'll use the WP link to author posts loop.\n\t\tif ( function_exists( 'bp_loaded' ) ) {\n\t\t\t$author_url = bp_core_get_user_domain( $post->post_author );\n\t\t\t// Simple bool var to set all posts link true\n\t\t\t$show_all_posts = true;\n\t\t} else {\n\t\t\t$author_url = get_author_posts_url( get_the_author_meta( 'ID', $post->post_author ) );\n\t\t\t// set false $author url directs to all posts\n\t\t\t$show_all_posts = false;\n\t\t}\n\n\t\t$user_name = get_the_author_meta( 'display_name', $post->post_author );\n\n//var_dump($post);\n\t\t$time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\n\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t$time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time><time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\n\t\t}\n\n\t\t$time_string = sprintf( $time_string,\n\t\t\tesc_attr( get_the_date( 'c' ) ),\n\t\t\tesc_html( get_the_date() ),\n\t\t\tesc_attr( get_the_modified_date( 'c' ) ),\n\t\t\tesc_html( get_the_modified_date() )\n\t\t);\n\n\t\t$posted_on = sprintf(\n\t\t\t/* translators: %s: post date. */\n\t\t\tesc_html_x( 'Posted on %s', 'post date', 'bp-progenitor' ),\n\t\t\t'<a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">' . $time_string . '</a>'\n\t\t);\n\n\t\t$byline = sprintf(\n\t\t\t/* translators: %s: post author. */\n\t\t\tesc_html_x( 'by %s', 'post author', 'bp-progenitor' ),\n\t\t\t'<span class=\"author vcard\"><a class=\"url fn n\" href=\"' . esc_url( $author_url ) . '\">' . esc_html( $user_name ) . '</a></span>'\n\t\t);\n\n\t\t$all_author_posts = sprintf(\n\t\t\t/* translators: %s: post author. */\n\t\t\tesc_html_x( ' - All posts by %s', 'post author', 'bp-progenitor' ),\n\t\t\t'<span class=\"author vcard\"><a class=\"url fn n\" href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID', $post->post_author ) ) ) . '\">' . esc_html( $user_name ) . '</a></span>'\n\t\t);\n\n\t\techo '<span class=\"posted-on\">' . $posted_on . '</span><span class=\"byline\"> ' . $byline . '</span>'; // WPCS: XSS OK.\n\n\t\tif ( $show_all_posts ) {\n\t\t\techo '<span class=\"all-author-posts\">' . $all_author_posts . '</span>';\n\t\t}\n\n\t}", "function pinboard_post_author() {\n\tif( pinboard_get_option( 'author_box' ) && ! is_category( pinboard_get_option( 'portfolio_cat' ) ) && ! in_category( pinboard_get_option( 'portfolio_cat' ) ) ) : ?>\n\t\t<div class=\"entry-author\">\n\t\t\t<?php echo get_avatar( get_the_author_meta( 'user_email' ), 96 ); ?>\n\t\t\t<h3 class=\"author vcard\"><?php _e( 'Written by', 'pinboard' ) ?> <span class=\"fn\"><?php the_author_posts_link(); ?></span></h3>\n\t\t\t<p class=\"author-bio\"><?php the_author_meta( 'description' ); ?></p>\n\t\t\t<div class=\"clear\"></div>\n\t\t</div><!-- .entry-author -->\n\t<?php endif;\n}", "function buddyboss_entry_meta( $show_author = true, $show_date = true, $show_comment_info = true ) {\n\t\t// Translators: used between list items, there is a space after the comma.\n\t\t$categories_list = get_the_category_list( __( ', ', 'boss' ) );\n\n\t\t// Translators: used between list items, there is a space after the comma.\n\t\t$tag_list = get_the_tag_list( '', __( ', ', 'boss' ) );\n\n\t\t$date = sprintf( '<a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\" class=\"post-date fa fa-clock-o\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a>', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() )\n\t\t);\n\n\t\t$author = sprintf( '<span class=\"author vcard\"><a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'boss' ), get_the_author() ) ), get_the_author()\n\t\t);\n\n\t\tif ( function_exists( 'get_avatar' ) ) {\n\t\t\t$avatar = sprintf( '<a href=\"%1$s\" rel=\"bookmark\">%2$s</a>', esc_url( get_permalink() ), get_avatar( get_the_author_meta( 'email' ), 55 )\n\t\t\t);\n\t\t}\n\n\t\tif ( $show_author ) {\n\t\t\techo '<span class=\"post-author\">';\n\t\t\techo $avatar;\n\t\t\techo $author;\n\t\t\techo '</span>';\n\t\t}\n\n\t\tif ( $show_date ) {\n\t\t\techo $date;\n\t\t}\n\n\t\tif ( $show_comment_info ) {\n\t\t\tif ( comments_open() ) :\n\t\t\t\t?>\n\t\t\t\t<!-- reply link -->\n\t\t\t\t<span class=\"comments-link fa fa-comment-o\">\n\t\t\t\t\t<?php comments_popup_link( '<span class=\"leave-reply\">' . __( '0 comments', 'boss' ) . '</span>', __( '1 comment', 'boss' ), __( '% comments', 'boss' ) ); ?>\n\t\t\t\t</span><!-- .comments-link -->\n\t\t\t\t<?php\n\t\t\tendif; // comments_open()\n\t\t}\n\t}", "function my_the_content_filter($content) {\n \n //Get from post_meta table\n $meta = get_post_meta( get_the_ID() );\n if(!empty($meta['contributer'][0])){\n $uid=explode(\",\",$meta['contributer'][0]);\n \n $content.='<div><h3>Contributers</h3></div>';\n $content.='<ul style=\"list-style:none;\">';\n \n foreach($uid as $auth){\n\t $user_data=get_userdata( $auth );\n\t//get_avatar use for get user image from gravatar\n $getu=get_the_author_meta( $user_data->ID );\n $content.='<li><a href=\"'.get_author_posts_url( $user_data->ID ).'\"><span>'.get_avatar($user_data->ID).\"</span><p>\".$user_data->user_nicename.'</p></a></li>';\n }\n $content.='</ul>';\n }\n return $content;\n}", "public function the_metadata( $args = array() ) {\n\t\t$default = array(\n\t\t\t'meta_data' => array(),\n\t\t\t'before' => '',\n\t\t\t'inline' => false,\n\t\t\t'link' => true,\n\t\t\t'date_format' => '',\n\t\t\t'verse_init' => false,\n\t\t);\n\t\t$args = $args + $default;\n\n\t\t$post = $this->post;\n\t\t$args['meta_data'] = ! empty( $args['meta_data'] ) ? $args['meta_data'] : array();\n\t\tob_start();\n\t\t?>\n\n\t\t<<?php echo $args['inline'] ? 'span' : 'div'; ?> class=\"sm-pro-sermon-meta-items\">\n\t\t<?php foreach ( $args['meta_data'] as $item ) { ?>\n\t\t\t<span class=\"sm-pro-sermon-meta-item sm-pro-sermon-meta-item-<?php echo esc_attr( sanitize_title( $item ) ); ?> elementor-post-<?php echo esc_attr( sanitize_title( $item ) ); ?>\">\n\t\t\t\t\t<?php if ( $args['before'] ) : ?>\n\t\t\t\t\t\t<?php echo $args['before']; ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tswitch ( $item ) {\n\t\t\t\t\t\tcase 'date':\n\t\t\t\t\t\t\techo $this->get_the_published_date( array(\n\t\t\t\t\t\t\t\t'date_format' => $args['date_format'],\n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'time':\n\t\t\t\t\t\t\techo $this->get_the_published_time();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'preached_date':\n\t\t\t\t\t\t\techo 'Preached Date: ';\n\t\t\t\t\t\t\techo $this->get_the_preached_date( array(\n\t\t\t\t\t\t\t\t'date_format' => $args['date_format'],\n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'author':\n\t\t\t\t\t\t\techo $this->get_the_author();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'preachers':\n\t\t\t\t\t\t\t$this->the_terms(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'taxonomy' => 'wpfc_preacher',\n\t\t\t\t\t\t\t\t\t'link' => $args['link'],\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'books':\n\t\t\t\t\t\t\t$this->the_terms(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'taxonomy' => 'wpfc_bible_book',\n\t\t\t\t\t\t\t\t\t'link' => $args['link'],\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'series':\n\t\t\t\t\t\t\t$this->the_terms(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'taxonomy' => 'wpfc_sermon_series',\n\t\t\t\t\t\t\t\t\t'link' => $args['link'],\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'service_type':\n\t\t\t\t\t\t\t$this->the_terms(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'taxonomy' => 'wpfc_service_type',\n\t\t\t\t\t\t\t\t\t'link' => $args['link'],\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'comments':\n\t\t\t\t\t\t\techo $this->get_the_comments();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'passage':\n\t\t\t\t\t\t\techo $this->get_the_passage( array(\n\t\t\t\t\t\t\t\t'verse_init' => $args['verse_init'],\n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\techo apply_filters( 'smp/shortcodes/the_metadata_' . $item, '' );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</span>\n\t\t<?php } ?>\n\t\t<<?php echo $args['inline'] ? '/span' : '/div'; ?>>\n\n\t\t<?php\n\t\t$content = ob_get_clean();\n\n\t\t/**\n\t\t * Allows to filter the rendered metadata HTML.\n\t\t *\n\t\t * @since 1.0.0-beta.1\n\t\t *\n\t\t * @param string $content The HTML.\n\t\t * @param \\WP_Post $post The sermon.\n\t\t * @param array $args The settings.\n\t\t */\n\t\techo apply_filters( 'smp/shortcodes/the_metadata', $content, $post, $args );\n\t}", "function elife_article_aff_details_render($subtype, $conf, $args, $context) {\n drupal_add_js(drupal_get_path('module', 'elife_templates') . '/js/elife_article_authors.js');\n $article_version = $context->data;\n $dto = elife_article_version_to_dto($article_version);\n\n $authors_full = [];\n $contributors = $dto->getContributors();\n\n if (!empty($contributors)) {\n $contribs = $dto->getReferenced()->getContribution();\n foreach ($contribs as $key => $value) {\n $split = strpos($value, ': ');\n if (!$split) {\n $split = strpos($value, ', ');\n }\n if ($split) {\n $value = substr($value, $split + 2);\n }\n $contribs[$key] = $value;\n }\n\n $footnotes = [];\n foreach ($dto->getReferenced()->getFootNote() as $fn => $footnote) {\n $footnotes[$footnote->getType()][$fn] = $footnote->getValue();\n }\n\n // Prepare equal_contrib name lists so that we can easily strip a name out.\n $equal_contribs = [];\n foreach ($contributors as $co => $contributor) {\n if ($contributor instanceof Contributor) {\n if ($references = $contributor->getReferences()) {\n if (!empty($references['equal-contrib'])) {\n if ($contributor instanceof BylineContributor) {\n $name = [];\n if ($given_names = $contributor->getGivenNames()) {\n $name['given-names'] = $given_names;\n }\n if ($surname = $contributor->getSurname()) {\n $name['surname'] = $surname;\n }\n if ($suffix = $contributor->getSuffix()) {\n $name['suffix'] = $suffix;\n }\n foreach ($references['equal-contrib'] as $ec) {\n $equal_contribs[$ec][$co] = implode(' ', $name);\n }\n }\n }\n }\n }\n }\n\n foreach ($contributors as $co => $contributor) {\n if ($contributor->getType() != 'author') {\n continue;\n }\n $variables = [];\n $name = [];\n if ($contributor instanceof BylineContributor) {\n $name = $contributor->getNameParts();\n if ($orcid = $contributor->getOrcId()) {\n $orcid_options = array(\n 'external' => TRUE,\n 'attributes' => array(\n 'target' => '_blank',\n ),\n );\n $orcid_image = theme('image', array(\n 'path' => drupal_get_path('module', 'elife_templates') . '/images/orcid.png',\n 'alt' => 'ORCID',\n 'attributes' => array(\n 'class' => 'corresp-icon',\n ),\n ));\n $variables['orcid_image'] = l($orcid_image, $orcid, array_merge(array('html' => TRUE), $orcid_options));\n\n $orcid = l($orcid, $orcid, $orcid_options);\n $variables['orcid'] = $orcid;\n }\n }\n elseif ($contributor instanceof CollabContributor) {\n if ($collab = $contributor->getName()) {\n $name['collab'] = $collab;\n }\n }\n elseif ($contributor instanceof OnBehalfOfContributor) {\n if ($on_behalf_of = $contributor->getName()) {\n $name['on-behalf-of'] = $on_behalf_of;\n }\n }\n\n if (!empty($name)) {\n $author = [];\n foreach ($name as $k => $n) {\n $author[] = '<span class=\"' . $k . '\">' . $n . '</span>';\n }\n $variables['tooltip_name'] = implode(' ', $author);\n if ($contributor instanceof BylineContributor && $role = $contributor->getRole()) {\n $variables['tooltip_name'] .= ', <span class=\"role\">' . $role . '</span>';\n }\n }\n\n $references = $contributor->getReferences();\n if (!empty($references['present-address'])) {\n $present_addresses = $dto->getReferenced()->getPresentAddress();\n $variables['present_addy'] = implode('; ', array_intersect_key($present_addresses, array_flip($references['present-address'])));\n }\n if (!empty($references['contribution'])) {\n $variables['contrib'] = implode('; ', array_intersect_key($contribs, array_flip($references['contribution'])));\n }\n if (!empty($references['foot-note']) && !empty($footnotes['other'])) {\n $variables['other_footnotes'] = array_intersect_key($footnotes['other'], array_flip($references['foot-note']));\n }\n if (!empty($references['contribution'])) {\n $variables['contrib'] = implode('; ', array_intersect_key($contribs, array_flip($references['contribution'])));\n }\n if (!empty($references['foot-note']) && !empty($footnotes['deceased'])) {\n $variables['deceased_footnote'] = implode('; ', array_intersect_key($footnotes['deceased'], array_flip($references['foot-note'])));\n }\n if (!empty($references['competing-interest'])) {\n $competing_interests = $dto->getReferenced()->getCompetingInterest();\n $conflicts = array_intersect_key($competing_interests, array_flip($references['competing-interest']));\n $conflict = [];\n foreach ($conflicts as $conf) {\n if (mb_strpos($conf, 'no competing interests') === FALSE) {\n $conflict[] = $conf;\n }\n }\n if (!empty($conflict)) {\n $variables['conflict'] = _elife_article_xmltohtml(implode(' ', $conflict)); // TODO sort\n }\n }\n if (!empty($references['equal-contrib'])) {\n $ecgs = [];\n foreach ($references['equal-contrib'] as $eq) {\n // Only display the other authors in the equal-contrib list.\n if (isset($equal_contribs[$eq][$co])) {\n $ecg = array_diff_key($equal_contribs[$eq], array_flip([$co]));\n if (!empty($ecg)) {\n $ecgs[] = implode(', ', $ecg);\n }\n }\n }\n $variables['equal_contrib_group'] = implode('; ', array_unique($ecgs));\n }\n\n if ($contributor instanceof Contributor) {\n _elife_article_aff_details_contrib_affiliations($variables, ($co + 1), $contributor, $dto);\n }\n\n if (!empty($references['email'])) {\n $emails = $dto->getReferenced()->getEmail();\n $emails = array_intersect_key($emails, array_flip($references['email']));\n $email = reset($emails);\n $variables['email'] = $email;\n }\n elseif ($contributor instanceof PersonContributor && $contributor->getEmail()) {\n $variables['email'] = $contributor->getEmail();\n }\n\n if (empty($variables['email']) && $contributor instanceof PersonContributor && count($contributor->getAffiliations())) {\n foreach ($contributor->getAffiliations() as $aff) {\n if ($email = $aff->getEmail()) {\n $variables['email'] = $email;\n break;\n }\n }\n }\n\n if (empty($variables['email']) && !empty($variables['affiliation']) &&\n preg_match('/^(?P<before>.*)\\s<a [^>]*class=\\\"email\\\"[^>]*>(?P<email>[^\\<]+)<\\/a>(?P<after>.*)$/', $variables['affiliation'], $matches)) {\n $variables['affiliation'] = $matches['before'] . $matches['after'];\n $variables['email'] = $matches['email'];\n }\n\n $tooltip_content = theme('elife_article_author_tooltip', $variables);\n $authors_full[] = '<li class=\"item-' . $co . '\">' . trim($tooltip_content) . '</li>';\n }\n }\n\n if (!empty($authors_full)) {\n $block = new stdClass();\n $block->title = t('Affiliation details');\n $block->content = '<div class=\"author-list-full ctools-collapsible-content\"><ul>' . implode(\"\\n\", $authors_full) . '</ul></div>';\n return $block;\n }\n}", "function render_link( $args ) {\n\t\t$args['tag'] = 'a';\n\t\t$tooltip_markup = $this->render( $args );\n\n\t\treturn $tooltip_markup;\n\t}", "private function step_reply_authors()\n {\n }", "public function author($params) \n {\n $this->oTemplator->setVar('type', 'author');\n $this->oTemplator->setVar('js', ['post', 'aside']);\n $this->oTemplator->setVar('id', $params['id']);\n $this->show('/blog/post');\n }", "function spartan_get_the_author_posts_link() {\n\tglobal $authordata;\n\tif ( !is_object( $authordata ) )\n\t\treturn false;\n\t$link = sprintf(\n\t\t'<a href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a>',\n\t\tget_author_posts_url( $authordata->ID, $authordata->user_nicename ),\n\t\tesc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ), // No further l10n needed, core will take care of this one\n\t\tget_the_author()\n\t);\n\treturn $link;\n}", "function icopyright_post_passes_filters($post_id = NULL, $post_author_id = NULL) {\r\n\tglobal $post;\r\n\t\r\n if($post_id == NULL) {\r\n $post_id = $post->ID;\r\n }\r\n \r\n if ($post_author_id == NULL) {\r\n \t$post_author_id = $post->post_author;\r\n }\r\n \r\n $user_info = get_userdata($post_author_id);\r\n $post_author = $user_info->display_name;\r\n \r\n // Is there even a configured publication ID? If not, no point in continuing\r\n $pub_id_no = get_option('icopyright_pub_id');\r\n if (empty($pub_id_no) || !is_numeric($pub_id_no)) {\r\n return FALSE;\r\n }\r\n // Has the site admin chosen to hide this particular post? If so then return false\r\n $icopyright_hide_toolbar = get_post_meta($post_id, 'icopyright_hide_toolbar', $single = TRUE);\r\n \r\n if ($icopyright_hide_toolbar == 'yes') {\r\n return FALSE;\r\n }\r\n // If this is a page, check to see if we're supposed to be on pages\r\n if(is_page()) {\r\n if(get_option('icopyright_display_on_pages') != 'yes')\r\n return FALSE;\r\n } else {\r\n // Does the post pass all the category filters? If not, then return false\r\n if(!icopyright_post_passes_category_filter($post_id)) {\r\n return FALSE;\r\n }\r\n \r\n if (!icopyright_post_passes_author_filter($post_author)) {\r\n \treturn FALSE;\r\n }\r\n }\r\n // Is there content within the post that we *know* can't be reused?\r\n if(icopyright_post_contains_known_unlicensable_content(get_post($post_id))) {\r\n return FALSE;\r\n }\r\n // Got this far? Then it passed all the filters\r\n return TRUE;\r\n}", "function theme_meta__relationship($args=NULL){\n if($args===NULL){\n echo 'please enter [\"field\": \" \", \"title\": \" \"]';\n }\n\n $array_of_post_objects = get_field($args[\"field\"]);\n // var_dump($array_of_post_objects);\n if ($array_of_post_objects):\n?>\n <hr class=\"section-break\">\n <h2 class=\"headline headline--medium\"><?php echo $args[\"title\"] ?></h2>\n <ul class=\"link-list min-list\">\n <?php \n foreach($array_of_post_objects as $post_object):\n ?>\n <li><a href=\"<?php echo get_the_permalink($post_object) ?>\"><?php echo get_the_title($post_object) ?></a></li>\n <?php endforeach ?>\n </ul>\n<?php \n endif; \n }", "function all_business_get_post_author($template_type = 'page', $show = true) {\r\n\tif ($template_type == 'page') {\r\n\t\t$out = '<span class=\"cmsmasters_post_user_name\">' . \r\n\t\t\tesc_html__('by', 'all-business') . ' ' . \r\n\t\t\t'<a href=\"' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '\" title=\"' . esc_attr__('Posts by', 'all-business') . ' ' . esc_attr(get_the_author_meta('display_name')) . '\" class=\"vcard author\">' . \r\n\t\t\t\t'<span class=\"fn\" rel=\"author\">' . esc_html(get_the_author_meta('display_name')) . '</span>' . \r\n\t\t\t'</a>' . \r\n\t\t'</span>';\r\n\t} elseif ($template_type == 'post') {\r\n\t\t$cmsmasters_option = all_business_get_global_options();\r\n\t\t$out = '';\r\n\t\t\r\n\t\tif ($cmsmasters_option[CMSMASTERS_SHORTNAME . '_blog_post_author']) {\r\n\t\t\t$out .= '<span class=\"cmsmasters_post_user_name\">' . \r\n\t\t\t\tesc_html__('by', 'all-business') . ' ' . \r\n\t\t\t\t'<a href=\"' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '\" title=\"' . esc_attr__('Posts by', 'all-business') . ' ' . esc_attr(get_the_author_meta('display_name')) . '\" class=\"vcard author\">' . \r\n\t\t\t\t\t'<span class=\"fn\" rel=\"author\">' . esc_html(get_the_author_meta('display_name')) . '</span>' . \r\n\t\t\t\t'</a>' . \r\n\t\t\t'</span>';\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tif ($show) {\r\n\t\techo $out;\r\n\t} else {\r\n\t\treturn $out;\r\n\t}\r\n}" ]
[ "0.5755466", "0.5468563", "0.5427621", "0.53969675", "0.5327851", "0.5321025", "0.5290182", "0.5266982", "0.52433944", "0.52203566", "0.52043074", "0.51918066", "0.51512986", "0.51404554", "0.5139684", "0.51313263", "0.51138514", "0.50972116", "0.5093323", "0.5085162", "0.50713485", "0.50441855", "0.50207883", "0.49966627", "0.49576664", "0.4954167", "0.49414024", "0.49398878", "0.49283716", "0.49201083" ]
0.71767217
0
Renders a banner from template parts according to value from meta field select. Has ability to custom render for template parts that require arguements like email signup
function render_front_page_banner($key) { switch ($key) { case (false || '0'): // if empty or set none break; case (preg_match('/^newsletter-signup-/', $key) ? true : false) : // if key has newsletter signup prefix $newsletter_id = str_replace('newsletter-signup-', '', $key); $newsletter = get_post($newsletter_id); if ($newsletter) { $meta = get_post_meta($newsletter->ID); $mailchimp_key = !empty($meta['_nm_mailchimp_key']) ? $meta['_nm_mailchimp_key'][0] : false; $banner_text = !empty($meta['_nm_banner_text']) ? $meta['_nm_banner_text'][0] : false; if ($mailchimp_key) { get_template_part('partials/email-signup', null, array( 'newsletter' => $mailchimp_key, 'copy' => $banner_text, )); } } break; case 'email-the-cortado': // custom logic for email sign ups with variables depreciated 3.9.0 get_template_part('partials/email-signup', null, array( 'newsletter' => 'The Cortado', 'copy' => 'Sign up to The Cortado—your weekly shot of political analysis from Ash Sarkar, plus a round up of the week’s content. It’s brewed every Friday morning.' )); break; case 'email-the-pick': // depreciated 3.9.0 get_template_part('partials/email-signup', null, array( 'newsletter' => 'The Pick', 'copy' => 'Novara Media’s best articles, every week, straight to your inbox.' )); break; default: // default behavior to render the template part from path provided get_template_part($key); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function render() {\n\t\twoodmart_elementor_banner_carousel_template( $this->get_settings_for_display() );\n\t}", "public function forTemplate() {\n return $this->renderWith('Banner');\n }", "function wpi_postform_banner(){\n\t\techo '<p id=\"banner-enabled\" style=\"padding-bottom:9px\">';\n\t\twpi_postmeta_label('banner',__('Show banner',WPI_META));\n\t\techo '<select name=\"wpi_banner\" id=\"wpi_banner\" size=\"2\" class=\"row-4\" style=\"height:36px\">';\n\t\t$prop = wpi_get_postmeta('banner'); //if (empty($prop))\t$prop = 1;\n\t\twpiAdmin::htmlOption(array('Enabled' => 1,'Disabled' => 0),$prop);?>\t\t\n\t</select></p>\n\t\t\t<p id=\"banner-url\" style=\"clear:both;border-top:1px solid #dfdfdf;padding-top:18px;padding-bottom:9px\">\n\t\t\t\t<?php $ltitle = __('Image URL ',WPI_META);?>\n\t\t\t\t<?php wpi_postmeta_label('banner_url',$ltitle);?>\n\t\t\t\t<?php wpi_postmeta_input('banner_url');?>\t\t\t\n\t\t\t</p>\t\n\t\t\t<p id=\"banner-height\" style=\"clear:both;border-top:1px solid #dfdfdf;padding-top:18px;padding-bottom:9px\">\n\t\t\t\t<?php $ltitle = __('Banner height ',WPI_META);?>\n\t\t\t\t<?php wpi_postmeta_label('banner_height',$ltitle);?>\t\t\t\t\n\t\t\t\t<?php wpi_postmeta_input('banner_height','width:10%','72px');?>\t\n\t\t\t</p>\t\n\t\t\t<p style=\"clear:both;border-top:1px solid #dfdfdf;padding-top:18px;padding-bottom:9px\">\t\t\t\n\t\t\t\t<?php $ltitle = __('Background repeat:',WPI_META);?>\n\t\t\t\t<?php wpi_postmeta_label('banner_repeat',$ltitle);?>\n\t\t\t\t\t<select name=\"wpi_banner_repeat\" id=\"wpi_banner_repeat\" size=\"2\" class=\"row-4\" style=\"height:68px\">\n\t\t\t<?php\t$prop = wpi_get_postmeta('banner_repeat'); \n\t\t\t\t\tif(empty($prop))\t$prop = 'no-repeat';\n\t\t\t\t\twpiAdmin::htmlOption(array('None' => 'no-repeat','Tile' => 'repeat',\n\t\t\t\t\t'Horizontal'=>'repeat-x','Vertical'=>'repeat-y'),$prop);?>\t\t\n\t\t\t\t\t</select>\n\t\t\t</p>\n\t\t\t<p id=\"banner-position\" style=\"clear:both;border-top:1px solid #dfdfdf;padding-top:18px;padding-bottom:9px\">\n\t\t\t\t<?php $ltitle = __('Background position ',WPI_META);?>\n\t\t\t\t<?php wpi_postmeta_label('banner_position',$ltitle);?>\t\t\t\t\n\t\t\t\t<?php wpi_postmeta_input('banner_position','width:10%','left top');?>\t\n\t\t\t</p>\t\t\t\t\t\n\n<?php\t\n}", "function banner() {\n $return = '';\n\n $return .= '<section class=\"content-panel one-column-banner ' . get_sub_field('custom_class') . '\" ';\n\t // height of the banner is variable based on contents and bg image\n\t\t\t\t\t\tif(get_sub_field('banner_background')) { \n\t\t\t\t\t\t\t$return .= 'style=\"background-image: url(' . get_sub_field('banner_background')['url'] . ');padding-top: 15px;';\n\t\t\t\t\t\t\tif(get_sub_field('banner_button_text')) {\n\t\t\t\t\t\t\t\t$return .= 'min-height: 307px;\"';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$return .= '\"';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$return .= 'style=\"min-height: 140px;margin-bottom: -30px;\"';\n\t\t\t\t\t\t}\n\t$return .= '>\n <div class=\"container-fluid\">\n\t\t\t\t\t <div class=\"row\">\n\t\t\t\t\t\t <div class=\"col-xs-12\">';\n\t if(get_sub_field('banner_h1')) { $return .= '<h1>' . get_sub_field('banner_h1') . '</h1>'; }\n\t\t if(get_sub_field('banner_h2')) { \n\t\t\t\t\t\t\t\t $return .= '<h2>' . get_sub_field('banner_h2');\n\t\t\t\t\t\t\t\t if(get_sub_field('banner_h2_image')) { \n\t\t\t\t\t\t\t\t\t if(get_sub_field('banner_h2_image_link')) {\n\t\t\t\t\t\t\t\t\t \t$return .= '<a href=\"' . get_sub_field('banner_h2_image_link') . '\">';\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t $return .= ' <img src=\"' . get_sub_field('banner_h2_image')['url'] . '\" />';\n\t\t\t\t\t\t\t\t\t if(get_sub_field('banner_h2_image_link')) {\n\t\t\t\t\t\t\t\t\t \t$return .= '</a>';\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t $return .= '</h2>'; \n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t if(get_sub_field('banner_text')) { $return .= '<p>' . get_sub_field('banner_text') . '</p>'; }\n\t if(get_sub_field('banner_button_text')) { \n\t\t\t\t\t\t\t\t $return .= '<a class=\"btn universal-btn-red\" href=\"' . get_sub_field('banner_button_link') . '\">' . get_sub_field('banner_button_text') . '</a>';\n\t\t\t\t\t\t\t }\n\n $return .= '</div>\n\t </div>\n\t </div>';\n\t$return .= '</section>'; \n return $return;\n}", "public function content_template() {\n $control_uid = $this->get_control_uid();\n ?>\n <div class=\"elementor-control-field\">\n <label for=\"<?php echo $control_uid; ?>\" class=\"elementor-control-title\">Sample Control</label>\n <div class=\"elementor-control-input-wrapper\">\n <input type=\"text\" id=\"<?php echo $control_uid; ?>\" class=\"elementor-control-text\" />\n </div>\n </div>\n\n <# if ( data.description ) { #>\n <div class=\"elementor-control-field-description\">{{{ data.description }}}</div>\n <# } #>\n <?php\n }", "public function content_template() {\n\t\t$control_uid = $this->get_control_uid();\n\t\t?>\n\t\t<div class=\"elementor-control-field\">\n\t\t\t<label for=\"<?php echo esc_attr( $control_uid ); ?>\" class=\"elementor-control-title\">{{{ data.label }}}</label>\n\t\t\t<div class=\"elementor-control-input-wrapper\">\n\t\t\t\t<a href=\"#\" class=\"scisco-select-file elementor-button elementor-button-success\" style=\"padding: 10px 15px;border:none !important;display: block;text-align: center;\" id=\"select-file-<?php echo esc_attr( $control_uid ); ?>\" ><?php echo esc_html__( \"Choose / Upload File\", 'scisco' ); ?></a> <br />\n\n\t\t\t\t<input type=\"text\" class=\"scisco-selected-fle-url\" id=\"<?php echo esc_attr( $control_uid ); ?>\" data-setting=\"{{ data.name }}\" placeholder=\"{{ data.placeholder }}\">\n\t\t\t</div>\n\t\t</div>\n\t\t<# if ( data.description ) { #>\n\t\t<div class=\"elementor-control-field-description\">{{{ data.description }}}</div>\n\t\t<# } #>\n\t\t<?php\n\t}", "function getMakeyBanner() {\n $title = get_sub_field('title_link_text');\n $URL = get_sub_field('link_url');\n\n $content = '<div class=\"makey-banner ' . get_sub_field('background-color') . '\">';\n $content .= ' <div class=\"container\">';\n $content .= ' <div class=\"picture-holder\">';\n $content .= ' <img alt=\"Maker Robot\" height=\"74\" class=\"lazyload\" src=\"/wp-content/uploads/2015/04/maker-robot.png\" width=\"53\">';\n $content .= ' </div>';\n $content .= ' <a href=\"'.$URL.'\">'.$title.' <i class=\"icon-arrow-right\"></i></a>';\n $content .= ' </div>';\n $content .= '</div>';\n\n return $content; \n }", "function render_benefit()\n{\n\tget_template_part('templates/content', 'benefit');\n}", "function templateText($args = array()){\n global $DOPBSP;\n \n $field = $args['field'];\n $language = isset($args['language']) && $args['language'] != '' ? $args['language']:$DOPBSP->classes->backend_language->get();\n?>\n <li id=\"DOPBSP-form-field-<?php echo $field->id; ?>\" class=\"dopbsp-field-wrapper\">\n<?php\n /*\n * Preview\n */\n $this->displayPreview(array('field' => $field,\n 'language' => $language));\n?>\n <div class=\"dopbsp-settings-wrapper\">\n<?php\n /*\n * Label\n */\n $this->displayTextInput(array('id' => 'label',\n 'label' => $DOPBSP->text('FORMS_FORM_FIELD_LABEL_LABEL'),\n 'value' => $DOPBSP->classes->translation->decodeJSON($field->translation, $language),\n 'form_field_id' => $field->id,\n 'help' => $DOPBSP->text('FORMS_FORM_FIELD_LABEL_HELP')));\n /*\n * Allowed characters.\n */\n $this->displayTextInput(array('id' => 'allowed_characters',\n 'label' => $DOPBSP->text('FORMS_FORM_FIELD_ALLOWED_CHARACTERS_LABEL'),\n 'value' => $field->allowed_characters,\n 'form_field_id' => $field->id,\n 'help' => $DOPBSP->text('FORMS_FORM_FIELD_ALLOWED_CHARACTERS_HELP')));\n /*\n * Size\n */\n $this->displayTextInput(array('id' => 'size',\n 'label' => $DOPBSP->text('FORMS_FORM_FIELD_SIZE_LABEL'),\n 'value' => $field->size < 1 ? '':$field->size,\n 'form_field_id' => $field->id,\n 'help' => $DOPBSP->text('FORMS_FORM_FIELD_SIZE_HELP')));\n /*\n * Is email.\n */\n $this->displaySwitchInput(array('id' => 'is_email',\n 'label' => $DOPBSP->text('FORMS_FORM_FIELD_EMAIL_LABEL'),\n 'value' => $field->is_email,\n 'form_field_id' => $field->id,\n 'help' => $DOPBSP->text('FORMS_FORM_FIELD_EMAIL_HELP')));\n /*\n * Is phone.\n */\n $this->displaySwitchInput(array('id' => 'is_phone',\n 'label' => $DOPBSP->text('FORMS_FORM_FIELD_PHONE_LABEL'),\n 'value' => $field->is_phone,\n 'form_field_id' => $field->id,\n 'help' => $DOPBSP->text('FORMS_FORM_FIELD_PHONE_HELP')));\n /*\n * Required\n */\n $this->displaySwitchInput(array('id' => 'required',\n 'label' => $DOPBSP->text('FORMS_FORM_FIELD_REQUIRED_LABEL'),\n 'value' => $field->required,\n 'form_field_id' => $field->id,\n 'help' => $DOPBSP->text('FORMS_FORM_FIELD_REQUIRED_HELP')));\n /*\n * Add to info.\n */\n $this->displaySwitchInput(array('id' => 'add_to_day_hour_info',\n 'label' => $DOPBSP->text('FORMS_FORM_FIELD_ADD_TO_DAY_HOUR_INFO_LABEL'),\n 'value' => $field->add_to_day_hour_info,\n 'form_field_id' => $field->id,\n 'help' => $DOPBSP->text('FORMS_FORM_FIELD_ADD_TO_DAY_HOUR_INFO_HELP')));\n /*\n * Add to body.\n */\n $this->displaySwitchInput(array('id' => 'add_to_day_hour_body',\n 'label' => $DOPBSP->text('FORMS_FORM_FIELD_ADD_TO_DAY_HOUR_BODY_LABEL'),\n 'value' => $field->add_to_day_hour_body,\n 'form_field_id' => $field->id,\n 'help' => $DOPBSP->text('FORMS_FORM_FIELD_ADD_TO_DAY_HOUR_BODY_HELP'),\n 'dopbsp-last'));\n?>\n </div>\n </li>\n<?php\n }", "function pixel_bazaarinvoice() {\n\t\tglobal $post;\n\t\t$custom = get_post_meta($post->ID,'jht_specs');\n\t\t$jht_specs = $custom[0];\n\t\t$prod = esc_attr($jht_specs['product_id']);\n\t\t$val = get_post_meta( $post->ID, 'lead-type', true );\n\t\tif ( !empty( $prod ) ) { ?>\n\t\t\t<script type=\"text/javascript\"> \n\t\t\t$BV.configure(\"global\", { productId : \"<?php echo $prod; ?>\" });\n\t\t\t</script>\n\t\t<?php }\n\t\tif ( !empty( $val ) ) { ?>\n\t\t\t<script>\n\t\t\t$BV.SI.trackConversion({\n\t\t\t\"type\" : \"lead-<?php echo $val; ?>\",\n\t\t\t\"value\" : \"<?php echo $val; ?>\"\n\t\t\t});\n\t\t\t</script>\n\t\t<?php }\n\t}", "public function render_content() {\n\n\t\tif ( empty( $this->choices ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n\t\t<label>\n\t\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t<?php endif;\nif ( ! empty( $this->description ) ) : ?>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"description customize-control-description\"><?php echo wp_kses_post( $this->description ); ?></span>\n\t\t\t<?php endif;\n$the_value = $this->value();\nif ( is_string( $the_value ) ) {\n\t$the_value = array( $the_value );\n}\n?>\n\n\t\t\t<select <?php $this->link(); ?> multiple=\"multiple\" class=\"g1-customizer-multi-select-control\">\n\t\t\t\t<?php\n\t\t\t\tforeach ( $this->choices as $value => $label ) {\n\t\t\t\t\techo '<option value=\"' . esc_attr( $value ) . '\"' . selected( in_array( $value, $the_value, true ), true, false ) . '>' . esc_html( $label ) . '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</label>\n\t\t<?php\n\t}", "function jws_add_banner() {\n\t// Get page options\n\t$options = get_post_meta( get_the_ID(), '_custom_wc_options', true );\n\n\t// Get image to display size guide\n\t$banner = ( isset( $options['wc-single-banner'] ) && $options['wc-single-banner'] ) ? $options['wc-single-banner'] : cs_get_option( 'wc-single-banner' );\n $banner_link = ( isset( $options['wc-single-banner-link'] ) && $options['wc-single-banner-link'] ) ? $options['wc-single-banner-link'] : cs_get_option( 'wc-single-banner-link' );\n \n\n if($banner) {\n\t\t\techo '<a class=\"jws-banner-single\" href=\"' . esc_url( $banner_link ) . '\"><img src = \"'.esc_url( $banner ).'\">'.'</a>';\n\t\t\n ?>\n <?php }\n\n \n}", "function blockpack_hero_section_render( $atts = [], $content = null ) {\n $atts = shortcode_atts( [\n 'align' => 'full',\n 'title' => __( 'Heading Text...' ),\n 'desc' => __( 'Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...' ),\n 'ctaTextFirst' => __( 'Button First' ),\n 'ctaLinkFirst' => '#',\n 'ctaTextSecond' => __( 'Button Second' ),\n 'ctaLinkSecond' => '#',\n 'image' => [\n 'id' => 0,\n 'url' => ''\n ],\n 'position' => 'image-right'\n ], $atts ); \n\n ob_start();\n ?>\n <div class=\"bg-white pb-8 sm:pb-12 lg:pb-12\">\n <div class=\"pt-8 sm:pt-12 lg:relative lg:py-48\">\n <div class=\"mx-auto max-w-md px-4 sm:max-w-3xl sm:px-6 lg:px-8 lg:max-w-7xl lg:grid lg:grid-cols-2 lg:gap-24\">\n <div>\n <div class=\"mt-20\">\n <div class=\"mt-6 sm:max-w-xl\">\n <h1 class=\"text-4xl font-medium text-gray-900 sm:text-5xl\"><?= $atts[ 'title' ] ?></h1>\n <div class=\"relative mask-layer-mobile mx-auto max-w-md my-10 lg:hidden\">\n <svg class=\"absolute w-1/2 -top-1 -ml-20 lg:m-0 lg:left-0\" width=\"404\" height=\"392\" fill=\"none\" viewBox=\"0 0 404 392\"> <defs> <pattern id=\"837c3e70-6c3a-44e6-8854-cc48c737b659\" x=\"0\" y=\"0\" width=\"20\" height=\"20\" patternUnits=\"userSpaceOnUse\"> <rect x=\"0\" y=\"0\" width=\"4\" height=\"4\" class=\"text-gray-200\" fill=\"currentColor\"></rect> </pattern> </defs> <rect width=\"404\" height=\"392\" fill=\"url(#837c3e70-6c3a-44e6-8854-cc48c737b659)\"></rect> </svg>\n <div class=\"absolute top-0 image-mask w-full h-full transform -rotate-6 -ml-4 bg-secondary-600 __mask-decor\"></div>\n <div class=\"image-mask w-full h-full __mask-image\" style=\"background-image: url('<?= $atts[ 'image' ][ 'url' ] ?>');\"></div>\n </div>\n <p class=\"mt-6 text-xl text-gray-500\"><?= $atts[ 'desc' ] ?></p>\n </div>\n <div class=\"mt-12 sm:max-w-lg sm:w-full sm:flex\">\n <a href=\"<?= $atts[ 'ctaLinkFirst' ] ?>\" class=\"block rounded-md border border-transparent px-5 py-3 bg-primary-600 text-base font-medium text-white shadow hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:px-10 text-center sm:mb-0 mb-3\"><?= $atts[ 'ctaTextFirst' ] ?></a>\n <a href=\"<?= $atts[ 'ctaLinkSecond' ] ?>\" class=\"block rounded-md border border-transparent px-5 py-3 bg-secondary-600 text-base font-medium text-white shadow hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:px-10 sm:ml-4 text-center\"><?= $atts[ 'ctaTextSecond' ] ?></a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"sm:mx-auto sm:max-w-3xl sm:px-6 hidden lg:block\">\n <div class=\"sm:relative lg:absolute lg:inset-y-0 lg:right-0 lg:w-1/2\"> \n <div class=\"hidden sm:block\">\n <svg class=\"absolute top-8 right-1/2 -mr-3 lg:m-0 lg:left-0\" width=\"404\" height=\"392\" fill=\"none\" viewBox=\"0 0 404 392\"> <defs> <pattern id=\"837c3e70-6c3a-44e6-8854-cc48c737b659\" x=\"0\" y=\"0\" width=\"20\" height=\"20\" patternUnits=\"userSpaceOnUse\"> <rect x=\"0\" y=\"0\" width=\"4\" height=\"4\" class=\"text-gray-200\" fill=\"currentColor\"></rect> </pattern> </defs> <rect width=\"404\" height=\"392\" fill=\"url(#837c3e70-6c3a-44e6-8854-cc48c737b659)\"></rect> </svg>\n </div>\n <div class=\"relative pl-4 -mr-40 sm:mx-auto sm:max-w-3xl sm:px-0 lg:max-w-none lg:h-full lg:pl-12\">\n <div class=\"absolute top-0 image-mask w-full lg:h-full transform -rotate-6 -ml-4 bg-secondary-600\"></div>\n <div class=\"absolute top-0 image-mask w-full lg:h-full\" style=\"background-image: url('<?= $atts[ 'image' ][ 'url' ] ?>');\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <?php \n return ob_get_clean();\n}", "function anthrohack_render_meta_field( $atts , $anthrohack_stored_meta = False) {\r\n\r\n if($anthrohack_stored_meta === False){ //if content is not supplied in the params (ie: is not an existing Card)\r\n global $post; \r\n $anthrohack_stored_meta = get_post_meta( $post->ID );\r\n $card = False;\r\n //set content to value stored in db or fallback to default\r\n }else{\r\n $card = True;\r\n }\r\n\r\n if(!array_key_exists(\"default_content\", $atts))\r\n $atts['default_content'] = \"\";\r\n\r\n //handle optional params\r\n foreach(array(\"description\", \"default_content\", \"class\") as $param){\r\n if(!array_key_exists( $param, $atts ))\r\n $atts[$param] = \"\";\r\n }\r\n\r\n //concat classes for field wrapper\r\n $classes = \"\";\r\n if(array_key_exists( \"type\", $atts ))\r\n $classes .= \" \".$atts[\"type\"];\r\n if(array_key_exists( \"name\", $atts ))\r\n $classes .= \" \".\"field-\".$atts[\"name\"];\r\n if(array_key_exists( \"required\", $atts ))\r\n $classes .= \" \".$atts[\"required\"];\r\n if(array_key_exists( \"class\", $atts ))\r\n $classes .= \" \".$atts[\"class\"];\r\n if(array_key_exists( \"width\", $atts ))\r\n $classes .= \" \".$atts[\"width\"];\r\n\r\n //if this is a card, prefix the \"name\" and \"id\" params with the section title (to prevent js and formconflcits)\r\n if($card)\r\n // var_dump($anthrohack_stored_meta);\r\n $atts['name'] = $anthrohack_stored_meta[\"section_slug\"] . \"_\" . $atts['name'];\r\n\r\n // var_dump($atts);\r\n\r\n if($atts[\"type\"] == \"slider\"){\r\n if(array_key_exists( \"range\", $atts ) && is_array($atts[\"range\"])){ \r\n $data_maxmin = ' data-min=\"'.$atts[\"range\"][0].'\" data-max=\"'.$atts[\"range\"][1].'\"'; \r\n }else{\r\n $data_maxmin = ' ERROR:must specify range for sliders';\r\n }\r\n }else{\r\n $data_maxmin = '';\r\n }\r\n\r\n //open wrapper div\r\n echo '<div class=\"anthrohack_metabox_option '.$classes.'\">';\r\n\r\n $content = anthrohack_check_meta_var($anthrohack_stored_meta, $atts['name'], $atts['default_content']);\r\n\r\n switch ($atts[\"type\"]) {\r\n\r\n case \"text\":\r\n case \"slider\":\r\n case \"date\": \r\n $type = ($atts[\"type\"] == \"date\")? \"date\" : \"text\";?>\r\n\r\n <label for=\"<?php echo $atts['name']; ?>\" class=\"title\"><strong><?php echo $atts['title']; ?></strong></label>\r\n <span class=\"option-description\"><?php echo $atts['description']; ?></span>\r\n <input type=\"<?php echo $type; ?>\" name=\"<?php echo $atts['name']; ?>\" id=\"<?php echo $atts['name']; ?>\" <?php echo $data_maxmin; ?> value=\"<?php echo $content; ?>\" />\r\n\r\n <?php break;\r\n\r\n case \"textarea\": ?>\r\n\r\n <label for=\"<?php echo $atts['name']; ?>\" class=\"title\"><strong><?php echo $atts['title']; ?></strong></label>\r\n <span class=\"option-description\"><?php echo $atts['description']; ?></span>\r\n <textarea class=\"field \" rows=\"3\" style=\"width:100%;\" name=\"<?php echo $atts['name']; ?>\" id=\"<?php echo $atts['name']; ?>\" placeholder=\"Enter <?php echo $atts['name']; ?> here\"><?php echo $content ?></textarea>\r\n\r\n <?php break;\r\n\r\n case \"image\": \r\n $height = ($content != \"\")? \"100\" : \"0\"; ?>\r\n\r\n <label for=\"<?php echo $atts['name']; ?>\" class=\"title\"><strong><?php echo $atts['title']; ?></strong></label>\r\n <span class=\"option-description\"><?php echo $atts['description']; ?></span>\r\n <div style=\"width:100px; height:<?php echo $height; ?>px; background: url(<?php echo $content; ?>) repeat;\" class=\"preview-image\" id=\"<?php echo $atts['name']; ?>_preview\"></div>\r\n <input type=\"hidden\" class=\"hidden-input\" name=\"<?php echo $atts['name']; ?>\" id=\"<?php echo $atts['name']; ?>\" value=\"<?php echo $content; ?>\" >\r\n <input type=\"button\" id=\"<?php echo $atts['name']; ?>_visible\" name=\"Upload\" class=\"upload_image_button button-secondary\" value=\"Attach Image\" /><br>\r\n <input class=\"remove-image button-secondary\" value=\"Remove Image\" />\r\n \r\n <?php break;\r\n\r\n case \"file_attachment\": ?>\r\n\r\n <label for=\"<?php echo $atts['name']; ?>\"><strong><?php echo $atts['title']; ?></strong></label> \r\n <span class=\"option-description\"><?php echo $atts['description']; ?></span>\r\n <input type=\"hidden\" class=\"hidden-input\" name=\"<?php echo $atts['name']; ?>\" id=\"<?php echo $atts['name']; ?>\" value=\"<?php echo $content; ?>\" >\r\n <span id=\"<?php echo $atts['name']; ?>_filename\" class=\"filename\"><?php echo $content; ?></span>\r\n <input type=\"submit\" id=\"<?php echo $atts['name']; ?>_visible\" name=\"Upload\" class=\"upload_image_button button-secondary\" value=\"Attach File\" /><br>\r\n <input class=\"remove-image button-secondary\" value=\"Remove Attachment\" />\r\n \r\n <?php break;\r\n \r\n case \"color_selector\": \r\n global $background_colors; ?>\r\n\r\n <h4 class=\"title\"><?php echo $atts['title']; ?></h4>\r\n <span class=\"option-description\"><?php echo $atts['description']; ?></span>\r\n <div class=\"colors\">\r\n <?php //echo var_dump($content); ?>\r\n <input class=\"anthrohack-color-picker\" type=\"text\" name=\"<?php echo $atts['name']; ?>\" value=\"<?php echo $content; ?>\">\r\n <p class=\"caption\">Click a \"Select a Color\" or choose from the presets below.</p>\r\n <?php foreach ($background_colors as $key => $value) { \r\n $color = ($value == \"\" || $value == \"#fff\")? \"#333\" : \"#fff\"; ?>\r\n <span class=\"color\" style=\"background-color:<?php echo $value; ?>; color:<?php echo $color; ?>;\">\r\n <label class=\"anthrohack-row-title\">\r\n <input type=\"radio\" name=\"color_dummy\" value=\"<?php echo $value; ?>\" <?php if ($content == $value) echo 'checked'; ?> >\r\n \r\n <?php echo $key; ?>\r\n </label>\r\n </span>\r\n <?php } ?>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n <?php break;\r\n \r\n case \"editor\":\r\n if($card) $content = base64_decode($content); ?>\r\n\r\n <h4 class=\"title\"><?php echo $atts['title']; ?></h4>\r\n <span class=\"option-description\"><?php echo $atts['description']; ?></span>\r\n\r\n <?php \r\n $settings = array(\r\n \"media_buttons\" => true,\r\n \"textarea_rows\" => 20,\r\n \"teeny\" => false\r\n );\r\n wp_editor( $content, $atts['name'], $settings ); \r\n \r\n break;\r\n\r\n case \"select\": ?>\r\n\r\n <label for=\"<?php echo $atts['name']; ?>\" class=\"title\"><strong><?php echo $atts['title']; ?></strong></label>\r\n <span class=\"option-description\"><?php echo $atts['description']; ?></span>\r\n <div style=\"width:100px; height:0px; background-repeat: repeat; background-size: initial!important;\" class=\"preview-image\"></div>\r\n <?php if(array_key_exists(\"select_options\",$atts) && is_array($atts[\"select_options\"])){ ?>\r\n\r\n <select name=\"<?php echo $atts['name']; ?>\" id=\"<?php echo $atts['name']; ?>\" >\r\n <?php foreach($atts[\"select_options\"] as $value => $key){\r\n //if \"selected\" field exists and matches current item...\r\n if($content == $key || $content == strtolower($value)){\r\n $selected = \"selected\";\r\n }else{\r\n $selected = \"\";\r\n }\r\n echo '<option value=\"'.$key.'\" '.$selected.'>'.$value.'</option>';\r\n } ?>\r\n </select>\r\n\r\n <?php }else{ ?>\r\n <span>Error: Enter select items in anthrohack_metaboxes.php</span>\r\n <?php }\r\n\r\n break;\r\n\r\n case \"checkbox\": //var_dump($content); \r\n // if( $atts['name'] == \"logo_header\") $content = \"\";\r\n if($content == \"no\" || $content == \"\") $content = \"off\";\r\n if($content == \"on\") $content = \"yes\"; ?>\r\n <label for=\"<?php echo $atts['name']; ?>\" class=\"title\"><strong><?php echo $atts['title']; ?></strong>\r\n <input type=\"checkbox\" class=\"anthrohack_checkbox\" id=\"<?php echo $atts['name']; ?>\" <?php checked( $content, 'yes' ); ?> />\r\n <input type=\"hidden\" id=\"<?php echo $atts['name']; ?>_hidden\" class=\"anthrohack_checkbox-hidden\" name=\"<?php echo $atts['name']; ?>\" value=\"<?php echo $content; ?>\" />\r\n\r\n </label>\r\n <span class=\"option-description\"><?php echo $atts['description']; ?></span>\r\n\r\n\r\n <?php break;\r\n\r\n\r\n }//end switch\r\n echo '</div>'; //close anthrohack_metabox_option div\r\n}", "function page_banner($args = NULL) {\n if (!$args['title']) {\n $args['title'] = get_the_title();\n }\n\n if (!$args['subtitle']) {\n $args['subtitle'] = get_field('page_banner_subtitle');\n }\n\n if (!$args['photo']) {\n if (get_field('page_banner_background_image') && !is_archive()) {\n $args['photo'] = get_field('page_banner_background_image')['sizes']['pageBanner'];\n } else {\n $args['photo'] = get_theme_file_uri('/images/ocean.jpg');\n }\n }\n ?>\n\n <div class=\"page-banner\">\n <div\n class=\"page-banner__bg-image\"\n style=\"background-image: url(<?php echo $args['photo']; ?>\"\n ></div>\n <div class=\"page-banner__content container container--narrow\">\n <h1 class=\"page-banner__title\"><?php echo $args['title']; ?></h1>\n <div class=\"page-banner__intro\">\n <p><?php echo $args['subtitle']; ?></p>\n </div>\n </div>\n </div>\n<?php }", "public function render_control_template_scripts() {\n\t\tparent::render_control_template_scripts();\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-wp-media-widget-yikes-card-fields\">\n\t\t\t<# var elementIdPrefix = 'el' + String( Math.random() ) + '_'; #>\n\t\t\t<p>\n\t\t\t\t<label for=\"{{ elementIdPrefix }}textArea\"><?php esc_html_e( 'Card content:' ); ?></label>\n\t\t\t\t<textarea id=\"{{ elementIdPrefix }}textArea\" class=\"widefat textarea\" rows=\"5\"></textarea>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label for=\"{{ elementIdPrefix }}linkText\"><?php esc_html_e( 'Link Text' ); ?></label>\n\t\t\t\t<input id=\"{{ elementIdPrefix }}linkText\" class=\"widefat linktext\" type=\"text\" />\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label for=\"{{ elementIdPrefix }}linkUrl\"><?php esc_html_e( 'Link URL' ); ?></label>\n\t\t\t\t<input id=\"{{ elementIdPrefix }}linkUrl\" class=\"widefat linkurl\" type=\"text\" />\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label for=\"{{ elementIdPrefix }}badge\"><?php esc_html_e( 'Badge Text (optional)' ); ?></label>\n\t\t\t\t<input for=\"{{ elementIdPrefix }}badge\" class=\"widefat badge\" type=\"text\" />\n\t\t\t</p>\n\n\t\t</script>\n\t\t<?php\n\t}", "public static function render()\n {\n // On récupère les données personnalisées de notre section dans la BDD avec la function get_option\n // https://developer.wordpress.org/reference/functions/get_option/\n // Lisez la description dans la documentation officiel.\n $nbr_recette_home = get_option('recette_home_number');\n // Je compact ma variable pour la rendre accessible dans ma view.\n view('sections/recette-home-number',compact('nbr_recette_home'));\n }", "protected function content_template() {}", "public function render_content() {\n\t\t$selected = '';\n\t\t$selected_variants = $selected_subsets = array();\n\n\t\tif ( isset( $this->settings[0] ) ) {\n\t\t\t$selected = $this->settings[0]->value();\n\t\t\t$selected_variants = $this->choices->$selected->variants;\n\t\t\t$selected_subsets = $this->choices->$selected->subsets;\n\t\t}\n\n\t?>\n\t\t<label>\n\t\t\t<div class=\"customize-control control-vertical-c font-main\">\n\t\t\t\t<span class=\"customize-control-title customize-control-title-top\"><?php echo esc_html__( 'Google Font', 'zeen' ); ?></span>\n\t\t\t\t<?php\n\t\t\t\tif ( isset( $this->description ) && '' !== $this->description ) {\n\t\t\t\t\techo '<span class=\"description customize-control-description\">' . sanitize_text_field( $this->description ) . '</span>';\n\t\t\t\t} ?>\n\t\t\t\t<div class=\"zeen-select-wrap\">\n\t\t\t\t\t <select data-customize-setting-link=\"<?php echo esc_attr( $this->settings[0]->id ); ?>\" class=\"zeen-fonts\" name=\"_customize-zeen-fonts-<?php echo esc_attr( $this->id ); ?>[]\">\n\t\t\t\t\t\t<optgroup label=\"<?php esc_attr_e( 'Recommended Google Fonts', 'zeen' ); ?>\">\n\t\t\t\t\t\t<?php foreach ( $this->recommended() as $key => $value ) { ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\" data-category=\"<?php echo esc_attr( $value->category ); ?>\" data-variants=\"<?php echo esc_attr( implode( ',', $value->variants ) ); ?>\" data-subsets=\"<?php echo esc_attr( implode( ',', $value->subsets ) ); ?>\"><?php echo sanitize_text_field( $key ); ?></option>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t</optgroup>\n\t\t\t\t\t\t<optgroup label=\"<?php esc_attr_e( 'All Google Fonts', 'zeen' ); ?>\">\n\t\t\t\t\t\t<?php foreach ( $this->choices as $key => $value ) { ?>\n\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\" data-category=\"<?php echo esc_attr( $value->category ); ?>\" data-variants=\"<?php echo esc_attr( implode( ',', $value->variants ) ); ?>\" data-subsets=\"<?php echo esc_attr( implode( ',', $value->subsets ) ); ?>\"><?php echo sanitize_text_field( $key ); ?></option>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t</optgroup>>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"customize-control control-vertical-c font-weight\">\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html__( 'Font Weight', 'zeen' ); ?></span>\n\t\t\t\t<div class=\"zeen-select-wrap\">\n\t\t\t\t\t<select data-customize-setting-link=\"<?php echo esc_attr( $this->settings[1]->id ); ?>\" class=\"zeen-font-weight\" data-default-weight=\"<?php echo esc_attr( $this->settings[1]->default ); ?>\" name=\"_customize-zeen-fonts-<?php echo esc_attr( $this->id ); ?>[]\">\n\t\t\t\t\t\t<option value=\"100\" <?php disabled( false, in_array( '100', $selected_variants ) ); ?>>Thin (100)</option>\n\t\t\t\t\t\t<option value=\"100italic\" <?php disabled( false, in_array( '100italic', $selected_variants ) ); ?>>Thin Italic (100)</option>\n\t\t\t\t\t\t<option value=\"200\" <?php disabled( false, in_array( '200', $selected_variants ) ); ?>>Extra-light (200)</option>\n\t\t\t\t\t\t<option value=\"200italic\" <?php disabled( false, in_array( '200italic', $selected_variants ) ); ?>>Extra-light Italic (200)</option>\n\t\t\t\t\t\t<option value=\"300\" <?php disabled( false, in_array( '300', $selected_variants ) ); ?>>Light (300)</option>\n\t\t\t\t\t\t<option value=\"300italic\" <?php disabled( false, in_array( '300italic', $selected_variants ) ); ?>>Light Italic (300)</option>\n\t\t\t\t\t\t<option value=\"regular\" <?php disabled( false, in_array( 'regular', $selected_variants ) ); ?>>Regular (400)</option>\n\t\t\t\t\t\t<option value=\"italic\" <?php disabled( false, in_array( 'italic', $selected_variants ) ); ?>>Regular Italic (400)</option>\n\t\t\t\t\t\t<option value=\"500\" <?php disabled( false, in_array( '500', $selected_variants ) ); ?>>Medium (500)</option>\n\t\t\t\t\t\t<option value=\"500italic\" <?php disabled( false, in_array( '500italic', $selected_variants ) ); ?>>Medium Italic (500)</option>\n\t\t\t\t\t\t<option value=\"600\" <?php disabled( false, in_array( '600', $selected_variants ) ); ?>>Semi-bold (600)</option>\n\t\t\t\t\t\t<option value=\"600italic\" <?php disabled( false, in_array( '600italic', $selected_variants ) ); ?>>Semi-bold Italic (600)</option>\n\t\t\t\t\t\t<option value=\"700\" <?php disabled( false, in_array( '700', $selected_variants ) ); ?>>Bold (700)</option>\n\t\t\t\t\t\t<option value=\"700italic\" <?php disabled( false, in_array( '700italic', $selected_variants ) ); ?>>Bold Italic (700)</option>\n\t\t\t\t\t\t<option value=\"800\" <?php disabled( false, in_array( '800', $selected_variants ) ); ?>>Extra-bold (800)</option>\n\t\t\t\t\t\t<option value=\"800italic\" <?php disabled( false, in_array( '800italic', $selected_variants ) ); ?>>Extra-bold Italic (800)</option>\n\t\t\t\t\t\t<option value=\"900\" <?php disabled( false, in_array( '900', $selected_variants ) ); ?>>Black (900)</option>\n\t\t\t\t\t\t<option value=\"900italic\" <?php disabled( false, in_array( '900italic', $selected_variants ) ); ?>>Black Italic (900)</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"customize-control control-vertical-c font-subsets\">\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html__( 'Character Set', 'zeen' ); ?></span>\n\t\t\t\t<div class=\"zeen-select-wrap zeen-select-wrap-multi\">\n\t\t\t\t\t<select multiple=\"true\" data-customize-setting-link=\"<?php echo esc_attr( $this->settings[2]->id ); ?>\" class=\"zeen-font-subsets\" data-default-subset=\"<?php //esc_attr( $this->settings[2]->default ); ?>\" name=\"_customize-zeen-fonts-<?php echo esc_attr( $this->id ); ?>[]\">\n\t\t\t\t\t\t<option value=\"latin\" <?php disabled( false, in_array( 'latin', $selected_subsets ) ); ?>><?php esc_attr_e( 'Default', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"latin-ext\" <?php disabled( false, in_array( 'latin-ext', $selected_subsets ) ); ?>><?php esc_attr_e( 'Latin Extended', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"greek\" <?php disabled( false, in_array( 'greek', $selected_subsets ) ); ?>><?php esc_attr_e( 'Greek', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"greek-ext\" <?php disabled( false, in_array( 'greek-ext', $selected_subsets ) ); ?>><?php esc_attr_e( 'Greek Extended', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"vietnamese\" <?php disabled( false, in_array( 'vietnamese', $selected_subsets ) ); ?>><?php esc_attr_e( 'Vietnamese', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"cyrillic\" <?php disabled( false, in_array( 'cyrillic', $selected_subsets ) ); ?>><?php esc_attr_e( 'Cyrillic', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"cyrillic-ext\" <?php disabled( false, in_array( 'cyrillic-ext', $selected_subsets ) ); ?>><?php esc_attr_e( 'Cyrillic Extended', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"oriya\" <?php disabled( false, in_array( 'oriya', $selected_subsets ) ); ?>><?php esc_attr_e( 'Oriya', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"bengali\" <?php disabled( false, in_array( 'bengali', $selected_subsets ) ); ?>><?php esc_attr_e( 'Bengali', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"korean\" <?php disabled( false, in_array( 'korean', $selected_subsets ) ); ?>><?php esc_attr_e( 'Korean', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"japanese\" <?php disabled( false, in_array( 'japanese', $selected_subsets ) ); ?>><?php esc_attr_e( 'Japanese', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"chinese-simplified\" <?php disabled( false, in_array( 'chinese-simplified', $selected_subsets ) ); ?>><?php esc_attr_e( 'Chinese Simplified', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"chinese-traditional\" <?php disabled( false, in_array( 'chinese-traditional', $selected_subsets ) ); ?>><?php esc_attr_e( 'Chinese Traditional', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"khmer\" <?php disabled( false, in_array( 'khmer', $selected_subsets ) ); ?>><?php esc_attr_e( 'Khmer', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"myanmar\" <?php disabled( false, in_array( 'myanmar', $selected_subsets ) ); ?>><?php esc_attr_e( 'Myanmar', 'zeen' ); ?></option>\n\t\t\t\t\t\t<option value=\"devanagari\" <?php disabled( false, in_array( 'devanagari', $selected_subsets ) ); ?>><?php esc_attr_e( 'Devanagari', 'zeen' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<input type=\"hidden\" class=\"zeen-font-cat\" name=\"_customize-zeen-fonts-<?php echo esc_attr( $this->id ); ?>[]\" data-customize-setting-link=\"<?php echo esc_attr( $this->settings[3]->id ); ?>\">\n\t\t</label>\n\t<?php\n\t}", "function careerfy_vc_banner_caption()\n{\n $attributes = array(\n \"name\" => esc_html__(\"Banner Caption\", \"careerfy-frame\"),\n \"base\" => \"careerfy_banner_caption\",\n \"category\" => esc_html__(\"Careerfy Theme\", \"careerfy-frame\"),\n \"class\" => \"\",\n \"params\" => array(\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Title \", \"careerfy-frame\"),\n 'param_name' => 'banner_title',\n 'value' => '',\n 'description' => ''\n ),\n array(\n 'type' => 'textarea_html',\n 'heading' => esc_html__(\"Description\", \"careerfy-frame\"),\n 'param_name' => 'banner_desc',\n 'value' => '',\n 'description' => '',\n ),\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Button Heading\", \"careerfy-frame\"),\n 'param_name' => 'btn_heading',\n 'value' => '',\n 'description' => ''\n ),\n array(\n 'type' => 'param_group',\n 'value' => '',\n 'heading' => esc_html__(\"Banner Buttons\", \"careerfy-frame\"),\n 'param_name' => 'banner_btn',\n 'params' => array(\n array(\n 'type' => 'textfield',\n 'value' => '',\n 'heading' => __('Button Text', 'careerfy-frame'),\n 'param_name' => 'btn_txt',\n ),\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Button Link\", \"careerfy-frame\"),\n 'param_name' => 'btn_link',\n 'value' => '',\n 'description' => ''\n ),\n ),\n ),\n )\n );\n\n if (function_exists('vc_map')) {\n vc_map($attributes);\n }\n}", "public function render_content() { \n\n\t\t\t?>\n\t\t\t<label>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<div class=\"description customize-control-description\"><?php echo esc_html( $this->description ); ?></div>\n\t\t <div class=\"switch_options\">\n\t\t \t<?php \n\t\t \t\t$show_choices = $this->choices;\n\n\t\t \t\tforeach ( $show_choices as $key => $value ) {\n\t\t \t\t\techo '<span class=\"switch_part ' . esc_attr($key) . '\" data-switch=\"' . esc_attr($key) . '\">' . esc_html($value) . '</span>';\n\t\t \t\t}\n\t\t \t?>\n \t<input type=\"hidden\" id=\"ap_switch_option\" <?php $this->link(); ?> value=\"<?php echo wp_kses_post($this->value()); ?>\" />\n </div>\n </label>\n\t<?php\n\t\t}", "function ca_banner($content){\n\t\t//executed if only inline banner is wanted\n\t\tif(ctype_space(get_option('ca_inline_banner_code')['text']) || get_option('ca_inline_banner_code')['text'] == '' || !isset(get_option('ca_inline_banner_code')['text'])){\n\t\t\t$warn_html = ca_default_inline_banner();\n\t\t}else{\n\t\t\t$warn_html = get_option('ca_inline_banner_code')['text'];\n\t\t}\n\t\treturn ca_inline_banner_js($warn_html, $content, admin_url( 'admin-ajax.php' ));\n\t}", "function render_field($id, $label ,$fieldName, $fieldType = \"text\", $args = []){\n // Get the location data if it's already been entered\n $key_value = get_post_meta($id, $fieldName, true);\n\n // Output the field\n $output = \"<label style='font-size: 1.3em'>$label</label>\";\n switch ($fieldType) {\n\n case 'number' :\n $output .='<input type=\"number\" name=\"'. $fieldName. '\" value=\"' . $key_value . '\" class=\"form-control\">';\n break;\n\n case 'select' :\n $output .= '<br>';\n $output .= \"<Select name='\" .$fieldName. \"' class='form-control'>\";\n foreach($args as $arg){\n if($key_value == $arg){\n $output .='<option value=\"' . $arg . '\" class=\"form-control\" selected>'. ucfirst($arg) .'</option>';\n }\n $output .='<option value=\"' . $arg . '\" class=\"form-control\">'. ucfirst($arg) .'</option>';\n }\n $output .= \"</Select>\";\n break;\n\n case 'checkbox' :\n\n $output = '<div class=\" form-group form-check\">';\n $output .= '<input style=\"margin: 3px 0 0 -20px;\" id=\"'. $fieldName .'\" name=\"'. $fieldName .'\" class=\"form-check-input\" type=\"checkbox\" ' . ($key_value == 'on' ? 'checked' : '') .'>';\n $output .= \"<label for='\" . $fieldName . \"' class='form-check-label' style='font-size: 1.3em'>$label</label>\";\n $output .= '</div>';\n break;\n\n default:\n $extra_class = '';\n $styles = '';\n if(strpos($fieldName, 'color')){\n $extra_class = 'color-container';\n if(!empty($key_value)){\n $styles = \"background-color:\".$key_value.\"; color: white;\";\n }\n }\n\n $output .= '<input style=\"' . $styles . '\" type=\"text\" name=\"'. $fieldName. '\" value=\"' . $key_value . '\" class=\"form-control ' . $extra_class . '\">';\n break;\n \n }\n \n $output .= '<br>';\n echo $output;\n\n }", "function createBanner()\r\n {\r\n \r\n }", "public function content_template() {\r\n\r\n ?>\r\n <div class=\"typography-wrap\">\r\n\r\n <div class=\"typography-header\">\r\n <# if ( data.label ) { #>\r\n <span class=\"customize-control-title\">{{ data.label }}</span>\r\n <# } #>\r\n\r\n <# if ( data.description ) { #>\r\n <span class=\"description customize-control-description\">{{{ data.description }}}</span>\r\n <# } #>\r\n </div>\r\n\r\n <div class=\"typography-settings\">\r\n\r\n <ul>\r\n <# if ( data.fields.font_family ) { #>\r\n <li class=\"typography-font-family\">\r\n <span class=\"customize-control-title\">{{ data.labels.family }}</span>\r\n <select class=\"font-family select-typo-font-families\"></select>\r\n </li>\r\n <# } #>\r\n\r\n <# if ( data.fields.font_family && data.fields.font_style ) { #>\r\n <li class=\"typography-font-style typography-half\">\r\n <span class=\"customize-control-title\">{{ data.labels.style }}</span>\r\n <select class=\"font-style\"></select>\r\n </li>\r\n <# } #>\r\n\r\n <# if ( data.fields.font_size ) { #>\r\n <li class=\"typography-font-size typography-half right\">\r\n <span class=\"customize-control-title\">{{ data.labels.size }}</span>\r\n <input class=\"unit-value font-size\" placeholder=\"<?php esc_attr_e( 'Default', 'sovenco-plus' ); ?>\" type=\"number\" min=\"1\" />\r\n </li>\r\n <# } #>\r\n\r\n <# if ( data.fields.line_height ) { #>\r\n <li class=\"typography-line-height first typography-half\">\r\n <span class=\"customize-control-title\">{{ data.labels.line_height }}</span>\r\n <input class=\"unit-value line-height\" placeholder=\"<?php esc_attr_e( 'Default', 'sovenco-plus' ); ?>\" type=\"number\" min=\"1\" />\r\n </li>\r\n <# } #>\r\n\r\n <# if ( data.fields.letter_spacing ) { #>\r\n <li class=\"typography-letter-spacing typography-half right\">\r\n <span class=\"customize-control-title\">{{ data.labels.letter_spacing }}</span>\r\n <input class=\"unit-value letter-spacing\" placeholder=\"<?php esc_attr_e( 'Default', 'sovenco-plus' ); ?>\" type=\"number\" />\r\n </li>\r\n <# } #>\r\n\r\n <# if ( data.fields.text_decoration ) { #>\r\n <li class=\"typography-text-decoration clr\">\r\n <span class=\"customize-control-title\">{{ data.labels.text_decoration }}</span>\r\n <select class=\"text-decoration\">\r\n <option value=\"\"><?php esc_attr_e( 'Default', 'sovenco-plus' ); ?></option>\r\n <option value=\"none\"><?php esc_attr_e( 'None', 'sovenco-plus' ); ?></option>\r\n <option value=\"overline\"><?php esc_attr_e( 'Overline', 'sovenco-plus' ); ?></option>\r\n <option value=\"underline\"><?php esc_attr_e( 'Underline', 'sovenco-plus' ); ?></option>\r\n <option value=\"line-through\"><?php esc_attr_e( 'Line through', 'sovenco-plus' ); ?></option>\r\n </select>\r\n </li>\r\n <# } #>\r\n\r\n <# if ( data.fields.text_transform ) { #>\r\n <li class=\"typography-text-transform clr\">\r\n <span class=\"customize-control-title\">{{ data.labels.text_transform }}</span>\r\n <select class=\"text-transform\" >\r\n <option value=\"\"><?php esc_attr_e( 'Default', 'sovenco-plus' ); ?></option>\r\n <option value=\"none\"><?php esc_attr_e( 'None', 'sovenco-plus' ); ?></option>\r\n <option value=\"uppercase\"><?php esc_attr_e( 'Uppercase', 'sovenco-plus' ); ?></option>\r\n <option value=\"lowercase\"><?php esc_attr_e( 'Lowercase', 'sovenco-plus' ); ?></option>\r\n <option value=\"capitalize\"><?php esc_attr_e( 'Capitalize', 'sovenco-plus' ); ?></option>\r\n </select>\r\n </li>\r\n <# } #>\r\n\r\n <# if ( data.fields.color ) { #>\r\n <li class=\"typography-text-transform clr\">\r\n <span class=\"customize-control-title\">{{ data.labels.color }}</span>\r\n <input type=\"text\" class=\"text-color\" />\r\n </li>\r\n <# } #>\r\n\r\n </ul>\r\n </div>\r\n </div>\r\n <?php\r\n }", "function add_banner_to_shop_page(){\n get_template_part('partials/partial', 'jumbotron');\n}", "function run($map)\n\t{\n\t\tif (!array_key_exists('param',$map)) $map['param']='';\n\t\tif (!array_key_exists('extra',$map)) $map['extra']='';\n\t\tif (!array_key_exists('title',$map)) $map['title']='I support'; //default value\n\t\t$max=array_key_exists('max',$map)?intval($map['max']):100;\n\t\t$height=(!empty($map['height']))?$map['height']:'100%';//default: 100%\n\n\t\t$set_height = '';\n\t\tif($height!='100%')\n\t\t{\n\t\t\t$set_height = ' style=\"overflow: auto; width: 100%!important; height: '.$height.'!important;\" ';\n\t\t}\n\n\n\t\trequire_code('banners');\n\n\t\t$b_type=$map['param'];\n\t\t$myquery='SELECT * FROM '.get_table_prefix().'banners WHERE ((((the_type<>1) OR ((campaign_remaining>0) AND ((expiry_date IS NULL) or (expiry_date>'.strval(time()).')))) AND '.db_string_not_equal_to('name','').')) AND validated=1 AND '.db_string_equal_to('b_type',$b_type).' ORDER BY name';\n\t\t$banners=$GLOBALS['SITE_DB']->query($myquery,200/*Just in case of ridiculous numbers*/);\n\t\t$assemble=new ocp_tempcode();\n\n\t\tif (count($banners)>$max)\n\t\t{\n\t\t\tshuffle($banners);\n\t\t\t$banners=array_slice($banners,0,$max);\n\t\t}\n\n\t\tforeach ($banners as $i=>$banner)\n\t\t{\n\t\t\t$bd=show_banner($banner['name'],$banner['b_title_text'],get_translated_tempcode($banner['caption']),$banner['img_url'],'',$banner['site_url'],$banner['b_type']);\n\t\t\t$more_coming=($i<count($banners)-1);\n\t\t\t$assemble->attach(do_template('BLOCK_MAIN_BANNER_WAVE_BWRAP_CUSTOM',array('EXTRA'=>$map['extra'],'TYPE'=>$map['param'],'BANNER'=>$bd,'MORE_COMING'=>$more_coming)));\n\t\t}\n\n\t\treturn do_template('BLOCK_MAIN_BUTTONS',array('EXTRA'=>$map['extra'],'TYPE'=>$map['param'],'ASSEMBLE'=>$assemble,'TITLE'=>$map['title'],'SET_HEIGHT'=>$set_height));\n\t}", "function section_template(){ ?>\n\n <!-- (pl-render-item) The render item class is used when you want to create a JS item like a slider, carousel, etc.. (it is picked up and duplicated for rendering) -->\n <!-- (pl-trigger) The trigger class will cause the template_ready event to file on the section whenever the bindings to this element are changed. -->\n <div class=\"pl-render-item pl-trigger\"></div>\n\n <!-- This text will be synced to the value of the option from the option array with key alert_text_key -->\n <div class=\"pl-alert pl-alert-default\" data-bind=\"pltext: alert_text_key\"></div>\n\n <?php \n }", "abstract protected function renderTemplate();", "function kochava_plugin_banner_announcement() {\n\t/* Pull in Front End Template */\n\tinclude (plugin_dir_path( __FILE__ )) . '/templates/front-end-page.php';\n}" ]
[ "0.63348633", "0.62470406", "0.6196876", "0.61658335", "0.5893559", "0.5867198", "0.58337396", "0.5823337", "0.5735318", "0.5734373", "0.5642988", "0.56090325", "0.56054825", "0.56017447", "0.55840176", "0.55721915", "0.55422753", "0.5527506", "0.55238396", "0.5522685", "0.5488112", "0.54715204", "0.54385257", "0.54089165", "0.5406236", "0.5390324", "0.537364", "0.5372386", "0.5367125", "0.53546125" ]
0.6783211
0
Handle the question "updated" event.
public function updated(Question $question) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function updateQuestion() {\n // text, answers, complexity, attributes.\n }", "public function setUpdated()\n {\n if ($this->getQuestion() != null) {\n $this->getQuestion()->setUpdated();\n }\n }", "public function updated(Answer $answer)\n {\n //\n }", "function updateQuestion(){\r\n\t\t$query = \"UPDATE {$this->main->databaseTablePrefix}poll_questions\r\n\t\t\t\t\tSET\r\n\t\t\t\t\t\tquestion = '\".addslashes($_POST[\"question\"]).\"'\r\n\t\t\t\t \tWHERE poll_module_id ={$this->moduleID}\";\r\n\r\n\t\t$recordSet = $this->main->databaseConnection->Execute($query);\r\n\t\t\t\t\t\r\n\t\t//Check for error, if an error occured then report that error\r\n\t\tif (!$recordSet) {\r\n\t\t\ttrigger_error(\"Unable to update poll question\\nreason is : \".$this->main->databaseConnection->ErrorMsg());\r\n\t\t}else{\r\n\t\t\t$this->main->controlVariables[\"pollEditQuestion\"][\"updated\"] = true;\r\n\t\t}\r\n\t}", "function update($question) {\n\t\t//need to load the question index data files from Stratum\n\n\t}", "public function update(Request $request, question $question)\n {\n //\n }", "public function update(Request $request, Question $question) {\n //\n }", "public function on_update() {}", "public function update(Question $question)\n {\n request()->validate([\n \"question\" => \"required|min:10\",\n \"answer\" => \"required_if:publish,on\",\n ]);\n\n $send_notify = false;\n\n $question->question = request('question');\n $question->answer = request('answer');\n $question->publish = (request('publish') != null)? true : false;\n $question->rubric_id = request(\"rubric\");\n\n if((request('publish') != null && $question->owner_notified == 0)) {\n $question->owner_notified = $send_notify = true;\n }\n\n $question->save();\n\n if($send_notify) {\n\t\t\t$this->notifyUser($question);\n }\n\n return redirect(action(\"AdminController@edit\", $question->id))->with(\"status\", \"Изменения сохранены\");\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function updateQuestion($request)\n {\n }", "public function onUpdate($event);", "abstract public function onUpdate();", "public function update(Request $request, Question $question)\n {\n if (isset($_POST['update']))\n {\n $question->text = $request->text;\n \n if ($request->has('danger_response')) $question->danger_response=$request->danger_response;\n \n $question->save();\n\n $equivalents= request()->get('equivalent_id');\n $question->updateEquivalents($equivalents);\n return redirect('/questions');\n } \n }", "function updateQuestion($q){\n $this->wishanswerlist_model->deleteAllAnswersByQuestion($q->id);\n \n foreach($q->answers as $answer){\n $a = new stdClass();\n $a->wensVraagId = $q->id;\n $a->antwoord = $answer;\n $a->verwijderd = 0;\n \n $this->wishanswerlist_model->insertAnswer($a);\n }\n \n $question = new stdClass();\n $question->naam = $q->naam;\n $question->formulierTypeId = $q->formulierTypeId;\n $question->actief = $q->actief;\n $question->order = $q->order;\n $this->db->where('id', $q->id);\n $this->db->update('wensVraag', $question);\n }", "public function handle(EventUpdateEvent $event)\n {\n\n }", "abstract protected function on_update_object();", "public function update(Question $question, Request $request)\r\n {\r\n $question = $this->question->update($question, $request->all());\r\n\r\n if($request->has('answer') && !$question->is_answered) {\r\n \\Mail::to($question->email)->queue(new QuestionAnswered($question));\r\n $this->question->update($question, ['is_answered'=>1]);\r\n }\r\n\r\n return redirect()->route('admin.ask.question.index')\r\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('ask::questions.title.questions')]));\r\n }", "public function updateData(BeforeEntityUpdatedEvent $event)\n {\n $entity = $event->getEntityInstance();\n\n // Verify if the entity is a Question Image\n if ($entity instanceof QuestionImage) {\n $value = $entity->getCorrectAnswerObject()->getValue();\n $entity->setCorrectAnswer($value);\n }\n }", "public function testUpdateAction()\n {\n $res = $this->controller->updateAction(2);\n $this->assertInstanceOf(\"\\Anax\\Response\\Response\", $res);\n\n $body = $res->getBody();\n $exp = \"<h1>Update a question</h1>\";\n $this->assertContains($exp, $body);\n }", "public function handleUpdated($partner){\n }", "protected function _update()\n\t{\n\t}", "public function updateAction(\\JaccoVanDerPost\\Jpfaq\\Domain\\Model\\Question $question)\n {\n $this->questionRepository->update($question);\n $this->addFlashMessage('Your Question was updated.');\n $this->redirect('list');\n }", "public function for_update();" ]
[ "0.7193711", "0.70654875", "0.689793", "0.68471193", "0.6833861", "0.6324047", "0.6226938", "0.6224443", "0.62059265", "0.61791867", "0.61791867", "0.61791867", "0.61791867", "0.61791867", "0.61791867", "0.61791867", "0.6173512", "0.609314", "0.5995821", "0.5970454", "0.5952594", "0.5841257", "0.5822727", "0.57828456", "0.57617104", "0.57613647", "0.57600635", "0.57576823", "0.5743162", "0.5728129" ]
0.7811646
0
Handle the question "deleted" event.
public function deleted(Question $question) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onDelete($event);", "public function on_delete() {}", "public function afterDelete($event)\n {\n $this->emit(\"delete\");\n }", "protected function _afterDelete()\r\n\t{}", "protected function afterDelete()\n {\n }", "public function forceDeleted(Question $question)\n {\n //\n }", "protected function onPostDelete()\n\t{\n\t\t$event = $this->table->getEvent();\n\t\tif ($this->string()->length($event) > 0){\n\t\t\t$event = 'OnPost'.$this->string()->ucwords($event).'Delete';\n\t\t\t$this->fire($event,[$this->id]);\n\t\t}\n\t}", "public function onDelete()\n {\n }", "protected function _postDelete()\n\t{\n\t}", "public function delete(){\n $record = question::find($this->selectedId);\n $record->delete($validatequestion);\n\n session()->flash('message', 'question modifié avec succès');\n $this->emit('Type');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function afterDelete()\n {\n }", "protected function onDelete(): Delete\r\n {\r\n }", "public function deleteQuestion(Question $question)\n {\n\n }", "abstract public static function deleted($callback);", "abstract public static function deleted($callback);", "public function onPostDelete(StorageEvent $event)\n {\n $id = $event->getId();\n // $contenttype = $event->getContentType();\n $record = $event->getContent();\n }", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t}", "protected function _beforeDelete()\r\n\t{}", "public function afterDelete(): void\n {\n }", "public function deleted(Answer $answer)\n {\n if(!empty($answer->attachment_path)) Storage::delete('public/files/'.$answer->attachment_path);;\n }", "public function postDelete($event)\n\t{\n\t\tparent::postDelete($event);\n\t\tif(!$this instanceof dmPage && $this->getDmModule() && $this->getDmModule()->getOption('has_security', false))\n\t\t{\n\t\t\t$this->getService('record_security_manager')->manage('delete', $this);\n\t\t}\n\t\t$this->notify('delete');\n\t}", "public function delete()\n\t{\n\t\tif (! Model_User::check_user_has_write_access())\n\t\t\tthrow new Kohana_Exception('Model_Question::delete(): Could not get current user');\n\n\t\t// The question marked anonymous (user_id = 0) instead of marked deleted.\n\t\t$this->mark_post_anonymous();\n\n\t\t$this->handle_reputation(Model_Reputation::QUESTION_ADD, true);\n\t}", "public function deleted(AskedQuestion $askedQuestion)\n {\n $askedQuestion->answers()->delete();\n }", "public function onPreDelete(StorageEvent $event)\n {\n $id = $event->getId();\n // $contenttype = $event->getContentType(); // You don't get this value at the moment on delete events\n $record = $event->getContent();\n }", "public function callback_beforedelete1()\n {\n }", "public function preDelete($event) {\n\t\tself::fireCategoryDeleted($this);\n\t}", "protected function beforeDelete()\n {\n }", "public static function course_deleted(\\core\\event\\calendar_event_deleted $event) {\n //echo \"<pre>\";print_r($event);exit;\n\n \n }", "protected function onAfterDelete()\n\t{\n\t\t$event = $this->table->getEvent();\n\t\tif ($this->string()->length($event) > 0){\n\t\t\t$event = 'OnAfter'.$this->string()->ucwords($event).'Delete';\n\t\t\t$this->fire($event,[$this->id]);\n\t\t}\n\t}", "public static function deleted($callback)\n {\n }" ]
[ "0.7146802", "0.70947933", "0.69883865", "0.6942093", "0.6905838", "0.6843886", "0.6827451", "0.6806368", "0.67989135", "0.67912686", "0.6712693", "0.6688467", "0.6665794", "0.659027", "0.659027", "0.6583675", "0.65489084", "0.65276396", "0.64512074", "0.6434504", "0.64292884", "0.6407883", "0.6379194", "0.6374233", "0.63505214", "0.6345211", "0.63171715", "0.6315501", "0.6272944", "0.62424487" ]
0.76553774
0
Handle the question "restored" event.
public function restored(Question $question) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function restored(Answer $answer)\n {\n //\n }", "public function restored(Event $event)\n {\n //\n }", "public function restore(ThreadWasRestored $event)\n {\n if ($event->thread->firstPost ) {\n $event->thread->firstPost->restore();\n event(new PostWasRestored($event->thread->firstPost));\n }\n }", "public function restored(EventMeasure $eventMeasure)\n {\n //\n }", "public function restored(Reaction $reaction)\n {\n //\n }", "public function restored(Prescription $prescription)\n {\n //\n }", "public function restored(Recordable $model): void\n {\n Accountant::record($model, 'restored');\n\n // Once the event terminates, the state is reverted\n static::$restoring = false;\n }", "abstract public function restore();", "private function backToQuestionCmd()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t$ilCtrl->redirect($this->parentGUI, $this->parentCMD);\n\t}", "public function restored(Employee $employee)\n {\n event(new EmployeeUpdated($employee, \"restore\"));\n }", "public function restored(Cart $cart)\n {\n //\n }", "public function restored(Review $entity)\n {\n ReviewRestoredEvent::dispatch($entity);\n }", "public function restored(Retweet $retweet)\n {\n //\n }", "public function restored(Feedback $feedback)\n {\n //\n }", "public function restored(Events $events)\n {\n //\n }", "public function restoring(Recordable $model): void\n {\n // This event triggers others that should be ignored, so we track\n // the original to avoid creating unnecessary Ledger records\n static::$restoring = true;\n }", "function restore();", "public function restored(MessageThread $messageThread)\n {\n //\n }", "public function restored(TradeActivityDetail $tradeActivityDetail)\n {\n //\n }", "public function restored(PurchaseOrder $purchaseOrder)\n {\n //\n }", "function restore($old_question_id,$new_question_id,$info,$restore) {\n global $DB;\n $status = true;\n\n //Get the multianswers array\n $multianswers = $info['#']['MULTIANSWERS']['0']['#']['MULTIANSWER'];\n //Iterate over multianswers\n for($i = 0; $i < sizeof($multianswers); $i++) {\n $mul_info = $multianswers[$i];\n\n //We need this later\n $oldid = backup_todb($mul_info['#']['ID']['0']['#']);\n\n //Now, build the question_multianswer record structure\n $multianswer = new stdClass;\n $multianswer->question = $new_question_id;\n $multianswer->sequence = backup_todb($mul_info['#']['SEQUENCE']['0']['#']);\n \n\n //We have to recode the sequence field (a list of question ids)\n //Extracts question id from sequence\n $sequence_field = \"\";\n $in_first = true;\n //$tok = strtok($multianswer->sequence,\",\");\n $tok = explode(\",\", $multianswer->sequence);\n while (list($key,$value) = each($tok)) {\n if (!empty($value)) {\n //Get the answer from reader_backup_ids\n $question = backup_getid($restore->backup_unique_code,\"question\",$value);\n if ($question) {\n if ($in_first) {\n $sequence_field .= $question->new_id;\n $in_first = false;\n } else {\n $sequence_field .= \",\".$question->new_id;\n }\n }\n }\n }\n //We have the answers field recoded to its new ids\n $multianswer->sequence = $sequence_field;\n //The structure is equal to the db, so insert the question_multianswer\n\n $newid = $DB->insert_record(\"question_multianswer\", $multianswer);\n\n //Save ids in reader_backup_ids\n if ($newid) {\n backup_putid($restore->backup_unique_code,\"question_multianswer\",\n $oldid, $newid);\n }\n\n //Do some output\n if (($i+1) % 50 == 0) {\n if (!defined('RESTORE_SILENTLY')) {\n echo \".\";\n if (($i+1) % 1000 == 0) {\n echo \"<br />\";\n }\n }\n backup_flush(300);\n }\n }\n\n return $status;\n }", "public function restored($tag)\n {\n parent::restored($tag);\n\n Log::Info(\"Restored tag\", ['tag' => $tag->id]);\n }", "public function restored(Domain $domain)\n {\n //\n }", "public function restored(TrialRequest $trial_request)\n {\n //\n }", "public function restored(Post $post)\n {\n //\n }", "public function restored(Post $post)\n {\n //\n }", "public function restored(Post $post)\n {\n //\n }", "public function restored(Article $article)\n {\n //\n }", "public function restored(Genre $genre)\n {\n //\n }", "public function restored(Onu $onu)\n {\n //\n }" ]
[ "0.6809347", "0.66438156", "0.63976574", "0.6055762", "0.6005499", "0.59462446", "0.5812377", "0.57426155", "0.5739643", "0.57377225", "0.56605166", "0.56376314", "0.56273097", "0.561104", "0.5601115", "0.55779785", "0.5547564", "0.5534997", "0.5493013", "0.54843974", "0.54303515", "0.54301405", "0.5420174", "0.5417053", "0.53910106", "0.53910106", "0.53910106", "0.53507876", "0.5344057", "0.5328591" ]
0.73197854
0
Handle the question "force deleted" event.
public function forceDeleted(Question $question) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _afterDelete()\r\n\t{}", "protected function _beforeDelete()\r\n\t{}", "protected function afterDelete()\n {\n }", "public function on_delete() {}", "protected function beforeDelete()\n {\n }", "protected function _postDelete()\n\t{\n\t}", "public function afterDelete()\n {\n }", "public function deleted(Question $question)\n {\n //\n }", "protected function onDelete(): Delete\r\n {\r\n }", "public function afterDelete() { return true; }", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t}", "public function forceDeleted(Event $event)\n {\n //\n }", "public function before_delete() {\n\t}", "public function onDelete()\n {\n }", "public function beforeDelete(): void\n {\n }", "public function afterDelete(): void\n {\n }", "protected function afterDelete()\n\t{\n\t\treturn true;\n\t}", "public function beforeDelete() {\n }", "protected function onPostDelete()\n\t{\n\t\t$event = $this->table->getEvent();\n\t\tif ($this->string()->length($event) > 0){\n\t\t\t$event = 'OnPost'.$this->string()->ucwords($event).'Delete';\n\t\t\t$this->fire($event,[$this->id]);\n\t\t}\n\t}", "public function onDelete($event);", "public function callback_beforedelete1()\n {\n }", "public function forceDeleted(Reaction $reaction)\n {\n //\n }", "public function beforeDelete() { return true; }", "public function afterDelete($event)\n {\n $this->emit(\"delete\");\n }", "public function forceDeleted(Prescription $prescription)\n {\n //\n }", "protected function onBeforeDelete()\n\t{\n\t\t$event = $this->table->getEvent();\n\t\tif ($this->string()->length($event) > 0){\n\t\t\t$event = 'OnBefore'.$this->string()->ucwords($event).'Delete';\n\t\t\tif ($this->fire($event,[$this->id]) === false){\n\t\t\t\tif (!$this->entity->hasErrors()){\n\t\t\t\t\t$trans = 'db.unitofwork.delete_unknow_error';\n\t\t\t\t\t$this->entity->addError(false,$this->trans($trans));\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "abstract public static function deleted($callback);", "abstract public static function deleted($callback);", "protected function _delete()\n\t{\n\t}", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\t//Comment::model()->deleteAll('post_id='.$this->id);\n\t\tAetiquetas::model()->updateFrequency($this->etiquetas, '');\n\t}" ]
[ "0.73517686", "0.7349866", "0.7215015", "0.71586686", "0.7039872", "0.6996682", "0.69707745", "0.68986756", "0.6898538", "0.6887923", "0.68355095", "0.6820845", "0.67964756", "0.6779395", "0.6777817", "0.6767128", "0.6760551", "0.67431605", "0.67426103", "0.66971725", "0.6671424", "0.6629333", "0.6604479", "0.6571748", "0.6568613", "0.6568394", "0.64616156", "0.64616156", "0.6446461", "0.6440631" ]
0.76610595
0
Initilaize routes fields options.
public function init_route_fields_options() { //Setup Settings Page $settings_page = Rest_Manager_Settings::getInstance( $this->plugin_name ); $route_fields = rest_manager_settings_route_fields(); foreach ( $route_fields as $route_field) { $settings_page->add_field( 'rest_manager_routes', 'routes', $route_field ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restOptions() {\n\t\t$_page = $_option = $this->slug;\n\t\t$_section = $this->slug . '_section';\n\n\t\t$defaults = [];\n\n\t\tif ( false == call_user_func( $this->get_option, $this->slug ) ) {\n\t\t\tcall_user_func( $this->add_option, $this->slug, $defaults );\n\t\t}\n\n\t\t/****************************************\n\t\t * Add Routes Section\n\t\t *****************************************/\n\t\tadd_settings_section(\n\t\t\t'available_' . $_section,\n\t\t\t__( 'Available Custom Post Types', 'custom-rest-routes' ),\n\t\t\t[ $this, 'renderSectionCallback' ],\n\t\t\t$_page\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'add_rest_routes',\n\t\t\t__( 'Add Routes', 'custom-rest-routes' ),\n\t\t\t[ $this, 'renderFieldCallback' ],\n\t\t\t$_page,\n\t\t\t'available_' . $_section\n\t\t);\n\n\t\tregister_setting(\n\t\t\t$_page,\n\t\t\t$_option\n\t\t);\n\n\t\t/****************************************\n\t\t * Test Routes Section\n\t\t * only fired on single installs\n\t\t *****************************************/\n\t\tif ( ! is_multisite() ) {\n\t\t\tadd_settings_section(\n\t\t\t\t'test_' . $_section,\n\t\t\t\t__( 'Test Routes', 'custom-rest-routes' ),\n\t\t\t\t[ $this, 'renderSectionCallback' ],\n\t\t\t\t$_page\n\t\t\t);\n\t\t}\n\n\t\t$this->updateSettings();\n\t}", "function initialize() {\n\t\t\n\t\t// vars\n\t\t$this->name = 'options_page';\n\t\t$this->label = __(\"Options Page\",'acf');\n\t\t$this->category = 'forms';\n \t\n\t}", "protected function init()\n {\n foreach ($this->options as $name => $value) {\n switch ($name) {\n case 'field':\n $this->setFields($value);\n break;\n case 'facet':\n $this->setFacets($value);\n break;\n }\n }\n }", "public function initAttributes()\n {\n $this->formModifier = $this->app->makeWith(Form::class, ['mode' => $this->mode]);\n\n $this->beforeInit($this->formModifier);\n $this->configureFields($this->formModifier);\n $this->afterInit($this->formModifier);\n\n $this->repo->setRules($this->rules);\n $this->repo->setAttributes($this->formModifier->getAllAttributes(), $this->repo->getRules());\n\n $this->data['routes'] = $this->getCurrentRouteNames();\n }", "function form_init_data()\n {\n // Initialize the form fields\n\n $this->set_hidden_element_value('swimmerid', $this->getSwimmerId()) ;\n $this->set_hidden_element_value('_action', $this->getAction()) ;\n\n if (get_option(WPST_OPTION_OPT_IN_OPT_OUT_MODE) == WPST_PARTIAL)\n $this->set_element_value($this->getActionLabel() . ' Type', WPST_PARTIAL) ;\n else\n $this->set_element_value($this->getActionLabel() . ' Type', WPST_FULL) ;\n }", "protected function init()\n {\n parent::init();\n\n foreach ($this->options as $name => $value) {\n switch ($name) {\n case 'exclude':\n $this->getLocalParameters()->addExcludes($value);\n break;\n case 'pivot':\n $this->setPivot(new Pivot($value));\n }\n }\n }", "protected function initOptions()\n {\n $this->clientOptions = array_merge([\n 'sortable' => $this->sortable,\n 'addUrl' => Url::to(['/base/relation/add']),\n 'form' => $this->form,\n 'modelClass' => $this->modelClass,\n 'modelView' => $this->modelView,\n 'itemView' => $this->itemView,\n // Sortable\n 'items' => '.list-item',\n 'placeholder' => 'sortable-placeholder',\n 'axis' => 'y',\n 'forcePlaceholderSize' => true\n ], $this->clientOptions);\n }", "function initialize() {\n\t\t\t$this->getOptions();\n\t\t}", "public static function init() {\n\t\tself::load_routes();\n\t\tself::load_fields();\n\t}", "public function admin_init() {\n\t\t\t\t\t\t\n\t\t\t$name = $this->options['slug'];\n\t\t\t$this->slug = strtolower(THEME_NAME.'_'.$name);\n\t\t\t\n\t\t\tadd_option($this->slug.'_fields', '', '', 'yes');\n\t\t\tupdate_option($this->slug.'_fields', $this->options['options']);\n\t\t}", "function InitOptions() {\n\t\t\t\n\t\t\t$this->_options=array();\n\t\t\t$this->_options['use_rewrite'] = true;\n\t\t\t$this->_options['file_path'] = '';\n\t\t\t$this->_options['file_url'] = '';\n\t\t\t$this->_options['welcome'] = true;\n\t\t\t$this->_options['donated'] = false;\n\t\t\t$this->_options['hide_donors'] = false;\n\t\t\t$this->_options['hide_donated'] = false;\n\t\t\t\n\t\t\t$this->_options['include_home'] = true;\n\t\t\t$this->_options['include_search'] = true;\n\t\t\t$this->_options['include_pages'] = true;\n\t\t\t$this->_options['include_archives'] = true;\n\t\t\t$this->_options['include_categories'] = true;\n\t\t\t$this->_options['include_recentposts'] = true;\n\t\t}", "protected function init() {\n\t\tforeach ( $this->options as $name => $value ) {\n\t\t\tswitch ( $name ) {\n\t\t\t\tcase 'facet':\n\t\t\t\t\t$this->setFacets( $value );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pivot':\n\t\t\t\t\t$this->setPivots( $value );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'exclude':\n\t\t\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\t\t\t$value = array( $value );\n\t\t\t\t\t}\n\t\t\t\t\t$this->setExcludes( $value );\n\t\t\t\t\tunset( $this->options['exclude'] );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function init()\n {\n $defaults = array(\n 'name' => '',\n 'description' => '',\n );\n $this->options = array_merge($defaults, (array) $this->options);\n }", "private function _initEndpointFields() {\n \t// Add fields\n \tadd_settings_field(\n \t\t'endpoint_list', // ID\n \t\t$GLOBALS[LANG]['server_connection'], // Title\n \t\tarray( $this, 'endpointListCallback' ), // Callback\n \t\t$this->settingsPage, // Page\n \t\t$this->settingSectionId // Section\n \t);\n \t\n \tadd_settings_field(\n \t\t'hidden_endpoint_fields',\n \t\t'',\n \t\tarray( $this, 'hiddenEndpointFieldsCallback' ),\n \t\t$this->settingsPage,\n \t\t$this->settingSectionId\n \t);\n \t\n \tadd_settings_field(\n \t\t'hidden_settings',\n \t\t'',\n \t\tarray($this, 'printHiddenSettings'),\n \t\t$this->settingsPage,\n \t\t$this->settingSectionId\n \t);\n }", "public function __construct() {\n\n // All the routers are initialized with these HTTP methods by default\n // Every other method will be ignored\n $this->routes = [\n 'OPTIONS' => [],\n 'GET' => [],\n 'POST' => [],\n 'PUT' => [],\n 'DELETE' => [],\n\n '_ERROR_' => []\n ];\n\n // Default route prefix for this router\n $this->routes_prefix = \"\";\n\n $this->error_handler = null;\n\n // Load overriden settings\n $this->load();\n }", "public function init ()\r\n\t{\r\n\t\t$this->fields = array ( );\r\n\t}", "protected function initOptions()\n {\n if (!isset($this->options['id'])) {\n $this->options['id'] = $this->getId();\n }\n }", "public function init()\n {\n $cfg = $this->getOptions();\n _::services()->contact\n ->setNamespace('\\NetBricks\\Contact\\Service\\Contact')\n ->setAllowed('guest')\n ->setOptions($cfg);\n }", "protected function init(): void\n {\n $id = $this->getOption('id');\n if (null !== $id) {\n if (\\is_array($id)) {\n $this->addIds($id);\n } else {\n $this->addId($id);\n }\n }\n\n $queries = $this->getOption('query');\n if (null !== $queries) {\n if (\\is_array($queries)) {\n $this->addQueries($queries);\n } else {\n $this->addQuery($queries);\n }\n }\n }", "public function __construct()\n {\n $this->config = [\n 'RouteServerRequest' => $_SERVER['REQUEST_URI'],\n 'RouteRequest' => explode('?', $_SERVER['REQUEST_URI'])[0],\n 'RouteQueryString' => empty($_SERVER['QUERY_STRING']) ? '' : $_SERVER['QUERY_STRING'],\n 'RouteAllowedMethods' => ['GET', 'POST', 'PUT', 'DELETE', 'HEAD'],\n ];\n }", "public function init_form_fields()\n {\n //fileds for the modal form from the Zones window\n $this->instance_form_fields = array(\n\n 'title' => array(\n 'title' => __('Title', self::PLUGIN_LANG),\n 'type' => 'text',\n 'description' => __('Title to be display on site', self::PLUGIN_LANG),\n 'default' => __('Shipping by Location ', self::PLUGIN_LANG)\n ),\n\n 'cost' => array(\n 'title' => __('Minimum Cost (2 km)', self::PLUGIN_LANG),\n 'type' => 'number',\n 'description' => __('Minimum Cost of shipping', self::PLUGIN_LANG),\n 'default' => 2\n ),\n\n );\n\n //$this->form_fields - use this with the same array as above for setting fields for separate settings page\n }", "private function __init_config() {\n if (!is_array($this->config[\"staticroutes\"])) {\n $this->config[\"staticroutes\"] = [];\n $this->config[\"staticroutes\"][\"route\"] = [];\n }\n }", "protected function adjustOptionsValues() \n {\n $this->root = config('organizer.root');\n $this->init();\n $this->create();\n }", "public function admin_init() {\n\n\t\t\t$name = $this->options['slug'];\n\t\t\t$this->slug = strtolower(THEME_NAME.'_'.$name);\n\t\t\n\t\t\tadd_option($this->slug, '', '', 'yes');\n\t\t\tadd_option($this->slug.'_fields', '', '', 'yes');\n\t\t\tupdate_option($this->slug.'_fields', $this->options['options']);\n\t\t}", "public function init_form_fields() {\n $this->form_fields = include( 'settings/bbalogistics-rules.php' );\n }", "public function initializeRouter()\r\n {\r\n $this->route = trim($this->app->request->get('route') , '/');\r\n\r\n $this->route = $this->route ? explode('/' , $this->route) : false;\r\n\r\n $this->setScript();\r\n\r\n $this->establishRoutes();\r\n\r\n $this->setRouteKey();\r\n\r\n $this->setRouteController();\r\n\r\n $this->setControllerMethod();\r\n\r\n $this->setControllerArguments();\r\n\r\n }", "public function init() {\r\n $this->_router->route();\r\n }", "public function init_integrated_options() {\n\t\t$this->permalink_sections();\n\t}", "public function init()\r\n\t{\r\n\t\t$this->dbFields = array(\r\n\t\t\t'hash'=>'',\r\n\t\t\t'duration'=>86400,\r\n\t\t\t'cachehome'=>false,\r\n\t\t\t'compressfile'=>true\r\n\t\t);\r\n\t\t\r\n\t\t// Disable default form buttons\r\n\t\t//$this->formButtons = false;\r\n\r\n\t}", "public function __construct() \r\n\t{\r\n\t\tparent::__construct();\r\n\t\t$tabRoute = array();\r\n\t\t\r\n\t\t$this->setRouteTab();\r\n\t}" ]
[ "0.64232737", "0.64063275", "0.63813245", "0.63476104", "0.62776226", "0.62752205", "0.62381923", "0.6181901", "0.61704814", "0.6169944", "0.6158237", "0.6123333", "0.60862964", "0.6080409", "0.60702884", "0.60225534", "0.6012907", "0.5997594", "0.5995663", "0.59927297", "0.59701496", "0.59424937", "0.5894481", "0.5884632", "0.5872346", "0.58213127", "0.5806775", "0.57930845", "0.5773661", "0.5755747" ]
0.8701607
0
Adds the breadcrumbs to the breadcrumbtrail
protected function add_breadcrumbs() { $trail = BreadcrumbTrail::getInstance(); $trail->add( new Breadcrumb( $this->get_url( array(\Chamilo\Core\Reporting\Viewer\Manager::PARAM_BLOCK_ID => 4), array(\Chamilo\Application\Weblcms\Manager::PARAM_TEMPLATE_ID)), Translation::get('LastAccessToToolsBlock'))); $trail->add( new Breadcrumb( $this->get_url(), Translation::get( 'TypeName', null, \Chamilo\Application\Weblcms\Tool\Manager::get_tool_type_namespace($this->tool)))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addBreadcrumb()\n\t{\n\t\tBackend::addPagesBreadcrumb();\n\t}", "private function addBreadcrumb(): void\n {\n $breadcrumb = $this->container->get(BreadCrumbService::class)->get();\n $this->paramViews['breadcrumb'] = $breadcrumb;\n }", "function hook_menu_breadcrumb_alter(&$active_trail, $item) {\n // Always display a link to the current page by duplicating the last link in\n // the active trail. This means that menu_get_active_breadcrumb() will remove\n // the last link (for the current page), but since it is added once more here,\n // it will appear.\n if (!drupal_is_front_page()) {\n $end = end($active_trail);\n if ($item['href'] == $end['href']) {\n $active_trail[] = $end;\n }\n }\n}", "function append_crumb($title, $href){\n // no title or href provided\n if (!$title) return;\n \n // add to end\n $this->breadcrumbs[] = array('title' => $title, 'href' => $href);\n }", "abstract function breadcrumbs();", "protected function breadcrumb() {\n // nothing\n }", "public function get_breadcrumbs()\n {\n $trail = BreadcrumbTrail::getInstance();\n $this->render($this->array_renderer, 'urhere');\n $breadcrumbs = $this->array_renderer->toArray();\n foreach ($breadcrumbs as $crumb)\n {\n $str = Translation::get('MyRepository');\n if (substr($crumb['title'], 0, strlen($str)) == $str)\n continue;\n $trail->add(new Breadcrumb($crumb['url'], substr($crumb['title'], 0, strpos($crumb['title'], '('))));\n }\n return $trail;\n }", "private function agregarBreadCrumb(){\n\n if(is_array($this->opcionesBreadCrumb)){\n if(array_key_exists(\"selector\",$this->opcionesBreadCrumb)){\n $selector = $this->opcionesBreadCrumb['selector'];\n unset($this->opcionesBreadCrumb['selector']);\n }\n $lis=\"\";\n foreach ($this->opcionesBreadCrumb as $campo => $valor) {\n $span = Selector::crear('span',array('data-id'=>\"$valor[enlace]\"),$valor['nombreLink'],5);\n $link = Selector::crear('a',array('href'=>$valor['enlace']),$span,5);\n $lis .= Selector::crear('li',null,$link,4);\n }\n $ol = Selector::crear('ol',array('class'=>$this->cssBreadcrumb),$lis,3);\n $div = Selector::crear('div',array('class'=>'col-lg-12 col-md-12'),$ol,2);\n $bc = Selector::crear('section',array('class'=>'row'),$div);\n return $bc;\n\n return $bc;\n }//fin if\n }", "public static function addBreadcrumb(Breadcrumb $breadcrumb): void\n {\n $self = Hub::getCurrent()->getIntegration(self::class);\n\n if (!$self instanceof self) {\n return;\n }\n\n addBreadcrumb($breadcrumb);\n }", "public function &add(bcn_breadcrumb $object)\n\t{\n\t\t$this->breadcrumbs[] = $object;\n\t\t//Return the just added object\n\t\treturn $this->breadcrumbs[count($this->breadcrumbs) - 1];\n\t}", "function shell_breadcrumb(){\r\n\tif ( current_theme_supports( 'breadcrumb-trail' ) ){\r\n\t\tbreadcrumb_trail( array(\r\n\t\t\t'before' => __( 'You are here:', 'shell' ),\r\n\t\t\t'show_browse' => false,\r\n\t\t\t'after' => shell_edit_link()\r\n\t\t));\r\n\t}\r\n}", "private function _create_breadcrumb()\n {\n $em = EntityManagerSingleton::getInstance();\n $session_service = $this->getServiceLocator()->get('session');\n $breadcrumb_container = $session_service->getContainer('breadcrumb');\n $page_type = $page_id = $url = $title = null;\n $breadcrumb_container['first'] = [];\n\n // Parse title correctly\n if ($this->page->getPageType() == 'home')\n {\n $title = \"<i class='fa fa-home'></i> Home\";\n $page_type = 'home';\n $page_id = null;\n $url = '/';\n\n $breadcrumb_container['whence'] = [];\n }\n elseif ($this->page->getPageType() == 'search')\n {\n $title = \"<i class='fa fa-search'></i> Search Results\";\n $page_type = 'search';\n $page_id = null;\n $url = $_SERVER['REQUEST_URI'];\n\n $breadcrumb_container['whence'] =\n [\n 'title' => \"<i class='fa fa-home'></i> Home\",\n 'url' => '/',\n 'page_type' => 'home'\n ];\n }\n\n // Handle bread crumbs for categories\n elseif ($this->page->getPageType() == 'category')\n {\n // Check if this category has a parent\n $category = $em->getRepository('Library\\Model\\Category\\Category')->findOneByPage($this->page);\n if ($category instanceof Category)\n {\n // Place the parent in the first part of the breadcrumb\n if (!is_null($category->getParentCategory()))\n {\n $breadcrumb_container['whence'] =\n [\n 'title' => $category->getParentCategory()->getPage()->getTitle(),\n 'url' => $category->getParentCategory()->getPage()->getFullUrl(),\n 'page_type' => 'category',\n 'page_id' => $category->getParentCategory()->getPage()->getId()\n ];\n }\n else\n {\n $breadcrumb_container['whence'] =\n [\n 'title' => \"<i class='fa fa-home'></i> Home\",\n 'url' => '/',\n 'page_type' => 'home'\n ];\n }\n\n $page_type = 'category';\n $page_id = $category->getPage()->getId();\n $title = $category->getPage()->getTitle();\n $url = $_SERVER['REQUEST_URI'];\n }\n }\n\n // Handle bread crumbs for products\n elseif ($this->page->getPageType() == 'product')\n {\n $product = $em->getRepository('Library\\Model\\Product\\Product')->findOneByPage($this->page);\n if ($product instanceof Product)\n {\n if ($breadcrumb_container['current']['page_type'] == 'search' || $breadcrumb_container['current']['page_type'] == 'category')\n {\n $breadcrumb_container['whence'] = $breadcrumb_container['current'];\n\n // Place parent category in first position\n if ($breadcrumb_container['whence']['page_type'] == 'category')\n {\n $parent_category = $em->getRepository('Library\\Model\\Category\\Category')\n ->findOneByPage($em->getReference('Library\\Model\\Page\\Page', $breadcrumb_container['whence']['page_id']))->getParentCategory();\n\n if (!is_null($parent_category))\n {\n $breadcrumb_container['first'] =\n [\n 'title' => $parent_category->getPage()->getTitle(),\n 'url' => $parent_category->getPage()->getFullUrl(),\n 'page_type' => 'category',\n 'page_id' => $parent_category->getPage()->getId()\n ];\n }\n }\n }\n elseif ($breadcrumb_container['current']['page_type'] == 'home' || $breadcrumb_container['current']['page_type'] == 'product')\n {\n $breadcrumb_container['whence'] =\n [\n 'title' => \"New Arrivals\",\n 'url' => $em->getReference('Library\\Model\\Category\\Category', 3)->getPage()->getFullUrl(),\n 'page_type' => 'category',\n 'page_id' => $em->getReference('Library\\Model\\Category\\Category', 3)->getPage()->getId(),\n ];\n }\n\n $page_id = $this->page->getId();\n $page_type = 'product';\n $title = $this->page->getTitle();\n $url = $this->page->getFullUrl();\n }\n }\n\n // Add current page\n $breadcrumb_container['current'] = [\n 'title' => $title,\n 'url' => $url,\n 'page_type' => $page_type,\n 'page_id' => $page_id\n ];\n }", "protected function addBreadcrumbs(Translation $translator)\n {\n $trail = BreadcrumbTrail::getInstance();\n $trail->add(\n new Breadcrumb(\n $this->get_url(\n array(self::PARAM_ACTION => $this->get_action()),\n array(self::PARAM_REPORTING_USER_ID)\n ),\n $translator->getTranslation('UserProgressComponent')\n )\n );\n $trail->add(\n new Breadcrumb(\n $this->get_url(),\n $translator->getTranslation(\n 'ReportingComponent',\n array('USER' => $this->getReportingUser()->get_fullname())\n )\n )\n );\n }", "public function add_wc_breadcrumb( $crumbs) {\n\t\tif ( $this->is_compare_page() ) {\n\t\t\t$crumbs[1] = array( $this->get_page_title() );\n\t\t}\n\n\t\treturn $crumbs;\n\t}", "public function addBreadcrumbs($breadcrumb)\n {\n $this->getView()->params['breadcrumbs'] [] = $breadcrumb;\n\n return $this;\n }", "function massdata_template_header_breadcrumb($args){\n\n if ( function_exists( 'breadcrumb_trail' ) ){\n\n breadcrumb_trail(\n array(\n 'show_on_front'=> false,\n 'separator' => '&gt;',\n 'show_browse' => false\n )\n );\n }\n\n}", "function fielding_breadcrumb() {\n\tfielding_menu( 'main_nav', false, 'breadcrumb', new Fielding_Breadcrumb_Walker() );\n}", "function book_review_breadcrumbs( $crumb, $args ) {\n\t// Only modify the breadcrumb if in the 'book_review' post type\n\tif( 'book_review' !== get_post_type() )\n\t\treturn $crumb;\n\n\t// Grab terms\n\t$terms = get_the_terms( get_the_ID(), 'genre' );\n\tif( empty( $terms ) || is_wp_error( $terms ) )\n\t\treturn $crumb;\n\n\t// Only use one term\n\t$term = array_shift( $terms );\n\n $crumb_wrap_open = '<span class=\"breadcrumb-link-wrap\" itemprop=\"itemListElement\" itemscope=\"\" itemtype=\"http://schema.org/ListItem\">';\n $crumb_wrap_close = '</span>';\n\n\t// Build the breadcrumb\n\t$crumb = $crumb_wrap_open . '<a href=\"' . get_post_type_archive_link( 'book_review' ) . '\">Book Reviews</a>' . $crumb_wrap_close . $args['sep'];\n $crumb .= $crumb_wrap_open . '<a href=\"' . get_term_link( $term, 'genre' ) . '\">' . $term->name . '</a>' . $crumb_wrap_close . $args['sep'];\n $crumb .= get_the_title();\n\n\treturn $crumb;\n}", "function bat_booking_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('BAT'), 'admin/bat'),\n l(t('Configuration'), 'admin/bat/config'),\n l(t('BAT Bookings'), 'admin/bat/config/booking'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "private function addBreadcrumb($titulo, $href = null, $icone = null)\n {\n $this->breadcrumb[] = [\n \"titulo\" => $titulo,\n \"href\" => $href,\n \"icone\" => $icone,\n ];\n\n $this->addMergeData('breadcrumb', $this->breadcrumb);\n }", "public function setCrumbs($html){\n\n // First, we fetch the contents of the crumbs page\n $crumb_html = file_get_contents(TEMPLATE_DIRECTORY . \"Crumbs\"\n . DIRECTORY_SEPARATOR . \"index.php\");\n\n // Now we manipulate the crumbs as needed\n $name = $GLOBALS['name'];\n\n /*\n * Variables to locate:\n *\n * CRUMB_HOME_ACTIVE = Is the home link active?\n * CRUMB_CURRENT_HOME = Is the current page the home page?\n * CRUMB_HOME_LINK = The Home link\n * CRUMB_VARS = Loop for crumb vars\n * - CRUMB_PAGE_NAME = Name of the page\n * - CRUMB_PAGE_ACTIVE = Is the page active\n * - CRUMB_PAGE_CURRENT = ^^^^\n * - CRUMB_PAGE_LINK = Link to page\n * - CRUMB_PAGE_VISIBLE = If link needs to be hidden\n */\n\n $args = [\n \"CRUMB_HOME_ACTIVE\" => ($name == \"Default\") ? \"active\" : \"\",\n \"CRUMB_CURRENT_HOME\" => ($name == \"Default\") ? 'aria-current=\"page\"' : \"\",\n \"CRUMB_HOME_LINK\" => ($name == \"Default\") ? \"#\" : \"/\" . BASE_DIR . \"/\"\n ];\n\n if($name != \"Default\"){\n\n $vars = (isset($GLOBALS['vars'][0]) && !empty($GLOBALS['vars'][0])) ? $GLOBALS['vars'][0] : null;\n\n $args[\"CRUMB_VARS\"][] = [\n \"CRUMB_PAGE_NAME\" => ucfirst($name),\n \"CRUMB_PAGE_VISIBLE\" => \"visible\",\n \"CRUMB_PAGE_ACTIVE\" => (is_null($vars)) ? \"active\" : \"\",\n \"CRUMB_PAGE_CURRENT\" => (is_null($vars)) ? \"aria-current=\\\"page\\\"\" : \"\",\n \"CRUMB_PAGE_LINK\" => (is_null($vars)) ? \"#\" : \"/\" . BASE_DIR . \"/\" . $name . \"/\"\n ];\n\n if(!is_null($vars)){\n $args[\"CRUMB_VARS\"][] = [\n \"CRUMB_PAGE_NAME\" => $vars[0],\n \"CRUMB_PAGE_VISIBLE\" => \"visible\",\n \"CRUMB_PAGE_ACTIVE\" => \"active\",\n \"CRUMB_PAGE_CURRENT\" => \"aria-current=\\\"page\\\"\",\n \"CRUMB_PAGE_LINK\" => \"#\"\n ];\n }\n\n } else {\n $args[\"CRUMB_VARS\"][] = [\n \"CRUMB_PAGE_NAME\" => ucfirst($name),\n \"CRUMB_PAGE_VISIBLE\" => \"hidden\"\n ];\n }\n\n $crumb_html = $this->set($args, $crumb_html);\n\n // Then we put into the HTML and return\n return $this->set([\"__BREAD_CRUMBS__\" => $crumb_html], $html);\n\n }", "function tpl_breadcrumbs(){\n global $lang;\n global $conf;\n\n //check if enabled\n if(!$conf['breadcrumbs']) return;\n\n $crumbs = breadcrumbs(); //setup crumb trace\n\n //reverse crumborder in right-to-left mode\n if($lang['direction'] == 'rtl') $crumbs = array_reverse($crumbs,true);\n\n //render crumbs, highlight the last one\n print $lang['breadcrumb'].':';\n $last = count($crumbs);\n $i = 0;\n foreach ($crumbs as $id => $name){\n $i++;\n print ' <span class=\"bcsep\">&raquo;</span> ';\n if ($i == $last) print '<span class=\"curid\">';\n tpl_link(wl($id),$name,'class=\"breadcrumbs\" title=\"'.$id.'\"');\n if ($i == $last) print '</span>';\n }\n}", "public function setBreadCrumb() {\n return '<div class=\"breadcrumb\"><a href =\"\">Document</a><a href =\"\">Document</a><a href =\"\">Document</a></div>';\n }", "protected function breadcrumbForIndex()\n {\n $breadcrumbTree = new ullAdminBreadcrumbTree;\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }", "protected static function getFacadeAccessor() { return 'platform.breadcrumbs'; }", "public function testBreadcrumbShouldAdd() : void\n {\n $linkItem = LayerItemsLayerItems::first();\n\n $response = $this->get(route('breadcrumb.add', ['id' => $linkItem->linked_layer_item_id, 'breadcrumb' => $linkItem->layer_item_id]));\n $response->assertViewIs('items.show');\n $response->assertStatus(200);\n }", "function _{PROFILE_CODE}_setup_crumbs() {\n variable_set('crumbs_show_current_page', TRUE);\n variable_set('crumbs_weights', {PROFILE_CODE}_crumbs_get_info());\n}", "protected function push_breadcrumb($name, $url = '#', $append = TRUE)\n\t{\n\t\t$entry = array('name' => $name, 'url' => $url);\n\n\t\tif ($append)\n\t\t\t$this->mBreadcrumb[] = $entry;\n\t\telse\n\t\t\tarray_unshift($this->mBreadcrumb, $entry);\n\t}", "private function _setupBreadcrumbs($tree) {\n\t\tforeach ($tree as $item) {\n\t\t\tif ($item['active'] == 1) {\n\t\t\t\tif ($item['module'] != '' || $item['visible'] == 1) {\n\t\t\t\t\t$this->_breadcrumbs[] = $item;\n\t\t\t\t}\n\t\t\t\tif (isset($item['children'])) {\n\t\t\t\t\t$this->_setupBreadcrumbs($item['children']);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (count($this->_breadcrumbs) == 0) {\n\t\t\treturn;\n\t\t}\n\t\t$currentItem = $this->_breadcrumbs[count($this->_breadcrumbs) - 1];\n\t\tif (isset($currentItem['independent']) && $currentItem['independent']) {\n\t\t\t$this->_breadcrumbs = array($this->_breadcrumbs[count($this->_breadcrumbs) - 1]);\n\t\t}\n\t}", "function advertising_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('Content'), 'admin/content'),\n l(t('Advertisings'), 'admin/content/advertisings'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}" ]
[ "0.7733623", "0.74189955", "0.67983305", "0.6764055", "0.6689898", "0.6663445", "0.6636942", "0.66366833", "0.6627395", "0.6607772", "0.6589663", "0.64961845", "0.6426578", "0.64196914", "0.63904953", "0.63591266", "0.6334137", "0.631094", "0.63072014", "0.62966454", "0.6271862", "0.62567824", "0.6254912", "0.6176632", "0.6170489", "0.6149057", "0.614237", "0.61295116", "0.6127878", "0.61054057" ]
0.816269
0
/ Setup pager types
function qw_default_pager_types( $pagers ) { $pagers['default'] = array( 'title' => 'Default', 'callback' => 'qw_theme_pager_default' ); $pagers['numbers'] = array( 'title' => 'Page Numbers', 'callback' => 'qw_theme_pager_numbers' ); // WP PageNavi Plugin if ( function_exists( 'wp_pagenavi' ) ) { $pagers['pagenavi'] = array( 'title' => 'PageNavi', 'callback' => 'wp_pagenavi' ); } return $pagers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initPager() {\n\t\t// create and configure pager object and store reference to it into the registry\n\t\t$this->pager = new tx_ptlist_pager();\n\t\t$this->conf['itemsPerPage'] = $GLOBALS['TSFE']->cObj->stdWrap($this->conf['itemsPerPage'], $this->conf['itemsPerPage.']);\n\t\tif (!empty($this->conf['itemsPerPage'])) {\n\t\t\t$this->pager->set_itemsPerPage($this->conf['itemsPerPage']);\n\t\t}\n\t\tif (!empty($this->conf['maxRows'])) {\n\t\t\t$this->pager->set_maxRows($this->conf['maxRows']);\n\t\t}\n\t\t$this->pager->set_itemCollection($this->getCurrentListObject());\n\t\t$this->pager->set_currentPageNumber(!empty($this->params['page']) ? $this->params['page'] : 1);\n\t\ttx_pttools_registry::getInstance()->register($this->currentlistId.'_pager', $this->pager);\n\t}", "protected function AssignPageTypeFields() {\n $this->AddField('includespecialoffers', self::DT_BOOLEAN, true);\n $this->AddField('includeprices', self::DT_BOOLEAN, true);\n $this->AddField('includeimage', self::DT_BOOLEAN, true);\n $this->AddField('includedelivery', self::DT_BOOLEAN, true);\n $this->AddField('productsperpage', self::DT_INTEGER, 12);\n }", "protected function _initPages() {\n }", "public function configurePager()\n {\n $numArgs = func_num_args();\n $query = $numArgs >= 1 ? func_get_arg(0) : null;\n $params = $numArgs >= 2 ? func_get_arg(1) : array();\n\n if ($query === null && !isset($this->pagerQuery)) {\n $this->pager = new TablePager($this->request, 5);\n } else {\n $this->pager = new QueryPager($this->request, 5);\n }\n\n // setting up filter for pager\n $schema = new Schema($this->tableName);\n $columns = $schema->getColumnNames();\n foreach ($columns as $c) {\n if ($c == 'id') continue;\n $this->filter->addQuery($c, $this->request->get('search'));\n }\n\n /* action links */\n $pageUrl = $this->filter->getUrlFilter(); /* this is useful for keeping extra filters in request */\n $this->pagerAction = $this->request->getAppUrl($this->appName . '/pager') . $pageUrl;\n $this->editAction = $this->request->getAppUrl($this->appName . '/edit') . $pageUrl;\n $this->deleteAction = $this->request->getAppUrl($this->appName . '/delete') . $pageUrl;\n\n $this->pager->setFilter($this->filter);\n $this->pager->setInlineForm($this->inlineForm);\n\n if (isset($this->pagerOrderBy) && $this->pager instanceof TablePager) {\n $this->pager->setOrderBy($this->pagerOrderBy);\n }\n\n $this->pager->setPagerAction($this->pagerAction);\n $this->pager->setEditAction($this->editAction);\n $this->pager->setDeleteAction($this->deleteAction);\n\n $this->pager->setReadOnly($this->readOnly);\n\n if ($query === null && !isset($this->pagerQuery)) {\n $this->pager->build($this->tableName, $this->columns);\n } else {\n $this->pager->build(($query === null ? $this->pagerQuery : $query), \n ($query === null ? $this->pagerParams : $params), $this->columns);\n }\n }", "public function _replyToSetUpPageTypeProperty() {\n \n if ( 0 === count( $this->aAutoInsertIDs ) ) { \n return; \n }\n \n $this->iPostID = $this->___getPostID();\n \n $this->aDisplayedPageTypes = array(\n 'is_single' => is_single(), // deprecated\n 'is_singular' => is_singular(),\n 'is_home' => ( is_home() || is_front_page() ),\n 'is_archive' => is_archive(),\n 'is_404' => is_404(),\n 'is_search' => is_search(), \n );\n \n // The below are nothing to do with pages that don't have a post ID.\n if ( ! $this->iPostID ) { \n return; \n }\n \n $this->sPostType = get_post_type( $this->iPostID ); \n $this->aTermIDs = array();\n \n $aTaxonomies = $this->getPostTaxonomies( $this->iPostID );\n foreach( $aTaxonomies as $sTaxonomySlug => $oTaxonomy ) {\n \n $aTaxonomyTerms = wp_get_post_terms( \n $this->iPostID, \n $sTaxonomySlug \n );\n foreach( $aTaxonomyTerms as $oTerm ) {\n $this->aTermIDs[] = $oTerm->term_id;\n }\n \n }\n $this->aTermIDs = array_unique( $this->aTermIDs ); \n \n }", "protected function initialize_pages() {\n\t\t$this->pages['log_list_page'] = new Page\\LogListPage();\n\t\t$this->pages['settings_page'] = new Page\\SettingsPage();\n\t}", "function SetupMultiPages() {\r\n\t\t$pages = new cSubPages();\r\n\t\t$pages->Add(0);\r\n\t\t$pages->Add(1);\r\n\t\t$pages->Add(2);\r\n\t\t$pages->Add(3);\r\n\t\t$this->MultiPages = $pages;\r\n\t}", "public function setup_pages() {\n\t\t$this->pages = array(\n\t\t\t'the7-dashboard' => array(\n\t\t\t\t'title' => __( 'My The7', 'the7mk2' ),\n\t\t\t\t'capability' => 'edit_theme_options',\n\t\t\t),\n\t\t\t'the7-demo-content' => array(\n\t\t\t\t'title' => __( 'Pre-made Websites', 'the7mk2' ),\n\t\t\t\t'capability' => 'edit_theme_options',\n\t\t\t),\n\t\t\t'the7-plugins' => array(\n\t\t\t\t'title' => __( 'Plugins', 'the7mk2' ),\n\t\t\t\t'capability' => 'install_plugins',\n\t\t\t),\n\t\t\t'the7-status' => array(\n\t\t\t\t'title' => __( 'Service Information', 'the7mk2' ),\n\t\t\t\t'capability' => 'switch_themes',\n\t\t\t),\n\t\t);\n\t}", "abstract function buildPaginator($type, array $options);", "public function setPager($pager) {\n $this->pager = $pager;\n }", "function qw_make_pager($pager, &$wp_query)\n{\n $pager_themed = '';\n $pagers = qw_all_pager_types();\n\n //set callback if function exists\n if(function_exists($pagers[$pager['type']]['callback'])) {\n $callback = $pagers[$pager['type']]['callback'];\n } else {\n $callback = $pagers['default']['callback'];\n }\n\n // execute callback\n $pager_themed = call_user_func_array($callback, array($pager, $wp_query));\n\n return $pager_themed;\n}", "private function setPostTypeSettings()\n\t{\n\t\t$this->post_type_settings = $this->post_type_repo->getSinglePostType($this->post_type->name);\n\t\t$this->assigned_pt_pages = $this->post_type_repo->getAssignedPages();\n\t}", "private static function setupPages()\n {\n self::$pages = array (\n 'mooexternallinks' => array (\n 'title' => 'External Links (for the bottom of the page)',\n 'file_folder' => 'operations',\n 'table' => 'moo_external_link',\n 'singular' => 'External link',\n 'submenu_title' => 'External link',\n 'default_empty_msg' => 'Sorry, no external links could be found! Please try again.',\n 'model' => array (\n 'selects' => array (\n '*'\n ),\n 'joins' => array (\n ),\n 'where_fields' => array (\n 'title',\n 'url',\n ),\n /**\n * Fix url\n */\n 'pre_hook' => function (&$row) {\n if (!preg_match(\"~^(?:f|ht)tps?://~i\", $row->url)) {\n $row->url = \"http://\" . $row->url;\n }\n }\n ),\n 'view' => array (\n 'all' => array (\n 'title' => array (\n 'link' => true,\n 'sort' => true,\n 'width' => '5%',\n 'align' => 'left'\n ),\n 'url' => array (\n 'heading' => 'Links To',\n 'sort' => true,\n 'external_link' => true,\n 'align' => 'left'\n ),\n 'ordering' => array (\n 'width' => '5%',\n 'sort' => true\n ),\n 'published' => array (\n 'width' => '5%',\n 'sort' => true\n )\n ),\n 'single' => array (\n 'title' => array (\n \n ),\n 'url' => array (\n 'heading' => 'Links To'\n ),\n 'ordering' => array (\n 'additional_style' => 'width:25px;'\n ),\n 'published' => array (\n 'formatter' => 'boolean'\n ),\n )\n ),\n 'controller' => array (\n )\n ),\n );\n }", "function phptemplate_preprocess_custom_pager(&$vars) {\n // no need to compare it to current index.\n $vars['first'] = empty($vars['nav_array']['first']) ? '' : l('Erste', 'node/' . $vars['nav_array']['first']);\n $vars['last'] = empty($vars['nav_array']['last']) ? '' : l('Letzte', 'node/' . $vars['nav_array']['last']);\n}", "public function testPager() {\n $view = Views::getView('test_view');\n $view->setDisplay();\n $view->displayHandlers->get('default')->overrideOption('fields', [\n 'counter' => [\n 'id' => 'counter',\n 'table' => 'views',\n 'field' => 'counter',\n 'relationship' => 'none',\n ],\n 'name' => [\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'field' => 'name',\n 'relationship' => 'none',\n ],\n ]);\n $view->displayHandlers->get('default')->setOption('pager', [\n 'type' => 'mini',\n 'options' => ['items_per_page' => 1],\n ]);\n\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals('1', $counter);\n $view->destroy();\n\n // Go to the second page.\n $view->setCurrentPage(1);\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals('2', $counter);\n $view->destroy();\n\n // Go to the third page.\n $view->setCurrentPage(2);\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals('3', $counter);\n\n $view->destroy();\n\n // Test using the counter start option.\n $counter_start = 1000000;\n $view->setDisplay();\n $view->displayHandlers->get('default')->overrideOption('fields', [\n 'counter' => [\n 'id' => 'counter',\n 'table' => 'views',\n 'field' => 'counter',\n 'relationship' => 'none',\n 'counter_start' => $counter_start,\n ],\n 'name' => [\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'field' => 'name',\n 'relationship' => 'none',\n ],\n ]);\n\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals($counter_start, $counter);\n $view->destroy();\n\n // Go to the second page.\n $view->setCurrentPage(1);\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals($counter_start + 1, $counter);\n $view->destroy();\n\n // Go to the third page.\n $view->setCurrentPage(2);\n $view->preview();\n\n $counter = $view->style_plugin->getField(0, 'counter');\n $this->assertEquals($counter_start + 2, $counter);\n }", "public function setPage() {\n }", "function set_posts_per_page_for_post_types( $query ) {\n\tif ( ! is_admin() && $query->is_main_query() ) {\n\n//vanilla search with no post type uses search.php and only shows posts\n\t\tif ( $query->is_search() && ! $query->is_post_type_archive() ) {\n\t\t\t$query->set( 'post_type', 'post' );\n\t\t}\n\n\t}\n\n}", "protected function AssignPageTypeFields() {\n//incemail tinyint\n $this->AddField('contactname', self::DT_STRING, 'Name');\n $this->AddField('contactemail', self::DT_STRING, 'E-mail Address');\n $this->AddField('contactsubject', self::DT_STRING, 'Subject');\n $this->AddField('contactmessage', self::DT_STRING, 'Message');\n// $this->AddField('inccontactinsidearea', DT_BOOLEAN);\n $this->AddField('inccontactname', self::DT_BOOLEAN);\n $this->AddField('incaddress', self::DT_BOOLEAN);\n $this->AddField('inctelephone', self::DT_BOOLEAN);\n $this->AddField('showmap', self::DT_BOOLEAN);\n $this->AddField('mapaddress', self::DT_STRING);\n }", "function nr_set_pagetype(){\n\t\t\n\tif(!is_admin() && $_SERVER['REQUEST_URI'] != '/admin/' && $_SERVER['REQUEST_URI'] != '/admin'){\n\t\n\t\tglobal $post;\n\t\tglobal $pagetype;\n\t\t\n\t\t$pagetype = false;\n\t\t\t\t\t\n\t\tif(is_front_page()){\n\t\t\t\n\t\t\t$pagetype = 'home';\n\t\t\t\n\t\t}\n\t\telse if(is_page()){\n\t\t\t\t\t\t\n\t\t\t$pagetypes = array(NR_PID_HOME=>'home',NR_PID_CONTACT=>'contact',NR_PID_JOBS=>'jobs',NR_PID_ABOUT=>'about',NR_PID_NEWS=>'news',NR_PID_CASES=>'cases');\n\t\t\tif(array_key_exists($post->ID,$pagetypes))\n\t\t\t $pagetype = $pagetypes[''.$post->ID.''];\t\n\t\t\telse if(get_post_meta($post->ID,'_wp_page_template',true) == 'template-solution.php')\n\t\t\t\t$pagetype = 'solution'; \n\t\t\telse if(get_post_meta($post->ID,'_wp_page_template',true) == 'template-custompage.php')\n\t\t\t\t$pagetype = 'custompage'; \t\t\t\n\t\t}\n\t\telse if(is_single()){\n\t\t\t\t\t\t\t\t\n\t\t\t$pagetype = $post->post_type;\n\t\t\n\t\t}\n\t\telse if(is_category() || is_tag() || is_author() || is_search() || is_attachment()){\n\t\t\n\t\t\t$pagetype = 'redirect';\n\t\t\n\t\t}\n\t\t\n\t\tif($pagetype == 'post' || $pagetype == 'redirect'){\t\t\t\t\t\t\t\n\t\t\theader(\"HTTP/1.1 301 Moved Permanently\");\n\t\t\theader(\"Location: \".get_home_url());\n\t\t\texit();\n \n\t\t}\n\t}\n\t\n}", "function _buildPaging($options)\n {\n $defaults = array('totalItems' => $this->_totalRecordsNum,\n 'perPage' => is_null($this->_pageLimit) \n ? $this->_totalRecordsNum \n : $this->_pageLimit,\n 'urlVar' => $this->_requestPrefix . 'page',\n 'currentPage' => $this->_page); \n $options = array_merge($defaults, $options);\n $this->_pager =& Pager::factory($options);\n }", "public function createPager(int $limit = 0, ?string $startKey = null): PagerInterface;", "public function init()\r\n\t{\r\n\t\tif(!isset($this->htmlOptions['class']))\r\n\t\t\t$this->htmlOptions['class']='pagination';\r\n\r\n parent::init();\r\n\t}", "protected function pagerDefaultAction() {\n\n\t\t// setup pagerStrategy\n\n\t\t// check if class file exists\n\t\ttx_pttools_assert::isNotEmptyString($this->conf['pagerStrategyClass'], array('message' => 'No \"pagerType\" found in configuration!'));\n\t\t$file = implode(':', array_slice(t3lib_div::trimExplode(':', $this->conf['pagerStrategyClass']), 0, -1));\n\t\ttx_pttools_assert::isFilePath($file, array('message' => sprintf('File \"%s\" not found', $file)));\n\n\t\t$pagerStrategy = t3lib_div::getUserObj($this->conf['pagerStrategyClass']); /* @var $pagerStrategy tx_ptlist_iPagerStrategy */\n\t\tif (!empty($this->conf['pagerStrategyConfiguration.'])) {\n\t\t\t$pagerStrategy->setConfiguration($this->conf['pagerStrategyConfiguration.']);\n\t\t}\n\n\t\t$this->pager->set_pagerStrategy($pagerStrategy);\n\n\t\t$view = $this->getView('list_pager');\n\t\t$view->addItem($this->pager->getMarkerArray(), 'pager');\n\n\t\t$appendToUrl = '';\n\t\tif ($this->conf['appendFilterValuesToUrls']) {\n\t\t\t$appendToUrl = $this->getCurrentListObject()->getCompleteListStateAsUrlParameters();\n\t\t}\n\t\t$view->addItem($appendToUrl, 'appendToUrl', false);\n\n\t\treturn $view->render();\n\t}", "function init() {\n\t\t\n\t\tif($this->getData(\"pagingRecordsPerPage\")!='')\n\t\t{\n\t\t\t$this->internal['results_at_a_time'] = $this->getData(\"pagingRecordsPerPage\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->internal['results_at_a_time'] = 2;\n\t\t}\n\t\t// Settings for paging starts here\n\t\t\n\t\t$this->internal['maxPages'] = 7;\n\t\t$this->internal['dontLinkActivePage'] = true;\n\t\t$this->internal['pagefloat'] = 'center';\n\t\t// Settings for paging ends here\n\n\t}", "public function create_pxp_pages()\n\t{\n\t\t$pages = array(\n\t\t\t'registration'\t=> array(\n\t\t\t\t'name'\t\t=> 'registration',\n\t\t\t\t'title'\t\t=> 'Registration',\n\t\t\t\t'content'\t=> '[pxp_registration]'\n\t\t\t),\n\t\t\t'cart'\t\t\t=> array(\n\t\t\t\t'name'\t\t=> 'cart',\n\t\t\t\t'title'\t\t=> 'Cart',\n\t\t\t\t'content'\t=> '[pxp_cart]'\n\t\t\t),\n\t\t\t'checkout'\t\t=> array(\n\t\t\t\t'name'\t\t=> 'checkout',\n\t\t\t\t'title'\t\t=> 'Checkout',\n\t\t\t\t'content'\t=> '[pxp_checkout]'\n\t\t\t),\n\t\t\t'login'\t\t\t=>array(\n\t\t\t\t'name'\t\t=> 'login', \n\t\t\t\t'title'\t\t=> 'Login',\n\t\t\t\t'content'\t=> '[pxp_login]'\n\t\t\t),\n\t\t\t'search'\t\t=> array(\n\t\t\t\t'name'\t\t=> 'search',\n\t\t\t\t'title'\t\t=> 'Search',\n\t\t\t\t'content'\t=> '[pxp_search]'\n\t\t\t)\n\t\t);\n\t\t\n\t\tforeach( $pages as $key => $page )\n\t\t{\n\t\t\tpxp_create_page( 'pxp_' . $key . '_page', $page['name'], $page['title'], $page['content'] );\n\t\t}\n\t}", "abstract protected function getPaginationView();", "function pager($range = PAGINATION_RANGE, $pages = 'total', $prevnext = TRUE, $prevnext_always = FALSE, $firstlast = TRUE, $firstlast_always = FALSE) {\n extract( $this->kernel->params );\n $result_array = array();\n\n $total_items = $result_array[\"total_items\"] = $this->filter[\"total_items\"];\n $per_page = $this->filter[\"per_page\"];\n $start = $this->filter[\"start\"];\n\n // First, check on a few parameters to see if they're ok, we don't want negatives\n $total_items = ($total_items < 0) ? 0 : $total_items;\n $per_page = ($per_page < 1) ? 1 : $per_page;\n $range = ($range < 1) ? 1 : $range;\n $sel_page = 1;\n\n $float_val = $total_items / $per_page;\n $int_val = (int) $float_val;\n $reminder = $float_val - $int_val;\n $last_page_calc = round( $per_page * $reminder);\n $total_pages = $int_val + ($last_page_calc >= 1 ? 1 : 0);\n\n // Are there more than one pages to show? If not, this section will be skipped,\n // and only the pages_text will be shown\n if ($total_pages > 1) {\n // The page we are on\n $sel_page = round($start / $per_page) + 1;\n\n // The ranges indicate how many pages should be displayed before and after\n // the selected one. Here, it will check if the range is an even number,\n // and adjust the ranges appropriately. It will behave best on non-even numbers\n $range_min = ($range % 2 == 0) ? ($range / 2) - 1 : ($range - 1) / 2;\n $range_max = ($range % 2 == 0) ? $range_min + 1 : $range_min;\n $page_min = $sel_page - $range_min;\n\n $page_max = $sel_page + $range_max;\n\n // This parts checks whether the ranges are 'out of bounds'. If we're at or near\n // the 'edge' of the pagination, we will start or end there, not at the range\n $page_min = ($page_min < 1) ? 1 : $page_min;\n $page_max = ($page_max < ($page_min + $range - 1)) ? $page_min + $range - 1 : $page_max;\n if ($page_max > $total_pages) {\n $page_min = ($page_min > 1) ? $total_pages - $range + 1 : 1;\n $page_min = ($page_min < 1) ? 1 : $page_min;\n $page_max = $total_pages;\n }\n\n // Build the links\n for ($i = $page_min;$i <= $page_max;$i++)\n $result_array[\"pages\"][] = array( (($i - 1) * $per_page), $i );\n\n // Do we got previous and next links to display?\n if (($prevnext) || (($prevnext) && ($prevnext_always))) {\n // Aye we do, set what they will look like\n $prev_num = (($prevnext === 'num') || ($prevnext === 'nump')) ? $sel_page - 1 : '';\n $next_num = (($prevnext === 'num') || ($prevnext === 'numn')) ? $sel_page + 1 : '';\n\n // Display previous link?\n if (($sel_page > 1) || ($prevnext_always)) {\n $start_at = ($sel_page - 2) * $per_page;\n $start_at = ($start_at < 0) ? 0 : $start_at;\n $result_array[\"prev_page\"] = $start_at;\n }\n // Next link?\n if (($sel_page < $total_pages) || ($prevnext_always)) {\n $start_at = $sel_page * $per_page;\n $start_at = ($start_at >= $total_items) ? $total_items - $per_page : $start_at;\n $result_array[\"next_page\"] = $start_at;\n }\n }\n\n // This part is just about identical to the prevnext links, just a few minor\n // value differences\n if (($firstlast) || (($firstlast) && ($firstlast_always))) {\n $first_num = (($firstlast === 'num') || ($firstlast === 'numf')) ? 1 : '';\n $last_num = (($firstlast === 'num') || ($firstlast === 'numl')) ? $total_pages : '';\n\n $first_txt = sprintf($first_txt, $first_num);\n $last_txt = sprintf($last_txt, $last_num);\n\n if ((($sel_page > ($range - $range_min)) && ($total_pages > $range)) || ($firstlast_always))\n $result_array[\"first_page\"] = 0;\n\n if ((($sel_page < ($total_pages - $range_max)) && ($total_pages > $range)) || ($firstlast_always))\n $result_array[\"last_page\"] = ($total_pages - 1) * $per_page;\n\n }\n }\n\n // Display pages text?\n if ($pages) {\n $result_array[\"total_pages\"] = $total_pages;\n $result_array[\"selected_page\"] = $sel_page;\n }\n\n return $result_array;\n\n }", "public function atp_post_types() {\n\t\t\n\t\t\tparent::atp_post_types();\n\t\t\t\n\t\t\t$this->child_index_require_once( MED_DIR . 'doctor/doctor.php');\n\t\t\t$this->child_index_require_once( MED_DIR . 'appointment/appointment.php');\n\t\t\t$this->child_index_require_once( MED_DIR . 'department/department.php');\n\t\t}", "public function init() {\n extract($this->data);\n\n //Set class\n $this->data['classList'][] = \"c-pagination\"; \n\n //Default to page one\n if(!$current) {\n $this->data['current'] = 1; \n }\n\n //Previous data\n if($this->data['current'] != 1) {\n $this->data['previous'] = $linkPrefix . ($this->data['current'] - 1); \n } else {\n $this->data['previous'] = false; \n }\n\n //Next data\n if((count($this->data['list'])) != $this->data['current']) {\n $this->data['next'] = $linkPrefix . ($this->data['current'] + 1); \n } else {\n $this->data['next'] = false; \n }\n }", "function pager_ex($post,$all_items,$order_column=\"\",$pagers_count=2,$order_direction=\"asc\")\n{\n\n //print_r(array($post,$all_items,$order_column,$pagers_count,$order_direction));\n if(!is_array($post)||!isset($post['pager']))\n {\n $pager=array();\n $pager[0]=is_array($order_column) ? $order_column[0] : $order_column;\n $pager[1]=$order_direction; //added by val petruchek\n $pager[2]=config_get('pager','default_perpage');\n $pager[3]='1';\n }\n else\n {\n $pager=$post['pager'];\n }\n if(is_array($order_column))\n {\n $pager[0]=in_array($pager[0],$order_column) ? $pager[0] : $order_column[0];\n }\n $ppage_set = get_perpagelist();\n $per_page=intval($pager[2]);\n $all_page=ceil(intval($all_items)/$per_page);\n $all_page=($all_page<1) ? 1 : $all_page;\n $cur_page=intval($pager[3])>$all_page?$all_page:intval($pager[3]);\n $cur_col=\"$pager[0]\";\n $cur_sort=\"$pager[1]\";\n $params=array('ccol'=>$cur_col,'csort'=>$cur_sort,'ppage'=>$per_page,'cpage'=>$cur_page);\n $result=array();\n $result['pager']=array();\n for($i=0;$i<$pagers_count;$i++)\n {\n $result['pager'][$i] = perpage_selectbox($ppage_set,'pagerHandler',$params,$per_page) . pagination_title(($cur_page-1)*$per_page,$per_page,$all_items) .page_selectbox($all_page ,'pagerHandler',$params, $cur_page);\n }\n $result['params']=array();\n $result['params']['limit']=$per_page;\n $result['params']['offset']=($cur_page-1)*$per_page;\n $result['params']['column']=$pager[0];\n $result['params']['order']=$pager[1];\n $result['params']['count']=$all_items;\n return $result;\n}" ]
[ "0.7033818", "0.6580467", "0.63413316", "0.62452275", "0.61838454", "0.6129177", "0.61214983", "0.60548043", "0.60317117", "0.5969194", "0.5920001", "0.58953846", "0.5826228", "0.5818835", "0.5795788", "0.5787103", "0.57636166", "0.5761484", "0.5720014", "0.5691589", "0.56451", "0.5642397", "0.5636951", "0.5586003", "0.5576267", "0.55715257", "0.5570268", "0.55574584", "0.5542549", "0.553875" ]
0.702185
1
TODO: Implement createProductPart() method.
function createProductPart($data) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createPart()\n {\n $entityClass = 'MU\\\\YourCityModule\\\\Entity\\\\PartEntity';\n\n $entity = new $entityClass();\n\n $this->entityInitialiser->initPart($entity);\n\n return $entity;\n }", "private function create_product()\n\t{\n\t\t$this->product = new stdClass();\n\t\t$this->product->{'@context'} = \"http://schema.org/\";\n\t\t$this->product->{'@type'} = \"Product\";\n\t}", "protected function createProduct()\n {\n return Mage::getModel('catalog/model');\n }", "public function createProduct()\n {\n $entityClass = 'MU\\\\YourCityModule\\\\Entity\\\\ProductEntity';\n\n $entity = new $entityClass();\n\n $this->entityInitialiser->initProduct($entity);\n\n return $entity;\n }", "public function create_product()\n {\n $view = new View();\n $view->renderAdmin('admin_create_product.php', 'admin_view.php');\n }", "function deleteProductPart($id)\n {\n }", "protected function createProduct()\n {\n return Product::create([\n 'name' => 'Silver Product',\n 'id' => 'silver-'.self::generateRandomString(20),\n 'url' => 'www.stripe.com/silver',\n ]);\n }", "public function add_product() {\n \n }", "public function createProducts($categoryName = NULL, $parts = NULL)\n\t{\t\n\t\t$product = Product::getInstance();\n\t\t\n\t\tif( Arr::is_array($this->_groupDetails) && !empty($this->_groupDetails) )\n\t\t{\n\t\t\t$i = 0;\n\t\t\tforeach( $this->_groupDetails as $key => $item )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$group = mb_convert_encoding(strip_tags(pq($key)->find('td')->html()), 'UTF-8');\n\t\t\t\t$groupName = preg_replace('/[^а-яё ]+/ius', '', $group);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$result = array();\n\t\t\t\tforeach( $item as $index => $cell )\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif( count($cell) > 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$articleLink = pq($cell[1])->children('a')->attr('href');\n\t\t\t\t\t\tif( stripos($articleLink, 'catalog_part') !== false )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$articleField = pq($cell[1])->children('a');\n\t\t\t\t\t\t\t$article = trim($articleField->text());\n\t\t\t\t\t\t\t$name = pq($cell[2])->html();\n\t\t\t\t\t\t\t$manufacture = ( pq($cell[4])->children('img')->length() > 0 ? pq($cell[4])->children('img')->attr('title'):pq($cell[3])->children('img')->attr('title') );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$result = array(\n\t\t\t\t\t\t\t\t'name'\t=> trim($name),\n\t\t\t\t\t\t\t\t'article'\t=> $article,\n\t\t\t\t\t\t\t\t'clear_article' => preg_replace('/([^\\w]+)/', '', $article),\n\t\t\t\t\t\t\t\t'manufacture'\t=> trim($manufacture),\n\t\t\t\t\t\t\t\t'parentName'\t=> ( !is_null($parts ) ? $parts->get('name') : '' ),\n\t\t\t\t\t\t\t\t'parentId'\t=> ( !is_null($parts ) ? $parts->get('_id')->{'$id'} : '' ),\n\t\t\t\t\t\t\t\t'groupName'\t=> trim($groupName),\n\t\t\t\t\t\t\t\t'category'\t=> ( !is_null($categoryName) ? $categoryName : '' ),\n\t\t\t\t\t\t\t\t'link'\t=> $articleLink,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->_data[] = $result;\n\t\t\t\t\t\t\t$product->offsetSet($i, $result);\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function addProduct()\r\n {\r\n }", "function updateProductPart($data, $id)\n {\n }", "public function produceRandomPart() {\n\n // Combine the parts with the buffer\n $parts = $this->product_references->getParts();\n $parts_buffer = $this->product_references->getPartsBuffer();\n $parts_combined = array_merge($parts,$parts_buffer);\n\n $random_part = array_rand($parts_combined, 1);\n\n $new_part = array(\n 'part' => $parts_combined[$random_part],\n 'locked' => false\n );\n\n array_unshift($this->conveyor, $new_part);\n\n\n\n }", "function getProductByPartNumber($partNumber) {\r\n if ($partNumber === null) {\r\n return null;\r\n }\r\n $queryString = \"SELECT S.ServiceProduct.ID, S.PartNumber, S.Name, S.Descriptions.LabelText FROM SalesProduct S WHERE S.PartNumber='{$partNumber}'\";\r\n $roqlResultSet = RNCPHP\\ROQL::query($queryString)->next();\r\n if ($product = $roqlResultSet->next()) {\r\n return $product;\r\n }\r\n }", "function productPartRules()\n {\n }", "public function productcreateAction() : object\n {\n $title = \"Ny produkt\";\n $page = $this->app->page;\n\n $page->add(\"admin/header\");\n $page->add(\"admin/productcreate\");\n\n return $page->render([\n \"title\" => $title\n ]);\n }", "public function getProduct();", "public function create() {\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t\t$order = ( new Krokedil_Order() )->create();\n\t\t$order->add_product( $this->product );\n\t\t$order->calculate_totals();\n\t\t$order->save();\n\t\t$this->order = $order;\n\t}", "public function getFromPart()\n {\n }", "private function create_gift_product(){\n\t\terror_log('creating new gift product for course: ' . $this->course_id );\n\t\t\n\t\t$course = new WC_product( $this->course_id );\n\t\t$gift_title = __('Regalo', 'yc-curso-regalo' ) . ' - ' . $course->get_title();\n\t\t$new_gift_id = wp_insert_post( \n\t\t\tarray(\n\t\t\t 'post_title' \t=> $gift_title,\n\t\t\t 'post_status' \t=> 'publish',\n\t\t\t 'post_type' \t=> 'product',\n\t\t\t)\n\t\t);\n\t\t$course_price = get_post_meta( $this->course_id, '_price', true );\n\t\terror_log('new price: ' . $course_price );\n\t\twp_set_object_terms( $new_gift_id, 'simple_gift', 'product_type' );\n\t\tupdate_post_meta( $new_gift_id, '_visibility', 'visible' );\n\t\tupdate_post_meta( $new_gift_id, '_stock_status', 'instock');\n\t\tupdate_post_meta( $new_gift_id, '_virtual', 'yes' );\n\t\tupdate_post_meta( $new_gift_id, '_price', $course_price );\n\t\tupdate_post_meta( $new_gift_id, '_course_id', $this->course_id );\n\n\t\t$this->id = $new_gift_id;\n\t}", "public function createProduct()\n {\n $product = factory(Product::class)->create();\n return $product;\n }", "protected function createTestProduct()\n {\n $product = factory(Product::class)->create();\n\n\t\t$sizeAttr = factory(Attribute::class)->make([\n\t\t\t'name' => 'size'\n\t\t]);\n\t\t$sizeTerms = ['small', 'medium', 'large'];\n\t\t$colorAttr = factory(Attribute::class)->make([\n\t\t\t'name' => 'color'\n\t\t]);\n\t\t$colorTerm = ['black', 'white'];\n\n\t\t// Set the terms and attributes\n\t\t$product->addAttribute($sizeAttr->name);\n\t\t$product->addAttribute($colorAttr->name);\n\t\t$product->addAttributeTerm($sizeAttr->name, $sizeTerms);\n\t\t$product->addAttributeTerm($colorAttr->name, $colorTerm);\n\t\t\n\t\t$variantSmallBlack = [\n\t\t\t'sku' => Str::random(16),\n\t\t\t'price' => rand(100,300),\n\t\t\t'cost' => rand(50, 99),\n\t\t\t'variation' => [\n\t\t\t\t['option' => 'color', 'value' => 'black'],\n\t\t\t\t['option' => 'size', 'value' => 'small'],\n\t\t\t]\n\t\t];\n\t\t$variantSmallWhite = [\n\t\t\t'sku' => Str::random(16),\n\t\t\t'price' => rand(100,300),\n\t\t\t'cost' => rand(50, 99),\n\t\t\t'variation' => [\n\t\t\t\t['option' => 'color', 'value' => 'white'],\n\t\t\t\t['option' => 'size', 'value' => 'small'],\n\t\t\t]\n\t\t];\n\t\t$product->addVariant($variantSmallBlack);\n\t\t$product->addVariant($variantSmallWhite);\n\n\t\treturn $product;\n }", "public function create()\n {\n $data['page_title'] = 'Product Add';\n $data['page_url'] = 'product';\n $data['page_route'] = 'product';\n $data['page_title'] = 'Product Add';\n $data['champaignList'] = $this->commonRepository->all($this->parentModel, 'campaign_name', 'asc');\n $data['productCategoryList'] = $this->commonRepository->all($this->productCategory, 'name', 'asc');\n $response = $this->resource->create('backend.product.create',$data);\n return $response;\n\n }", "protected function addModelPart(Product $product)\n {\n $this->chain($product, 'model');\n $product->model .= $this->_original;\n\n $this->chain($product, 'name');\n $product->name .= $this->_original;\n }", "public function createVariation(ProductInterface $product, $copyDependencies = true);", "public function getProduct()\n {\n return $this->product instanceof ProductResourceIdentifierBuilder ? $this->product->build() : $this->product;\n }", "public function createProduct() {\n $publishedCategories = category::where('publicationStatus', 1)->get();\n $publishedManufacturer = manufacture::where('publicationStatus', 1)->get();\n return view('admin.product.addProduct', ['publishedCategories' => $publishedCategories, 'publishedManufacturer' => $publishedManufacturer]);\n }", "public function created(Product $product): void\n {\n $addonCategories = Request::input('product.addon_categories');\n $variants = Request::input('product.variants');\n $files = Request::input('product.files');\n\n // save addon categories\n foreach ($addonCategories as $addonCategory) {\n $addonCategory['product_uuid'] = $product->uuid;\n\n ProductAddonCategory::create(Arr::except($addonCategory, ['category']));\n }\n\n // save product variants\n foreach ($variants as $variant) {\n $variant['created_by_uuid'] = Request::session()->get('user');\n $variant['company_uuid'] = Request::session()->get('company');\n $variant['product_uuid'] = $product->uuid;\n\n $productVariant = ProductVariant::create(Arr::except($variant, ['options']));\n\n foreach ($variant['options'] as $option) {\n $option['product_variant_uuid'] = $productVariant->uuid;\n ProductVariantOption::create($option);\n }\n }\n\n // set keys on files\n foreach ($files as $file) {\n $fileRecord = File::where('uuid', $file['uuid'])->first();\n $fileRecord->setKey($product);\n }\n }", "function addSubProduct()\n{\n echo '======================================== add Sub Product =================================' .PHP_EOL;\n global $ProductService;\n\n $param =\n [\n ## ============================ *Required Parameters =============================\n 'name' => 'Put product name',\n # ‌یکی از دو فیلد unlimited و availableCount اجباری است\n 'unlimited' => 'true/false', # default : false\n 'availableCount' => 'Put available count',\n 'price' => 'Put price',\n 'discount' => 'Put discount',\n 'groupId' => 'Put group id',\n ## =========================== Optional Parameters ================================\n# 'apiToken' => 'Put ApiToken',\n# 'guildCode' => 'Put guild code',\n# 'parentProductId' => 'Put parent product id',\n# 'description' => 'Put product description',\n# 'uniqueId' => 'Put unique id',\n# 'metaData' => 'Put json string like : {\"test\":\"true\"}',\n# 'businessId' => 'Put business id',\n# 'allowUserInvoice' => 'true/false', # default : false\n# 'allowUserPrice' => 'true/false', # default : false\n# 'currencyCode' => 'Put currency code',\n# 'attributes' =>\n# [\n# [\n# 'attCode' => 'Put attribute code',\n# 'attValue' => 'Put attribute value',\n# 'attGroup' => 'true/false',\n# ],\n# [\n# 'attCode' => 'Put attribute code',\n# 'attValue' => 'Put attribute value',\n# 'attGroup' => 'true/false',\n# ]\n# ],\n# 'tags' => 'Put tags separated with comma',\n# 'content' => 'Put content',\n# 'previewImage' => 'Put image address',\n# 'tagTrees' => 'Put tag trees name separated with comma',\n# 'tagTreeCategoryName' => 'Put tag tree category name',\n# 'preferredTaxRate' => 'Put tax rate default is 0.09',\n# 'quantityPrecision' => 'Put decimal digits of quantity',\n# 'scVoucherHash' => ['Put Service Call Voucher Hashes'],\n# 'scApiKey' => 'Put service call Api Key',\n ];\n try {\n $result = $ProductService->addSubProduct($param);\n print_r($result);\n }\n catch (ValidationException $e) {\n print_r($e->getResult());\n print_r($e->getErrorsAsArray());\n } catch (PodException $e) {\n print_r($e->getResult());\n }\n}", "protected function productAction() {\n\t\tif (Tools_Security_Acl::isAllowed(self::RESOURCE_STORE_MANAGEMENT)) {\n\n\t\t\t$this->_view->generalConfig = $this->_configMapper->getConfigParams();\n\n\t\t\t$this->_view->templateList = Application_Model_Mappers_TemplateMapper::getInstance()->findByType(Application_Model_Models_Template::TYPE_PRODUCT);\n\t\t\t$this->_view->brands = Models_Mapper_Brand::getInstance()->fetchAll();\n\n\t\t\t$listFolders = Tools_Filesystem_Tools::scanDirectoryForDirs($this->_websiteConfig['path'] . $this->_websiteConfig['media']);\n\t\t\tif (!empty ($listFolders)) {\n\t\t\t\t$listFolders = array('select folder') + array_combine($listFolders, $listFolders);\n\t\t\t}\n\t\t\t$this->_view->imageDirList = $listFolders;\n\n\t\t\t$this->_view->plugins = array();\n\t\t\tforeach (Tools_Plugins_Tools::getPluginsByTags(array('ecommerce')) as $plugin) {\n\t\t\t\tif ($plugin->getTags() && in_array('merchandising', $plugin->getTags())) {\n\t\t\t\t\tarray_push($this->_view->plugins, $plugin->getName());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($this->_request->has('id')) {\n\t\t\t\t$id = filter_var($this->_request->getParam('id'), FILTER_VALIDATE_INT);\n\t\t\t\tif ($id) {\n\t\t\t\t\t$this->_view->product = Models_Mapper_ProductMapper::getInstance()->find($id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->_view->websiteConfig = $this->_websiteConfig;\n\n\t\t\t$this->_layout->content = $this->_view->render('product.phtml');\n\t\t\t$this->_layout->sectionId = Tools_Misc::SECTION_STORE_ADDEDITPRODUCT;\n\t\t\techo $this->_layout->render();\n\t\t}\n\t}", "public function createProduct($title, $prix, $reference)\n {\n return new Boulanger\\Product($title,$prix,$reference);\n }" ]
[ "0.7032147", "0.68081367", "0.6454833", "0.64429647", "0.638188", "0.6262671", "0.6194976", "0.61356807", "0.61329824", "0.60400045", "0.60184616", "0.6008802", "0.59693176", "0.59633976", "0.5932625", "0.5881969", "0.58734745", "0.58617264", "0.5806163", "0.57930964", "0.5791919", "0.5784107", "0.5751678", "0.5725709", "0.5723086", "0.5699601", "0.5689284", "0.56815135", "0.56740814", "0.567314" ]
0.79969513
0
TODO: Implement updateProductPart() method.
function updateProductPart($data, $id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateProduct() {\n\n $params = [\n 'name' => $this->product\n ];\n \n $response = getResponse(getConfigVar(\"api_url\"), \"products\", $params, [],'body');\n \n $this->qty = $response[\"results\"][0][\"qty\"];\n $this->price = $response[\"results\"][0][\"price\"];\n \n $product = get_page_by_title( $this->product, OBJECT, 'product' );\n \n $productID = $product->ID;\n \n update_post_meta( $productID, \"_stock\", $this->qty );\n update_post_meta( $productID, \"_price\", $this->price );\n }", "function createProductPart($data)\n {\n }", "public function updateProductData()\n {\n $this->productName = $this->product->getName();\n }", "public function ajaxProcessEditProductOnSupplierPieces() {\n\n // Return value\n $res = true;\n\n $order = new SupplierPieces((int) Tools::getValue('id_order'));\n $orderDetail = new SupplierPiecesDetail((int) Tools::getValue('product_id_order_detail'));\n\n if (Tools::isSubmit('product_invoice')) {\n $orderInvoice = new SupplierPiecesInvoice((int) Tools::getValue('product_invoice'));\n }\n\n // If multiple product_quantity, the order details concern a product customized\n $productQuantity = 0;\n\n if (is_array(Tools::getValue('product_quantity'))) {\n\n foreach (Tools::getValue('product_quantity') as $idCustomization => $qty) {\n // Update quantity of each customization\n Db::getInstance()->update('customization', ['quantity' => (int) $qty], 'id_customization = ' . (int) $idCustomization);\n // Calculate the real quantity of the product\n $productQuantity += $qty;\n }\n\n } else {\n $productQuantity = Tools::getValue('product_quantity');\n }\n\n $this->checkStockAvailable($orderDetail, ($productQuantity - $orderDetail->product_quantity));\n\n // Check fields validity\n $this->doEditProductValidation($orderDetail, $order, isset($orderInvoice) ? $orderInvoice : null);\n\n // If multiple product_quantity, the order details concern a product customized\n $productQuantity = 0;\n\n if (is_array(Tools::getValue('product_quantity'))) {\n\n foreach (Tools::getValue('product_quantity') as $idCustomization => $qty) {\n // Update quantity of each customization\n Db::getInstance()->update(\n 'customization',\n [\n 'quantity' => (int) $qty,\n ],\n 'id_customization = ' . (int) $idCustomization,\n 1\n );\n // Calculate the real quantity of the product\n $productQuantity += $qty;\n }\n\n } else {\n $productQuantity = Tools::getValue('product_quantity');\n }\n\n $productPriceTaxIncl = Tools::ps_round(Tools::getValue('product_price_tax_incl'), 2);\n $productPriceTaxExcl = Tools::ps_round(Tools::getValue('product_price_tax_excl'), 2);\n $totalProductsTaxIncl = $productPriceTaxIncl * $productQuantity;\n $totalProductsTaxExcl = $productPriceTaxExcl * $productQuantity;\n\n // Calculate differences of price (Before / After)\n $diffPriceTaxIncl = $totalProductsTaxIncl - $orderDetail->total_price_tax_incl;\n $diffPriceTaxExcl = $totalProductsTaxExcl - $orderDetail->total_price_tax_excl;\n\n // Apply change on SupplierPiecesInvoice\n\n if (isset($orderInvoice)) {\n // If SupplierPiecesInvoice to use is different, we update the old invoice and new invoice\n\n if ($orderDetail->id_order_invoice != $orderInvoice->id) {\n $oldSupplierPiecesInvoice = new SupplierPiecesInvoice($orderDetail->id_order_invoice);\n // We remove cost of products\n $oldSupplierPiecesInvoice->total_products -= $orderDetail->total_price_tax_excl;\n $oldSupplierPiecesInvoice->total_products_wt -= $orderDetail->total_price_tax_incl;\n\n $oldSupplierPiecesInvoice->total_paid_tax_excl -= $orderDetail->total_price_tax_excl;\n $oldSupplierPiecesInvoice->total_paid_tax_incl -= $orderDetail->total_price_tax_incl;\n\n $res &= $oldSupplierPiecesInvoice->update();\n\n $orderInvoice->total_products += $orderDetail->total_price_tax_excl;\n $orderInvoice->total_products_wt += $orderDetail->total_price_tax_incl;\n\n $orderInvoice->total_paid_tax_excl += $orderDetail->total_price_tax_excl;\n $orderInvoice->total_paid_tax_incl += $orderDetail->total_price_tax_incl;\n\n $orderDetail->id_order_invoice = $orderInvoice->id;\n }\n\n }\n\n if ($diffPriceTaxIncl != 0 && $diffPriceTaxExcl != 0) {\n $orderDetail->unit_price_tax_excl = $productPriceTaxExcl;\n $orderDetail->unit_price_tax_incl = $productPriceTaxIncl;\n\n $orderDetail->total_price_tax_incl += $diffPriceTaxIncl;\n $orderDetail->total_price_tax_excl += $diffPriceTaxExcl;\n\n if (isset($orderInvoice)) {\n // Apply changes on SupplierPiecesInvoice\n $orderInvoice->total_products += $diffPriceTaxExcl;\n $orderInvoice->total_products_wt += $diffPriceTaxIncl;\n\n $orderInvoice->total_paid_tax_excl += $diffPriceTaxExcl;\n $orderInvoice->total_paid_tax_incl += $diffPriceTaxIncl;\n }\n\n // Apply changes on SupplierPieces\n $order = new SupplierPieces($orderDetail->id_order);\n $order->total_products += $diffPriceTaxExcl;\n $order->total_products_wt += $diffPriceTaxIncl;\n\n $order->total_paid += $diffPriceTaxIncl;\n $order->total_paid_tax_excl += $diffPriceTaxExcl;\n $order->total_paid_tax_incl += $diffPriceTaxIncl;\n\n $res &= $order->update();\n }\n\n $oldQuantity = $orderDetail->product_quantity;\n\n $orderDetail->product_quantity = $productQuantity;\n $orderDetail->reduction_percent = 0;\n\n // update taxes\n $res &= $orderDetail->updateTaxAmount($order);\n\n // Save order detail\n $res &= $orderDetail->update();\n\n // Update weight SUM\n $orderCarrier = new SupplierPiecesCarrier((int) $order->getIdSupplierPiecesCarrier());\n\n if (Validate::isLoadedObject($orderCarrier)) {\n $orderCarrier->weight = (float) $order->getTotalWeight();\n $res &= $orderCarrier->update();\n\n if ($res) {\n $order->weight = sprintf(\"%.3f \" . Configuration::get('EPH_WEIGHT_UNIT'), $orderCarrier->weight);\n }\n\n }\n\n // Save order invoice\n\n if (isset($orderInvoice)) {\n $res &= $orderInvoice->update();\n }\n\n // Update product available quantity\n StockAvailable::updateQuantity($orderDetail->product_id, $orderDetail->product_attribute_id, ($oldQuantity - $orderDetail->product_quantity), $order->id_shop);\n\n $products = $this->getProducts($order);\n // Get the last product\n $product = $products[$orderDetail->id];\n $product['current_stock'] = StockAvailable::getQuantityAvailableByProduct($product['product_id'], $product['product_attribute_id'], $product['id_shop']);\n $resume = SupplierPiecesSlip::getProductSlipResume($orderDetail->id);\n $product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity'];\n $product['amount_refundable'] = $product['total_price_tax_excl'] - $resume['amount_tax_excl'];\n $product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl']);\n $product['refund_history'] = SupplierPiecesSlip::getProductSlipDetail($orderDetail->id);\n\n if ($product['id_warehouse'] != 0) {\n $warehouse = new Warehouse((int) $product['id_warehouse']);\n $product['warehouse_name'] = $warehouse->name;\n $warehouseLocation = WarehouseProductLocation::getProductLocation($product['product_id'], $product['product_attribute_id'], $product['id_warehouse']);\n\n if (!empty($warehouseLocation)) {\n $product['warehouse_location'] = $warehouseLocation;\n } else {\n $product['warehouse_location'] = false;\n }\n\n } else {\n $product['warehouse_name'] = '--';\n $product['warehouse_location'] = false;\n }\n\n // Get invoices collection\n $invoiceCollection = $order->getInvoicesCollection();\n\n $invoiceArray = [];\n\n foreach ($invoiceCollection as $invoice) {\n /** @var SupplierPiecesInvoice $invoice */\n $invoice->name = $invoice->getInvoiceNumberFormatted($this->context->language->id, (int) $order->id_shop);\n $invoiceArray[] = $invoice;\n }\n\n // Assign to smarty informations in order to show the new product line\n $this->context->smarty->assign(\n [\n 'product' => $product,\n 'order' => $order,\n 'currency' => new Currency($order->id_currency),\n 'can_edit' => $this->tabAccess['edit'],\n 'invoices_collection' => $invoiceCollection,\n 'current_id_lang' => $this->context->language->id,\n 'link' => $this->context->link,\n 'current_index' => static::$currentIndex,\n 'display_warehouse' => (int) Configuration::get('EPH_ADVANCED_STOCK_MANAGEMENT'),\n ]\n );\n\n if (!$res) {\n $this->ajaxDie(\n json_encode(\n [\n 'result' => $res,\n 'error' => Tools::displayError('An error occurred while editing the product line.'),\n ]\n )\n );\n }\n\n if (is_array(Tools::getValue('product_quantity'))) {\n $view = $this->createTemplate('_customized_data.tpl')->fetch();\n } else {\n $view = $this->createTemplate('_product_line.tpl')->fetch();\n }\n\n $this->sendChangedNotification($order);\n\n $this->ajaxDie(json_encode([\n 'result' => $res,\n 'view' => $view,\n 'can_edit' => $this->tabAccess['add'],\n 'invoices_collection' => $invoiceCollection,\n 'order' => $order,\n 'invoices' => $invoiceArray,\n 'documents_html' => $this->createTemplate('_documents.tpl')->fetch(),\n 'shipping_html' => $this->createTemplate('_shipping.tpl')->fetch(),\n 'customized_product' => is_array(Tools::getValue('product_quantity')),\n ]));\n }", "public function update(){\n \n $xml = $this->getXml();\n \n if($xml){\n \n foreach($xml->children() as $product){\n \n if($product->attributes()->action == 'modified'){\n //if($product->attributes()->action == 'unmodified'){\n \n $productxml = $this->getProductXml((string)$product->attributes()->id);\n \n if($productxml){\n foreach($productxml->children() as $productdetail){\n $this->updateProduct($productdetail);\n }\n }\n \n }\n }\n }\n }", "function deleteProductPart($id)\n {\n }", "function wpsc_ajax_ie_save() {\n\n\t$product_post_type = get_post_type_object( 'wpsc-product' );\n\n\tif ( !current_user_can( $product_post_type->cap->edit_posts ) ) {\n\t\techo '({\"error\":\"' . __( 'Error: you don\\'t have required permissions to edit this product', 'wpsc' ) . '\", \"id\": \"'. esc_js( $_POST['id'] ) .'\"})';\n\t\tdie();\n\t}\n\n\t$id = absint( $_POST['id'] );\n\t$post = get_post( $_POST['id'] );\n\t$parent = get_post( $post->post_parent );\n\t$terms = wpsc_get_product_terms( $id, 'wpsc-variation', 'name' );\n\n\t$product = array(\n\t\t'ID' => $_POST['id'],\n\t\t'post_title' => $parent->post_title . ' (' . implode( ', ', $terms ) . ')',\n\t);\n\n\t$id = wp_update_post( $product );\n\tif ( $id > 0 ) {\n\t\t//need parent meta to know which weight unit we are using\n\t\t$parent_meta = get_product_meta($post->post_parent, 'product_metadata', true );\n\t\t$product_meta = get_product_meta( $product['ID'], 'product_metadata', true );\n\t\tif ( is_numeric( $_POST['weight'] ) || empty( $_POST['weight'] ) ){\n\t\t\t$product_meta['weight'] = wpsc_convert_weight($_POST['weight'], $parent_meta['weight_unit'], 'pound', true);\n\t\t\t$product_meta['weight_unit'] = $parent_meta['weight_unit'];\n\t\t}\n\n\t\tupdate_product_meta( $product['ID'], 'product_metadata', $product_meta );\n\t\tupdate_product_meta( $product['ID'], 'price', (float)$_POST['price'] );\n\t\tupdate_product_meta( $product['ID'], 'special_price', (float)$_POST['special_price'] );\n\t\tupdate_product_meta( $product['ID'], 'sku', $_POST['sku'] );\n\t\tif ( !is_numeric($_POST['stock']) )\n\t\t\tupdate_product_meta( $product['ID'], 'stock', '' );\n\t\telse\n\t\t\tupdate_product_meta( $product['ID'], 'stock', absint( $_POST['stock'] ) );\n\n\t\t$meta = get_product_meta( $id, 'product_metadata', true );\n\t\t$price = get_product_meta( $id, 'price', true );\n\t\t$special_price = get_product_meta( $id, 'special_price', true );\n\t\t$sku = get_product_meta( $id, 'sku', true );\n\t\t$sku = ( $sku )?$sku:__('N/A', 'wpsc');\n\t\t$stock = get_product_meta( $id, 'stock', true );\n\t\t$stock = ( $stock === '' )?__('N/A', 'wpsc'):$stock;\n\t\t$results = array( 'id' => $id, 'title' => $post->post_title, 'weight' => wpsc_convert_weight($meta['weight'], 'pound', $parent_meta['weight_unit']), 'price' => wpsc_currency_display( $price ), 'special_price' => wpsc_currency_display( $special_price ), 'sku' => $sku, 'stock' => $stock );\n\t\techo '(' . json_encode( $results ) . ')';\n\t\tdie();\n\t} else {\n\t\techo '({\"error\":\"' . __( 'Error updating product', 'wpsc' ) . '\", \"id\": \"'. esc_js( $_POST['id'] ) .'\"})';\n\t}\n\tdie();\n}", "protected function processChangeProductInCart()\n\t{\n\t\t$mode = (Tools::getIsset('update') && $this->id_product) ? 'update' : 'add';\n\n\t\tif (!$this->id_product)\n\t\t\t$this->errors[] = Tools::displayError('Product not found', !Tools::getValue('ajax'));\n\n\t\t$product = new Product($this->id_product, true, $this->context->language->id);\n\t\tif (!$product->id || !$product->active || !$product->checkAccess($this->context->cart->id_customer))\n\t\t{\n\t\t\t$this->errors[] = Tools::displayError('This product is no longer available.', !Tools::getValue('ajax'));\n\t\t\treturn;\n\t\t}\n\n\t\t$qty_factor = 1;\n\t\t$ext_qty_factor = 1;\n\t\t$ext_prop_quantities = null;\n\t\t$id_cart_product = 0;\n\t\t$qty_behavior = 0;\n\t\t$icp = (int)Tools::getValue('icp');\n\t\t$properties = $product->productProperties();\n\t\tif ($icp && $this->context->cart->id)\n\t\t{\n\t\t\t\t\t\t$cart_products = $this->context->cart->getProducts();\n\t\t\tif (count($cart_products))\n\t\t\t{\n\t\t\t\tforeach ($cart_products as $cart_product)\n\t\t\t\t{\n\t\t\t\t\tif ($icp == (int)$cart_product['id_cart_product'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$id_cart_product = $icp;\n\t\t\t\t\t\tif ($mode == 'add')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (Tools::getValue('qty') != 'default')\n\t\t\t\t\t\t\t\t$qty_factor = (int)Tools::getValue('qty');\n\t\t\t\t\t\t\t$_POST['qty'] = ((float)$cart_product['cart_quantity_fractional'] > 0 ? (float)$cart_product['cart_quantity_fractional'] : ($product->qtyStep() > 0 ? $product->qtyStep() : 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($mode == 'update')\n\t\t\t\t\t\t\t$qty_behavior = PP::qtyBehavior($product, $cart_product['cart_quantity']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($properties['pp_ext'] == 1 && in_array($properties['pp_ext_policy'], array(0, 2)))\n\t\t\t{\n\t\t\t\t$ext_prop_quantities = array();\n\t\t\t\t$ext_prop_qty_ratio = array();\n\t\t\t\tif ($properties['pp_ext_policy'] == 2)\n\t\t\t\t{\n\t\t\t\t\t$prop = $product->productProp();\n\t\t\t\t\tif ($this->id_product_attribute)\n\t\t\t\t\t\t$id_product_attribute = $this->id_product_attribute;\n\t\t\t\t\telse if ($product->hasAttributes())\n\t\t\t\t\t\t$id_product_attribute = Product::getDefaultAttribute($product->id);\n\t\t\t\t\telse\n\t\t\t\t\t\t$id_product_attribute = 0;\n\t\t\t\t}\n\n\t\t\t\t$positions = count($properties['pp_ext_prop']);\n\t\t\t\tfor ($position = 1; $position <= $positions; $position++)\n\t\t\t\t{\n\t\t\t\t\t$pp_ext_prop = $properties['pp_ext_prop'][$position];\n\t\t\t\t\tif ($properties['pp_ext_policy'] == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t$q = PP::productProp($prop, $id_product_attribute, $position, 'quantity');\n\t\t\t\t\t\tif ($q === false)\n\t\t\t\t\t\t\t$q = (float)$pp_ext_prop['default_quantity'];\n\t\t\t\t\t\tif ($q <= 0)\n\t\t\t\t\t\t\t$q = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$q = PP::resolveInputQty(Tools::getValue('pp_ext_prop_quantity_'.$position, 'default'), $properties['pp_qty_policy'], $pp_ext_prop['qty_step'], ($pp_ext_prop['default_quantity'] > 0 ? $pp_ext_prop['default_quantity'] : 1));\n\n\t\t\t\t\t$ext_prop_quantities[$position] = $q;\n\t\t\t\t\t$ext_prop_qty_ratio[$position] = $properties['pp_ext_prop'][$position]['qty_ratio'];\n\t\t\t\t\tif ($q <= 0)\n\t\t\t\t\t\t$this->errors[] = Tools::displayError('Quantity not specified.', !Tools::getValue('ajax'));\n\t\t\t\t\t$min_qty = (float)$pp_ext_prop['minimum_quantity'];\n\t\t\t\t\tif ($min_qty > 0 && $q < $min_qty)\n\t\t\t\t\t\t$this->errors[] = Tools::displayError(sprintf('Please specify at least %s for %s', (string)PP::formatQty($min_qty), (string)$pp_ext_prop['property']), !Tools::getValue('ajax'));\n\t\t\t\t\t$max_qty = (float)$pp_ext_prop['maximum_quantity'];\n\t\t\t\t\tif ($max_qty > 0 && $q > $max_qty)\n\t\t\t\t\t\t$this->errors[] = Tools::displayError(sprintf('Please specify no more than %s for %s', (string)PP::formatQty($max_qty), (string)$pp_ext_prop['property']), !Tools::getValue('ajax'));\n\t\t\t\t}\n\t\t\t\tif (!$this->errors)\n\t\t\t\t{\n\t\t\t\t\t$ext_qty_factor = ($properties['pp_ext_method'] == 1 ? 1 : 0);\n\t\t\t\t\t$positions = count($ext_prop_quantities);\n\t\t\t\t\tfor ($position = 1; $position <= $positions; $position++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$value = $ext_prop_quantities[$position];\n\t\t\t\t\t\t$qty_ratio = $ext_prop_qty_ratio[$position];\n\t\t\t\t\t\tif ($properties['pp_ext_method'] == 1)\n\t\t\t\t\t\t\t$ext_qty_factor *= ($qty_ratio > 0 ? $value / $qty_ratio : $value);\n\t\t\t\t\t\telseif ($properties['pp_ext_method'] == 2)\n\t\t\t\t\t\t\t$ext_qty_factor += ($qty_ratio > 0 ? $value / $qty_ratio : $value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!$this->errors)\n\t\t{\n\t\t\t\t\t\tif ($this->id_product_attribute)\n\t\t\t{\n\t\t\t\t$default_quantity = $product->attributeDefaultQty($this->id_product_attribute);\n\t\t\t\t$this->qty = $qty_factor * $this->resolveInputQty($properties, $default_quantity);\n\t\t\t\tif ($this->qty == 0)\n\t\t\t\t\t$this->errors[] = Tools::displayError('Quantity not specified.', !Tools::getValue('ajax'));\n\t\t\t\telse if (!Product::isAvailableWhenOutOfStock($product->out_of_stock) && !Attribute::checkAttributeQty($this->id_product_attribute, $ext_qty_factor * $this->qty))\n\t\t\t\t\t$this->errors[] = Tools::displayError('There isn\\'t enough product in stock.', !Tools::getValue('ajax'));\n\t\t\t}\n\t\t\telse if ($product->hasAttributes())\n\t\t\t{\n\t\t\t\t$min_quantity = ($product->out_of_stock == 2) ? !Configuration::get('PS_ORDER_OUT_OF_STOCK') : !$product->out_of_stock;\n\t\t\t\t$this->id_product_attribute = Product::getDefaultAttribute($product->id, $min_quantity);\n\t\t\t\t\t\t\t\tif (!$this->id_product_attribute)\n\t\t\t\t\tTools::redirectAdmin($this->context->link->getProductLink($product));\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$default_quantity = $product->attributeDefaultQty($this->id_product_attribute);\n\t\t\t\t\t$this->qty = $qty_factor * $this->resolveInputQty($properties, $default_quantity);\n\t\t\t\t\tif ($this->qty == 0)\n\t\t\t\t\t\t$this->errors[] = Tools::displayError('Quantity not specified.', !Tools::getValue('ajax'));\n\t\t\t\t\telse if (!Product::isAvailableWhenOutOfStock($product->out_of_stock) && !Attribute::checkAttributeQty($this->id_product_attribute, $ext_qty_factor * $this->qty))\n\t\t\t\t\t\t$this->errors[] = Tools::displayError('There isn\\'t enough product in stock.', !Tools::getValue('ajax'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$default_quantity = $product->defaultQty();\n\t\t\t\t$this->qty = $qty_factor * $this->resolveInputQty($properties, $default_quantity);\n\t\t\t\tif ($this->qty == 0)\n\t\t\t\t\t$this->errors[] = Tools::displayError('Quantity not specified.', !Tools::getValue('ajax'));\n\t\t\t\telse if (!$product->checkQty($ext_qty_factor * $this->qty))\n\t\t\t\t\t$this->errors[] = Tools::displayError('There isn\\'t enough product in stock.', !Tools::getValue('ajax'));\n\t\t\t}\n\t\t}\n\n\t\t\t\tif (!$this->errors && ($mode == 'add' || ($mode == 'update' && $qty_behavior)))\n\t\t{\n\t\t\t\t\t\tif ($mode == 'add' && !$this->context->cart->id)\n\t\t\t{\n\t\t\t\tif (Context::getContext()->cookie->id_guest)\n\t\t\t\t{\n\t\t\t\t\t$guest = new Guest(Context::getContext()->cookie->id_guest);\n\t\t\t\t\t$this->context->cart->mobile_theme = $guest->mobile_theme;\n\t\t\t\t}\n\t\t\t\t$this->context->cart->add();\n\t\t\t\tif ($this->context->cart->id)\n\t\t\t\t\t$this->context->cookie->id_cart = (int)$this->context->cart->id;\n\t\t\t}\n\n\t\t\t\t\t\tif (!$product->hasAllRequiredCustomizableFields() && !$this->customization_id)\n\t\t\t\t$this->errors[] = Tools::displayError('Please fill in all of the required fields, and then save your customizations.', !Tools::getValue('ajax'));\n\n\t\t\tif (!$this->errors)\n\t\t\t{\n\t\t\t\t$cart_rules = $this->context->cart->getCartRules();\n\t\t\t\t$update_quantity = $this->context->cart->updateQty(\n\t\t\t\t\t$id_cart_product ? ($mode == 'add' ? $qty_factor : $this->qty) : ($ext_prop_quantities !== null ? $ext_qty_factor : $this->qty),\n\t\t\t\t\t$this->id_product, $this->id_product_attribute, $this->customization_id,\n\t\t\t\t\t($mode == 'update' ? 'update' : Tools::getValue('op', 'up')),\n\t\t\t\t\t$this->id_address_delivery, null, true, $id_cart_product, $ext_prop_quantities, $this->qty);\n\t\t\t\tif ($update_quantity < 0)\n\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$minimal_quantity = ($this->id_product_attribute) ? $product->attributeMinQty($this->id_product_attribute) : $product->minQty();\n\t\t\t\t\t$this->errors[] = Tools::displayError(sprintf('You must add %s minimum quantity', $minimal_quantity), !Tools::getValue('ajax'));\n\t\t\t\t}\n\t\t\t\telseif (!$update_quantity)\n\t\t\t\t\t$this->errors[] = Tools::displayError('You already have the maximum quantity available for this product.', !Tools::getValue('ajax'));\n\t\t\t\telseif ((int)Tools::getValue('allow_refresh'))\n\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$cart_rules2 = $this->context->cart->getCartRules();\n\t\t\t\t\tif (count($cart_rules2) != count($cart_rules))\n\t\t\t\t\t\t$this->ajax_refresh = true;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$rule_list = array();\n\t\t\t\t\t\tforeach ($cart_rules2 as $rule)\n\t\t\t\t\t\t\t$rule_list[] = $rule['id_cart_rule'];\n\t\t\t\t\t\tforeach ($cart_rules as $rule)\n\t\t\t\t\t\t\tif (!in_array($rule['id_cart_rule'], $rule_list))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->ajax_refresh = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$removed = CartRule::autoRemoveFromCart();\n\t\tCartRule::autoAddToCart();\n\t\tif (count($removed) && (int)Tools::getValue('allow_refresh'))\n\t\t\t$this->ajax_refresh = true;\n\t}", "public function ajaxProcessDeleteProductLine() {\n\n $res = true;\n\n $orderDetail = new SupplierPiecesDetail((int) Tools::getValue('id_order_detail'));\n $order = new SupplierPieces((int) Tools::getValue('id_order'));\n\n $this->doDeleteProductLineValidation($orderDetail, $order);\n\n // Update SupplierPiecesInvoice of this SupplierPiecesDetail\n\n if ($orderDetail->id_order_invoice != 0) {\n $orderInvoice = new SupplierPiecesInvoice($orderDetail->id_order_invoice);\n $orderInvoice->total_paid_tax_excl -= $orderDetail->total_price_tax_excl;\n $orderInvoice->total_paid_tax_incl -= $orderDetail->total_price_tax_incl;\n $orderInvoice->total_products -= $orderDetail->total_price_tax_excl;\n $orderInvoice->total_products_wt -= $orderDetail->total_price_tax_incl;\n $res &= $orderInvoice->update();\n }\n\n // Update SupplierPieces\n $order->total_paid -= $orderDetail->total_price_tax_incl;\n $order->total_paid_tax_incl -= $orderDetail->total_price_tax_incl;\n $order->total_paid_tax_excl -= $orderDetail->total_price_tax_excl;\n $order->total_products -= $orderDetail->total_price_tax_excl;\n $order->total_products_wt -= $orderDetail->total_price_tax_incl;\n\n $res &= $order->update();\n\n // Reinject quantity in stock\n $this->reinjectQuantity($orderDetail, $orderDetail->product_quantity, true);\n\n // Update weight SUM\n $orderCarrier = new SupplierPiecesCarrier((int) $order->getIdSupplierPiecesCarrier());\n\n if (Validate::isLoadedObject($orderCarrier)) {\n $orderCarrier->weight = (float) $order->getTotalWeight();\n $res &= $orderCarrier->update();\n\n if ($res) {\n $order->weight = sprintf(\"%.3f \" . Configuration::get('EPH_WEIGHT_UNIT'), $orderCarrier->weight);\n }\n\n }\n\n if (!$res) {\n $this->ajaxDie(json_encode([\n 'result' => $res,\n 'error' => Tools::displayError('An error occurred while attempting to delete the product line.'),\n ]));\n }\n\n // Get invoices collection\n $invoiceCollection = $order->getInvoicesCollection();\n\n $invoiceArray = [];\n\n foreach ($invoiceCollection as $invoice) {\n /** @var SupplierPiecesInvoice $invoice */\n $invoice->name = $invoice->getInvoiceNumberFormatted($this->context->language->id, (int) $order->id_shop);\n $invoiceArray[] = $invoice;\n }\n\n // Assign to smarty informations in order to show the new product line\n $this->context->smarty->assign([\n 'order' => $order,\n 'currency' => new Currency($order->id_currency),\n 'invoices_collection' => $invoiceCollection,\n 'current_id_lang' => $this->context->language->id,\n 'link' => $this->context->link,\n 'current_index' => static::$currentIndex,\n ]);\n\n $this->sendChangedNotification($order);\n\n $this->ajaxDie(json_encode([\n 'result' => $res,\n 'order' => $order,\n 'invoices' => $invoiceArray,\n 'documents_html' => $this->createTemplate('_documents.tpl')->fetch(),\n 'shipping_html' => $this->createTemplate('_shipping.tpl')->fetch(),\n ]));\n }", "public function sync_product_attachemtns(){\n\n ob_start();\n $allowed_sufix = ['jpg','jpeg','png'];\n $response = $this->makeRequest('GET','LOGPART?$filter=EXTFILEFLAG eq \\'Y\\' &$select=PARTNAME&$expand=PARTEXTFILE_SUBFORM');\n\n\n $response_data = json_decode($response['body_raw'], true);\n foreach($response_data['value'] as $item) {\n $sku = $item['PARTNAME'];\n \n //$product_id = wc_get_product_id_by_sku($sku);\n\n $args = array(\n 'post_type'\t\t=>\t'product',\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=>\t$item['PARTNAME']\n )\n )\n );\n $product_id = 0;\n $my_query = new \\WP_Query( $args );\n if ( $my_query->have_posts() ) {\n $my_query->the_post();\n $product_id = get_the_ID();\n }else{\n $product_id = 0;\n continue;\n }\n //**********\n $product = new \\WC_Product($product_id);\n $product_media = $product->get_gallery_image_ids();\n\n //$main_attach_id = [];\n //$attachments = [$main_attach_id];\n $attachments = [];\n \n echo 'Starting process for product '.$sku.'<br>';\n\n foreach ( $item['PARTEXTFILE_SUBFORM'] as $attachment ) {\n $file_path = $attachment['EXTFILENAME'];\n $file_info = pathinfo( $file_path );\n $file_name = $file_info['basename'];\n $file_ext = $file_info['extension'];\n if (array_search( $file_ext, $allowed_sufix, false )!==false ) {\n $is_existing_file = false;\n // check if the item exists in media\n //$id = $this->simply_check_file_exists($file_name);\n global $wpdb;\n $id = $wpdb->get_var( \"SELECT post_id FROM $wpdb->postmeta WHERE meta_value like '%$file_name' AND meta_key = '_wp_attached_file'\" );\n if($id){\n echo $file_path . ' already exists in media, add to product... <br>';\n $is_existing_file = true;\n array_push( $attachments, (int)$id );\n continue;\n }\n // if is a new file, download from Priority and push to array\n if ( $is_existing_file !== true ) {\n $images_url = 'https://'. $this->option('url').'/primail';\n echo 'File '.$file_path.' not exsits, downloading from '.$images_url,'<br>';\n $priority_image_path = $file_path;\n $priority_image_path = str_replace('\\\\', '/', $priority_image_path);\n $product_full_url = str_replace( '../../system/mail', $images_url, $priority_image_path );\n $thumb_id = download_attachment( $sku, $product_full_url );\n array_push( $attachments, (int)$thumb_id );\n };\n }\n };\n // add here merge to files that exists in wp and not exists in the response from API\n $image_id_array = array_merge($product_media, $attachments);\n // https://stackoverflow.com/questions/43521429/add-multiple-images-to-woocommerce-product\n //update_post_meta($product_id, '_product_image_gallery',$image_id_array); not correct can not pass array\n update_post_meta($product_id, '_product_image_gallery',implode(',',$image_id_array));\n }\n $output_string = ob_get_contents();\n ob_end_clean();\n return $output_string;\n\n }", "private function updateProduct($ipdcproduct){\n \n $attributes = $ipdcproduct->attributes();\n \n $node = $this->getProductNode((string)$ipdcproduct->productId, (string)$attributes->datumLaatsteAanpassing);\n \n if($node){\n \n $config = \\Drupal::config('e2e_product.settings');\n \n $node->set('title', (string)$ipdcproduct->titel);\n $node->set('changed', time());\n $node->set('field_section', [['target_id' => $config->get('e2e_product.section')]]);\n $node->set('show_title', [['value' => 1]]);\n \n $textfields = [\n 'what' => $ipdcproduct->inhoud, 'conditions' => $ipdcproduct->voorwaarden,\n 'procedure' => $ipdcproduct->procedure, 'bringwhat' => $ipdcproduct->watMeebrengen,\n 'amount' => $ipdcproduct->bedrag, 'exceptions' => $ipdcproduct->uitzonderingen,\n 'rules' => $ipdcproduct->regelgeving,\n ];\n \n foreach($textfields as $fieldname => $fieldvalue){\n $node->set('field_ipdc_' . $fieldname, [['format' => 'full_html', 'value' => (string)$fieldvalue]]);\n }\n \n $termfields = [\n 'type' => ['values' => [$ipdcproduct->productType], 'vid' => 'product_type'],\n 'target' => ['values' => $ipdcproduct->doelgroepen->children(), 'vid' => 'product_target'],\n 'scope' => ['values' => [], 'vid' => 'product_scope'],\n 'theme' => ['values' => $ipdcproduct->themas->children(), 'vid' => 'product_theme'],\n 'keywords' => ['values' => $ipdcproduct->trefwoorden->children(), 'vid' => 'product_keyword'],\n ];\n \n if(isset($ipdcproduct->geografischeToepassingsgebieden))\n $termfields['scope']['values'] = $ipdcproduct->geografischeToepassingsgebieden->children();\n \n foreach($termfields as $fieldname => $termfield){\n $tids = [];\n \n foreach($termfield['values'] as $ipdcterm){\n \n if($ipdcterm->waarde)\n $tids[] = ['target_id' => $this->getTid((string)$ipdcterm->waarde, $termfield['vid'])];\n }\n \n $node->set('field_ipdc_' . $fieldname, $tids);\n }\n \n $nids = [];\n \n foreach($ipdcproduct->verwanteProducten->children() as $relatedproduct){\n \n $relatednode = $this->getProductNode((string)$relatedproduct->productId, FALSE, FALSE);\n \n if($relatednode)\n $nids[] = ['target_id' => $relatednode->id()];\n \n }\n \n $node->set('field_ipdc_reference', $nids);\n \n $node->set('field_timestamp', [['value' => (string)$attributes->datumLaatsteAanpassing]]);\n\n $node->save();\n }\n \n }", "static public function update(Product $obj){\n\t\t\n\t}", "abstract protected function setParts();", "public function syncPacksPriority()\n {\n $stamp = mktime(0, 0, 0);\n $bod = date(DATE_ATOM,$stamp);\n $url_addition = 'LOGPART?$select=PARTNAME&$filter=ITAI_INKATALOG eq \\'Y\\'&$expand=PARTPACK_SUBFORM';\n $response = $this->makeRequest('GET', $url_addition, [], true);\n // check response status\n if ($response['status']) {\n $data = json_decode($response['body_raw'], true);\n foreach($data['value'] as $item) {\n // if product exsits, update\n $args = array(\n 'post_type'\t\t=>\t'product',\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=>\t$item['PARTNAME']\n )\n )\n );\n $my_query = new \\WP_Query( $args );\n if ( $my_query->have_posts() ) {\n while ( $my_query->have_posts() ) {\n $my_query->the_post();\n $product_id = get_the_ID();\n }\n }else{\n $product_id = 0;\n }\n\n //if ($id = wc_get_product_id_by_sku($item['PARTNAME'])) {\n if(!$product_id == 0){\n update_post_meta($product_id, 'pri_packs', $item['PARTPACK_SUBFORM']);\n }\n }\n }\n }", "public function updateWcProduct(\\WC_Product $product, Product $productData)\n {\n $product->update_meta_data('supplier', $productData->getSupplierId());\n $product->save();\n return $product;\n\n\n $changed = false;\n if ($productData->getDescription() != '' && $productData->getDescription() != $product->get_sale_price()) {\n $product->set_description($productData->getDescription());\n $changed = true;\n }\n\n if ($productData->getShortDescription() != '' && $productData->getShortDescription() != $product->get_short_description()) {\n $product->set_short_description($productData->getShortDescription());\n $changed = true;\n }\n\n if ($productData->getSalePrice() > 0 && ($productData->getSalePrice() !== (float)$product->get_sale_price())) {\n $product->set_sale_price($productData->getSalePrice());\n $changed = true;\n }\n\n if ($productData->getInputPrice() > 0 && ($productData->getInputPrice() !== (float)$product->get_meta('input_price'))) {\n $product->update_meta_data('input_price', $productData->getInputPrice());\n $changed = true;\n }\n\n if ($productData->getRegularPrice() !== (float)$product->get_regular_price()) {\n $product->set_regular_price($productData->getRegularPrice());\n $changed = true;\n }\n if ($product->get_status() !== $productData->getStatus()) {\n $product->set_status($productData->getStatus());\n $changed = true;\n }\n// if ($product->get_status() === 'pending' && $productData->getStatus() == 1) {\n// $status = 'publish';\n// $product->set_status($status);\n// $changed = true;\n// }\n\n// if($productData->getManufacturer() != '' || $productData->getManufacturer() !== $product->get_meta('suplier')){\n// $product->update_meta_data('supplier', $productData->getManufacturer());\n// $changed = true;\n// }\n if ($productData->getPdv() > 0 && $productData->getPdv() !== $product->get_meta('_pdv')) {\n $product->update_meta_data('_pdv', $productData->getPdv());\n $changed = true;\n }\n\n\n //TODO napraviti bolju proveru za slike\n// $product_thumbnail_id = $product->get_image_id();\n// $product_gallery_ids = $product->get_gallery_image_ids();\n// if($product_thumbnail_id !== ''){\n// $product_gallery_ids[] = $product_thumbnail_id;\n// }\n// var_dump($product_gallery_ids);\n// if (!empty($product_gallery_ids)) {\n// foreach ($product_gallery_ids as $image_id) {\n// wp_delete_attachment($image_id, true);\n// var_dump('obrisano');\n// }\n// }\n//\n// $this->handleImage($productData->getImages(), $product->get_id());\n\n// $product->save();\n\n\n if ($changed) {\n $product->save();\n }\n\n return $product;\n }", "function productPartRules()\n {\n }", "public function productEdition($data){\n $this->db->where('product_id', $data['product_id']);\n $this->db->update('product', $data);\n }", "protected function addModelPart(Product $product)\n {\n $this->chain($product, 'model');\n $product->model .= $this->_original;\n\n $this->chain($product, 'name');\n $product->name .= $this->_original;\n }", "public function sendFlubitProductMassAttributeUpdate() {\n\n\n $flubitCollection = Mage::getModel('flubit/globalproduct')->getCollection()\n\n ->addfieldtofilter('update_status', '0')\n\n ->addFieldToSelect('product_id')\n\n ->addFieldToSelect('flubit_status')\n\n ->addFieldToSelect('id')\n\n ->setPageSize('200');\n\n foreach ($flubitCollection as $flubitglobal) {\n\n $product[] = $flubitglobal->getFlubitStatus() . '_' . $flubitglobal->getProductId();\n\n $flubitglobal->setUpdateStatus('1')\n\n ->save();\n\n }\n\n if(count($product) > 0)\n\n $this->saveFlubitProductMassAttributeData($product);\n\n }", "public function collectUpdateProduct()\n {\n if (isset($_POST['send'])) {\n $this->productsLogic->updateProduct($_POST['price'], $_POST['platform'], $_POST['resolution'], $_POST['refresh_rate'], $_POST['function'], $_POST['color'], $_POST['accessoires'], $_POST['product_name']\n , $_POST['detail'], $_POST['connection'], $_POST['brand'], $_GET['id']);\n $host = $_SERVER['HTTP_HOST'];\n $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n $extra = 'index.php?op=admin';\n header(\"Location: http://$host$uri/$extra\");\n } else {\n $dataProduct = $this->productsLogic->readProduct($_GET['id'])[0];\n $form = $this->productsLogic->createForm($dataProduct);\n include 'view/form.php';\n }\n }", "private function enqueue_ces_survey_for_edited_product() {\n\t\tif ( $this->has_been_shown( self::PRODUCT_UPDATE_ACTION_NAME ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->enqueue_to_ces_tracks(\n\t\t\tarray(\n\t\t\t\t'action' => self::PRODUCT_UPDATE_ACTION_NAME,\n\t\t\t\t'label' => __(\n\t\t\t\t\t'How easy was it to edit your product?',\n\t\t\t\t\t'woocommerce'\n\t\t\t\t),\n\t\t\t\t'pagenow' => 'product',\n\t\t\t\t'adminpage' => 'post-php',\n\t\t\t\t'props' => array(\n\t\t\t\t\t'product_count' => $this->get_product_count(),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "function updateProduct()\n{\n echo '===================================== update Product ================================' .PHP_EOL;\n global $ProductService;\n\n $param =\n [\n ## ============================ *Required Parameters =============================\n 'entityId' => 'Put entity Id of product',\n 'name' => 'Put product name',\n 'description' => 'Put product description',\n 'canComment' => 'true/false',\n 'canLike' => 'true/false',\n 'enable' => 'true/false',\n 'price' => 'Put product price',\n 'discount' => 'Put discount',\n 'changePreview' => 'true/false',\n# 'availableCount' => 200, # تعداد موجود از محصول درصورت بدون محدودیت نبودن اجباری است\n 'unlimited' => 'true/false', # بدون محدودیت بودن محصول true/false\n ## =========================== Optional Parameters ================================\n# 'apiToken' => 'Put ApiToken',\n# 'guildCode' => 'FOOD_GUILD',\n# 'version' => 4,\n# 'uniqueId' => 'Put unique id',\n# 'metaData' => 'Put Metadata(json string)',\n# 'businessId' => 'Put business id',\n# 'allowUserInvoice' => 'true/false',\n# 'allowUserPrice' => 'true/false',\n # توجه: درصورتی که محصول قالب نداشته باشد قابل اضافه شدن است\n# در غیر این صورت قابل تغییر نمی باشد فقط مقادیر مشخصه های آن قالب را می توان تغییر داد\n# 'attTemplateCode' => 'Put attribute template code',\n# 'attributes' =>\n# [\n# [\n# 'attCode' => 'Put attribute code',\n# 'attValue' => 'Put attribute value',\n# 'attGroup' => 'true/false',\n# ],\n# [\n# 'attCode' => 'Put attribute code',\n# 'attValue' => 'Put attribute value',\n# 'attGroup' => 'true/false',\n# ]\n# ],\n# 'categories' => ['cat1', 'cat2', ...],\n# 'groupId' => 'Put group id',\n# 'lat' => 'Put Latitude',\n# 'lng' => 'Put Longitude',\n# 'tags' => 'Put tags separated with comma',\n# 'content' => 'Put content',\n# 'previewImage' => 'Put image address',\n# 'tagTrees' => 'Put tag trees name separated with comma',\n# 'tagTreeCategoryName' => 'Put tag tree category name',\n# 'preferredTaxRate' => 'Put tax rate default is 0.09',\n# 'quantityPrecision' => 'Put decimal digits of quantity',\n# 'scVoucherHash' => ['Put Service Call Voucher Hashes'],\n# 'scApiKey' => 'Put service call Api Key',\n ];\n try {\n $result = $ProductService->updateProduct($param);\n print_r($result);\n }\n catch (ValidationException $e) {\n# print_r($e->getResult());\n print_r($e->getErrorsAsArray());\n } catch (PodException $e) {\n print_r($e->getResult());\n }\n}", "public function productUpdate(Varien_Event_Observer $observer)\n {\n try\n {\n //------------------------------------------------------------//\n // Retreive and Handle Org Data\n //------------------------------------------------------------//\n $orgData = Mage::getModel('comrsesync/comrseconnect')->load(Comrse_ComrseSync_Model_Config::COMRSE_RECORD_ROW_ID);\n\n //------------------------------------------------------------//\n // Normalize Product Data\n //------------------------------------------------------------//\n $normalizedProduct = Mage::helper('comrsesync/product')->normalizeProductData($observer->getProduct());\n\n //------------------------------------------------------------//\n // Sync Products to Comr.se\n //------------------------------------------------------------//\n $preparedData = json_encode(array(\"product_details_list\" => array($normalizedProduct)));\n $postProducts = Mage::helper('comrsesync')->comrseRequest(\"POST\", Comrse_ComrseSync_Model_Config::API_PATH . \"organizations/\" . $orgData->getOrg() . \"/products\", $orgData, $preparedData);\n }\n catch (Exception $e)\n {\n Mage::log(\"Comrse Product Update Sync Error: {$e->getMessage()}\");\n }\n }", "public function updateProduct($product, $force = false)\n {\n if ($product->getTypeId() == 'simple') {\n $sku = $product->getSku();\n $skuParts = [];\n preg_match_all( '/([^\\-\\_! ?]*[\\-\\_!?])/', $sku , $skuParts );\n if (count($skuParts) > 1) {\n $stockItem = $this->stockRegistry->getStockItemBySku($sku);\n $originalData = $product->getOrigData();\n if (isset($originalData['quantity_and_stock_status'])\n && isset($originalData['quantity_and_stock_status']['qty'])) {\n $qty = $stockItem->getQty();\n if ($qty != $originalData['quantity_and_stock_status']['qty'] || $force) {\n if(isset($skuParts[0]) && isset($skuParts[0][0]) and strlen($skuParts[0][0]) > 4) {\n $lookupSku = $skuParts[0][0];\n $exactSku = substr($lookupSku,0,-1);\n $collection = $this->productCollectionFactory->create()\n ->addAttributeToFilter(\n [\n ['attribute'=> 'sku','like' => str_replace(['_'],['\\_'], $lookupSku) . '%' ],\n ['attribute'=> 'sku','eq' => str_replace(['_'],['\\_'], $exactSku) ]\n ]\n )\n ->addAttributeToFilter('sku', array('neq' => $sku))\n ->addStoreFilter()\n ->load();\n $count = $collection->count();\n $this->logger->notice((string) $collection->getSelect());\n if ($count > 0) {\n $this->handleData($count,$collection, $sku, $qty);\n }\n } else {\n // need to check if this sku has potentials upscale similar ones\n $collection = $this->productCollectionFactory->create()\n ->addAttributeToFilter(\n [\n ['attribute'=> 'sku','like' => str_replace(['_'],['\\_'], $sku) . '-%' ],\n ['attribute'=> 'sku','like' => str_replace(['_'],['\\_'], $sku) . '_%' ],\n ]\n )\n ->addAttributeToFilter('sku', array('neq' => $sku))\n ->addStoreFilter()\n ->load();\n $count = $collection->count();\n $this->logger->notice((string) $collection->getSelect());\n if ($count > 0) {\n $this->handleData($count,$collection, $sku, $qty);\n }\n }\n }\n }\n }\n }\n\n }", "function editAction()\n { \n $id = (int)$this->registry->router->getArg('id');\n $myProduct = new Core_Product($id);\n $redirectUrl = $this->getRedirectUrl();\n if($myProduct->id > 0)\n {\n \n $error = array();\n $success = array();\n $contents = '';\n $formData = array();\n \n $formData['fid'] = $myProduct->id;\n $formData['fname'] = $myProduct->name; \n $formData['fprice'] = $myProduct->price; \n \n if(!empty($_POST['fsubmit']))\n {\n \n if($_SESSION['productEditToken']==$_POST['ftoken'])\n {\n $formData = array_merge($formData, $_POST);\n \n $formData['fprice'] = $this->registry->currency->refinePriceString($formData['fprice']);\n \t\n \t//calculate currency exchange\n \t$formData['fprice'] = $this->registry->currency->convertCurrency($formData['fprice']);\n \t\n if($this->editActionValidator($formData, $error))\n {\n \n\t $myProduct->price = $formData['fprice'];\n \n $actionResult = $myProduct->updateData();\n if($actionResult == Core_Product::ERROR_OK)\n {\n $success[] = str_replace('###name###', $myProduct->name, $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('productedit', $myProduct->id, array('name' => $myProduct->name));\n \n }\n else if($actionResult == Core_Product::ERROR_UPLOAD_IMAGE)\n {\n $error[] = $this->registry->lang['controller']['errEditUpload']; \n }\n else\n {\n $error[] = $this->registry->lang['controller']['errEdit']; \n }\n \n }\n }\n $_SESSION['productEditToken']=Helper::getSecurityToken();//Tao token moi\n }\n \n //refresh new price\n $myProduct->updateRealPrice();\n \n $this->registry->smarty->assign(array( 'formData' => $formData, \n \t\t\t\t\t\t\t\t\t\t\t'myProduct'\t=> $myProduct,\n\t 'redirectUrl'=> $redirectUrl,\n 'encoderedirectUrl'=> base64_encode($redirectUrl),\n 'error' => $error,\n 'success' => $success,\n \n ));\n $contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n $this->registry->smarty->assign(array(\n 'menu' => 'productlist',\n 'pageTitle' => $this->registry->lang['controller']['pageTitle_edit'],\n 'contents' => $contents));\n $this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n }\n else\n {\n $redirectMsg = $this->registry->lang['controller']['errNotFound'];\n $this->registry->smarty->assign(array('redirect' => $redirectUrl,\n 'redirectMsg' => $redirectMsg,\n ));\n $this->registry->smarty->display('redirect.tpl');\n }\n }", "public function update()\n {\n // It's not currently possible to update product details via the API.\n return false;\n }", "public function updated(Product $product): void\n {\n $productAddonCategories = Request::input('product.addon_categories');\n $variants = Request::input('product.variants');\n\n // update addon categories\n foreach ($productAddonCategories as $productAddonCategory) {\n if (!empty($productAddonCategory['uuid'])) {\n ProductAddonCategory::where('uuid', $productAddonCategory['uuid'])->update(Arr::except($productAddonCategory, ['uuid', 'name', 'category']));\n continue;\n }\n\n // add new addon category\n $productAddonCategory['product_uuid'] = $product->uuid;\n ProductAddonCategory::create(Arr::except($productAddonCategory, ['category']));\n }\n\n // update product variants\n foreach ($variants as $variant) {\n if (!empty($variant['uuid'])) {\n // update product variante\n ProductVariant::where('uuid', $variant['uuid'])->update(Arr::except($variant, ['uuid', 'options']));\n\n // update product variant options\n foreach ($variant['options'] as $option) {\n if (!empty($option['uuid'])) {\n // make sure additional cost is always numbers only\n if (isset($option['additional_cost'])) {\n $option['additional_cost'] = Utils::numbersOnly($option['additional_cost']);\n }\n\n $updateAttrs = Arr::except($option, ['uuid']);\n\n ProductVariantOption::where('uuid', $option['uuid'])->update($updateAttrs);\n continue;\n }\n\n $option['product_variant_uuid'] = $variant['uuid'];\n ProductVariantOption::create($option);\n }\n continue;\n }\n\n // create new variant\n $variant['created_by_uuid'] = Request::session()->get('user');\n $variant['company_uuid'] = Request::session()->get('company');\n $variant['product_uuid'] = $product->uuid;\n\n $productVariant = ProductVariant::create(Arr::except($variant, ['options']));\n\n foreach ($variant['options'] as $option) {\n $option['product_variant_uuid'] = $productVariant->uuid;\n ProductVariantOption::create($option);\n }\n }\n }", "function save_feature_on_product_save() {\n\t\t// Abort if we can't determine a product type\n\t\tif ( ! $product_type = it_exchange_get_product_type() )\n\t\t\treturn;\n\n\t\t// Abort if we don't have a product ID\n\t\t$product_id = empty( $_POST['ID'] ) ? false : $_POST['ID'];\n\t\tif ( ! $product_id )\n\t\t\treturn;\n\n\t\t// Abort if this product type doesn't support this feature\n\t\tif ( ! it_exchange_product_type_supports_feature( $product_type, 'membership-hierarchy' ) )\n\t\t\treturn;\n\n\t\t$child_ids = empty( $_POST['it-exchange-membership-child-ids'] ) ? array() : $_POST['it-exchange-membership-child-ids'];\n\t\t$parent_ids = empty( $_POST['it-exchange-membership-parent-ids'] ) ? array() : $_POST['it-exchange-membership-parent-ids'];\n\n\t\tit_exchange_update_product_feature( $product_id, 'membership-hierarchy', $child_ids, array( 'setting' => 'children' ) );\n\t\tit_exchange_update_product_feature( $product_id, 'membership-hierarchy', $parent_ids, array( 'setting' => 'parents' ) );\n\t}", "function setProduct( $product )\r\n {\r\n if ( is_a( $product, \"eZProduct\" ) )\r\n {\r\n $this->ProductID = $product->id();\r\n }\r\n }", "public function update(Request $request, $id)\n {\n\n $this->validate($request, [\n 'name_ar' => 'required',\n 'name_en' => 'required',\n 'description_ar' => 'required|min:30' ,\n 'description_en' => 'required' ,\n 'price' => 'required' ,\n 'parent_id' => 'required|integer' ,\n 'product_owner_id' => 'required' ,\n 'min_quantity' => 'required|integer' ,\n 'image'=>'bail|image|mimes:jpg,jpeg,png,gif' ,\n ]);\n\n if(isset($request->sub_id)){\n $this->validate($request, [\n 'sub_id' => 'required|integer',\n ]);\n }\n\n if(isset($request->sub_sub_section_id)){\n $this->validate($request, [\n 'sub_id' => 'required|integer',\n 'sub_sub_id' => 'required|integer',\n ]);\n }\n\n $product = Product::find($id) ;\n\n $product->name_ar = $request->name_ar;\n $product->name_en = $request->name_en;\n $product->description_ar = $request->description_ar ;\n $product->description_en = $request->description_en ;\n $product->keywords_ar = $request->keywords_ar ;\n $product->keywords_en = $request->keywords_en ;\n $product->brand_id = $request->brand_id ;\n $product->section_id = $request->parent_id ;\n $product->sub_section_id =(isset($request->sub_id ) ) ? $request->sub_id: 0;\n $product->sub_sub_section_id = (isset($request->sub_sub_id ) ) ? $request->sub_sub_id: 0 ;\n $product->product_owner_id = $request->product_owner_id ;\n $product->price = $request->price ;\n $product->weight = (isset($request->weight ) ) ? $request->weight: 1 ;\n $product->min_price = $request->min_price ;\n $product->quantity = $request->quantity ;\n $product->min_quantity = $request->min_quantity ;\n $product->max_quantity = $request->max_quantity ;\n $product->active = $request->active ;\n $product->featured = $request->featured ;\n $product->manfacture_country = (isset($request->manfacture_country ) ) ? $request->manfacture_country : 0;\n $product->measurements_unit_id = (isset($request->measurements_unit_id ) ) ? $request->measurements_unit_id : 0;\n\n //upload one image\n if(!empty($request->file('image'))){\n $image = Storage::putFile('public', $request->file('image'));\n $product->image = Storage::url($image);\n }\n\n //uploaded many image\n $files = $request->file('images');\n if(!empty($request->hasFile('images')))\n {\n $files_list = array();\n foreach ($files as $key=>$file) {\n if($key == 5 ) { break ; }\n\n $photo = Storage::putFile('public' , $file);\n $original = Storage::url($photo);\n array_push($files_list,$original);\n\n }\n $product->images = implode(\",\",$files_list);\n }\n\n //save colors\n if(!empty($request->colors))\n {\n $colors = array();\n foreach ($request->colors as $color) {\n\n array_push($colors , $color);\n\n }\n $product->color_id = implode(\",\",$colors );\n }\n\n //save sizes\n if(!empty($request->sizes))\n {\n $sizes = array();\n foreach ($request->sizes as $size) {\n\n array_push($sizes , $size);\n\n }\n $product->size_id = implode(\",\",$sizes );\n }\n\n //option arabic\n if(!empty($request->details_ar) || $request->details_ar != null )\n {\n $details_ar = array();\n foreach ($request->details_ar as $detail_ar) {\n if(isset($detail_ar)){\n array_push($details_ar , $detail_ar);\n }\n }\n $product->details_ar = implode(\",\",$details_ar );\n }else{\n $product->details_ar = null ;\n }\n //option english\n if(!empty($request->details_en) || isset($request->details_en))\n {\n $details_en = array();\n foreach ($request->details_en as $detail_en) {\n if(isset($detail_en) || $detail_en != \" \" ){\n array_push($details_en , $detail_en);\n }\n }\n $product->details_en = implode(\",\",$details_en );\n }else{\n $product->details_en = null ;\n }\n\n\n $product->save();\n\n $request->session()->flash('alert-success', __('admin.alerts_success_editing'));\n return back();\n }" ]
[ "0.687474", "0.6567394", "0.63455176", "0.6316998", "0.6313841", "0.62349576", "0.6068152", "0.606392", "0.6027608", "0.5995744", "0.5994314", "0.59876174", "0.5940095", "0.5935544", "0.58788043", "0.5878333", "0.58586127", "0.5847473", "0.5845087", "0.5835788", "0.5787668", "0.5785277", "0.5764841", "0.5719306", "0.5712135", "0.5709881", "0.5706546", "0.5704162", "0.5701797", "0.56970954" ]
0.76151586
0
TODO: Implement deleteProductPart() method.
function deleteProductPart($id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function del($part){\n // PARAM $part : part number\n\n // MAIN ENTRY\n $this->start();\n $sql = \"DELETE FROM `inventory_stock` WHERE `part_no`=?;\";\n $cond = [$part];\n $pass = $this->exec($sql, $cond);\n\n // STOCK MOVEMENT - IF PART NUMBER IS CHANGED\n if ($pass) {\n $sql = \"DELETE FROM `inventory_movement` WHERE `part_no`=?;\";\n $pass = $this->exec($sql, $cond);\n }\n\n // FINALIZE\n $this->end($pass);\n return $pass;\n }", "public function\n\t\tdelete()\n\t{\n\t\t\n\t\t$product_id = $this->get_product_id();\n\t\t\n\t\t#echo \"\\$product_id: $product_id\\n\";\n\t\t\n\t\t$affected_rows = Database_ModifyingStatementHelper\n\t\t\t::apply_statement(\n\t\t\t\tnew Database_SQLUpdateStatement(\n<<<SQL\nUPDATE\n\thpi_trackit_stock_management_products\nSET\n\tdeleted = 'Yes'\nWHERE\n\tproduct_id = '$product_id'\nSQL\n\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t#echo \"\\$affected_rows: $affected_rows\\n\";\n\t}", "public function destroy(Part $part)\r\n {\r\n //\r\n try\r\n {\r\n $part->delete(); \r\n }\r\n catch(QueryException $ex){\r\n //23000 Foriegn Key Exception aka already linked to another table\r\n if($ex->getcode() === '23000'){\r\n return redirect('parts')->with('status', 'danger')->with('message', 'Type \"'.$part->part_number.'\" is linked, cannot be deleted.');\r\n }\r\n\r\n }\r\n\r\n $this->tableData();\r\n\r\n return redirect('parts')->with('status', 'success')->with('message', 'Part \"'.$part->part_number.'\" was deleted successfully.');\r\n\r\n }", "public function delete(Product $product)\n {\n\n }", "public function deleted(Product $product)\n {\n //\n }", "public function delete($id) {\n \t//Delete the PackingPart\n \t$this->getDb()->delete('t_packing_part', array('pkp_id' => $id));\n }", "public static function delete($product): void\n {\n $product->delete();\n }", "public function delete() {\n //Update parent product if has thumbnail set to the image to be deleted\n $products = $this->product()->get();\n\n foreach($products as $p) {\n if($p->thumbnail_id == $this->attributes['id']) {\n $p->thumbnail_id = null;\n $p->save();\n }\n }\n\n try {\n Storage::disk(config('filesystems.default'))->delete($this->attributes['location']);\n } catch(FileNotFoundException $e) {\n //Carry on\n }\n\n parent::delete();\n }", "public function actionDeleteProduct()\n\t{\n\t\t$post = Yii::$app->request->post();\n\n\t\t$product = Product::findOne(['id' => $post['id']]);\n\t\t$product->deleteProduct();\n\n\t\treturn $product;\n\t}", "function testDeleteProduct() {\n\t \n\t $this->loginAs('admin');\n\t $productA = $this->objFromFixture('Product', 'productA');\n\t $productID = $productA->ID; \n\t \n\t //Publish\n\t $productA->doPublish();\n\t $this->assertTrue($productA->isPublished());\n\n\t $versions = DB::query('SELECT * FROM \"Product_versions\" WHERE \"RecordID\" = ' . $productID);\n\t $versionsAfterPublished = array();\n\t foreach ($versions as $versionRow) $versionsAfterPublished[] = $versionRow;\n\n\t \n //Delete\n\t $productA->delete();\n\t $this->assertTrue(!$productA->isPublished());\n\n\t $versions = DB::query('SELECT * FROM \"Product_versions\" WHERE \"RecordID\" = ' . $productID);\n\t $versionsAfterDelete = array();\n\t foreach ($versions as $versionRow) $versionsAfterDelete[] = $versionRow;\n\t \n\t $this->assertTrue($versionsAfterPublished == $versionsAfterDelete);\n\n\t //$versions = DB::query('SELECT * FROM \"SiteTree_Live\" WHERE \"ID\" = ' . $productID);\n\t}", "public function destroy(Part $part)\n {\n $part->delete();\n return redirect()->to(url('/parts'));\n }", "public function deleteProduct() {\r\n if (Mage::getStoreConfig('megamenu/general/cache_auto_flush')) {\r\n Mage::helper('megamenu')->saveCacheHtml();\r\n return;\r\n }\r\n\r\n $products = Mage::app()->getRequest()->getParams('product');\r\n if ($products) {\r\n Mage::getModel('core/config')->saveConfig('megamenu/general/reindex',1);\r\n } else {\r\n $product_id = Mage::app()->getRequest()->getParams('id');\r\n if ($product_id) {\r\n Mage::getModel('core/config')->saveConfig('megamenu/general/reindex',1);\r\n }\r\n }\r\n Mage::app()->getCacheInstance()->cleanType('config');\r\n return;\r\n }", "public function before_delete_product( $product_id ) {\r\n WPF_Field_Product_DS::instance()->delete_by_product( $product_id );\r\n }", "public function deleted(Product $product)\n {\n\n }", "public function deleteProduct ($IdProduct, $iQuantity = 1);", "public function deleteProductThumb() {\n\t \t$id = decrypt(get('id'));\n\t \t$model_product = $this->model('product');\n\t \t$model_product->deleteProductThumb($id);\n\t }", "public function ajaxProcessDeleteProductLine() {\n\n $res = true;\n\n $orderDetail = new SupplierPiecesDetail((int) Tools::getValue('id_order_detail'));\n $order = new SupplierPieces((int) Tools::getValue('id_order'));\n\n $this->doDeleteProductLineValidation($orderDetail, $order);\n\n // Update SupplierPiecesInvoice of this SupplierPiecesDetail\n\n if ($orderDetail->id_order_invoice != 0) {\n $orderInvoice = new SupplierPiecesInvoice($orderDetail->id_order_invoice);\n $orderInvoice->total_paid_tax_excl -= $orderDetail->total_price_tax_excl;\n $orderInvoice->total_paid_tax_incl -= $orderDetail->total_price_tax_incl;\n $orderInvoice->total_products -= $orderDetail->total_price_tax_excl;\n $orderInvoice->total_products_wt -= $orderDetail->total_price_tax_incl;\n $res &= $orderInvoice->update();\n }\n\n // Update SupplierPieces\n $order->total_paid -= $orderDetail->total_price_tax_incl;\n $order->total_paid_tax_incl -= $orderDetail->total_price_tax_incl;\n $order->total_paid_tax_excl -= $orderDetail->total_price_tax_excl;\n $order->total_products -= $orderDetail->total_price_tax_excl;\n $order->total_products_wt -= $orderDetail->total_price_tax_incl;\n\n $res &= $order->update();\n\n // Reinject quantity in stock\n $this->reinjectQuantity($orderDetail, $orderDetail->product_quantity, true);\n\n // Update weight SUM\n $orderCarrier = new SupplierPiecesCarrier((int) $order->getIdSupplierPiecesCarrier());\n\n if (Validate::isLoadedObject($orderCarrier)) {\n $orderCarrier->weight = (float) $order->getTotalWeight();\n $res &= $orderCarrier->update();\n\n if ($res) {\n $order->weight = sprintf(\"%.3f \" . Configuration::get('EPH_WEIGHT_UNIT'), $orderCarrier->weight);\n }\n\n }\n\n if (!$res) {\n $this->ajaxDie(json_encode([\n 'result' => $res,\n 'error' => Tools::displayError('An error occurred while attempting to delete the product line.'),\n ]));\n }\n\n // Get invoices collection\n $invoiceCollection = $order->getInvoicesCollection();\n\n $invoiceArray = [];\n\n foreach ($invoiceCollection as $invoice) {\n /** @var SupplierPiecesInvoice $invoice */\n $invoice->name = $invoice->getInvoiceNumberFormatted($this->context->language->id, (int) $order->id_shop);\n $invoiceArray[] = $invoice;\n }\n\n // Assign to smarty informations in order to show the new product line\n $this->context->smarty->assign([\n 'order' => $order,\n 'currency' => new Currency($order->id_currency),\n 'invoices_collection' => $invoiceCollection,\n 'current_id_lang' => $this->context->language->id,\n 'link' => $this->context->link,\n 'current_index' => static::$currentIndex,\n ]);\n\n $this->sendChangedNotification($order);\n\n $this->ajaxDie(json_encode([\n 'result' => $res,\n 'order' => $order,\n 'invoices' => $invoiceArray,\n 'documents_html' => $this->createTemplate('_documents.tpl')->fetch(),\n 'shipping_html' => $this->createTemplate('_shipping.tpl')->fetch(),\n ]));\n }", "function remove($product_id) \r\n\t{\r\n\t\tunset($this->contents[$product_id]);\r\n }", "public function productdeleteAction() : object\n {\n $title = \"Raderar produkt\";\n $page = $this->app->page;\n $request = $this->app->request;\n $id = $request->getGet(\"id\");\n\n $this->productAdminClass->productDelete($id);\n $products = $this->productAdminClass->getAllProducts();\n\n $data = [\n \"products\" => $products,\n \"title\" => $title,\n ];\n\n $page->add(\"admin/header\", $data);\n $page->add(\"admin/product\", $data);\n\n return $page->render([\n \"title\" => $title\n ]);\n }", "static public function delete(Product $product, ProductSupplier $detail){\n\t\t// Code here...\n\t}", "function updateProductPart($data, $id)\n {\n }", "function delete($product_id) {\n \t\t$jinput = JFactory::getApplication()->input;\n \t\t$variationid = $jinput->get('variationid', '', 'int');\n \t\t$temp = array();\n\n \t\t$j = 0;\n \t\tfor ($i=0;$i<$this->cart[\"idx\"];$i++) {\n\n \t\t\tif (isset($this->cart[$i]['product_id']) && $this->cart[$i]['product_id'] != $product_id){\n \t\t\t\tif(isset($this->cart[$i]['variationid']) && $this->cart[$i]['variationid'] != $variationid){\n \t\t\t\t\t$temp[$j++] = $this->cart[$i];\n \t\t\t\t}elseif(!isset($this->cart[$i]['variationid']) || !$variationid){\n \t\t\t\t\t$temp[$j++] = $this->cart[$i];\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t$temp[\"idx\"] = $j;\n \t\t$this->cart = $temp;\n \t\t$this->buildOrder(1,1);\n \t\treturn True;\n \t}", "protected function afterDelete()\n {\n db()->createCommand()->delete('{{product_related}}', '`product_id`=' . $this->id);\n parent::afterDelete();\n }", "public function forceDeleted(Product $product)\n {\n\n }", "public function actionDelete() {\r\n $this->checkIfCartExists();\r\n $params = $this->getParams();\r\n if (!array_key_exists('product_id', $params)) {\r\n throw new NotFoundHttpException(Yii::t('app', 'Unable to find \"product_id\" param in request.'));\r\n }\r\n $cp = $this->getUser()->getCartsProducts()->where(['products_id' => $params['product_id']])->one();\r\n\r\n if (!isset($cp))\r\n throw new NotFoundHttpException(Yii::t('app', 'Unable to find product with product_id: {id}.', ['id' => $params['product_id']]));\r\n\r\n if ($cp->delete() === false) {\r\n throw new ServerErrorHttpException('Failed to delete the object for unknown reason.');\r\n }\r\n\r\n Yii::$app->getResponse()->setStatusCode(204);\r\n }", "public function remove(Product $product);", "public function hookActionProductDelete($params)\n {\n\n $sets = $this->getSets($params['id_product']);\n\n foreach ($sets as $set) {\n Ajaxzoom::deleteSet($set['id_360set']);\n }\n\n $id_product = (int)$params['id_product'];\n\n Ajaxzoom::clearProductImagesAXCache($params['id_product']);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomproducts`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomproductsimages`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomvideo`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomimagehotspots`\n WHERE id_product = '.$id_product);\n }", "public function _deleteAction(int $id, $page = 1)\n {\n $item = $this->productRepository->getItemUpdateDetail($id);\n if (!$item) {\n $this->flash->error(\"Không tìm thấy dữ liệu\");\n return $this->dispatcher->forward(array('action' => 'index'));\n }\n\n $subFolder = $this->_get_subdomainFolder();\n $photo = $item->photo;\n $photoSecondary = $item->photo_secondary;\n $folder = $item->folder;\n $general = new General();\n\n if (!$item->delete()) {\n $this->flashSession->error($item->getMessages());\n } else {\n // delete elastic search id id\n // $this->elastic_service->deleteProduct($id);\n\n TmpProductCategory::deleteByRawSql('product_id ='. $id .'');\n TmpProductProductElementDetail::deleteByRawSql('product_id ='. $id .'');\n TmpProductFormItem::deleteByRawSql('product_id ='. $id .'');\n \n // delete folder thumb\n $this->general->deleteDirectory(\"files/product/\" . $subFolder . \"/\" . $folder . \"/thumb/\" . $photo);\n $this->general->deleteDirectory(\"files/product/\" . $subFolder . \"/\" . $folder . \"/thumb/\" . $photoSecondary);\n\n @unlink(\"files/product/\" . $subFolder . \"/\" . $folder . \"/\" . $photo);\n @unlink(\"files/product/\" . $subFolder . \"/thumb/360x360/\" . $folder . '/' . $photo);\n @unlink(\"files/product/\" . $subFolder . \"/thumb/260x260/\" . $folder . '/' . $photo);\n @unlink(\"files/product/\" . $subFolder . \"/thumb/120x120/\" . $folder . '/' . $photo);\n @unlink(\"files/product/\" . $subFolder . \"/\" . $folder . \"/\" . $photoSecondary);\n\n $productContents = ProductContent::findByProductId($id);\n if (count($productContents) > 0) {\n foreach ($productContents as $productContent) {\n $productContent->delete();\n }\n }\n\n $product_photos = ProductPhoto::findByProductId($id);\n if (count($product_photos) > 0) {\n foreach ($product_photos as $product_photo) {\n if ($product_photo->delete()) {\n @unlink(\"files/product/\" . $subFolder . \"/\" . $folder . \"/\" . $product_photo->photo);\n @unlink(\"files/product/\" . $subFolder . \"/thumb/360x360/\" . $folder . '/' . $product_photo->photo);\n @unlink(\"files/product/\" . $subFolder . \"/thumb/260x260/\" . $folder . '/' . $product_photo->photo);\n @unlink(\"files/product/\" . $subFolder . \"/thumb/120x120/\" . $folder . '/' . $product_photo->photo);\n } else {\n $messages = $product_photo->getMessages();\n\n foreach ($messages as $message) {\n echo $message, \"\\n\";\n }\n }\n }\n }\n\n $tmpProductElementDetailCombos = TmpProductProductElementDetail::findByProductId($id);\n if (count($tmpProductElementDetailCombos) > 0) {\n foreach ($tmpProductElementDetailCombos as $tmpProductElementDetailCombo) {\n if ($tmpProductElementDetailCombo->delete()) {\n if ($tmpProductElementDetailCombo->combo_id != ''){\n @unlink(\"files/product/\" . $subFolder . \"/\" . $folder . \"/\" . $tmpProductElementDetailCombo->photo);\n }\n } else {\n $messages = $tmpProductElementDetailCombo->getMessages();\n\n foreach ($messages as $message) {\n echo $message, \"\\n\";\n }\n }\n }\n }\n\n if (is_dir(\"uploads/\" . $this->_get_subdomainFolder() . \"/product/\" . $item->row_id)) {\n $general->deleteDirectory(\"uploads/\" . $this->_get_subdomainFolder() . \"/product/\" . $item->row_id);\n }\n\n $dependProducts = $this->productRepository->findByPropertyName('DependId', $id);\n if (count($dependProducts) > 0) {\n foreach ($dependProducts as $dependProduct) {\n if ($dependProduct->delete()) {\n // delete elastic search id id\n // $this->elastic_service->deleteProduct($dependProduct->id);\n\n TmpProductCategory::deleteByRawSql('product_id ='. $dependProduct->id .'');\n TmpProductProductElementDetail::deleteByRawSql('product_id ='. $dependProduct->id .'');\n TmpProductFormItem::deleteByRawSql('product_id ='. $dependProduct->id .'');\n\n $productContents = ProductContent::findByProductId($dependProduct->id);\n if (count($productContents) > 0) {\n foreach ($productContents as $productContent) {\n $productContent->delete();\n }\n }\n\n $product_photos = ProductPhoto::findByProductId($dependProduct->id);\n\n if (count($product_photos) > 0) {\n foreach ($product_photos as $product_photo) {\n if ($product_photo->delete()) {\n } else {\n $messages = $product_photo->getMessages();\n\n foreach ($messages as $message) {\n echo $message, \"\\n\";\n }\n }\n }\n }\n\n if (is_dir(\"uploads/\" . $this->_get_subdomainFolder() . \"/product/\" . $dependProduct->row_id)) {\n $general->deleteDirectory(\"uploads/\" . $this->_get_subdomainFolder() . \"/product/\" . $dependProduct->row_id);\n }\n }\n }\n }\n\n \n $this->flashSession->success($this->_message[\"delete\"]);\n }\n\n $url = ($page > 1) ? ACP_NAME . '/' . $this->_getControllerName() . '?page=' . $page : ACP_NAME . '/' . $this->_getControllerName();\n $this->response->redirect($url);\n }", "public function delete($pid)\n {\n //delete in sale items\n if($this->saleItemModel->delete($pid))\n {\n return true;\n }\n else {\n return 'Fail in delete the product';\n }\n }", "public function deleteProduct(Varien_Event_Observer $observer)\n {\n try{\n $product = $observer->getEvent()->getProduct();\n $response = Mage::getModel('sailthruemail/client_content')->deleteProduct($product);\n } catch (Sailthru_Client_Exception $e) {\n Mage::logException($e);\n }\n }" ]
[ "0.6637312", "0.6513286", "0.64892757", "0.6361099", "0.63530713", "0.6342366", "0.63202846", "0.6314489", "0.63136375", "0.6313512", "0.63038576", "0.6292826", "0.6285919", "0.6269659", "0.62076354", "0.6197536", "0.61604774", "0.6155678", "0.6147361", "0.6144671", "0.61270493", "0.61005104", "0.61000043", "0.6088493", "0.60678786", "0.6062781", "0.60237414", "0.6022929", "0.6012196", "0.60082155" ]
0.82279295
0
TODO: Implement productPartRules() method.
function productPartRules() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createProductPart($data)\n {\n }", "public static function getCatalogPriceRules($product)\n {\n // Used as first argument of the logEvent function.\n $codeLocation = 'helpers/pricerule.php';\n\n // Gets current date and time (UTC).\n $now = JFactory::getDate()->toSql();\n\n // Gets the user data.\n $user = JFactory::getUser();\n // Gets user group ids to which the user belongs to. \n $groups = JAccess::getGroupsByUser($user->id);\n $INcustGroups = implode(',', $groups);\n\n // The translated fields of a price rule.\n $translatedFields = 'pr.name,pr.description,';\n $leftJoinTranslation = '';\n\n // Checks if a translation is needed.\n if(ShopHelper::switchLanguage()) {\n // Gets the SQL query parts needed for the translation of the price rules.\n $pruleTranslation = ShopHelper::getTranslation('price_rule', 'id', 'pr', 'pr');\n // Translation fields are now defined by the SQL conditions.\n $translatedFields = $pruleTranslation->translated_fields.',';\n // Build the left join SQL clause.\n //$leftJoinTranslation = 'LEFT OUTER JOIN '.$pruleTranslation->left_join;\n $leftJoinTranslation = $pruleTranslation->left_join;\n }\n\n // Checks for possible coupon price rule.\n $couponQuery = self::setCouponQuery();\n\n // Gets all the rules concerning the product (or its group/category) and the\n // current user (or the group he's in).\n // The list of result is ordered to determine their level.\n // Only catalog rules are selected.\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n $query->select('pr.id, pr.type, pr.operation, pr.value, pr.behavior, pr.ordering, pr.show_rule,'. \n\t\t 'pr.target, pr.recipient, pr.ordering,'.$translatedFields.'pr.modifier, pr.application, prt.var_id')\n\t ->from('#__ketshop_price_rule AS pr')\n\t ->join('LEFT', '#__ketshop_prule_recipient AS prr ON (pr.recipient=\"customer\" '.\n\t\t\t 'AND prr.item_id='.$user->id.') OR (pr.recipient=\"customer_group\" '.\n\t\t\t 'AND prr.item_id IN ('.$INcustGroups.')) ')\n\t ->join('LEFT', '#__ketshop_prule_target AS prt ON ((pr.target=\"product\" OR pr.target=\"bundle\") '.\n\t\t\t 'AND prt.item_id='.(int)$product['id'].') '.\n\t\t\t 'OR (pr.target=\"product_cat\" AND prt.item_id='.(int)$product['catid'].')')\n\t ->join('LEFT', '#__ketshop_coupon AS cp ON cp.prule_id=pr.id');\n\n // Checks for translation.\n if(!empty($leftJoinTranslation)) {\n $query->join('LEFT', $leftJoinTranslation);\n }\n\n $query->where('pr.id = prt.prule_id AND pr.id = prr.prule_id AND pr.published = 1 AND pr.type = \"catalog\"')\n\t ->where($couponQuery)\n\t // Checks against publication dates (start and stop).\n\t ->where('('.$db->quote($now).' < pr.publish_down OR pr.publish_down = \"0000-00-00 00:00:00\")')\n\t ->where('('.$db->quote($now).' > pr.publish_up OR pr.publish_up = \"0000-00-00 00:00:00\")')\n\t ->order('ordering');\n $db->setQuery($query);\n $catalogPriceRules = $db->loadAssocList();\n\n // Checks for errors.\n if($db->getErrorNum()) {\n ShopHelper::logEvent($codeLocation, 'sql_error', 1, $db->getErrorNum(), $db->getErrorMsg());\n return false;\n }\n\n // Restructures the price rule array in case of several product variant are linked to\n // the same price rule.\n foreach($catalogPriceRules as $key => $catalogPriceRule) {\n // Adds a var_ids attribute to the price rule.\n $catalogPriceRules[$key]['var_ids'] = array();\n\n // The current price rule is a duplicate of the previous one. It means that several\n // product variants are linked to this price rule.\n if($key != 0 && $catalogPriceRule['id'] == $catalogPriceRules[$key - 1]['id']) {\n\t// Stores the product variant id in the previous price rule.\n\t$catalogPriceRules[$key - 1]['var_ids'][] = $catalogPriceRule['var_id'];\n\t// Delete the current price rule as it's a duplicate.\n\tunset($catalogPriceRules[$key]);\n }\n else {\n\t// Stores the product variant id in the price rule.\n\t$catalogPriceRules[$key]['var_ids'][] = $catalogPriceRule['var_id'];\n\t// Removes the var_id attribute from the price rule as it's useless now.\n\tunset($catalogPriceRules[$key]['var_id']);\n }\n }\n\n // Checks for a possible exclusive rule. \n $delete = false;\n\n foreach($catalogPriceRules as $key => $catalogPriceRule) {\n // An exclusive rule has been found. \n if($delete) {\n\t// Deletes the rest of the price rule array.\n\tunset($catalogPriceRules[$key]);\n\tcontinue;\n }\n\n // In case of exclusive rule, the rest of the price rule array has to be deleted.\n if($catalogPriceRule['behavior'] == 'XOR') {\n\t$delete = true;\n }\n }\n\n return $catalogPriceRules;\n }", "protected function addProductRestrictions()\n {\n $success = array();\n Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'cart_rule_product_rule_group` (`id_cart_rule`, `quantity`)\n VALUES (' . (int) $this->id . ', 1)');\n $id_product_rule_group = Db::getInstance()->Insert_ID();\n if ($id_product_rule_group) {\n Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'cart_rule_product_rule` (`id_product_rule_group`, `type`)\n VALUES (' . (int) $id_product_rule_group . ', \"products\")');\n $id_product_rule = Db::getInstance()->Insert_ID();\n if ($id_product_rule) {\n $values = array('(' . (int) $id_product_rule . ',' . (int) $this->product->id . ')');\n $success[] = Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'cart_rule_product_rule_value` (`id_product_rule`, `id_item`) VALUES ' . implode(',', $values));\n if ($this->multi_adding == 1) {\n /* Add discount for other main product have the same this accessory*/\n $id_products = $this->getIdProductsHaveSameAccessory();\n if (!empty($id_products)) {\n $multi_adding_values = array();\n foreach ($id_products as $id_product) {\n $multi_adding_values[] = '(' . (int) $id_product_rule . ',' . (int) $id_product['id_product'] . ')';\n }\n if (!empty($multi_adding_values)) {\n $success[] = Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'cart_rule_product_rule_value` (`id_product_rule`, `id_item`) VALUES ' . implode(',', $multi_adding_values));\n }\n }\n }\n }\n }\n return array_sum($success) >= count($success);\n }", "public function run($part)\n {\n $item = new BaseItem($this->store,$part);\n if (!$item->isExistInEwiz()){\n Log::info('can not get item on company.com,so can not be added');\n return false;\n }\n $data = $item->getEwiz();\n $data['preview_pic'] = ItemImage::create()->getPreviewImg($part, '_LG', true);\n $data['price'] = $item->ebayPrice->getPrice();\n $data['ship_cost'] = $item->ebayPrice->getShipCost();\n if (!$this->checkRule($data)){\n Log::info('the item fit the add rules,so can not be added');\n return false;\n }\n return $item->addItem();\n }", "function ecse_get_the_product_list() {\n\treturn ECSE_mail::get_product_rows_part();\n}", "public function rules()\n {\n $this->setModel(Product::class);\n $rules = parent::rules();\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|max:191',\n 'price' => 'required',\n 'categories' => 'required'\n ]);\n\n }\n\n if ($this->isStore()) {\n\n $rules = $this->downloadableStoreRules($rules);\n $rules = array_merge($rules, [\n 'slug' => 'max:191|unique:ecommerce_products,slug'\n ]);\n $rules = array_merge($rules, []);\n }\n\n if ($this->isUpdate()) {\n $product = $this->route('product');\n\n $rules = $this->downloadableUpdateRules($rules, $product);\n\n $rules = array_merge($rules, [\n 'slug' => 'max:191|unique:ecommerce_products,slug,' . $product->id,\n ]);\n $rules = array_merge($rules, []);\n }\n\n\n\n return $rules;\n }", "public function applyOffer(Product $product) {\n }", "static function get_product_rows_part() {\n\t\t\n\t\tob_start();\n\t\t\n\t\twhile(ECSE_purchase::have_products()) { ECSE_purchase::the_product();\n\t\t\tget_template_part('wpsc','email_content_part-product_row'); //the theme file\n\t\t}\n\t\t\n\t\treturn ob_get_clean();\n\t}", "public function ajaxProcessAddProductOnSupplierPieces() {\n\n // Load object\n $order = new SupplierPieces((int) Tools::getValue('id_order'));\n\n if (!Validate::isLoadedObject($order)) {\n $this->ajaxDie(\n json_encode(\n [\n 'result' => false,\n 'error' => Tools::displayError('The order object cannot be loaded.'),\n ]\n )\n );\n }\n\n $oldCartRules = $this->context->cart->getCartRules();\n\n if ($order->hasBeenShipped()) {\n $this->ajaxDie(\n json_encode(\n [\n 'result' => false,\n 'error' => Tools::displayError('You cannot add products to delivered orders. '),\n ]\n )\n );\n }\n\n $productInformations = $_POST['add_product'];\n\n if (isset($_POST['add_invoice'])) {\n $invoiceInformations = $_POST['add_invoice'];\n } else {\n $invoiceInformations = [];\n }\n\n $product = new Product($productInformations['product_id'], false, $order->id_lang);\n\n if (!Validate::isLoadedObject($product)) {\n $this->ajaxDie(\n json_encode(\n [\n 'result' => false,\n 'error' => Tools::displayError('The product object cannot be loaded.'),\n ]\n )\n );\n }\n\n if (isset($productInformations['product_attribute_id']) && $productInformations['product_attribute_id']) {\n $combination = new Combination($productInformations['product_attribute_id']);\n\n if (!Validate::isLoadedObject($combination)) {\n $this->ajaxDie(\n json_encode(\n [\n 'result' => false,\n 'error' => Tools::displayError('The combination object cannot be loaded.'),\n ]\n )\n );\n }\n\n }\n\n // Total method\n $totalMethod = Cart::BOTH_WITHOUT_SHIPPING;\n\n // Create new cart\n $cart = new Cart();\n $cart->id_shop_group = $order->id_shop_group;\n $cart->id_shop = $order->id_shop;\n $cart->id_customer = $order->id_customer;\n $cart->id_carrier = $order->id_carrier;\n $cart->id_address_delivery = $order->id_address_delivery;\n $cart->id_address_invoice = $order->id_address_invoice;\n $cart->id_currency = $order->id_currency;\n $cart->id_lang = $order->id_lang;\n $cart->secure_key = $order->secure_key;\n\n // Save new cart\n $cart->add();\n\n // Save context (in order to apply cart rule)\n $this->context->cart = $cart;\n $this->context->customer = new Customer($order->id_customer);\n\n // always add taxes even if there are not displayed to the customer\n $useTaxes = true;\n\n $initialProductPriceTaxIncl = Product::getPriceStatic(\n $product->id,\n $useTaxes,\n isset($combination) ? $combination->id : null,\n 2,\n null,\n false,\n true,\n 1,\n false,\n $order->id_customer,\n $cart->id,\n $order->{Configuration::get('EPH_TAX_ADDRESS_TYPE', null, null, $order->id_shop)}\n );\n\n // Creating specific price if needed\n\n if ($productInformations['product_price_tax_incl'] != $initialProductPriceTaxIncl) {\n $specificPrice = new SpecificPrice();\n $specificPrice->id_shop = 0;\n $specificPrice->id_shop_group = 0;\n $specificPrice->id_currency = 0;\n $specificPrice->id_country = 0;\n $specificPrice->id_group = 0;\n $specificPrice->id_customer = $order->id_customer;\n $specificPrice->id_product = $product->id;\n\n if (isset($combination)) {\n $specificPrice->id_product_attribute = $combination->id;\n } else {\n $specificPrice->id_product_attribute = 0;\n }\n\n $specificPrice->price = $productInformations['product_price_tax_excl'];\n $specificPrice->from_quantity = 1;\n $specificPrice->reduction = 0;\n $specificPrice->reduction_type = 'amount';\n $specificPrice->reduction_tax = 0;\n $specificPrice->from = '0000-00-00 00:00:00';\n $specificPrice->to = '0000-00-00 00:00:00';\n $specificPrice->add();\n }\n\n // Add product to cart\n $updateQuantity = $cart->updateQty(\n $productInformations['product_quantity'],\n $product->id,\n isset($productInformations['product_attribute_id']) ? $productInformations['product_attribute_id'] : null,\n isset($combination) ? $combination->id : null,\n 'up',\n 0,\n new Shop($cart->id_shop)\n );\n\n if ($updateQuantity < 0) {\n // If product has attribute, minimal quantity is set with minimal quantity of attribute\n $minimalQuantity = ($productInformations['product_attribute_id']) ? Attributes::getAttributeMinimalQty($productInformations['product_attribute_id']) : $product->minimal_quantity;\n $this->ajaxDie(json_encode(['error' => sprintf(Tools::displayError('You must add %d minimum quantity', false), $minimalQuantity)]));\n } else\n\n if (!$updateQuantity) {\n $this->ajaxDie(json_encode(['error' => Tools::displayError('You already have the maximum quantity available for this product.', false)]));\n }\n\n // If order is valid, we can create a new invoice or edit an existing invoice\n\n if ($order->hasInvoice()) {\n $orderInvoice = new SupplierPiecesInvoice($productInformations['invoice']);\n // Create new invoice\n\n if ($orderInvoice->id == 0) {\n // If we create a new invoice, we calculate shipping cost\n $totalMethod = Cart::BOTH;\n // Create Cart rule in order to make free shipping\n\n if (isset($invoiceInformations['free_shipping']) && $invoiceInformations['free_shipping']) {\n $cartRule = new CartRule();\n $cartRule->id_customer = $order->id_customer;\n $cartRule->name = [\n Configuration::get('EPH_LANG_DEFAULT') => $this->la('[Generated] CartRule for Free Shipping'),\n ];\n $cartRule->date_from = date('Y-m-d H:i:s', time());\n $cartRule->date_to = date('Y-m-d H:i:s', time() + 24 * 3600);\n $cartRule->quantity = 1;\n $cartRule->quantity_per_user = 1;\n $cartRule->minimum_amount_currency = $order->id_currency;\n $cartRule->reduction_currency = $order->id_currency;\n $cartRule->free_shipping = true;\n $cartRule->active = 1;\n $cartRule->add();\n\n // Add cart rule to cart and in order\n $cart->addCartRule($cartRule->id);\n $values = [\n 'tax_incl' => $cartRule->getContextualValue(true),\n 'tax_excl' => $cartRule->getContextualValue(false),\n ];\n $order->addCartRule($cartRule->id, $cartRule->name[Configuration::get('EPH_LANG_DEFAULT')], $values);\n }\n\n $orderInvoice->id_order = $order->id;\n\n if ($orderInvoice->number) {\n Configuration::updateValue('EPH_INVOICE_START_NUMBER', false, false, null, $order->id_shop);\n } else {\n $orderInvoice->number = SupplierPieces::getLastInvoiceNumber() + 1;\n }\n\n $invoiceAddress = new Address((int) $order->{Configuration::get('EPH_TAX_ADDRESS_TYPE', null, null, $order->id_shop)});\n $carrier = new Carrier((int) $order->id_carrier);\n $taxCalculator = $carrier->getTaxCalculator($invoiceAddress);\n\n $orderInvoice->total_paid_tax_excl = Tools::ps_round((float) $cart->getSupplierPiecesTotal(false, $totalMethod), 2);\n $orderInvoice->total_paid_tax_incl = Tools::ps_round((float) $cart->getSupplierPiecesTotal($useTaxes, $totalMethod), 2);\n $orderInvoice->total_products = (float) $cart->getSupplierPiecesTotal(false, Cart::ONLY_PRODUCTS);\n $orderInvoice->total_products_wt = (float) $cart->getSupplierPiecesTotal($useTaxes, Cart::ONLY_PRODUCTS);\n $orderInvoice->total_shipping_tax_excl = (float) $cart->getTotalShippingCost(null, false);\n $orderInvoice->total_shipping_tax_incl = (float) $cart->getTotalShippingCost();\n\n $orderInvoice->total_wrapping_tax_excl = abs($cart->getSupplierPiecesTotal(false, Cart::ONLY_WRAPPING));\n $orderInvoice->total_wrapping_tax_incl = abs($cart->getSupplierPiecesTotal($useTaxes, Cart::ONLY_WRAPPING));\n $orderInvoice->shipping_tax_computation_method = (int) $taxCalculator->computation_method;\n\n // Update current order field, only shipping because other field is updated later\n $order->total_shipping += $orderInvoice->total_shipping_tax_incl;\n $order->total_shipping_tax_excl += $orderInvoice->total_shipping_tax_excl;\n $order->total_shipping_tax_incl += ($useTaxes) ? $orderInvoice->total_shipping_tax_incl : $orderInvoice->total_shipping_tax_excl;\n\n $order->total_wrapping += abs($cart->getSupplierPiecesTotal($useTaxes, Cart::ONLY_WRAPPING));\n $order->total_wrapping_tax_excl += abs($cart->getSupplierPiecesTotal(false, Cart::ONLY_WRAPPING));\n $order->total_wrapping_tax_incl += abs($cart->getSupplierPiecesTotal($useTaxes, Cart::ONLY_WRAPPING));\n $orderInvoice->add();\n\n $orderInvoice->saveCarrierTaxCalculator($taxCalculator->getTaxesAmount($orderInvoice->total_shipping_tax_excl));\n\n $orderCarrier = new SupplierPiecesCarrier();\n $orderCarrier->id_order = (int) $order->id;\n $orderCarrier->id_carrier = (int) $order->id_carrier;\n $orderCarrier->id_order_invoice = (int) $orderInvoice->id;\n $orderCarrier->weight = (float) $cart->getTotalWeight();\n $orderCarrier->shipping_cost_tax_excl = (float) $orderInvoice->total_shipping_tax_excl;\n $orderCarrier->shipping_cost_tax_incl = ($useTaxes) ? (float) $orderInvoice->total_shipping_tax_incl : (float) $orderInvoice->total_shipping_tax_excl;\n $orderCarrier->add();\n }\n\n // Update current invoice\n else {\n $orderInvoice->total_paid_tax_excl += Tools::ps_round((float) ($cart->getSupplierPiecesTotal(false, $totalMethod)), 2);\n $orderInvoice->total_paid_tax_incl += Tools::ps_round((float) ($cart->getSupplierPiecesTotal($useTaxes, $totalMethod)), 2);\n $orderInvoice->total_products += (float) $cart->getSupplierPiecesTotal(false, Cart::ONLY_PRODUCTS);\n $orderInvoice->total_products_wt += (float) $cart->getSupplierPiecesTotal($useTaxes, Cart::ONLY_PRODUCTS);\n $orderInvoice->update();\n }\n\n }\n\n // Create SupplierPieces detail information\n $orderDetail = new SupplierPiecesDetail();\n $orderDetail->createList($order, $cart, $order->getCurrentSupplierPiecesState(), $cart->getProducts(), (isset($orderInvoice) ? $orderInvoice->id : 0), $useTaxes, (int) Tools::getValue('add_product_warehouse'));\n\n // update totals amount of order\n $order->total_products += (float) $cart->getSupplierPiecesTotal(false, Cart::ONLY_PRODUCTS);\n $order->total_products_wt += (float) $cart->getSupplierPiecesTotal($useTaxes, Cart::ONLY_PRODUCTS);\n\n $order->total_paid += Tools::ps_round((float) ($cart->getSupplierPiecesTotal(true, $totalMethod)), 2);\n $order->total_paid_tax_excl += Tools::ps_round((float) ($cart->getSupplierPiecesTotal(false, $totalMethod)), 2);\n $order->total_paid_tax_incl += Tools::ps_round((float) ($cart->getSupplierPiecesTotal($useTaxes, $totalMethod)), 2);\n\n if (isset($orderInvoice) && Validate::isLoadedObject($orderInvoice)) {\n $order->total_shipping = $orderInvoice->total_shipping_tax_incl;\n $order->total_shipping_tax_incl = $orderInvoice->total_shipping_tax_incl;\n $order->total_shipping_tax_excl = $orderInvoice->total_shipping_tax_excl;\n }\n\n StockAvailable::updateQuantity($orderDetail->product_id, $orderDetail->product_attribute_id, ($orderDetail->product_quantity * -1), $order->id_shop);\n\n // discount\n $order->total_discounts += (float) abs($cart->getSupplierPiecesTotal(true, Cart::ONLY_DISCOUNTS));\n $order->total_discounts_tax_excl += (float) abs($cart->getSupplierPiecesTotal(false, Cart::ONLY_DISCOUNTS));\n $order->total_discounts_tax_incl += (float) abs($cart->getSupplierPiecesTotal(true, Cart::ONLY_DISCOUNTS));\n\n // Save changes of order\n $order->update();\n\n // Update weight SUM\n $orderCarrier = new SupplierPiecesCarrier((int) $order->getIdSupplierPiecesCarrier());\n\n if (Validate::isLoadedObject($orderCarrier)) {\n $orderCarrier->weight = (float) $order->getTotalWeight();\n\n if ($orderCarrier->update()) {\n $order->weight = sprintf(\"%.3f \" . Configuration::get('EPH_WEIGHT_UNIT'), $orderCarrier->weight);\n }\n\n }\n\n // Update Tax lines\n $orderDetail->updateTaxAmount($order);\n\n // Delete specific price if exists\n\n if (isset($specificPrice)) {\n $specificPrice->delete();\n }\n\n $products = $this->getProducts($order);\n\n // Get the last product\n $product = end($products);\n $product['current_stock'] = StockAvailable::getQuantityAvailableByProduct($product['product_id'], $product['product_attribute_id'], $product['id_shop']);\n $resume = SupplierPiecesSlip::getProductSlipResume((int) $product['id_order_detail']);\n $product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity'];\n $product['amount_refundable'] = $product['total_price_tax_excl'] - $resume['amount_tax_excl'];\n $product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl']);\n $product['return_history'] = SupplierPiecesReturn::getProductReturnDetail((int) $product['id_order_detail']);\n $product['refund_history'] = SupplierPiecesSlip::getProductSlipDetail((int) $product['id_order_detail']);\n\n if ($product['id_warehouse'] != 0) {\n $warehouse = new Warehouse((int) $product['id_warehouse']);\n $product['warehouse_name'] = $warehouse->name;\n $warehouseLocation = WarehouseProductLocation::getProductLocation($product['product_id'], $product['product_attribute_id'], $product['id_warehouse']);\n\n if (!empty($warehouseLocation)) {\n $product['warehouse_location'] = $warehouseLocation;\n } else {\n $product['warehouse_location'] = false;\n }\n\n } else {\n $product['warehouse_name'] = '--';\n $product['warehouse_location'] = false;\n }\n\n // Get invoices collection\n $invoiceCollection = $order->getInvoicesCollection();\n\n $invoiceArray = [];\n\n foreach ($invoiceCollection as $invoice) {\n /** @var SupplierPiecesInvoice $invoice */\n $invoice->name = $invoice->getInvoiceNumberFormatted($this->context->language->id, (int) $order->id_shop);\n $invoiceArray[] = $invoice;\n }\n\n // Assign to smarty informations in order to show the new product line\n $this->context->smarty->assign(\n [\n 'product' => $product,\n 'order' => $order,\n 'currency' => new Currency($order->id_currency),\n 'can_edit' => $this->tabAccess['edit'],\n 'invoices_collection' => $invoiceCollection,\n 'current_id_lang' => $this->context->language->id,\n 'link' => $this->context->link,\n 'current_index' => static::$currentIndex,\n 'display_warehouse' => (int) Configuration::get('EPH_ADVANCED_STOCK_MANAGEMENT'),\n ]\n );\n\n $this->sendChangedNotification($order);\n $newCartRules = $this->context->cart->getCartRules();\n sort($oldCartRules);\n sort($newCartRules);\n $result = array_diff($newCartRules, $oldCartRules);\n $refresh = false;\n\n $res = true;\n\n foreach ($result as $cartRule) {\n $refresh = true;\n // Create SupplierPiecesCartRule\n $rule = new CartRule($cartRule['id_cart_rule']);\n $values = [\n 'tax_incl' => $rule->getContextualValue(true),\n 'tax_excl' => $rule->getContextualValue(false),\n ];\n $orderCartRule = new SupplierPiecesCartRule();\n $orderCartRule->id_order = $order->id;\n $orderCartRule->id_cart_rule = $cartRule['id_cart_rule'];\n $orderCartRule->id_order_invoice = $orderInvoice->id;\n $orderCartRule->name = $cartRule['name'];\n $orderCartRule->value = $values['tax_incl'];\n $orderCartRule->value_tax_excl = $values['tax_excl'];\n $res &= $orderCartRule->add();\n\n $order->total_discounts += $orderCartRule->value;\n $order->total_discounts_tax_incl += $orderCartRule->value;\n $order->total_discounts_tax_excl += $orderCartRule->value_tax_excl;\n $order->total_paid -= $orderCartRule->value;\n $order->total_paid_tax_incl -= $orderCartRule->value;\n $order->total_paid_tax_excl -= $orderCartRule->value_tax_excl;\n }\n\n // Update SupplierPieces\n $order->update();\n\n $this->ajaxDie(\n json_encode(\n [\n 'result' => true,\n 'view' => $this->createTemplate('_product_line.tpl')->fetch(),\n 'can_edit' => $this->tabAccess['add'],\n 'order' => $order,\n 'invoices' => $invoiceArray,\n 'documents_html' => $this->createTemplate('_documents.tpl')->fetch(),\n 'shipping_html' => $this->createTemplate('_shipping.tpl')->fetch(),\n 'discount_form_html' => $this->createTemplate('_discount_form.tpl')->fetch(),\n 'refresh' => $refresh,\n ]\n )\n );\n }", "public function __construct($mpMouserPartNumber=\"\", $mpDescription=\"\", $mpPrices=\"\", $mpAvailability=\"\", $mpDataSheetURL=\"\", $mpImagePath=\"./img/not_found.jpg\", $mpCategory=\"\", $mpLeadTime=\"\", $mpLifeCycleStatus=\"\", $mpManufacturer=\"\", $mpManufacturerPartNumber=\"\", $mpMin=\"\", $mpMult=\"\", $mpDetailURL=\"\", $mpReeling=\"\", $mpROHSStatus=\"\", $mpSuggestedReplacement=\"\", $mpMultiSimBlue=\"\", $mpSupplier=\"Mouser\")\n\t\t{\n\t\t\t//call parent construct (product)\n\t\t\tparent::__construct($mpMouserPartNumber, $mpDescription, $mpPrices, $mpManufacturer, $mpAvailability, $mpImagePath, $mpDataSheetURL, $mpSupplier);\n\t\t\t$this->mproductCategory = $mpCategory;\n\t\t\t$this->mproductLeadTime = $mpLeadTime;\n\t\t\t$this->mproductLifeCycleStatus = $mpLifeCycleStatus;\n\t\t\t$this->mproductManufacturerPartNumber = $mpManufacturerPartNumber;\n\t\t\t$this->mproductMin = $mpMin;\n\t\t\t$this->mproductMult = $mpMult;\n\t\t\t$this->mproductDetailURL = $mpDetailURL;\n\t\t\t$this->mproductReeling = $mpReeling;\n\t\t\t$this->mproductROHSStatus = $mpROHSStatus;\n\t\t\t$this->mproductSuggestedReplacement = $mpSuggestedReplacement;\n\t\t\t$this->mproductMultisimBlue = $mpMultiSimBlue;\n\t\t}", "public function ajaxProcessEditProductOnSupplierPieces() {\n\n // Return value\n $res = true;\n\n $order = new SupplierPieces((int) Tools::getValue('id_order'));\n $orderDetail = new SupplierPiecesDetail((int) Tools::getValue('product_id_order_detail'));\n\n if (Tools::isSubmit('product_invoice')) {\n $orderInvoice = new SupplierPiecesInvoice((int) Tools::getValue('product_invoice'));\n }\n\n // If multiple product_quantity, the order details concern a product customized\n $productQuantity = 0;\n\n if (is_array(Tools::getValue('product_quantity'))) {\n\n foreach (Tools::getValue('product_quantity') as $idCustomization => $qty) {\n // Update quantity of each customization\n Db::getInstance()->update('customization', ['quantity' => (int) $qty], 'id_customization = ' . (int) $idCustomization);\n // Calculate the real quantity of the product\n $productQuantity += $qty;\n }\n\n } else {\n $productQuantity = Tools::getValue('product_quantity');\n }\n\n $this->checkStockAvailable($orderDetail, ($productQuantity - $orderDetail->product_quantity));\n\n // Check fields validity\n $this->doEditProductValidation($orderDetail, $order, isset($orderInvoice) ? $orderInvoice : null);\n\n // If multiple product_quantity, the order details concern a product customized\n $productQuantity = 0;\n\n if (is_array(Tools::getValue('product_quantity'))) {\n\n foreach (Tools::getValue('product_quantity') as $idCustomization => $qty) {\n // Update quantity of each customization\n Db::getInstance()->update(\n 'customization',\n [\n 'quantity' => (int) $qty,\n ],\n 'id_customization = ' . (int) $idCustomization,\n 1\n );\n // Calculate the real quantity of the product\n $productQuantity += $qty;\n }\n\n } else {\n $productQuantity = Tools::getValue('product_quantity');\n }\n\n $productPriceTaxIncl = Tools::ps_round(Tools::getValue('product_price_tax_incl'), 2);\n $productPriceTaxExcl = Tools::ps_round(Tools::getValue('product_price_tax_excl'), 2);\n $totalProductsTaxIncl = $productPriceTaxIncl * $productQuantity;\n $totalProductsTaxExcl = $productPriceTaxExcl * $productQuantity;\n\n // Calculate differences of price (Before / After)\n $diffPriceTaxIncl = $totalProductsTaxIncl - $orderDetail->total_price_tax_incl;\n $diffPriceTaxExcl = $totalProductsTaxExcl - $orderDetail->total_price_tax_excl;\n\n // Apply change on SupplierPiecesInvoice\n\n if (isset($orderInvoice)) {\n // If SupplierPiecesInvoice to use is different, we update the old invoice and new invoice\n\n if ($orderDetail->id_order_invoice != $orderInvoice->id) {\n $oldSupplierPiecesInvoice = new SupplierPiecesInvoice($orderDetail->id_order_invoice);\n // We remove cost of products\n $oldSupplierPiecesInvoice->total_products -= $orderDetail->total_price_tax_excl;\n $oldSupplierPiecesInvoice->total_products_wt -= $orderDetail->total_price_tax_incl;\n\n $oldSupplierPiecesInvoice->total_paid_tax_excl -= $orderDetail->total_price_tax_excl;\n $oldSupplierPiecesInvoice->total_paid_tax_incl -= $orderDetail->total_price_tax_incl;\n\n $res &= $oldSupplierPiecesInvoice->update();\n\n $orderInvoice->total_products += $orderDetail->total_price_tax_excl;\n $orderInvoice->total_products_wt += $orderDetail->total_price_tax_incl;\n\n $orderInvoice->total_paid_tax_excl += $orderDetail->total_price_tax_excl;\n $orderInvoice->total_paid_tax_incl += $orderDetail->total_price_tax_incl;\n\n $orderDetail->id_order_invoice = $orderInvoice->id;\n }\n\n }\n\n if ($diffPriceTaxIncl != 0 && $diffPriceTaxExcl != 0) {\n $orderDetail->unit_price_tax_excl = $productPriceTaxExcl;\n $orderDetail->unit_price_tax_incl = $productPriceTaxIncl;\n\n $orderDetail->total_price_tax_incl += $diffPriceTaxIncl;\n $orderDetail->total_price_tax_excl += $diffPriceTaxExcl;\n\n if (isset($orderInvoice)) {\n // Apply changes on SupplierPiecesInvoice\n $orderInvoice->total_products += $diffPriceTaxExcl;\n $orderInvoice->total_products_wt += $diffPriceTaxIncl;\n\n $orderInvoice->total_paid_tax_excl += $diffPriceTaxExcl;\n $orderInvoice->total_paid_tax_incl += $diffPriceTaxIncl;\n }\n\n // Apply changes on SupplierPieces\n $order = new SupplierPieces($orderDetail->id_order);\n $order->total_products += $diffPriceTaxExcl;\n $order->total_products_wt += $diffPriceTaxIncl;\n\n $order->total_paid += $diffPriceTaxIncl;\n $order->total_paid_tax_excl += $diffPriceTaxExcl;\n $order->total_paid_tax_incl += $diffPriceTaxIncl;\n\n $res &= $order->update();\n }\n\n $oldQuantity = $orderDetail->product_quantity;\n\n $orderDetail->product_quantity = $productQuantity;\n $orderDetail->reduction_percent = 0;\n\n // update taxes\n $res &= $orderDetail->updateTaxAmount($order);\n\n // Save order detail\n $res &= $orderDetail->update();\n\n // Update weight SUM\n $orderCarrier = new SupplierPiecesCarrier((int) $order->getIdSupplierPiecesCarrier());\n\n if (Validate::isLoadedObject($orderCarrier)) {\n $orderCarrier->weight = (float) $order->getTotalWeight();\n $res &= $orderCarrier->update();\n\n if ($res) {\n $order->weight = sprintf(\"%.3f \" . Configuration::get('EPH_WEIGHT_UNIT'), $orderCarrier->weight);\n }\n\n }\n\n // Save order invoice\n\n if (isset($orderInvoice)) {\n $res &= $orderInvoice->update();\n }\n\n // Update product available quantity\n StockAvailable::updateQuantity($orderDetail->product_id, $orderDetail->product_attribute_id, ($oldQuantity - $orderDetail->product_quantity), $order->id_shop);\n\n $products = $this->getProducts($order);\n // Get the last product\n $product = $products[$orderDetail->id];\n $product['current_stock'] = StockAvailable::getQuantityAvailableByProduct($product['product_id'], $product['product_attribute_id'], $product['id_shop']);\n $resume = SupplierPiecesSlip::getProductSlipResume($orderDetail->id);\n $product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity'];\n $product['amount_refundable'] = $product['total_price_tax_excl'] - $resume['amount_tax_excl'];\n $product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl']);\n $product['refund_history'] = SupplierPiecesSlip::getProductSlipDetail($orderDetail->id);\n\n if ($product['id_warehouse'] != 0) {\n $warehouse = new Warehouse((int) $product['id_warehouse']);\n $product['warehouse_name'] = $warehouse->name;\n $warehouseLocation = WarehouseProductLocation::getProductLocation($product['product_id'], $product['product_attribute_id'], $product['id_warehouse']);\n\n if (!empty($warehouseLocation)) {\n $product['warehouse_location'] = $warehouseLocation;\n } else {\n $product['warehouse_location'] = false;\n }\n\n } else {\n $product['warehouse_name'] = '--';\n $product['warehouse_location'] = false;\n }\n\n // Get invoices collection\n $invoiceCollection = $order->getInvoicesCollection();\n\n $invoiceArray = [];\n\n foreach ($invoiceCollection as $invoice) {\n /** @var SupplierPiecesInvoice $invoice */\n $invoice->name = $invoice->getInvoiceNumberFormatted($this->context->language->id, (int) $order->id_shop);\n $invoiceArray[] = $invoice;\n }\n\n // Assign to smarty informations in order to show the new product line\n $this->context->smarty->assign(\n [\n 'product' => $product,\n 'order' => $order,\n 'currency' => new Currency($order->id_currency),\n 'can_edit' => $this->tabAccess['edit'],\n 'invoices_collection' => $invoiceCollection,\n 'current_id_lang' => $this->context->language->id,\n 'link' => $this->context->link,\n 'current_index' => static::$currentIndex,\n 'display_warehouse' => (int) Configuration::get('EPH_ADVANCED_STOCK_MANAGEMENT'),\n ]\n );\n\n if (!$res) {\n $this->ajaxDie(\n json_encode(\n [\n 'result' => $res,\n 'error' => Tools::displayError('An error occurred while editing the product line.'),\n ]\n )\n );\n }\n\n if (is_array(Tools::getValue('product_quantity'))) {\n $view = $this->createTemplate('_customized_data.tpl')->fetch();\n } else {\n $view = $this->createTemplate('_product_line.tpl')->fetch();\n }\n\n $this->sendChangedNotification($order);\n\n $this->ajaxDie(json_encode([\n 'result' => $res,\n 'view' => $view,\n 'can_edit' => $this->tabAccess['add'],\n 'invoices_collection' => $invoiceCollection,\n 'order' => $order,\n 'invoices' => $invoiceArray,\n 'documents_html' => $this->createTemplate('_documents.tpl')->fetch(),\n 'shipping_html' => $this->createTemplate('_shipping.tpl')->fetch(),\n 'customized_product' => is_array(Tools::getValue('product_quantity')),\n ]));\n }", "private function _prepareData() {\n $itemIds = array();\n\n // Check if feature is enabled\n if (!Mage::getStoreConfig(Ntoklo_Recommendations_Helper_Data::CONFIG_XPATH_IS_ENABLED)) {\n return $this;\n }\n\n $recommendedIds = Mage::getSingleton('ntoklo_recommendations/service')\n ->setDebug($this->getData('debug'))\n ->getRecommendedIds($this);\n if (!count($recommendedIds)) {\n return $this;\n }\n\n // Prepare product collection\n $limit = $this->getData('max_products');\n /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */\n $collection = Mage::getResourceModel('catalog/product_collection');\n $collection->addAttributeToSelect('*')\n ->addUrlRewrite()\n ->addAttributeToFilter('entity_id' ,array('in' => $recommendedIds))\n ->addStoreFilter()\n ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED)\n ->setPageSize($limit ? $limit : 6);\n\n //Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($collection);\n\n // Load parent product if possible if product is not visible individually\n /** @var $item Mage_Catalog_Model_Product */\n foreach ($collection->getItems() as $item) {\n if (!$item->isSaleable()) {\n continue;\n }\n if ($item->getVisibility() != Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE) {\n if (!in_array($item->getId(), $itemIds)) {\n $itemIds[] = $item->getId();\n $this->_items[] = $item;\n }\n } else {\n $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($item->getId());\n\n if (!isset($parentIds[0])) {\n $parentIds = Mage::getSingleton('bundle/product_type')->getParentIdsByChild($item->getId());\n }\n if (!isset($parentIds[0])) {\n $parentIds = Mage::getResourceSingleton('catalog/product_type_grouped')->getParentIdsByChild($item->getId());\n }\n\n if (isset($parentIds[0])) {\n $item = Mage::getModel('catalog/product')->load($parentIds[0]);\n if (!in_array($item->getId(), $itemIds)) {\n $itemIds[] = $item->getId();\n $this->_items[] = $item;\n }\n }\n }\n }\n\n return $this;\n }", "public function createProducts($categoryName = NULL, $parts = NULL)\n\t{\t\n\t\t$product = Product::getInstance();\n\t\t\n\t\tif( Arr::is_array($this->_groupDetails) && !empty($this->_groupDetails) )\n\t\t{\n\t\t\t$i = 0;\n\t\t\tforeach( $this->_groupDetails as $key => $item )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$group = mb_convert_encoding(strip_tags(pq($key)->find('td')->html()), 'UTF-8');\n\t\t\t\t$groupName = preg_replace('/[^а-яё ]+/ius', '', $group);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$result = array();\n\t\t\t\tforeach( $item as $index => $cell )\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif( count($cell) > 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$articleLink = pq($cell[1])->children('a')->attr('href');\n\t\t\t\t\t\tif( stripos($articleLink, 'catalog_part') !== false )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$articleField = pq($cell[1])->children('a');\n\t\t\t\t\t\t\t$article = trim($articleField->text());\n\t\t\t\t\t\t\t$name = pq($cell[2])->html();\n\t\t\t\t\t\t\t$manufacture = ( pq($cell[4])->children('img')->length() > 0 ? pq($cell[4])->children('img')->attr('title'):pq($cell[3])->children('img')->attr('title') );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$result = array(\n\t\t\t\t\t\t\t\t'name'\t=> trim($name),\n\t\t\t\t\t\t\t\t'article'\t=> $article,\n\t\t\t\t\t\t\t\t'clear_article' => preg_replace('/([^\\w]+)/', '', $article),\n\t\t\t\t\t\t\t\t'manufacture'\t=> trim($manufacture),\n\t\t\t\t\t\t\t\t'parentName'\t=> ( !is_null($parts ) ? $parts->get('name') : '' ),\n\t\t\t\t\t\t\t\t'parentId'\t=> ( !is_null($parts ) ? $parts->get('_id')->{'$id'} : '' ),\n\t\t\t\t\t\t\t\t'groupName'\t=> trim($groupName),\n\t\t\t\t\t\t\t\t'category'\t=> ( !is_null($categoryName) ? $categoryName : '' ),\n\t\t\t\t\t\t\t\t'link'\t=> $articleLink,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->_data[] = $result;\n\t\t\t\t\t\t\t$product->offsetSet($i, $result);\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function getProduct();", "protected function _afterSave()\r\n {\r\n if($this->getPromoRule()['product_ids']){\r\n $productIds = explode('&', $this->getPromoRule()['product_ids']);\r\n $website = Mage::getModel('core/website')->load($this->getWebsiteId());\r\n $storeIds = $website->getStoreIds();\r\n $storeId = 0;\r\n foreach($storeIds as $_storeId){\r\n $storeId = $_storeId;\r\n }\r\n $listSku = array();\r\n foreach($productIds as $_productId) {\r\n $_product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($_productId);\r\n if($_product->getId()){\r\n $listSku[] = $_product->getSku();\r\n $price = $_product->getPrice() * (float)(($this->defaultPercent - $this->getPercent())/$this->defaultPercent);\r\n $_product->setSpecialPrice($price);\r\n $_product->setSpecialFromDate(false);\r\n $_product->setSpecialFromDateIsFormated(true);\r\n //To stop Magento regenerating url-key for store, set following,\r\n $_product->setUrlKey(false);\r\n $_product->setRuleId($this->getRuleId());\r\n $_product->save();\r\n }\r\n }\r\n $this->insertSkuByRuleId($this->getRuleId(), $listSku);\r\n }\r\n return $this;\r\n }", "function getProduct();", "public function part ( $partid )\n{\n return $this->part_prm($partid,false);\n}", "public function calculateProduct();", "function getProductByPartNumber($partNumber) {\r\n if ($partNumber === null) {\r\n return null;\r\n }\r\n $queryString = \"SELECT S.ServiceProduct.ID, S.PartNumber, S.Name, S.Descriptions.LabelText FROM SalesProduct S WHERE S.PartNumber='{$partNumber}'\";\r\n $roqlResultSet = RNCPHP\\ROQL::query($queryString)->next();\r\n if ($product = $roqlResultSet->next()) {\r\n return $product;\r\n }\r\n }", "public static function ruleProductService()\n {\n return self::getService('inventorysuccess/service_lowStockNotification_ruleProductService');\n }", "public function getAvailableParts() {\n return @$this->attributes['available_parts'];\n }", "abstract protected function setParts();", "public function productfilter() {\n $dataProvider = Product::model()->allProducts(array(), 30, \"Educational Toys\");\n $all_products = Product::model()->returnProducts($dataProvider);\n $this->renderPartial(\"//educationToys/_product_list\", array('products' => $all_products,\n 'dataProvider' => $dataProvider,));\n }", "public function getParts();", "public function hasEnabledVariations(ProductInterface $product);", "abstract public function getAllParts();", "public function __construct() {\n $fieldset = Mage::getConfig()->getFieldset('catalog_product_dataflow', 'admin');\n foreach ($fieldset as $code => $node) {\n /* @var $node Mage_Core_Model_Config_Element */\n if ($node->is('inventory')) {\n foreach ($node->product_type->children() as $productType) {\n $productType = $productType->getName();\n $this->_inventoryFieldsProductTypes[$productType][] = $code;\n if ($node->is('use_config')) {\n $this->_inventoryFieldsProductTypes[$productType][] = 'use_config_' . $code;\n }\n }\n\n $this->_inventoryFields[] = $code;\n if ($node->is('use_config')) {\n $this->_inventoryFields[] = 'use_config_' . $code;\n }\n }\n if ($node->is('required')) {\n $this->_requiredFields[] = $code;\n }\n if ($node->is('ignore')) {\n $this->_ignoreFields[] = $code;\n }\n if ($node->is('img')) {\n $this->_imageFields[] = $code;\n }\n if ($node->is('to_number')) {\n $this->_toNumber[] = $code;\n }\n }\n\n $this->setVar('entity_type', 'catalog/product');\n if (!Mage::registry('Object_Cache_Product')) {\n $this->setProduct(Mage::getModel('catalog/product'));\n }\n\n if (!Mage::registry('Object_Cache_StockItem')) {\n $this->setStockItem(Mage::getModel('cataloginventory/stock_item'));\n }\n\n $this->__globalCatalogName = Mage::getStoreConfig('catalog/catagory/global_category_name');\n\n $area = array('global', 'frontend', 'adminhtml');\n foreach ($area as $ar) {\n $aa = Mage::getConfig()->getEventConfig($ar, 'catalog_product_save_after');\n if (isset($aa->observers)) {\n foreach ($aa->observers as $observers) {\n unset($observers->destroy_product_cache_objects, $observers->catalogsearch, $observers->googleoptimizer_observer, $observers->googlebase_observer);\n }\n }\n $aa = Mage::getConfig()->getEventConfig($ar, 'catalog_product_delete_after');\n if (isset($aa->observers)) {\n foreach ($aa->observers as $observers) {\n unset($observers->catalogsearch);\n }\n }\n }\n }", "public function subpart ( $partid )\n{\n return subpart_prm ( $partid, false );\n}", "public function syncPacksPriority()\n {\n $stamp = mktime(0, 0, 0);\n $bod = date(DATE_ATOM,$stamp);\n $url_addition = 'LOGPART?$select=PARTNAME&$filter=ITAI_INKATALOG eq \\'Y\\'&$expand=PARTPACK_SUBFORM';\n $response = $this->makeRequest('GET', $url_addition, [], true);\n // check response status\n if ($response['status']) {\n $data = json_decode($response['body_raw'], true);\n foreach($data['value'] as $item) {\n // if product exsits, update\n $args = array(\n 'post_type'\t\t=>\t'product',\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=>\t$item['PARTNAME']\n )\n )\n );\n $my_query = new \\WP_Query( $args );\n if ( $my_query->have_posts() ) {\n while ( $my_query->have_posts() ) {\n $my_query->the_post();\n $product_id = get_the_ID();\n }\n }else{\n $product_id = 0;\n }\n\n //if ($id = wc_get_product_id_by_sku($item['PARTNAME'])) {\n if(!$product_id == 0){\n update_post_meta($product_id, 'pri_packs', $item['PARTPACK_SUBFORM']);\n }\n }\n }\n }", "function verify_product() {\n //Validation Rules\n $this->form_validation->set_rules('title','Title','trim|required|min_length[4]|xss_clean');\n $this->form_validation->set_rules('description','Description','trim|required|xss_clean');\n $this->form_validation->set_rules('specifications','Specifications','trim|required|xss_clean');\n $this->form_validation->set_rules('price','Price','trim|required|xss_clean');\n $this->form_validation->set_rules('published','Publish','required');\n $this->form_validation->set_rules('category','Category','required');\n\n if (!$this->form_validation->run()) {\n return false ;\n } else {\n return true;\n }\n }" ]
[ "0.6023938", "0.55763644", "0.55501527", "0.55061185", "0.5498793", "0.5470961", "0.54324645", "0.5420485", "0.5344725", "0.532371", "0.5298575", "0.5262976", "0.5261773", "0.5232629", "0.51971316", "0.51729465", "0.5142837", "0.5135377", "0.511159", "0.5092171", "0.50915444", "0.50758284", "0.50739074", "0.5066069", "0.5029423", "0.5028795", "0.50261766", "0.5024548", "0.502055", "0.5011841" ]
0.8970002
0
TODO: Implement updateRules() method.
function updateRules() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function updateRules();", "abstract protected function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "public function rules();", "abstract public function getRules();", "public function registerRules(){\n\t\t\n\t}", "public function setUpdateRules()\n {\n $this->validationRules['nic'] = $this->validationRules['nic'] . ',' . $this->id;\n $this->validationRules['email'] = $this->validationRules['email'] . ',' . $this->id;\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "abstract public function storeRules();", "private function updateRulesArray() {\n $this->xacml['rules'] = array();\n\n if ($this->datastreamRule->isPopulated())\n $this->xacml['rules'][] = $this->datastreamRule->getRuleArray();\n\n if ($this->managementRule->isPopulated())\n $this->xacml['rules'][] = $this->managementRule->getRuleArray();\n\n if ($this->viewingRule->isPopulated())\n $this->xacml['rules'][] = $this->viewingRule->getRuleArray();\n\n $this->xacml['rules'][] = $this->permitEverythingRule->getRuleArray();\n }", "public function updateRules()\n\t{\n\t\t$rules = static::$rules;\n\t\tforeach ($rules as $field => $rule) {\n\t\t\t// replace :id with $model->id\n\t\t\t$rules[$field] = str_replace(':id', $this->getKey(), $rule);\n\t\t}\n\t\treturn $rules;\n\t}", "public function rules()\n {\n\n return ($this->uniqueIdentifier()) ? $this->updateRules() : $this->createRules();\n }", "public static function update_validation_rules()\n {\n }", "protected function addNewRules()\n {\n foreach($this->getRules() as $rule)\n {\n $this->extendValidator($rule);\n }\n }", "abstract protected function rules(): array;", "abstract protected function getRules() : array;", "abstract public function getRules(): array;", "public function getRules();", "public function getRules();", "public function getRules();", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract public function rules(): array;", "abstract public function rules(): array;", "private function initializeRules() {\n $this -> validateSerializedArray($this -> course['rules']) OR $this -> course['rules'] = $this -> sanitizeSerialized($this -> course['rules']);\n $this -> rules = unserialize($this -> course['rules']);\n }", "protected function getUpdateRules()\n\t{\n\t\treturn $this->updateRules;\n\t}", "protected function getRules()\n {\n $methods = get_class_methods($this->rules);\n $ruleMethods = [];\n\n foreach ($methods as $method)\n {\n if (substr($method, 0, 4) === 'rule')\n $ruleMethods[] = $method;\n }\n\n $this->ruleMethods = $ruleMethods;\n }" ]
[ "0.8421801", "0.7288822", "0.7269173", "0.7269173", "0.7269173", "0.7269173", "0.7203543", "0.71275526", "0.7065883", "0.706036", "0.7006159", "0.7006159", "0.69966245", "0.6818394", "0.6718046", "0.66940594", "0.66500086", "0.66364306", "0.6625779", "0.6618406", "0.6556435", "0.6532916", "0.6532916", "0.6532916", "0.65061724", "0.64341706", "0.64341706", "0.6427945", "0.642696", "0.6410468" ]
0.8385922
1
db_array() runs a database query and returns an array with the result usage: db_array() note: uses db_query()
function MY_dbArray($query) { $result = MY_dbQuery($query); $result_array = array(); while ($row = mysql_fetch_assoc($result)) { array_push($result_array, $row); } return $result_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dbArray($query, $parms = array()) {\n return \\App\\M\\Database::getArray($query, $parms);\n }", "function db_fetch_array ($sql) {\n\tglobal $db_err, $db_sql, $db_args;\n\t$db = db_get_conn ();\n\t$args = func_get_args ();\n\tarray_shift ($args);\n\t$args = db_args ($args);\n\t$sql = db_normalize_sql ($db, $sql);\n\t$db_sql = $sql;\n\t$db_args = $args;\n\n\ttry {\n\t\t$stmt = $db->prepare ($sql);\n\t\t$stmt->execute ($args);\n\t\treturn $stmt->fetchAll ();\n\t} catch (PDOException $e) {\n\t\t$db_err = $e->getMessage ();\n\t\treturn false;\n\t}\n}", "function db_fetch_array () {\n\ttry {\n\t\tlist ($stmt, $args) = Database::prepare (func_get_args ());\n\t\t$stmt->execute ($args);\n\t\treturn $stmt->fetchAll ();\n\t} catch (Exception $e) {\n\t\tDatabase::$error = $e->getMessage ();\n\t\treturn false;\n\t}\n}", "function db_fetch_array($db_query)\n {\n return mysqli_fetch_array($db_query, MYSQLI_ASSOC);\n }", "private function dbArray($query) \n\t{\n\t\t$result = @mysql_fetch_assoc($query);\n\t\tif ( ! $result) \n\t\t{\n\t\t\techo mysql_error();\n\t\t\treturn false;\n\t\t} \n\t\telse\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t}", "static function fetch_array($db,$sql){\n\t\t\n\t\t$result=$db->query($sql);\n\t\t$data=array();\n\t\twhile ($row=$db->fetch($result)){\n\t\t\t$data[]=$row;\n\t\t}\n\t\treturn $data;\n\t}", "function db_fetch_array($db_query) {\r\nreturn mysql_fetch_array($db_query, MYSQL_ASSOC);\r\n}", "function MY_dbSimpleArray($query)\n{\n $result = MY_dbQuery($query);\n $result_array = array();\n while ($row = mysql_fetch_row($result))\n {\n $result_array[$row[0]] = $row[1];\n }\n return $result_array;\n}", "function db_fetch_array($result) {\n\treturn mysqli_fetch_array ( $result );\n}", "function db_select($query) {\n $rows = array();\n $result = db_query( $query );\n\n if( $result === false ) {\n return false;\n }\n\n while( $row = $result -> fetchArray() ) {\n $rows[] = $row;\n }\n\n return $rows;\n}", "public function selectArray() {\r\n // Generate Query\r\n $this->selectArrayQuery();\r\n \r\n $this->result = mysql_query($this->query);\r\n // Update fetch-callback's argument\r\n $this->fetchArg1 = $this->result;\r\n// $this->debug();\r\n if ($this->returnPointer) {\r\n // Return link to resources\r\n return $this->result;\r\n } else {\r\n // Return only the first result\r\n return mysql_fetch_array($this->result);\r\n }\r\n }", "function db_fetch($db_result) {\n\t\twhile($value = mysql_fetch_assoc($db_result)) {\n\t\t\t$results[] = $value;\n\t\t}\n\t\treturn $results;\n\t}", "function sqlRequestArray($table, $array)\n{\n // //////////////////////////////////////////////////////////////////\n // Step #1:\n // Retrieve the data\n // //////////////////////////////////////////////////////////////////\n $returnValues = sqlRequest(\"select {$array} from {$table}\");\n\n // //////////////////////////////////////////////////////////////////\n // Step #2:\n // Send back the data we were looking for\n // //////////////////////////////////////////////////////////////////\n return $returnValues;\n}", "function db_get_array($sql, $primary_fld='')\r\n{\r\n\t$errstr = '';\r\n\t$result = @mysql_query($sql) OR ($errstr = mysql_error()) ;\r\n\t\r\n\tif($errstr != '') return $errstr;\r\n\t\r\n\t$return = array();\r\n\t\r\n\twhile($ret = mysql_fetch_array($result,MYSQL_ASSOC))\r\n\t{\r\n\t\t\r\n\t\tif( $primary_fld != '' )\t\t\r\n\t\t{\r\n\t\t\t$return[$ret[$primary_fld]] = $ret;\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$return[] = $ret;\r\n\t\t}\r\n\r\n\t}\r\n\t\r\n\treturn $return;\r\n}", "function fetchSqlArray($sqlQueryString)\n{\n //get sql result\n $sqlResult = mysql_query($sqlQueryString) or die(tdw_mysql_error($sqlQueryString));\n //Proccessing result\n $result = array();\n while ($row = mysql_fetch_assoc($sqlResult)) {\n $result[] = $row;\n }\n return $result;\n}", "function return_array($query) {\n $res=run_query($query);\n $ret=Array();\n while($row=mysqli_fetch_array($res)) {\n $ret[] = $row[0];\n };\n return $ret;\n}", "function getArraySQL($sql){\r\n $conexion = connectDB();\r\n mysqli_set_charset($conexion, \"utf8\");\r\n if(!$result = mysqli_query($conexion, $sql)) die();\r\n $rawdata = array();\r\n $i=0;\r\n while($row = mysqli_fetch_array($result))\r\n {\r\n $rawdata[$i] = $row;\r\n $i++;\r\n }\r\n disconnectDB($conexion);\r\n return $rawdata;\r\n}", "function _query($query) {\n $result = array();\n\n if ($this->lib_type == 'pear') {\n $dbq = $this->dbh->query($query);\n if (DB::isError($dbq))\n die(\"BabelKit: \" . $dbq->getMessage() . \". query($query)\");\n if (is_object($dbq)) {\n while ($row = $dbq->fetchRow()) {\n if (!is_array($row)) break;\n $result[] = $row;\n }\n $dbq->free();\n }\n\n } elseif ($this->lib_type == 'adodb') {\n $rs = $this->dbh->Execute($query);\n if ($rs) {\n if ($rs->connection) {\n $result = $rs->GetRows();\n $rs->Close();\n }\n } else {\n die(\"BabelKit: \" . $this->dbh->ErrorMsg() . \". query($query)\");\n }\n\n } elseif ($this->lib_type == 'phplib') {\n $dbh = $this->dbh;\n $dbh->query($query);\n while ($dbh->next_record()) {\n $result[] = $dbh->Record;\n }\n $dbh->free();\n\n }\n\n return $result;\n }", "public function dbMulti($query, $link=NULL){\n\n#\t$flux\t= ($link == NULL) ? self::__getInstance() : $link;\n#\t$result\t= $flux->query($query);\n\n\t$result = $this->dbQuery($query, $link);\n\n\n\tif($result === false) return array();\n\t$db\t\t= array();\n\n\twhile($row = $result->fetch_assoc()){\n\t\tarray_push($db, $row);\n\t}\n\n\treturn $db;\n}", "public function fetchArray();", "function db_fetch_array($result) \r\n\t{\r\n\t\tif($result && mysql_num_rows($result) > 0) :\r\n\t\t\treturn mysql_fetch_array($result);\r\n\t\telse :\r\n\t\t\treturn FALSE;\r\n\t\tendif;\r\n\t}", "function db_getItem($q,$conn=NULL){\r\n\t$res=db_query($q);\r\n\tif (count($res)==1)\r\n\t\treturn $res[0];\r\n\tif(!$res)\r\n\t\treturn Array();\r\n\treturn $res;\r\n}", "public function DBGetAsOneArray($sql){\n\t\t\t$count = substr_count($sql,\"?\");\n\t\t\t$count2 = func_num_args() - 1;\n\t\t\t$paramArray = null;\n\t\t\tif($count2 == 1 && is_array(func_get_arg(1))){\n\t\t\t\t// param passed as array\n\t\t\t\t$paramArray = func_get_arg(1);\n\t\t\t\t$count2 = count($paramArray);\n\t\t\t\tif($count > $count2)\n\t\t\t\t\tthrow new Exception(\"sql:$sql need $count values but get $count2 !\");\n\t\t\t}else if($count > $count2){\n\t\t\t\tthrow new Exception(\"sql:$sql need $count values but get $count2 !\");\n\t\t\t}\n\t\t\t$i = 0;\n\t\t\t$index = 0;\n\t\t\tfor(;$i<$count;$i++){\n\t\t\t\t$value = $paramArray === null ? func_get_arg($i+1) : $paramArray[$i];\n\t\t\t\t$type = gettype($value);\n\t\t\t\tswitch($type){\n\t\t\t\t\tcase \"boolean\":\n\t\t\t\t\t\t$value = ($value ? \"true\" : \"false\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"integer\":\n\t\t\t\t\tcase \"NULL\":\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t$value = myStrEscape($value);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Exception(\"unknown type:\".$type.\" of value:\".$value);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$sql = str_replace_once($sql,\"?\",$value);\n\t\t\t}\n\t\t\t$this->dbSQL = $sql;\n\t\t\t$this->DBExecute($this->dbSQL);\n\t\t\t$partSomeRows = array();\n\t\t\tif (mysqli_num_rows($this->dbResult) > 0){\n\t\t\t\twhile($partRows = mysqli_fetch_array($this->dbResult,MYSQLI_NUM))\n\t\t\t\t\t$partSomeRows = array_merge($partSomeRows,$partRows);\n\t\t\t\treturn $partSomeRows;\n\t\t\t}\n\t\t\treturn array();\n\t\t}", "function fetch_array ($query, $arraytype=CDE_NUM)\n {\n $this->error = \"\"; //Set the errors to none\n if ($this->debug)\n {\n $this->debugmsg (\"Fetching array on \".$this->dbtype.\" database....\", \"blue\");\n $this->debugmsg ($query, \"purple\");\n }\n switch ($this->dbtype)\n {\n /* Firebird Functionality */\n case \"firebird\" :\n if ($arraytype == 0)\n {\n $query = ibase_fetch_assoc ($query);\n }\n else\n if ($arraytype == 1) \n {\n $query = ibase_fetch_row ($query);\n } \n else\n {\n $query1 = ibase_fetch_assoc ($query);\n $query2 = ibase_fetch_row ($query);\n $query = array_merge($query1, $query2);\n } \n break;\n /* SQLite Functionality */\n case \"sqlite\" :\n $query = sqlite_fetch_array ($query, $arraytype);\n break;\n /*DBASE - this uses the record counter - currentrecord */\n case \"dbase\" :\n if ($this->currentrecord <= $this->num_rows($none))\n {\n $query = dbase_get_record($this->dbh, $this->currentrecord);\n $this->currentrecord++;\n }\n else\n {\n $query = false;\n }\n if ($query)\n {\n foreach ($query as $name => $value)\n {\n $value = str_replace (\"'\", \"''\", $value);\n $query[$name] = trim($value);\n }\n }\n break;\n /* MYSQL Functionality */\n case \"mysql\" :\n \tif($arraytype==\"CDE_NUM\")\n \t$myarr = MYSQL_NUM;\n \telseif($arraytype==\"CDE_ASSOC\")\n \t$myarr = MYSQL_ASSOC;\n \telse\n \t$myarr = MYSQL_BOTH;\n \t\n $query = mysql_fetch_array ($query, $myarr);\n break;\n /* Oracle Functionality */\n case \"oracle\" :\n $query = oci_fetch_array ($query, $arraytype);\n break;\n /* MSSQL Functionality */\n case \"mssql\" :\n $query = mssql_fetch_array ($query, $arraytype);\n break;\n case \"pgsql\":\n $query = pg_fetch_array($query, $arraytype);\n break;\n }\n \n if ($this->debug)\n {\n $this->debugmsg (\"Fetched array on \".$this->dbtype.\" database....\", \"green\");\n $this->debugmsg ($this->pre_r($query), \"purple\");\n }\n \n return $query;\n }", "function fetch_array()\n {\n return mysql_fetch_array($this->_queryResource, MYSQL_ASSOC);\n }", "function DBfetchArray($cursor) {\n\t$result = array();\n\twhile ($row = DBfetch($cursor)) {\n\t\t$result[] = $row;\n\t}\n\treturn $result;\n}", "function getArray( $connection, $query ){\n\t$result = getResultSet( $connection, $query );\n\t$data = array();\n\n\tif ( hasRecords( $result ) ){\n\t\twhile( $row = mysql_fetch_assoc($result) ){\n\t\t\tarray_push($data, $row);\n\t\t}\n\n\t\tfreeResultSet( $result );\n\t}\n\n\treturn $data;\n}", "function db_get_arr($query, $params_arr = array(), $res_type = 'row') {\n\n if(sizeof($params_arr)) {\n $param = pdo_prepare_arr($params_arr);\n $result = $GLOBALS['pdo']->prepare($query);\n $result->execute($param);\n }\n else {\n $result = $GLOBALS['pdo']->query($query);\n }\n \n switch ($res_type) {\n case \"one\":\n $res_arr = $result->fetchAll(PDO::FETCH_COLUMN);\n break;\n case \"pair\":\n $res_arr = $result->fetchAll(PDO::FETCH_KEY_PAIR);\n break;\n case \"arr\":\n $res_arr = $result->fetchAll();\n break;\n case \"row\":\n $res_arr = $result;\n break;\n }\n\n return $res_arr;\n}", "static function execArray($sql, $one_row = false) {\n global $db;\n\n $result = $db->query($sql);\n if (!$result) {\n return array();\n }\n\n if ($one_row) {\n return $result[0];\n }\n\n return $result;\n }", "function db_select_list($query)\n{\n $q = mysql_query($query);\n if (!$q) return null;\n $ret = array();\n while ($row = mysql_fetch_array($q, MYSQL_ASSOC)) {\n array_push($ret, $row);\n }\n mysql_free_result($q);\n return $ret;\n}" ]
[ "0.75648314", "0.7557573", "0.75508684", "0.7397634", "0.7394682", "0.734828", "0.73153114", "0.7286159", "0.7045256", "0.7023018", "0.7003746", "0.6988848", "0.69660175", "0.6939584", "0.69112134", "0.6901115", "0.6873792", "0.6867521", "0.68276906", "0.68111634", "0.67875004", "0.67779416", "0.67451614", "0.67230207", "0.6722903", "0.6706346", "0.66832453", "0.6667738", "0.6634517", "0.6633089" ]
0.7616252
0
db_simple_array() runs a database query and returns a simple array with the result usage: db_simple_array() note: uses db_query()
function MY_dbSimpleArray($query) { $result = MY_dbQuery($query); $result_array = array(); while ($row = mysql_fetch_row($result)) { $result_array[$row[0]] = $row[1]; } return $result_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MY_dbArray($query)\n{\n $result = MY_dbQuery($query);\n $result_array = array();\n while ($row = mysql_fetch_assoc($result))\n {\n array_push($result_array, $row);\n }\n return $result_array;\n}", "static function execArray($sql, $one_row = false) {\n global $db;\n\n $result = $db->query($sql);\n if (!$result) {\n return array();\n }\n\n if ($one_row) {\n return $result[0];\n }\n\n return $result;\n }", "function db_fetch_array () {\n\ttry {\n\t\tlist ($stmt, $args) = Database::prepare (func_get_args ());\n\t\t$stmt->execute ($args);\n\t\treturn $stmt->fetchAll ();\n\t} catch (Exception $e) {\n\t\tDatabase::$error = $e->getMessage ();\n\t\treturn false;\n\t}\n}", "function db_fetch_array ($sql) {\n\tglobal $db_err, $db_sql, $db_args;\n\t$db = db_get_conn ();\n\t$args = func_get_args ();\n\tarray_shift ($args);\n\t$args = db_args ($args);\n\t$sql = db_normalize_sql ($db, $sql);\n\t$db_sql = $sql;\n\t$db_args = $args;\n\n\ttry {\n\t\t$stmt = $db->prepare ($sql);\n\t\t$stmt->execute ($args);\n\t\treturn $stmt->fetchAll ();\n\t} catch (PDOException $e) {\n\t\t$db_err = $e->getMessage ();\n\t\treturn false;\n\t}\n}", "public function DBGetAsOneArray($sql){\n\t\t\t$count = substr_count($sql,\"?\");\n\t\t\t$count2 = func_num_args() - 1;\n\t\t\t$paramArray = null;\n\t\t\tif($count2 == 1 && is_array(func_get_arg(1))){\n\t\t\t\t// param passed as array\n\t\t\t\t$paramArray = func_get_arg(1);\n\t\t\t\t$count2 = count($paramArray);\n\t\t\t\tif($count > $count2)\n\t\t\t\t\tthrow new Exception(\"sql:$sql need $count values but get $count2 !\");\n\t\t\t}else if($count > $count2){\n\t\t\t\tthrow new Exception(\"sql:$sql need $count values but get $count2 !\");\n\t\t\t}\n\t\t\t$i = 0;\n\t\t\t$index = 0;\n\t\t\tfor(;$i<$count;$i++){\n\t\t\t\t$value = $paramArray === null ? func_get_arg($i+1) : $paramArray[$i];\n\t\t\t\t$type = gettype($value);\n\t\t\t\tswitch($type){\n\t\t\t\t\tcase \"boolean\":\n\t\t\t\t\t\t$value = ($value ? \"true\" : \"false\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"integer\":\n\t\t\t\t\tcase \"NULL\":\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t$value = myStrEscape($value);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Exception(\"unknown type:\".$type.\" of value:\".$value);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$sql = str_replace_once($sql,\"?\",$value);\n\t\t\t}\n\t\t\t$this->dbSQL = $sql;\n\t\t\t$this->DBExecute($this->dbSQL);\n\t\t\t$partSomeRows = array();\n\t\t\tif (mysqli_num_rows($this->dbResult) > 0){\n\t\t\t\twhile($partRows = mysqli_fetch_array($this->dbResult,MYSQLI_NUM))\n\t\t\t\t\t$partSomeRows = array_merge($partSomeRows,$partRows);\n\t\t\t\treturn $partSomeRows;\n\t\t\t}\n\t\t\treturn array();\n\t\t}", "private function dbArray($query) \n\t{\n\t\t$result = @mysql_fetch_assoc($query);\n\t\tif ( ! $result) \n\t\t{\n\t\t\techo mysql_error();\n\t\t\treturn false;\n\t\t} \n\t\telse\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t}", "function dbArray($query, $parms = array()) {\n return \\App\\M\\Database::getArray($query, $parms);\n }", "function return_array($query) {\n $res=run_query($query);\n $ret=Array();\n while($row=mysqli_fetch_array($res)) {\n $ret[] = $row[0];\n };\n return $ret;\n}", "function db_fetch_array($db_query)\n {\n return mysqli_fetch_array($db_query, MYSQLI_ASSOC);\n }", "function db_getItem($q,$conn=NULL){\r\n\t$res=db_query($q);\r\n\tif (count($res)==1)\r\n\t\treturn $res[0];\r\n\tif(!$res)\r\n\t\treturn Array();\r\n\treturn $res;\r\n}", "static function fetch_array($db,$sql){\n\t\t\n\t\t$result=$db->query($sql);\n\t\t$data=array();\n\t\twhile ($row=$db->fetch($result)){\n\t\t\t$data[]=$row;\n\t\t}\n\t\treturn $data;\n\t}", "public function singleArray()\n\t{\n\t\t$this->execute();\n\t\treturn $this->statement->fetch(PDO::FETCH_ASSOC);\n\t}", "function db_get_array($sql, $primary_fld='')\r\n{\r\n\t$errstr = '';\r\n\t$result = @mysql_query($sql) OR ($errstr = mysql_error()) ;\r\n\t\r\n\tif($errstr != '') return $errstr;\r\n\t\r\n\t$return = array();\r\n\t\r\n\twhile($ret = mysql_fetch_array($result,MYSQL_ASSOC))\r\n\t{\r\n\t\t\r\n\t\tif( $primary_fld != '' )\t\t\r\n\t\t{\r\n\t\t\t$return[$ret[$primary_fld]] = $ret;\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$return[] = $ret;\r\n\t\t}\r\n\r\n\t}\r\n\t\r\n\treturn $return;\r\n}", "function DBGetQuery($result, $arrayType = 1) {\n\n\tif ($arrayType == 0)\n\t\t$row = mssql_fetch_array($result, MSSQL_NUM);\n\tif ($arrayType == 1)\n\t\t$row = mssql_fetch_array($result, MSSQL_ASSOC);\n\tif ($arrayType == 2)\n\t\t$row = mssql_fetch_array($result, MSSQL_BOTH);\n\n\treturn $row;\n}", "function sqlRequestArray($table, $array)\n{\n // //////////////////////////////////////////////////////////////////\n // Step #1:\n // Retrieve the data\n // //////////////////////////////////////////////////////////////////\n $returnValues = sqlRequest(\"select {$array} from {$table}\");\n\n // //////////////////////////////////////////////////////////////////\n // Step #2:\n // Send back the data we were looking for\n // //////////////////////////////////////////////////////////////////\n return $returnValues;\n}", "public function singleArray(){\r\n $this->execute();\r\n return $this->stmt->fetch(PDO::FETCH_ASSOC);\r\n }", "function fetchSqlArray($sqlQueryString)\n{\n //get sql result\n $sqlResult = mysql_query($sqlQueryString) or die(tdw_mysql_error($sqlQueryString));\n //Proccessing result\n $result = array();\n while ($row = mysql_fetch_assoc($sqlResult)) {\n $result[] = $row;\n }\n return $result;\n}", "public function singleArray(){\n $this->execute();\n\n return $this->_statement->fetch(PDO::FETCH_ASSOC);\n }", "public function selectArray() {\r\n // Generate Query\r\n $this->selectArrayQuery();\r\n \r\n $this->result = mysql_query($this->query);\r\n // Update fetch-callback's argument\r\n $this->fetchArg1 = $this->result;\r\n// $this->debug();\r\n if ($this->returnPointer) {\r\n // Return link to resources\r\n return $this->result;\r\n } else {\r\n // Return only the first result\r\n return mysql_fetch_array($this->result);\r\n }\r\n }", "public function fetchArray();", "function db_fetch_array($db_query) {\r\nreturn mysql_fetch_array($db_query, MYSQL_ASSOC);\r\n}", "function db_select($query) {\n $rows = array();\n $result = db_query( $query );\n\n if( $result === false ) {\n return false;\n }\n\n while( $row = $result -> fetchArray() ) {\n $rows[] = $row;\n }\n\n return $rows;\n}", "function getArraySQL($sql){\r\n $conexion = connectDB();\r\n mysqli_set_charset($conexion, \"utf8\");\r\n if(!$result = mysqli_query($conexion, $sql)) die();\r\n $rawdata = array();\r\n $i=0;\r\n while($row = mysqli_fetch_array($result))\r\n {\r\n $rawdata[$i] = $row;\r\n $i++;\r\n }\r\n disconnectDB($conexion);\r\n return $rawdata;\r\n}", "public function dbOne($query, $link=NULL){\n\n#\t$flux\t= ($link == NULL) ? self::__getInstance() : $link;\n#\t$result = $flux->query($query);\n\n\t$result = $this->dbQuery($query, $link);\n\n\tif($result === false) return array();\n\t$db\t\t= $result->fetch_assoc();\n\n\treturn is_array($db) ? $db : array();\n}", "function _query($query) {\n $result = array();\n\n if ($this->lib_type == 'pear') {\n $dbq = $this->dbh->query($query);\n if (DB::isError($dbq))\n die(\"BabelKit: \" . $dbq->getMessage() . \". query($query)\");\n if (is_object($dbq)) {\n while ($row = $dbq->fetchRow()) {\n if (!is_array($row)) break;\n $result[] = $row;\n }\n $dbq->free();\n }\n\n } elseif ($this->lib_type == 'adodb') {\n $rs = $this->dbh->Execute($query);\n if ($rs) {\n if ($rs->connection) {\n $result = $rs->GetRows();\n $rs->Close();\n }\n } else {\n die(\"BabelKit: \" . $this->dbh->ErrorMsg() . \". query($query)\");\n }\n\n } elseif ($this->lib_type == 'phplib') {\n $dbh = $this->dbh;\n $dbh->query($query);\n while ($dbh->next_record()) {\n $result[] = $dbh->Record;\n }\n $dbh->free();\n\n }\n\n return $result;\n }", "function getSingleValueArray($sql)\r\n\t{\r\n\t\t\r\n\t\tif($result = $this->doQuery($sql, true))\r\n\t\t{\r\n\t\t\tif($result->num_rows >= 0)\r\n\t\t\t{\r\n\t\t\t\t$vals = Array(); \r\n\t\t\t\tfor($i=0;$i< $result->num_rows;$i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$row=$result->fetch_array();\r\n\t\t\t\t\t$vals[] = $row[0];\t\r\n\t\t\t\t}\r\n\t\t\t\t$result->close();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\t\telse \r\n\t\t\treturn Array();\r\n\t\t\t\r\n\t\treturn $vals;\t\r\n\t}", "function getArray( $connection, $query ){\n\t$result = getResultSet( $connection, $query );\n\t$data = array();\n\n\tif ( hasRecords( $result ) ){\n\t\twhile( $row = mysql_fetch_assoc($result) ){\n\t\t\tarray_push($data, $row);\n\t\t}\n\n\t\tfreeResultSet( $result );\n\t}\n\n\treturn $data;\n}", "function fetch_array()\n {\n return mysql_fetch_array($this->_queryResource, MYSQL_ASSOC);\n }", "function query($query_string) {\n $result = mysqli_query($this->connection, $query_string)\n or die('Error is query: ' . $query_string . '.' . mysql_error());\n\n if ($result === TRUE || $result === FALSE) return $result; //Boolean on DML-type queries\n\n //Results are null if there are no rows. Make it an empty array, to play nice with loops\n if (is_null($result)) return array();\n\n $return = array();\n for ($i = 0; $i < $result->num_rows; $i++) {\n $return[] = $result->fetch_assoc(); //Array of associative arrays on DSL-type queries\n }\n $result->free();\n\n return $return;\n }", "function fetch_array ($query, $arraytype=CDE_NUM)\n {\n $this->error = \"\"; //Set the errors to none\n if ($this->debug)\n {\n $this->debugmsg (\"Fetching array on \".$this->dbtype.\" database....\", \"blue\");\n $this->debugmsg ($query, \"purple\");\n }\n switch ($this->dbtype)\n {\n /* Firebird Functionality */\n case \"firebird\" :\n if ($arraytype == 0)\n {\n $query = ibase_fetch_assoc ($query);\n }\n else\n if ($arraytype == 1) \n {\n $query = ibase_fetch_row ($query);\n } \n else\n {\n $query1 = ibase_fetch_assoc ($query);\n $query2 = ibase_fetch_row ($query);\n $query = array_merge($query1, $query2);\n } \n break;\n /* SQLite Functionality */\n case \"sqlite\" :\n $query = sqlite_fetch_array ($query, $arraytype);\n break;\n /*DBASE - this uses the record counter - currentrecord */\n case \"dbase\" :\n if ($this->currentrecord <= $this->num_rows($none))\n {\n $query = dbase_get_record($this->dbh, $this->currentrecord);\n $this->currentrecord++;\n }\n else\n {\n $query = false;\n }\n if ($query)\n {\n foreach ($query as $name => $value)\n {\n $value = str_replace (\"'\", \"''\", $value);\n $query[$name] = trim($value);\n }\n }\n break;\n /* MYSQL Functionality */\n case \"mysql\" :\n \tif($arraytype==\"CDE_NUM\")\n \t$myarr = MYSQL_NUM;\n \telseif($arraytype==\"CDE_ASSOC\")\n \t$myarr = MYSQL_ASSOC;\n \telse\n \t$myarr = MYSQL_BOTH;\n \t\n $query = mysql_fetch_array ($query, $myarr);\n break;\n /* Oracle Functionality */\n case \"oracle\" :\n $query = oci_fetch_array ($query, $arraytype);\n break;\n /* MSSQL Functionality */\n case \"mssql\" :\n $query = mssql_fetch_array ($query, $arraytype);\n break;\n case \"pgsql\":\n $query = pg_fetch_array($query, $arraytype);\n break;\n }\n \n if ($this->debug)\n {\n $this->debugmsg (\"Fetched array on \".$this->dbtype.\" database....\", \"green\");\n $this->debugmsg ($this->pre_r($query), \"purple\");\n }\n \n return $query;\n }" ]
[ "0.72220004", "0.71870035", "0.7104622", "0.70905036", "0.7082062", "0.7070543", "0.70359784", "0.6896289", "0.6858952", "0.68543136", "0.68285936", "0.6824367", "0.6804708", "0.6804228", "0.6801626", "0.6765459", "0.67540973", "0.6749912", "0.6736135", "0.6722805", "0.67188346", "0.6682647", "0.66776913", "0.6635096", "0.6609454", "0.6605317", "0.6571139", "0.6571118", "0.65651494", "0.6534224" ]
0.76892596
0
/ ALL THE FUNCTIONS / find_matches() : This function will parse the "singles.txt" CSV file and create a 2D array that will make the data accessible to query It will then identify all of the queried client's attributes and use them to create a date array that holds all of the corresponding field quantities used to filter matches
function find_matches() { # request from the server $name = htmlspecialchars($_GET["name"]); # $all_singles : stores the entire "singles.txt" file $all_singles = file('singles.txt'); # $each_single : holds each line of the "singles.txt" $each_single = []; # $info_single : is an array of each single's information $info_single = []; /* $info : is a 2D array where the line number is the first index, the second index is the information for each person (i.e. $info[0][name] = Ada Lovelace because she is listed on the first line of the file) */ $info = array(); for ($i = 0; $i < 7; $i++){ $info[$i] = array(); } for ($i = 0; $i < count($all_singles); $i++) { $each_single[$i] = $all_singles[$i]; $info_single = explode(",", $each_single[$i]); $info[$i][name] = $info_single[0]; $info[$i][gender] = $info_single[1]; $info[$i][age] = $info_single[2]; $info[$i][type] = $info_single[3]; $info[$i][os] = $info_single[4]; $info[$i][minage] = $info_single[5]; $info[$i][maxage] = $info_single[6]; } $attributes_for_client = []; $line = 0; # identify which line the client is on in the "singles.txt" CSV while ($name != $info[$line][name]) { $line++; } # use that line to store all of the attributes of the client $attributes_for_client[gender] = $info[$line][gender]; $attributes_for_client[minage] = $info[$line][minage]; $attributes_for_client[maxage] = $info[$line][maxage]; $attributes_for_client[os] = $info[$line][os]; $attributes_for_client[type] = $info[$line][type]; $attributes_for_date = []; /* Assign the appropriate value for the date's gender search parameter */ $attributes_for_client[gender] == "F" ? $attributes_for_date[gender] = "M" : $attributes_for_date[gender] = "F"; /* Assign the client's preferred operating system to the date's preferred operating system */ $attributes_for_date[os] = $attributes_for_client[os]; /* FILTER to find MATCHES */ for ($i = 0; $i < count($all_singles); $i++){ # gender check if ($info[$i][gender] == $attributes_for_date[gender]){ # os check if ($info[$i][os] == $attributes_for_date[os]){ # age check min if ($info[$i][age] >= $attributes_for_client[minage]){ # age check max if ($info[$i][age] <= $attributes_for_client[maxage]){ # type check if (type_match($info[$i][type], $attributes_for_client[type]) > 0){ /* finally! Now that a match has been located, pass the corresponding information of the match/date to the display function */ display_matches($info[$i][name], $info[$i][gender], $info[$i][age], $info[$i][type], $info[$i][os]); } } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read_list_from_file($directory) {\n $ret = array();\n// echo 'read_list_from_file<br>';\n\n $nr = 0;\n $myfile = fopen(\"$directory/gps.csv\", \"r\") or die(\"Unable to open file!\");\n while (!feof($myfile)) {\n\n //Get one line\n $line = fgets($myfile);\n\n // Ignore empty lines\n if (strlen($line) == 0)\n continue;\n\n // Ignore comment lines\n if ($line[0] == '#')\n continue;\n// echo \"line=$line<br>\";\n// list($filename, $lat, $lon) = explode(',', $line);\n// echo \"1 myfile=$myfile, line=$line. <br>\";\n// trigger_error(\"read_gps_from_file: line=>>>$line<<<\");\n\n $parts = array();\n preg_match('/(.+)\\t(\\d+\\.\\d+)\\s(\\d+\\.\\d+)\\t(.+)\\t(.+)/', $line, $parts);\n// echo \"count parts=\" . count($parts) . \"<br>\";\n $filename = $parts[1];\n $lat = $parts[2];\n $lon = $parts[3];\n $title = $parts[4];\n $description = $parts[5];\n\n// echo \"$filename, $title, $description, $lon, $lat <br>\";\n $item = array();\n $item['filename'] = $filename;\n $item['lon'] = $lon;\n $item['lat'] = $lat;\n $item['title'] = $title;\n $item['description'] = $description;\n\n// echo \"Add to item nr $nr=\" . $item['filename'] . \" <br>\";\n\n $ret[++$nr] = $item;\n }\n fclose($myfile);\n\n// echo 'Returning ret array with size' . count($ret) . \"<br>\";\n// echo 'Item 1 has items=' . count($ret[1]) . \"<br>\";\n// echo \"Content=\" . $ret[1]['filename'] . \"<br>\";\n// echo \"Content=\" . $ret['1']['filename'] . \"<br>\";\n return $ret;\n}", "public function dataToMatch () : array\r\n\t{\r\n\t\t$pix_one = new Reader('00020101021126860014br.gov.bcb.pix0136285fb964-0087-4a94-851a-5a161ed8888a0224Solicitacao de pagamento52040000530398654041.005802BR5913STUDIO PIGGLY6007Uberaba62070503***63045C9B');\r\n\t\t$pix_two = new Reader('00020101021126780014br.gov.bcb.pix0136285fb964-0087-4a94-851a-5a161ed8888a0216DS PIX PAGAMENTO52040000530398654041.005802BR5913STUDIO PIGGLY6007Uberaba62080504TX01630422D4');\r\n\r\n\t\treturn [\r\n\t\t\t['285fb964-0087-4a94-851a-5a161ed8888a', $pix_one->getPixKey()],\r\n\t\t\t['285fb964-0087-4a94-851a-5a161ed8888a', $pix_two->getPixKey()],\r\n\t\t\t[Parser::KEY_TYPE_RANDOM, Parser::getKeyType($pix_one->getPixKey())],\r\n\t\t\t[Parser::KEY_TYPE_RANDOM, Parser::getKeyType($pix_two->getPixKey())],\r\n\t\t\t['Solicitacao de pagamento', $pix_one->getDescription()],\r\n\t\t\t['DS PIX PAGAMENTO', $pix_two->getDescription()],\r\n\t\t\t['STUDIO PIGGLY', $pix_one->getMerchantName()],\r\n\t\t\t['STUDIO PIGGLY', $pix_two->getMerchantName()],\r\n\t\t\t['Uberaba', $pix_one->getMerchantCity()],\r\n\t\t\t['Uberaba', $pix_two->getMerchantCity()],\r\n\t\t\t[1, $pix_one->getAmount()],\r\n\t\t\t[1, $pix_two->getAmount()],\r\n\t\t\t[StaticPayload::class, get_class($pix_one->export())],\r\n\t\t\t[StaticPayload::class, get_class($pix_two->export())],\r\n\t\t];\r\n\t}", "function createMatches() {\n global $singles;\n global $userInfo;\n $matches = $singles;\n $arraySize = sizeof($matches);\n\n\n //Test for gender compatibility\n for ($i = 0; $i < $arraySize; $i++) {\n $matchInfo = explode(\",\", $matches[$i]);\n $location = $i + 1;\n\n if ($matchInfo[1] == $userInfo[1]) {\n unset($matches[$i]); //remove same gender from array\n } else if ($matchInfo[4] != $userInfo[4]) {\n unset($matches[$i]); //remove different OS from array\n } else if (($matchInfo[2] < $userInfo[5] || $matchInfo[2] > $userInfo[6]) || ($userInfo[2] < $matchInfo[5] || $userInfo[2] > $matchInfo[6])) {\n unset($matches[$i]); //remove ages outside range from array\n } else if (!checkPersonality(str_split($matchInfo[3]), str_split($userInfo[3]))) {\n unset($matches[$i]); //remove incompatible personas from array\n }\n }\n $matches = array_values($matches); //re-indexes the array\n return $matches;\n}", "public static function parseCSV($csvFile)\n {\n $lines = explode(PHP_EOL, $csvFile);\n\n //remove the header from the cvs file\n $lines = array_slice($lines, 3);\n\n //convert into Contacts array\n $lines = array_map(function ($line) {\n $contact = explode(';', $line);\n\n if (count($contact) == 8) {\n $dateTimeCall = implode('-', array_reverse(explode('/', $contact[3])));\n // check hours minutes\n if (preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/\", $contact[0]))\n $dateTimeCall = $dateTimeCall . ' ' . $contact[4];\n else\n $dateTimeCall = $dateTimeCall . ' 00:00:00';\n\n // some dates was not working so i add the validation\n if (Carbon::createFromFormat('Y-m-d H:i:s', $dateTimeCall) !== false)\n $dateTimeCall = date(\"Y-m-d H:i:s\");\n\n\n $contact = [\n 'compte_facture' => $contact[0],\n 'numero_facture' => $contact[1],\n 'numero_abonnement' => $contact[2],\n 'date' => $contact[3],\n 'heure' => $contact[4],\n 'duree' => $contact[5],\n 'dureeV2' => $contact[6],\n 'type' => utf8_encode($contact[7])\n ];\n\n if ($contact != null)\n return $contact;\n }\n }, $lines);\n\n\n\n return $lines;\n }", "function read_gps_from_file($directory) {\n $ret = array();\n// echo 'read_gps_from_file<br>';\n\n $myfile = fopen(\"$directory/gps.csv\", \"r\") or die(\"Unable to open file!\");\n while (!feof($myfile)) {\n\n //Get one line\n $line = fgets($myfile);\n\n // Ignore empty lines\n if (strlen($line) == 0)\n continue;\n\n // Ignore comment lines\n if ($line[0] == '#')\n continue;\n\n// list($filename, $lat, $lon) = explode(',', $line);\n// echo \"1 myfile=$myfile, line=$line. <br>\";\n// trigger_error(\"read_gps_from_file: line=>>>$line<<<\");\n\n $parts = array();\n preg_match('/(.+)\\t(\\d+\\.\\d+)\\s(\\d+\\.\\d+)\\t(.+)\\t(.+)/', $line, $parts);\n// echo \"count parts=\" . count($parts) . \"<br>\";\n $filename = $parts[1];\n $lat = $parts[2];\n $lon = $parts[3];\n $title = $parts[4];\n $description = $parts[5];\n\n\n// echo \"1 filename=$filename, lat=$lat, lon=$lon title=$title description=$description <br>\";\n // Ignore incorrect lines\n// if (strlen($filename) == 0 or strlen($lat) == 0 or strlen($lon) == 0)\n// continue;\n//\n// ///TEST\n// $info = exif_read_data(\"$directory/$filename\", 'ANY_TAG');\n// if ($info == false) {\n// trigger_error(\">>>>>>>>>>>>>>>>>>>>>$directory/$filename: no EXIFs\");\n// } else {\n// $t = $info['title'];\n// trigger_error(\">>>>>>>>$directory/$filename: title=$t\");\n// }\n ///ENDTEST\n // echo \"3 myfile=$myfile, line=$line. <br>\";\n// $filename = substr($filename, 2);\n// $res = array();\n// preg_match('/\"(\\d+\\.\\d+) \\w/', $lat, $res);\n// $lat = $res[1];\n// $res = array();\n// preg_match('/(\\d+\\.\\d+) \\w\"/', $lon, $res);\n// $lon = $res[1];\n//\n// echo $filename . ' ' . $lat . ', ' . $lon . '.<br>';\n// trigger_error(\"read_gps_from_file: Description of file \" . $filename . \": >>>\" . $description . \"<<<\");\n $gps = array();\n $gps['lon'] = $lon;\n $gps['lat'] = $lat;\n $gps['title'] = $title;\n $gps['description'] = $description;\n $ret[$filename] = $gps;\n\n// echo \"$filename $lat $lon $title $description <br>\";\n }\n fclose($myfile);\n\n// echo var_dump($ret) . '<br>';\n return $ret;\n}", "public function apply()\n {\n // data content array\n $data = array();\n // Pattern applied to detect correct row\n $pattern = '/([0-9]{2}\\.[0-9]{2}\\.[0-9]{4})\\s+(.+)/';\n $reader = new \\SpreadsheetReader($this->source);\n // Response array\n foreach ($reader as $row) {\n if ($this->validateRow($row) && preg_match($pattern, $row[0], $matches)) {\n array_push($data, [\n 'date' => $this->formatter->date($matches[1]),\n 'weekday' => $this->formatter->firstUpper($matches[2]),\n 'meals' => [\n $this->formatter->trim($row[1]),\n $this->formatter->trim($row[2]),\n $this->formatter->trim($row[3]),\n $this->formatter->trim($row[4])\n ]\n ]);\n } \n }\n\n return $data;\n }", "function readsunspotdata($aFile, &$aYears, &$aSunspots) {\r\n $lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);\r\n \r\n // we use @ to avoid php droping error message.We will deal with errors\r\n \r\n if( $lines === false ) {\r\n throw new JpGraphException('Can not read sunspot data file.');\r\n \r\n // we deal with the error and drop out a warning message\r\n }\r\n \r\n \r\n foreach( $lines as $line => $datarow ) {\r\n //split on any part of the string that is at least 1 whitespace charac.\r\n \r\n $split = preg_split('/[\\s]+/',$datarow);\r\n \r\n // now we have a 2 dim array. split[0] is date.number,split[1] value.0\r\n // first we clean split[0] and assign the first 4 charac. to $ayears\r\n \r\n $aYears[] = substr(trim($split[0]),0,4);\r\n \r\n // now we assign the second dim of split to $asunsponts\r\n \r\n $aSunspots[] = trim($split[1]);\r\n \r\n /* this has been comented out becouse is used only to check out the $split array\r\n foreach ($split as $value) {\r\n echo \"$value <br>\";\r\n}\r\n*/\r\n }\r\n \r\n \r\n}", "function parseResults($results){\n\t//Parse results, split to lines\n\t$lines = explode(PHP_EOL, $results);\n\t$data = array();\n\t$files = null;\n\tglobal $totalMatches;\n\n\tforeach ($lines as $line) {\n\t//If line that contains file names\n\t\tif(0 === strpos($line, 'Unable to find a face')){\n\t\t\treturn null;\n\t\t} else if(0 === strpos($line, 'Comparing')){\n\t\t\t$parts = explode(' ', $line);\n\t\t\t$file1path = $parts[1];\n\t\t\t$file2path = rtrim($parts[3],\".\");\n\n\t\t\t//Use only filenames from file paths\n\t\t\t$f1 = getFileNameFromPath($file1path);\n\t\t\t$f2 = getFileNameFromPath($file2path);\n\n\t\t\t//craete an array of filenames\n\t\t\t$files = $f1;\n\t\t}\n\t\t//If line that contains probability result\n\t\telse if(-1 !== strpos($line, 'Squared')){\n\t\t\t$parts = explode(' ', $line);\n\n\t\t\t//If probability value is set\n\t\t\tif(isset($parts[8]) && $parts[8]){\n\n\t\t\t\t//If we have previously stored the values of the file names, that means that the next line is this line containing probability\n\t\t\t\tif($files){\n\t\t\t\t\t$probability = floatval($parts[8]);\n\t\t\t\t\tif($probability <= PROBABILITY_LIMIT){ //show only files that are good match (0-1). More than 1 is more likely that the result is not correct\n\t\t\t\t\t\t//$files['result'] = $probability;\n\t\t\t\t\t\t//$data[] = $files;\t\n\t\t\t\t\t\t$data = array('image'=>$files,'result'=>$probability);\n\t\t\t\t\t\t$alreadyMatched[$files] = $files;\n\t\t\t\t\t\t$totalMatches++;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//no match\n\t\t\t\t\t\treturn array();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$files = null;\n\t\t\t}\n\t\t}\n\t}\n\treturn $data;\n}", "private function processLine($line) {\n preg_match(\"/a href=\\\"\\/torrent.*>(.*)\\<\\/a>\\<\\/div>/i\", $line, $nameMatch);\n $name = $nameMatch[1];\n\n preg_match(\"/a href=\\\"(magnet[^ ]*)\\\"/i\", $line, $magnetMatch);\n $magnet = urlencode($magnetMatch[1]);\n\n preg_match(\"/\\<td align=\\\"right\\\">([0-9]*)\\<\\/td>/i\", $line, $seedMatch);\n $seeds = $seedMatch[1];\n \n return array('name' => $name, 'magnet' => $magnet, 'seeds' => $seeds);\n }", "function parse_csv(){\n $file_name = $_FILES['csv']['tmp_name'];\n $extension = pathinfo($_FILES['csv']['name'], PATHINFO_EXTENSION);\n if ($extension != \"csv\"){ //pokud soubor neni csv vrati error\n http_response_code(415);\n die();\n }\n $csv_string = file_get_contents($file_name);\n $csv_string = iconv( \"Windows-1250\", \"UTF-8\", $csv_string);\n $rows = preg_split(\"/\\\\r\\\\n/\", $csv_string); //rozdeli csv soubor po radcich\n array_shift($rows); //odstrani prvni radek souboru obsahujici záhlaví tabulky\n\n //= zahlavi tabulky csv souboru\n $csv_scheme = [\"Type\", \"Date1\", \"Date2\", \"Name\", \"Place\", \"GPS\", \"MeetTime\", \"MeetPlace\", \"EventTypeDescription\", \"StartTime\", \"Zabicky\", \"Pulci1\", \"Pulci2\", \"Zaci1\", \"Zaci2\", \"Dorost\", \"Map\", \"Terrain\", \"Transport\", \"Accomodation\", \"Food\", \"Leader\", \"DoWeOrganize\", \"Note\", \"Return\", \"Price\", \"Program\", \"ThingsToTake\", \"Signups\", \"Id\"];\n $approved_types = [\"Z\", \"M\", \"T\", \"S\", \"BZL\", \"BBP\", \"TABOR\", \"L\", \"J\"]; //ignoruje poznamky\n\n foreach($rows as $row_num => $row){ //prochazi vsechny radky\n $row_data = explode(\";\", $row); //rozdeli radek na jednotlive polozky oddelene \";\"\n if(isset($row_data[0])){\n if(!in_array(trim($row_data[0]), $approved_types)){ //parsuje jen spravne zaznamy\n continue;\n }\n }\n foreach($csv_scheme as $collum_num => $collum){ //prochazi sloupce a uklada do array\n $parsed[$row_num][$collum]= $this->trim_all($row_data[$collum_num]);\n }\n }\n return $parsed;\n }", "function process_csv( $csvfile )\r\n {\r\n global $ppcp_csv2sql;\r\n\r\n $i = 1;\r\n $path = $csvfile;\r\n \r\n $keyword = '';\r\n $date ='';\r\n $location = '';\r\n \r\n // Let's store the keyword, location and date, just for fun\r\n $b = pathinfo($path, PATHINFO_FILENAME);\r\n $parts = explode('+', $b);\r\n\r\n // The meta information\r\n if (count($parts) == 4) {\r\n $keyword = $parts[1];\r\n $location = $parts[2];\r\n $date = $parts[3];\r\n }\r\n \r\n $handle = fopen( $path, 'r' );\r\n if ( $handle == FALSE ) {\r\n die ( \"Could not open file $path <br/>\" );\r\n }\r\n\r\n /**\r\n * We could save this as a static array, however this method will\r\n * adapt in the event that PPCP changes it's output format, we are\r\n * not hard coding a specific order in the .csv file.\r\n */\r\n $hdata = fgetcsv( $handle );\r\n if ( $hdata === false ) {\r\n die (\"Could not get the headers\");\r\n }\r\n\r\n $headers = array();\r\n foreach ( $hdata as $h ) {\r\n $headers[] = $h;\r\n\r\n if ( ! array_key_exists ( $h, $ppcp_csv2sql ) ) {\r\n die (\"We do not have an SQL mapping for header: $h<br/>\");\r\n }\r\n $sql_headers[] = $ppcp_csv2sql[$h];\r\n }\r\n\r\n $noreps = 0;\r\n while ( ( $line = fgetcsv( $handle ) ) !== false ) {\r\n\r\n $record = array();\r\n\r\n // Map the new data with the specific info from the column\r\n for ( $c = 0; $c < count ($line) ; $c++ ) {\r\n $h = $headers[$c];\r\n $hdr = $ppcp_csv2sql[$h];\r\n\r\n $val = $line[$c]; /* incase we need special processing */\r\n\r\n if ( strpos( $val, '%' ) !== false ) {\r\n\r\n $val = floatval ( $val );\r\n }\r\n\r\n $record[$hdr] = $val;\r\n }\r\n\r\n // Map the report meta data (keyword, location and date \r\n $record['keyword'] = $keyword;\r\n $record['location'] = $location;\r\n $record['when_scraped'] = $date;\r\n\r\n $report = self::find_report( $record );\r\n if ( $report === null ) {\r\n $noreps ++;\r\n $record['report'] = \"\";\r\n } else {\r\n $record['report'] = $report;\r\n }\r\n\r\n /**\r\n * Now we'll store each record according to domain, this will\r\n * make it easier to find the .html report.\r\n */\r\n $domain = $record['domain'];\r\n\r\n /** We'll remove the www */\r\n $names = explode ( '.', $domain );\r\n if ( $names[0] === 'www' ) {\r\n\r\n array_shift ($names);\r\n\r\n $domain = implode ( '.', $names ) ;\r\n $record['domain'] = $domain;\r\n }\r\n\r\n if ( array_key_exists($domain, self::$all_records)) {\r\n\r\n /*\r\n * TBD: Need to figure out a good way to handle the\r\n * domain collision.\r\n */\r\n self::$logs[] = \"We have a matching domain: $domain<br/>\";\r\n $domain = $domain . $i++;\r\n }\r\n self::$all_records[$domain] = $record;\r\n }\r\n\r\n if ( $noreps > 0 ) {\r\n self::$logs[] = \"Could not find $noreps PPCP reports\";\r\n }\r\n\r\n fclose( $handle );\r\n return self::$all_records;\r\n }", "public function get(){\n $myfile = fopen($this->fileSurvey, \"r\", 1) or die(\"File could not open!\");\n $arraySurveys = new arraySurvey();\n $SequenceSurvey = new SequenceSurvey(fgetcsv($myfile));\n\n while(!feof($myfile)) {\n $survey = new dtoSurvey();\n $survey->arraySurveyToDto(fgetcsv($myfile),$SequenceSurvey);\n $arraySurveys->add_Survey($survey);\n }\n fclose($myfile);\n return $arraySurveys;\n\n }", "function drush_ting_smart_search_stats_importer() {\r\n\r\n $file = drush_get_option('file');\r\n\r\n if (!empty($file) && file_exists($file)) {\r\n $csv_data = array_map(function($v){return str_getcsv($v, \"\\t\");}, file($file));\r\n // loop through array and skip 0 lines\r\n for ($i = 5; $i < 5005/*count($csv_data)*/;$i++) {\r\n $title = $csv_data[$i][0];\r\n $hits_year = ($csv_data[$i][1] == '-') ? 0 : $csv_data[$i][1];\r\n $hits_month = ($csv_data[$i][2] == '-') ? 0 : $csv_data[$i][2];\r\n\r\n\r\n // fail if key fields are not present\r\n if (empty($title)) {\r\n drupal_set_message('Key fields are missing from array '.$i.'. Check the file and try again');\r\n } else {\r\n\r\n drupal_set_message($title.' - '.$hits_year.' - '.$hits_month);\r\n // find the matching entity and assign the stats\r\n $ssquery = new EntityFieldQuery();\r\n\r\n $ssquery->entityCondition('entity_type', 'ting_type')\r\n ->entityCondition('bundle', 'smart_search_string')\r\n ->propertyCondition('title', $title, '=');\r\n\r\n $result = $ssquery->execute();\r\n\r\n if (isset($result['ting_type'])) {\r\n $string_items_nids = array_keys($result['ting_type']);\r\n $string_item = entity_metadata_wrapper('ting_type', $string_items_nids[0]);\r\n $string_item->field_sss_hits_per_year->set($hits_year);\r\n $string_item->field_sss_hits_per_month->set($hits_month);\r\n // save\r\n $string_item->save();\r\n drupal_set_message('Title: '.$title.' has been substituted with: '.$hits_year.' - '.$hits_month);\r\n\r\n } else {\r\n\r\n drupal_set_message('No smart string found - creating new smart string');\r\n // create a new node and assign the data\r\n $values = array(\r\n 'type' => 'smart_search_string',\r\n 'uid' => 1,\r\n 'status' => 1,\r\n );\r\n $entity = entity_create('ting_type', $values);\r\n $new_string_item = entity_metadata_wrapper('ting_type', $entity);\r\n $new_string_item->title->set($title);\r\n $new_string_item->field_sss_hits_per_year->set($hits_year);\r\n $new_string_item->field_sss_hits_per_month->set($hits_month);\r\n\r\n // save\r\n $new_string_item->save();\r\n }\r\n\r\n }\r\n\r\n\r\n\r\n }\r\n } else {\r\n return 'No file given to import or file does not exist';\r\n }\r\n }", "function csvToArray($filename){\r\n\r\n\t$array = $fields = array(); $i = 0;\r\n\r\n\t\ttry {\r\n\t\t\t$handle = fopen($filename, \"r\");\r\n\t\t\tif ($handle) {\r\n\t\t\t\twhile (($row = fgetcsv($handle, 4096)) !== false) {\r\n\t\t\t\t\tif (empty($fields)) {\r\n\t\t\t\t\t\t$fields = $row;\r\n\t\t\t\t\t\t//print_r($fields);\r\n\t\t\t\t\t\t$fields = array_map('trim', $fields);\r\n\t\t\t\t\t\tif(count(array_intersect($fields, ['name','surname','email'])) < 3){\r\n\t\t\t\t\t\t\tthrow new Exception(\"Input the correct file!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tforeach ($row as $k=>$value) {\r\n\t\t\t\t\t\t$array[$i][$fields[$k]] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t\tif (!feof($handle)) {\r\n\t\t\t\t\techo \"Error: unexpected fgets() fail\\n\";\r\n\t\t\t\t}\r\n\t\t\t\t//print_r($array);\r\n\t\t\t\t$validation_result = dataChecking($array);\r\n\t\t\t\treturn $validation_result;\r\n\t\t\t\tfclose($handle);\r\n\t\t\t}else \r\n\t\t\t\tthrow new Exception(\"Could not open the file!\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception $e) {\r\n\t\t\techo \"Error (File: \".$e->getFile().\", line \".\r\n\t\t\t\t $e->getLine().\"): \\n\".$e->getMessage();\r\n\t\t\t\t \r\n\t\t\t\r\n\t\t}\r\n\t\treturn array('error'=>$e->getMessage());\r\n\r\n}", "function read_eventids()\n{\n global $path_to_root, $eventids;\n $csv = array_map('str_getcsv', file($path_to_root . \"/modules/rep_dr0100/reporting\" . \"/wwheventids.csv\"));\n foreach ($csv[0] as $key =>$value)\n $csv[0][$key]=preg_replace( '/\\s*/m', '',$value);\n\n array_walk($csv, function(&$a) use ($csv) {\n $a = array_combine($csv[0], $a);\n });\n\n array_shift($csv); # remove column header\n // display_notification(print_r($csv, true));\n\n foreach ($csv as $value) {\n $address=trim($value['Address']);\n $start = strpos($address, \",\")+2;\n $end = strpos($address, \",\", $start);\n $address=substr($address, $start, $end-$start);\n $eventids[$address] = $value;\n }\n\n // display_notification(print_r($eventids, true));\n}", "public function loadingDataFromCsvFile($input_file) {\n\t\t\n\t\t$row = 0;\n\t\t$line1 = array();\t// first line of CSV file\n\n\t\t$es_index = array();\n\t\t$docs = array();\n\n\t\tif (($handle = fopen($input_file, \"r\")) !== FALSE) {\n\t\t\twhile (($data = fgetcsv($handle, 100000, \"\\t\")) !== FALSE) {\n\t\t\t\t$row++;\n\n\t\t\t\tswitch ($row) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$num = count($data);\n\t\t\t\t\t\tfor ($c=1; $c < $num; $c++) {\n\t\t\t\t\t\t\t$bom = pack(\"CCC\", 0xef, 0xbb, 0xbf);\n\t\t\t\t\t\t\tif (0 == strncmp($data[$c], $bom, 3)) {\n\t\t\t\t\t\t\t\techo \"BOM detected - file is UTF-8\\n\";\n\t\t\t\t\t\t\t\t$data[$c] = substr($data[$c], 3);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$es_index[$c]['code'] = $data[$c];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$line1[$data[$c]] = $c ;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\n\t\t\t\t\t\t$num = count($data);\n\t\t\t\t\t\tfor ($c=1; $c < $num; $c++) {\n\t\t\t\t\t\t\t$es_index[$c]['type'] = (string) $data[$c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t$num = count($data);\n\t\t\t\t\t\tfor ($c=1; $c < $num; $c++) {\n\t\t\t\t\t\t\t$es_index[$c]['boost'] = (float)$data[$c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tfor ($c=1; $c < $num; $c++) {\n\t\t\t\t\t\t\t$d[$es_index[$c]['code']] = $data[$c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$docs[] = $d;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfclose($handle);\n\t\t}\n\t\t\n\t\t$this->_line1 = $line1;\n\t\t$this->_es_index = $es_index;\n\t\t$this->_docs = $docs;\n\t\t\n\t\treturn $this;\n\t}", "function parse_text_row($row)\n{\n //get main value\n $split_string = explode('->', $row);\n $main = $split_string[0];\n $values = explode(\"|\",$split_string[1]);\n //add info to an array\n $info = array(\n \"main\" => $main,\n \"values\" => $values\n );\n //return associate array\n return $info;\n\n}", "function parse_aspirante_metas($aspirantes_field_index){\n $aspirante_metas = array();\n echo '<br>';\n echo '<br>';\n // //echo the name of the file you're currently inserting intro database\n // echo '14jun_info_aspirantes/14jun_aspirantes_faltantes_info1.csv';\n // echo '<br>';\n // echo '<br>';\n // already tried to put a variable instead of hardcoded text, doesn't work\n // be careful if you want to see it not working for yourself\n $CSVfp = fopen(\"csv_instructores/info_16.csv\", \"r\");\n $fields = array_keys($aspirantes_field_index);\n if($CSVfp !== FALSE) {\n while(! feof($CSVfp)) {\n $data = fgetcsv($CSVfp, 1000, \",\");\n for($i = 0; $i < sizeof($fields); $i++){\n $field = $fields[$i];\n $index = $aspirantes_field_index[$field] - 1;\n $aspirante_meta[$field] = $data[$index];\n }\n array_push($aspirante_metas,$aspirante_meta);\n }\n }\n fclose($CSVfp);\n return $aspirante_metas;\n}", "static function importVehiclesCSV($lines, $catid)\r\n { \r\n \r\n \r\n global $database;\r\n $retVal = array();\r\n $i = 0;\r\n \r\n foreach ($lines as $line) {\r\n $tmp = array();\r\n if (trim($line) == \"\") continue;\r\n \r\n $line = explode('|', $line);\r\n $vehicle = new mosVehicleManager($database);\r\n \r\n $vehicle->asset_id = $line[0];\r\n $vehicle->vehicleid = trim($line[1]);\r\n //$vehicle->catid = trim($line[2]);\r\n $vehicle->sid = trim($line[3]);\r\n $vehicle->fk_rentid = trim($line[4]);\r\n $vehicle->description = $line[5];\r\n $vehicle->link = $line[6];\r\n $vehicle->listing_type = $line[7];\r\n if (($vehicle->listing_type) != ''){\r\n $listing_type[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $listing_type[_VEHICLE_MANAGER_OPTION_FOR_RENT] = 1;\r\n $listing_type[_VEHICLE_MANAGER_OPTION_FOR_SALE] = 2;\r\n $vehicle->listing_type = $listing_type[$vehicle->listing_type];\r\n }\r\n else{\r\n $vehicle->listing_type = 0;\r\n }\r\n \r\n $vehicle->price = $line[8];\r\n $vehicle->priceunit = $line[9];\r\n $vehicle->vtitle = $line[10];\r\n $vehicle->maker = $line[11];\r\n $vehicle->vmodel = $line[12];\r\n $vehicle->vtype = $line[13];\r\n if (($vehicle->vtype) != ''){\r\n $vtype[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $vtype1 = explode(',', _VEHICLE_MANAGER_OPTION_VEHICLE_TYPE);\r\n $k = 1;\r\n foreach ($vtype1 as $vtype2) {\r\n $vtype[$vtype2] = $k;\r\n $k++;\r\n }\r\n $vehicle->vtype = $vtype[$vehicle->vtype];\r\n }\r\n else{ $vehicle->vtype = 0; }\r\n \r\n $vehicle->vlocation = $line[14];\r\n $vehicle->vlatitude = $line[15];\r\n $vehicle->vlongitude = $line[16];\r\n $vehicle->map_zoom = $line[17];\r\n $vehicle->contacts = $line[18];\r\n $vehicle->year = $line[19];\r\n $vehicle->vcondition = $line[20];\r\n if (($vehicle->vcondition) != ''){\r\n $vcondition[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $vcondition1 = explode(',', _VEHICLE_MANAGER_OPTION_VEHICLE_CONDITION);\r\n $k = 1;\r\n foreach ($vcondition1 as $vcondition2) {\r\n $vcondition[$vcondition2] = $k;\r\n $k++;\r\n }\r\n $vehicle->vcondition = $vcondition[$vehicle->vcondition];\r\n } else{\r\n $vehicle->vcondition = 0;\r\n }\r\n \r\n $vehicle->mileage = $line[21];\r\n $vehicle->image_link = $line[22];\r\n $vehicle->listing_status = $line[23];\r\n if (($vehicle->listing_status) != ''){\r\n $listing_status[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $listing_status1 = explode(',', _VEHICLE_MANAGER_OPTION_LISTING_STATUS);\r\n $k = 1;\r\n foreach ($listing_status1 as $listing_status2) {\r\n $listing_status[$listing_status2] = $k;\r\n $k++;\r\n }\r\n $vehicle->listing_status = $listing_status[$vehicle->listing_status];\r\n } else{ $vehicle->listing_status = 0; }\r\n \r\n $vehicle->price_type = $line[24];\r\n if (($vehicle->price_type) != '')\r\n {\r\n $price_type[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $price_type1 = explode(',', _VEHICLE_MANAGER_OPTION_PRICE_TYPE);\r\n $k = 1;\r\n foreach ($price_type1 as $price_type2) {\r\n $price_type[$price_type2] = $k;\r\n $k++;\r\n }\r\n $vehicle->price_type = $price_type[$vehicle->price_type];\r\n }\r\n else{ $vehicle->price_type = 0; }\r\n \r\n $vehicle->transmission = $line[25];\r\n if (($vehicle->transmission) != ''){\r\n $transmission[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $transmission1 = explode(',', _VEHICLE_MANAGER_OPTION_TRANSMISSION);\r\n $k = 1;\r\n foreach ($transmission1 as $transmission2) {\r\n $transmission[$transmission2] = $k;\r\n $k++;\r\n }\r\n $vehicle->transmission = $transmission[$vehicle->transmission];\r\n }\r\n else{ $vehicle->transmission = 0; }\r\n \r\n $vehicle->num_speed = $line[26];\r\n if (($vehicle->num_speed) != ''){\r\n $num_speed[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $num_speed1 = explode(',', _VEHICLE_MANAGER_OPTION_NUMBER_OF_SPEEDS);\r\n $k = 1;\r\n foreach ($num_speed1 as $num_speed2) {\r\n $num_speed[$num_speed2] = $k;\r\n $k++;\r\n }\r\n $vehicle->num_speed = $num_speed[$vehicle->num_speed];\r\n }\r\n else{ $vehicle->num_speed = 0; }\r\n \r\n $vehicle->interior_color = $line[27];\r\n $vehicle->exterior_color = $line[28];\r\n $vehicle->doors = $line[29];\r\n if (($vehicle->doors) != '')\r\n {\r\n $doors[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $doors1 = explode(',', _VEHICLE_MANAGER_OPTION_NUMBER_OF_DOORS);\r\n $k = 1;\r\n foreach ($doors1 as $doors2) {\r\n $doors[$doors2] = $k;\r\n $k++;\r\n }\r\n $vehicle->doors = $doors[$vehicle->doors];\r\n }\r\n else{\r\n $vehicle->doors = 0;\r\n }\r\n \r\n $vehicle->engine = $line[30];\r\n $vehicle->fuel_type = $line[31];\r\n if (($vehicle->fuel_type) != ''){\r\n $fuel_type[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $fuel_type1 = explode(',', _VEHICLE_MANAGER_OPTION_FUEL_TYPE);\r\n $k = 1;\r\n foreach ($fuel_type1 as $fuel_type2) {\r\n $fuel_type[$fuel_type2] = $k;\r\n $k++;\r\n }\r\n $vehicle->fuel_type = $fuel_type[$vehicle->fuel_type];\r\n }\r\n else{\r\n $vehicle->fuel_type = 0;\r\n }\r\n \r\n $vehicle->drive_type = $line[32];\r\n if (($vehicle->drive_type) != ''){\r\n $drive_type[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $drive_type1 = explode(',', _VEHICLE_MANAGER_OPTION_DRIVE_TYPE);\r\n $k = 1;\r\n foreach ($drive_type1 as $drive_type2) {\r\n $drive_type[$drive_type2] = $k;\r\n $k++;\r\n }\r\n $vehicle->drive_type = $drive_type[$vehicle->drive_type];\r\n }\r\n else{ $vehicle->drive_type = 0; }\r\n \r\n $vehicle->cylinder = $line[33];\r\n if (($vehicle->cylinder) != '')\r\n {\r\n $cylinder[_VEHICLE_MANAGER_OPTION_SELECT] = 0;\r\n $cylinder1 = explode(',', _VEHICLE_MANAGER_OPTION_NUMBER_OF_CYLINDERS);\r\n $k = 1;\r\n foreach ($cylinder1 as $cylinder2) {\r\n $cylinder[$cylinder2] = $k;\r\n $k++;\r\n }\r\n $vehicle->cylinder = $cylinder[$vehicle->cylinder];\r\n }\r\n else {$vehicle->cylinder = 0;}\r\n \r\n $vehicle->wheelbase = $line[34];\r\n $vehicle->seating = $line[35];\r\n $vehicle->city_fuel_mpg = $line[36];\r\n $vehicle->highway_fuel_mpg = $line[37];\r\n $vehicle->wheeltype = $line[38];\r\n $vehicle->rear_axe_type = $line[39];\r\n $vehicle->brakes_type = $line[40];\r\n $vehicle->exterior_amenities = $line[41];\r\n $vehicle->dashboard_options = $line[42];\r\n $vehicle->interior_amenities = $line[43];\r\n $vehicle->safety_options = $line[44];\r\n $vehicle->w_basic = $line[45];\r\n $vehicle->w_drivetrain = $line[46];\r\n $vehicle->w_corrosion = $line[47];\r\n $vehicle->w_roadside_ass = $line[48];\r\n $vehicle->checked_out = $line[49];\r\n $vehicle->checked_out_time = $line[50];\r\n $vehicle->ordering = $line[51];\r\n $vehicle->date = $line[52];\r\n $vehicle->hits = $line[53];\r\n $vehicle->edok_link = $line[54];\r\n $vehicle->published = $line[55];\r\n $vehicle->approved = $line[56];\r\n $vehicle->country = $line[57];\r\n $vehicle->region = $line[58];\r\n $vehicle->city = $line[59];\r\n $vehicle->district = $line[60];\r\n $vehicle->zipcode = $line[61];\r\n $vehicle->owneremail = $line[62];\r\n $vehicle->language = $line[63];\r\n $vehicle->featured_clicks = $line[64];\r\n $vehicle->featured_shows = $line[65];\r\n $vehicle->extra1 = $line[66];\r\n $vehicle->extra2 = $line[67];\r\n $vehicle->extra3 = $line[68];\r\n $vehicle->extra4 = $line[69];\r\n $vehicle->extra5 = $line[70];\r\n $vehicle->extra6 = $line[71];\r\n $vehicle->extra7 = $line[72];\r\n $vehicle->extra8 = $line[73];\r\n $vehicle->extra9 = $line[74];\r\n $vehicle->extra10 = $line[75];\r\n $vehicle->video_link = $line[76];\r\n $vehicle->owner_id = $line[77]; \r\n \r\n $tmp[0] = $i;\r\n $tmp[1] = trim($vehicle->vehicleid);\r\n $tmp[2] = $vehicle->vtitle;\r\n $tmp[3] = $vehicle->vmodel;\r\n $tmp[4] = $vehicle->price . ' ' . $vehicle->priceunit;\r\n \r\n \r\n //print_r($catid); exit;\r\n \r\n if(!$vehicle->check() || !$vehicle->store()){\r\n $tmp[5] = $vehicle->getError();\r\n }\r\n else{\r\n $tmp[5] = \"OK\";\r\n $vehicle->saveCatIds($catid);\r\n }\r\n \r\n $retVal[$i] = $tmp;\r\n $i++;\r\n \r\n \r\n }\r\n return $retVal;\r\n \r\n }", "protected function parseFromCsv() {\n $fileLocation = Config::getConfig('cve_file_location');\n //the csv file contains a few lines which are descriptive about the file, rather than lines we care about.\n //because the headers are not on the first line, I am assuming that they could be on any line, and therefore I have hard coded them above.\n $i = 0;\n $fails = [];\n if (($handle = fopen($fileLocation, \"r\")) !== FALSE) {\n $this->logger->info('Parsing file: ' . $fileLocation);\n //truncate the tables;\n $this->cveModel->clearCVEData();\n while (($data = fgetcsv($handle, 0, \",\")) !== FALSE) {\n preg_match('/CVE-[0-9]+-[0-9]+/', $data[$this->fields['name']], $matches);\n //not a line we want to look at.\n if (!$matches) {\n continue;\n }\n\n try {\n $record = $this->prepareData($data);\n $this->cveModel->saveCVERecord($record);\n $i++;\n } catch (\\Exception $e) {\n $fails[] = $data[$this->fields['name']];\n }\n }\n if ($fails) {\n $this->logger->warn('Failed to save the records: ' . implode(',' ,$fails));\n }\n $this->logger->info('File finished parsing, ' . $i . ' records have been saved to the database');\n }\n }", "function getCandidates(){\n$file = \"candidates.csv\";\n$candidateArray = array_map('str_getcsv', file($file));\n array_walk($candidateArray, function(&$a) use ($candidateArray) {\n $a = array_combine($candidateArray[0], $a);\n });\n array_shift($candidateArray);\n\nreturn $candidateArray;\n}", "function readData($argFileHandle, $argRegEx)\n\t{\n\t\t$data = array(array());\n\t\tarray_pop($data);\n\t\twhile (!feof($argFileHandle)) {\n\t\t\t$line = fgets($argFileHandle, 4096);\n\t\t\t$line = preg_replace(\"/\\[([a-zA-Z\\s]+)\\]/\",\n\t\t\t\t\t \"[[base-sitestats.\\\\1]]\", $line);\n\t\t\tif (preg_match($argRegEx, $line, $matches)) {\n\t\t\t\tarray_push($data, $matches);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "function handleRow($row,$eaName,$differDate){\n $csv_row = \"\";\n $sDay = \"\";\n $eDay = \"\";\n $sTime = \"\";\n $eTime = \"\";\n $allDay = 'False';\n $desc = \"\";\n $loc = \"\";\n $priv = 'True';\n //$sYearDay = \"\";\n// Subject\n $subject = trim($row[4]). \" (\" . trim($row[6]). \") \" . trim($row[1]). \"-\" . trim($row[2]);\n// Start date\n if (!empty($row[0])) {\n $sDay = trim($row[0]);\n }\n// Start time\n // To get day light saving time + local time difference \n // (google adds this automatically in import to google calendar, so has to be subtracted from time hour)\n \n $timezone = \"Europe/Helsinki\";\n $localAt21 = new DateTime($differDate, new DateTimeZone($timezone));\n $differ = $localAt21->getOffset() / 3600;\n\n if (!empty($row[1])) {\n //$sTimeH = csvTime(trim($row[1]),\"\",\":\");\n // if need for time zone or day light saving times: use variable differ (+ 3, summer time)\n $sTimeH = csvTime(trim($row[1]),\"\",\":\") + $differ;\n $sTimeM = csvTime(trim($row[1]),\":\",\"\");\n $sTime = $sTimeH . ':' . $sTimeM;\n }\n \n// End date\n if (!empty($row[0])) {\n $eDay = trim($row[0]);\n }\n// End time\n if (!empty($row[2])) {\n // $eTimeH = csvTime(trim($row[2]),\"\",\":\");\n $eTimeH = csvTime(trim($row[2]),\"\",\":\") + $differ;\n $eTimeM = csvTime(trim($row[2]),\":\",\"\");\n $eTime = $eTimeH . ':' . $eTimeM;\n }\n\n//Description (Coach)\n if (!empty($row[3])) {\n if (!empty($eaName)) {\n $desc = trim($row[3]);\n } else {\n $desc = trim($row[6]);\n }\n }\n//Location\n if (!empty($row[0])) {\n $loc = trim($row[5]);\n }\n $csv_row .= $subject .',' . $sDay . ',' . $sTime . ',' . $eDay . ',' . $eTime . ',' . $allDay . ',' . $desc . ',' .\n $loc . ',' . $priv;\n return $csv_row;\n}", "function get_matches($rq){\n global $magnatune;\n $tracks = @$magnatune[metaphone($rq->artist)][metaphone($rq->track)];\n if(!$tracks) return array();\n $ret = array();\n foreach($tracks as $t){\n $pi = new stdclass;\n $pi->artist = $t['artist'];\n $pi->track = $t['track'];\n $pi->album = $t['album'];\n $pi->source = \"Magnatune.com\";\n// $pi->size = 0;\n $pi->bitrate= 128;\n $pi->duration = (int)$t['duration'];\n $pi->url = $t['url'];\n $pi->score = (float)1.00;\n $ret[]=$pi;\n }\n return $ret;\n}", "public function get_all_match() {\n /* Puis tous les matchs de cette dernière saison */\n $query = $this->_bdd->query(\"select * from MATCHS order by Id DESC\");\n $this->_nb = 0;\n if( $query->rowCount() > 0) {\n while ($data = $query->fetch()) {\n $this->_data[$this->_nb] = $data;\n $this->_data[$this->_nb]['Saison'] = $this->_bdd->query(\"select Saison from SAISONS where Id = \".$data['IdSaison']);\n $this->_nb++;\n }\n }\n }", "public function read()\n {\n // Return array\n $data = [];\n\n // Read the whole csv file\n $contents = file_get_contents($this->file);\n\n // Trim first the string\n $contents = trim($contents);\n\n // Explode by new line for mac and window\n $results = preg_split('/\\r\\n|\\r|\\n/', $contents);\n\n // Go through all of the result (exploded new line)\n foreach ($results as $key => $result) {\n // Check if key is first then skip\n if ($key == 0) {\n continue;\n }\n // Separate the values and add it to the result\n array_push($data, str_getcsv($result));\n }\n\n return $data;\n }", "public function getValidatedRecords($file)\n {\n $enclosure = $this->m_postvars['enclosure'];\n $delimiter = $this->m_postvars['delimiter'];\n $columncount = $this->m_postvars['columncount'];\n $skipfirstrow = $this->m_postvars['skipfirstrow'];\n $allFields = $this->m_postvars['allFields'];\n $col_map = $this->m_postvars['col_map'];\n\n $allFieldsValues = $this->getAllFieldsValues($col_map);\n $initial_values = $this->m_importNode->initial_values();\n\n $validatedrecs = [];\n $validatedrecs['add'] = [];\n $validatedrecs['update'] = [];\n $importerrors = [];\n $importerrors[0] = [];\n\n $importerrors[0] = array_merge($importerrors[0], $this->checkImport($col_map, $initial_values));\n $allfielderror = $this->checkAllFields($allFields, $allFieldsValues);\n if ($allfielderror) {\n $importerrors[0][] = $allfielderror;\n }\n\n if (Tools::count($importerrors[0]) > 0) {\n // don't start importing if even the minimum requirements haven't been met\n return array('importerrors' => &$importerrors, 'validatedrecs' => array());\n }\n\n static $mb_converting_exists = null;\n if (!isset($mb_converting_exists)) {\n $mb_converting_exists = function_exists('mb_convert_encoding');\n Tools::atkdebug('Checking function_exists(\"mb_convert_encoding\")');\n }\n\n static $atkCharset = null;\n if (!isset($atkCharset)) {\n $atkCharset = Tools::atkGetCharset();\n Tools::atkdebug('setting atkcharset static!');\n }\n\n //copy the csv in a record and add it to the db\n $fp = fopen($file, 'r');\n if ($skipfirstrow == '1') {\n $line = fgets($fp);\n }\n for ($line = fgets($fp), $counter = 1; $line !== false; $line = fgets($fp), $counter++) {\n Tools::atkdebug(\"Validating record nr. $counter\");\n //if we have an empty line, pass it\n if (trim($line) == '') {\n continue;\n }\n\n //large import are a problem for the maximum execution time, so we want to set for each\n //loop of the for-loop an maximum execution time\n set_time_limit(60);\n Tools::atkdebug('set_time_limit(60)');\n\n if ($atkCharset != '' && $mb_converting_exists) {\n $line = mb_convert_encoding($line, $atkCharset);\n }\n\n $data = $this->fgetcsvfromline($line, $columncount, $delimiter, $enclosure);\n\n $rec = $initial_values;\n\n for ($i = 0, $_i = Tools::count($col_map); $i < $_i; ++$i) {\n if ($col_map[$i] != '-') {\n if (!in_array($col_map[$i], $allFields)) {\n // column is mapped\n $value = $this->_getAttributeValue($col_map[$i], $allFields, $data[$i], $importerrors, $counter, $rec);\n } else { //this is the allField\n $value = $allFieldsValues[$col_map[$i]];\n }\n $this->addToRecord($rec, $col_map[$i], $value);\n }\n }\n $this->validateRecord($rec, $validatedrecs, $importerrors, $counter);\n }\n\n // close file\n @fclose($fp);\n\n return array('importerrors' => &$importerrors, 'validatedrecs' => &$validatedrecs);\n }", "function drush_ting_smart_search_score_importer() {\r\n\r\n $file = drush_get_option('file');\r\n //dpm($file);\r\n if (!empty($file) && file_exists($file)) {\r\n $csv_data = array_map(function($v){return str_getcsv($v, \",\", \"\\t\");}, file($file));\r\n // loop through array and skip 0 lines\r\n for ($i = 0; $i < 80000/*count($csv_data)*/;$i++) {\r\n $title = str_replace(' and ', ' ', $csv_data[$i][0]);\r\n $title = str_replace('(', '', $title);\r\n $title = str_replace(')', '', $title);\r\n $score = ($csv_data[$i][1] == '-') ? 0 : $csv_data[$i][1];\r\n\r\n\r\n // fail if key fields are not present\r\n if (empty($title)) {\r\n drupal_set_message('Key fields are missing from array '.$i.'. Check the file and try again');\r\n } else {\r\n\r\n drupal_set_message($title.' - '.$score);\r\n // find the matching entity and assign the stats\r\n $ssquery = new EntityFieldQuery();\r\n\r\n $ssquery->entityCondition('entity_type', 'ting_type')\r\n ->entityCondition('bundle', 'smart_search_string')\r\n ->propertyCondition('title', $title, '=');\r\n\r\n $result = $ssquery->execute();\r\n\r\n if (isset($result['ting_type'])) {\r\n $string_items_nids = array_keys($result['ting_type']);\r\n $string_item = entity_metadata_wrapper('ting_type', $string_items_nids[0]);\r\n $string_item->field_sss_hits_score->set($score);\r\n // save\r\n $string_item->save();\r\n drupal_set_message('Title: '.$title.' has been updated with: '.$score);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n } else {\r\n return 'No file given to import or file does not exist';\r\n }\r\n }", "function happywedding_vendors_import(){\n if(isset($_POST['upload-submit'])) {\n //print_r($_FILES);\n $file_path = $_FILES['vendor-data']['tmp_name'];\n $handle = @fopen($file_path,\"r\"); \n \tif ($handle) {\n \t $i = 0;\n \t $vendor_array = array();\n \t $output_result = '<div style=\"font-size:14px;\">';\n //$csv = fgetcsv($handle);print_r($csv);exit;\n \t while (!feof($handle)) { \n \t $vendor = fgetcsv($handle);//fgets($handle, 4096); \n \t if($i>0) {\n \t //$vendor = explode(\",\",$record);\n \t if(isset($vendor[1])) {\n //0no. ,1name, 2url, 3facebook, 4location, 5contact_name, 6contact_tel, 7contact_email\n// \t $vendor_name = $vendor[1];//strtolower(preg_replace('/\\(.*\\)/','',$sale[1]));\n// \t $vendor_url = $vendor[2];\n// $vendor_facebook = $vendor[3];\n// $vendor_location = $vendor[4];\n// \t $user_phone = str_replace('-','',$sale[4]);\n \t $vendor_data = array(\n \"name\" => $vendor[1],\n \"url\" => $vendor[2],\n \"facebook\" => $vendor[3],\n \"location\" => $vendor[4],\n \"contact_name\" => $vendor[5],\n \"contact_tel\" => $vendor[6],\n \"contact_email\" => $vendor[7]\n \t );\n \t print_r($vendor_data);//exit;\n \t $result = _vendors_create($vendor_data);\n \t $output_result .= $result.'<br>';//break;\n \t //$vendor_array[] = $vendor_data;\n\t }\n\t\t }\n \t\t $i++;\n \t } \n \t $output_result .= '</div>';\n \t fclose($handle);\n \t echo $output_result;\n \t //echo \"<pre>\";print_r($vendor_array);echo \"</pre>\";\n exit;\n \t}\n }else {\n $output = '<form enctype=\"multipart/form-data\" target=\"upload-result\" method=\"POST\" action=\"/admin/vendors/import\">';\n// $output .= 'Region : <select id=\"sale-region\" name=\"sale-region\" class=\"form-select\"><option value=\"c\" selected=\"selected\">ภาคกลาง</option><option value=\"n\" >ภาคเหนือ</option><option value=\"s\">ภาคใต้</option><option value=\"e\">ภาคตะวันออก</option><option value=\"ne\">ภาคตะวันออกเฉียงเหนือ</option><option value=\"w\">ภาคตะวันตก</option></select><br>';\n $output .= 'File : <br>'; \n $output .= '<input type=\"file\" name=\"vendor-data\" class=\"form-file\"><input name=\"upload-submit\" type=\"submit\" class=\"form-submit\" value=\"Upload\"></form>';\n //$output .= 'Ex: <a href=\"/example/sales-import.csv\">Example.csv</a>';\n $output .= '<iframe id=\"upload-result\" name=\"upload-result\" style=\"height:400px;width:100%;overflow:auto;border:none;\"><iframe>';\n return $output;\n }\n \n\n\n\n}", "public static function readRestaurantsByMatchingNames($matchString) {\n\t\t\n\t\t//array to store the restaurant details\n\t\t$data = array();\t\n\n\t\t$queryResult = DB::table('vendors as v')\n\t\t\t\t\t\t->join('vendor_locations as vl', 'vl.vendor_id', '=', 'v.id')\t\t\t\t\t\t\n\t\t\t\t\t\t->where('v.name','LIKE',\"%$matchString%\")\n\t\t\t\t\t\t->where('vl.status', 'Active')\n\t\t\t\t\t\t//->where('vl.a_la_carte','=', 1)\n\t\t\t\t\t\t->select('v.name', 'v.id as vendor_id',\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t DB::raw('COUNT(vl.vendor_id) as branch_count'))\n\t\t\t\t\t\t->groupBy('vl.vendor_id');\n\t\t\t\t\t\t//->get();\n\n\t\t\n\t\tif(array_key_exists('HTTP_X_WOW_CITY', $_SERVER)) { \n\t\t\t$queryResult = $queryResult->join('vendor_location_address as vla', 'vla.vendor_location_id', '=', 'vl.id')\n\t\t\t\t\t\t\t\t\t ->where('vla.city_id','=', $_SERVER[\"HTTP_X_WOW_CITY\"]);\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t//echo $queryResult->toSql(); die();\n\t\t\t\t\t\t\t //print_r($queryResult); die();\n\t\t}\n\t\t\n\t\t$queryResult = $queryResult->get();\n\t\t\n\t\t\t\t\t\t\n\t\tif($queryResult) {\n\t\t\t\n\t\t\tforeach($queryResult as $row) {\n\t\t\t\t$data[] = array(\n\t\t\t\t\t\t\t\t'id' => $row->vendor_id,\n\t\t\t\t\t\t\t\t'name' => $row->name,\n\t\t\t\t\t\t\t\t'branches' => $row->branch_count,\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$arrResponse['status'] = Config::get('constants.API_SUCCESS');\n\t\t$arrResponse['data'] = $data;\n\t\t\n\t\treturn $arrResponse;\n\t}" ]
[ "0.58056784", "0.57898176", "0.5619654", "0.5455533", "0.5447341", "0.5444841", "0.5412025", "0.5385104", "0.5328345", "0.5301048", "0.52809215", "0.5273156", "0.526488", "0.5262859", "0.5214906", "0.5184854", "0.5168099", "0.5153197", "0.51407677", "0.5136825", "0.5087471", "0.5069952", "0.5066592", "0.5061829", "0.50531995", "0.5045717", "0.50434715", "0.5036815", "0.5033181", "0.50300676" ]
0.7685221
0
/ Will brake down the personality types of the client and the potential date, this function will return whether or not this is a match when considering Personality Type
function type_match($type_date, $type_client) { $brake_type_client = []; $brake_type_date = []; $compatibility = 0; $brake_type_date = str_split($type_date); $brake_type_client = str_split($type_client); for ($i = 0; $i < 4; $i++){ switch ($brake_type_client[$i]) { case $brake_type_date[0]: $compatibility++; break; case $brake_type_date[1]: $compatibility++; break; case $brake_type_date[2]: $compatibility++; break; case $brake_type_date[3]: $compatibility++; break; } } return $compatibility; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPersonality($matchPersonality, $userPersonality) {\n\n for ($i = 0; $i < 4; $i++) {\n if ($matchPersonality[$i] == $userPersonality[$i]) {\n return true;\n }\n }\n}", "public function hasDateType(){\n return $this->_has(5);\n }", "private function is_allowed_contact_type($type){\n\t\t$allowed = array(\n\t\t\t'all',\n\t\t\t'westminstermp',\n\t\t\t'council',\n\t\t\t'regionalmp',\n\t\t\t'mep'\n\t\t);\n\t\t$found = array_search($type, $allowed);\n\t\treturn ($found===true)? true : false;\n\t}", "function isTypeLeague() {\r\n\t\treturn $this->record['type'] == 1;\r\n\t}", "public function isThisMatch(DateTime $date, int $idTeamA, int $idTeamB) {\n // if($idTeamA === 32 && $idTeamB === 21 && $date->format('Y-m-d') === $this->getDate()->format('Y-m-d') && $this->getId() === 33) {\n // echo '<br/>dateMatch => '.$date->format('Y-m-d').' ';\n // echo '<br/>Match => '.$this->getDate()->format('Y-m-d').'</br>';\n // print_r($this);\n\n // echo '==========================<br>';\n // echo 'if('.$date->format('Y-m-d').' === '.$this->getDate()->format('Y-m-d').' && (('.$idTeamA.' === '.$this->teamA.' && '.$idTeamB.' === '.$this->teamB.') || ('.$idTeamB.' === '.$this->teamA.' && '.$idTeamA.' === '.$this->teamB.'))) {<br/>';\n // }\n if($date->format('Y-m-d') === $this->getDate()->format('Y-m-d') && (($idTeamA === $this->teamA && $idTeamB === $this->teamB) || ($idTeamB === $this->teamA && $idTeamA === $this->teamB))) {\n\n // if($this->getId() === 33) {\n // echo '<br/>dateMatch => '.$date->format('Y-m-d').' ';\n // echo '<br/>Match => '.$this->getDate()->format('Y-m-d').'</br>';\n // print_r($this);\n // }\n return true;\n }\n return false;\n }", "protected function isDate(string $type) : bool\n {\n foreach ($this->defaultDates as $date) {\n return starts_with($type, $date);\n }\n\n return false;\n }", "function bgl360_di_isTrusteeTypeCompany($trusteeFullName) {\r\n $companyAbrArr = [\r\n 'PTY. LTD.',\r\n 'PTY. LTD',\r\n 'PTY. LIMITED',\r\n 'PTY LTD',\r\n 'PTY LTD.',\r\n 'PTY LIMITED',\r\n 'PROPRIETARY LTD.',\r\n 'PROPRIETARY LTD',\r\n 'PROPRIETARY LIMITED'\r\n ];\r\n $trusteeFullNameLower = strtolower(str_replace(' ', '', $trusteeFullName));\r\n $isCompany = false;\r\n foreach ( $companyAbrArr as $key => $companyAbr) {\r\n $companyAbrLower = strtolower(str_replace(' ', '', $companyAbr));\r\n // echo \"\\n <br> $trusteeFullName => \" . $trusteeFullNameLower . \" = $companyAbr => \" . $companyAbrLower;\r\n\r\n $pos = strpos($trusteeFullNameLower, $companyAbrLower);\r\n\r\n if ($pos !== false) {\r\n $isCompany = true;\r\n }\r\n }\r\n return $isCompany;\r\n}", "public static function IsDateCol($strType)\n {\n $arrType = array('DATETIME','DATE','TIMESTAMP','SMALLDATE','TIME', 'SMALLDATETIME');\n\n return in_array(strtoupper($strType), $arrType);\n }", "public function scoreForType($type) {\n\t\tif (Strings::compare($type, 'date') || Strings::compare($type, 'DateTime') || Strings::compare($type, 'Nette\\Utils\\DateTime')) {\n\t\t\treturn 1;\n\t\t}\n\t}", "function checkOfferOrNewArrival($pName,$typeOfAddition){\n\t\n\t\t$query = \"select * from business_added where comodity = '$pName' and type='$typeOfAddition'\";\n\t\t\n\t\t$result = mysql_query($query) or die(\"Query failed\" . mysql_error());\n\t\t\n\t\tif(mysql_num_rows($result)>0){\n\t\t\n\t\t\t//recors found\n\t\t\t//echo \"similar record found\";\n\t\t\treturn false;\n\t\t\t\n\t\t}else{\n\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\t\n\t}", "public function isSociety(): bool\n {\n return PersonInterface::MORAL === $this->type;\n }", "private function is_valid_date( $type, $year = 0, $month = 0, $day = 0, $week = 0 ) {\r\n\t\tswitch ( $type ) {\r\n\t\t\tcase 'y':\r\n\t\t\t\t$bool = ( $year >= 1 && $year <= 32767 );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'yw':\r\n\t\t\t\t$bool = ( $year >= 1 && $year <= 32767 && $week >= 0 && $week <= 53 );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'ym':\r\n\t\t\t\t$bool = ( $year >= 1 && $year <= 32767 && $month >= 1 && $month <= 12 );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'ymd':\r\n\t\t\t\t$bool = checkdate( $month, $day, $year );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'm':\r\n\t\t\t\t$bool = ( $month >= 1 && $month <= 12 );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'md':\r\n\t\t\t\t$bool = ( $month >= 1 && $month <= 12 && $day >= 1 && $day <= 31 );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'w':\r\n\t\t\t\t$bool = ( $week >= 0 && $week <= 53 );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'd':\r\n\t\t\t\t$bool = ( $day >= 1 && $day <= 31 );\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn $bool;\r\n\t}", "function DateCheck(&$str,$type) {\n switch($type) {\n default: break;\n case \"of_date\":\n\t$orig=$str;\n\tif (strlen($str)==3 and in_array($str,explode(\",\",\"jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec\"))) {\n\t\t$s = strtotime($str);\n\t\tif (date('Y-m')<date('Y-m',$s)) $str=date('Y-m',strtotime(\"$str last year\"));\n\t\telse $str = date('Y-m',$s);\n\t} else {\n\t\tif ($date = strtotime($str)) $str=date(\"Y-m-d\",$date);\n\t}\n#\tif (!strpos($orig,date('D',strtotime($str)))) $str=str_replace(date('-d',strtotime($str)),'-',$str);\n }\n }", "public static function f_check_date_1($param){\n $is_date_1 = FALSE;\n $is_date_2 = FALSE;\n $temp_date_1 = DateTime::createFromFormat(\"Y-m-d\", $param);\n $is_date_1 = isset($temp_date_1) && ($temp_date_1->format(\"Y-m-d\") === $param);\n //$temp_date_2 = DateTime::createFromFormat(\"m/d/Y\", $param);\n //$is_date_2 = isset($temp_date_2) && ($temp_date_2->format(\"m/d/Y\") === $param);\n return $is_date_1 || $is_date_2;\n }", "public static function isDateUsable($date) {\n\t\t\t$day = \"(0[1-9]|[1-2][0-9]|3[0-1])\";\n\t\t\t$month = \"(0[1-9]|1[0-2])\";\n\t\t\t$year = \"[0-9]{4}\";\n\t\t\t$pattern = \"/^\".$day.\"\\/\".$month.\"\\/\".$year.\"$/\";\n\n\t\t\treturn preg_match($pattern, $date);\n\t\t}", "function checkClash($day, $month, $year, $venue , $team1Name, $team2name, $matches){\n foreach ($matches as $match){\n $team1 = $match->team[0];\n $team2 = $match->team[1];\n\n\n if(!(($team1 == $team1Name && $team2 == $team2name) ||\n ($team2 == $team1Name && $team1 == $team2name))){\n\n ///to check to see whether the dates are the same between matches\n $strDate = $day . '/' . $month . '/' . $year;\n $matchDate = $match->date->day . '/' . $match->date->month . '/' . $match->date->year;\n if($strDate == $matchDate){\n\n // if same date\n if($venue == $match->venue){\n return false;\n }\n // check to see team isn't playing on the same day\n if($team1 == $team1Name || $team1 == $team2name){\n return false;\n }\n if($team2 == $team1Name || $team2 == $team2name){\n return false;\n }\n }\n return true;\n }\n\n }\n}", "private function Gooddate($date): bool { \r\nif(!preg_match('/^\\d{4}-\\d\\d-\\d\\d$/', $date))\r\n\treturn false;\r\nreturn true;\r\n}", "protected function _checkDateField($copernicaStructure)\n {\n return $copernicaStructure['type'] == 'date';\n }", "public static function isDate($key) {\n $datumProperties = self::forKey($key);\n if (is_null($datumProperties)) return false;\n else {\n $dataType = $datumProperties->dbDataType;\n $isDate = ($dataType == 'date');\n return $isDate;\n }\n }", "public function isPartner($type);", "function Is_Date($date)\n\t\t{\n\t\t\t$date = explode(\"-\", $date);\n\n\t\t\treturn checkdate($date[1],$date[2],$date[0]);\n\t\t}", "function match($date){\n\t\t$query = mysql_query(\"SELECT * FROM holyday WHERE holyday = '$date'\");\n\t\tif (mysql_num_rows($query) == 1) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "function is($type)\n {\n return strcmp($type,$this->type)===0;\n }", "protected function is_allowed_project_type(): bool {\n\t\t$allowed_project_types = [\n\t\t\tPlato_Project_Type::STV(),\n\t\t\tPlato_Project_Type::TEEN(),\n\t\t\tPlato_Project_Type::FAM(),\n\t\t];\n\t\treturn $this->project_type->equals( ...$allowed_project_types );\n\t}", "function checkTheDate($date)\n\t{\n\t\treturn (date('Y-m-d', strtotime($date)) == $date);\n\t}", "public function isMatching()\n {\n // We retrieve current Customer title\n // 1 M\n // 2 Mrs\n // 3 Miss\n $titleId = $this->facade->getCustomer()->getTitleId();\n\n // We match the customer title to our stored parameter\n // 1 => self::GENDER_MAN (man)\n // 2 and 3 => self::GENDER_WOMAN (woman)\n $toCheck = self::GENDER_WOMAN;\n if ($titleId == 1) {\n $toCheck = self::GENDER_MAN;\n }\n\n // Is Customer the title gender matching\n // the gender set in this Condition ?\n $condition = $this->conditionValidator->variableOpComparison(\n $toCheck,\n $this->operators[self::INPUT1],\n $this->values[self::INPUT1]\n );\n\n if ($condition) {\n return true;\n }\n\n return false;\n }", "function is_type($vlw, $type)\r\n{\r\n\t$r = FALSE;\r\n\tif (is_string($vlw))\r\n\t{\r\n\t\tswitch ($type)\r\n\t\t{\r\n\t\t\tcase \"int\":\r\n\t\t\t\t$regex = \"/^[0-9]{1,}$/\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"float\":\r\n\t\t\t\t$regex = \"/^([0-9]{1,3}\\.?){1,}((\\,[0-9]{2}){1})?$/\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\t//$regex = \"/^([0-9]{2,4}\\/?\\-?){2}([0-9]{2,4}\\/?\\-?)((\\s?[0-9]{2}\\:?){3})?$/\";\r\n\t\t\t\t$regex = \"/^([0-9]{2})\\/?\\-?([0-9]{2})\\/?\\-?([0-9]{4})$/\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif (preg_match($regex, $vlw))\r\n\t\t{\r\n\t\t\t$r = TRUE;\r\n\t\t}\r\n\t}\r\n\treturn $r;\r\n}", "function Submissions_Search_Details_Data_May($data)\n {\n $res=False;\n if (preg_match(\"(Coordinator|Admin)\",$this->Profile()))\n {\n $res=True;;\n }\n \n return $res;\n }", "public function match($request,$hotel): bool {\n $requestFromDate = $request->getFromDate();\n $requestToDate = $request->getToDate();\n if(is_null($requestFromDate) && is_null($requestToDate))\n return true;\n $availabilities = $hotel->getAvailabilities();\n if(is_null($requestFromDate))\n $requestFromDate = Carbon::minValue();\n if(is_null($requestToDate))\n $requestToDate = Carbon::maxValue();\n $matchesAvailability = false;\n foreach ($availabilities as $availability){\n $availabilityFromDate = $availability->getFromDate();\n $availabilityToDate = $availability->getToDate();\n if($requestFromDate >= $availabilityFromDate && $requestToDate <= $availabilityToDate){\n $matchesAvailability = true;\n break;\n } \n }\n return $matchesAvailability; \n }", "public function is_date($field)\n {\n return (preg_match('/_at$/', $field) >= 1);\n }" ]
[ "0.549718", "0.5467621", "0.5376719", "0.53680164", "0.52505696", "0.51880616", "0.5184424", "0.5114012", "0.509361", "0.5090989", "0.5085323", "0.50824887", "0.5016544", "0.49825305", "0.49820545", "0.4969406", "0.4933538", "0.4926214", "0.48811877", "0.48775768", "0.4875554", "0.48708662", "0.4869861", "0.48510724", "0.48458025", "0.48363936", "0.4821277", "0.48156303", "0.48081413", "0.48052618" ]
0.647052
0
Given an email, return the list of sites owned by that user.
private function get_wpcom_users( $email ) { $exclude_sites = array( 'https://woocommerce.com', ); $this->output->writeln( '<comment>Fetching list of WordPress.com & Jetpack sites...</comment>' ); $all_sites = $this->api_helper->call_wpcom_api( 'rest/v1.1/me/sites/?fields=ID,URL', array() ); if ( ! empty( $all_sites->error ) ) { $this->output->writeln( '<error>Failed. ' . $all_sites->message . '<error>' ); exit; } // Filter out sites from exclude list. $filtered_sites = array_filter( $all_sites->sites, function( $site ) use ( $exclude_sites ) { foreach ( $exclude_sites as $exclude ) { if ( $exclude === $site->URL ) { return false; } } return true; } ); $this->output->writeln( "<comment>Searching for '$email' across " . count( $filtered_sites ) . ' WordPress.com & Jetpack sites...</comment>' ); $site_users_endpoints = array_map( static function( $site ) use ( $email ) { return "sites/$site->ID/users/?search=$email&search_columns=user_email&fields=ID,email,site_ID,URL"; }, $filtered_sites ); // concurrent call for all endpoints. $sites_users = WPCOM_API_Helper::call_api_concurrent( $site_users_endpoints ); // clean up data by removing entries were user was not found. $sites_users = array_filter( $sites_users, static function( $user ) { return ( isset( $user ) && ! isset( $user->error ) && $user->found > 0 ); } ); $data = array(); foreach ( $filtered_sites as $site ) { foreach ( $site_users_endpoints as $index => $endpoint ) { if ( isset( $sites_users[ $index ] ) && str_contains( $endpoint, $site->ID ) ) { $data[] = (object) array( 'userId' => $sites_users[ $index ]->users[0]->ID, 'email' => $sites_users[ $index ]->users[0]->email, 'siteId' => $site->ID, 'siteName' => $site->URL, ); } } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function userWebsites(string $email) \n {\n return $this->select()->columns('twitter, vk, discordapp')\n ->where(\" user_email = '{$email}' \")\n ->get();\n }", "public function getSites($email)\n {\n return $this->apiRequest('customer/site/listByEmail', ['email' => $email], 'GET');\n }", "public function findCustomerListSignupsByEmailAddress($email);", "public function findCustomerListSignupsByEmailAddress($email)\n {\n $url = 'adv/list/signup/emailaddress/' . $email;\n return $this->get($url);\n }", "public function loadUsersByEmail($email);", "function users() {\n $ret = array();\n\n foreach($this->domains() as $d=>$domain_object) {\n foreach($domain_object->users() as $user)\n\t$ret[] = \"{$user}@{$d}\";\n }\n\n return $ret;\n }", "public function get_users_by_email($email) {\r\n return $this->ci->ion_auth_model->get_users_by_email($email)->result();\r\n }", "private function get_user_entries( $email ) {\n\t\t$query_args = array(\n\t\t\t'order_by' => 'item_id ASC',\n\t\t\t'limit' => $this->get_current_page(),\n\t\t);\n\n\t\t$user = get_user_by( 'email', $email );\n\n\t\t$entries_by_email = FrmDb::get_col( 'frm_item_metas', array( 'meta_value' => $email ), 'item_id', $query_args );\n\n\t\tif ( empty( $user ) ) {\n\t\t\t// no matching user, so return the entry ids we have\n\t\t\treturn $entries_by_email;\n\t\t}\n\n\t\t$query_args['order_by'] = 'id ASC';\n\n\t\t$entries_by_user = FrmDb::get_col( 'frm_items', array( 'user_id' => $user->ID ), 'id', $query_args );\n\n\t\t$entry_ids = array_merge( (array) $entries_by_user, (array) $entries_by_email );\n\t\t$entry_ids = array_unique( array_filter( $entry_ids ) );\n\n\t\treturn $entry_ids;\n\t}", "public function getEmails();", "function wp_get_sites($args){\n\t\t// replacement for wp-includes/ms-deprecated.php#get_blog_list\n\t\t// see wp-admin/ms-sites.php#352\n\t\t// also wp-includes/ms-functions.php#get_blogs_of_user\n\t\t// also wp-includes/post-template.php#wp_list_pages\n\t\tglobal $wpdb;\n\t\n\t\t$defaults = array(\n\t\t\t\t'include_id' \t\t,\t\t\t\t// includes only these sites in the results, comma-delimited\n\t\t\t\t'exclude_id' \t\t,\t\t\t\t// excludes these sites from the results, comma-delimted\n\t\t\t\t'blogname_like' \t,\t\t\t\t// domain or path is like this value\n\t\t\t\t'ip_like'\t\t\t,\t\t\t\t// Match IP address\n\t\t\t\t'reg_date_since'\t,\t\t\t\t// sites registered since (accepts pretty much any valid date like tomorrow, today, 5/12/2009, etc.)\n\t\t\t\t'reg_date_before'\t,\t\t\t\t// sites registered before\n\t\t\t\t'include_user_id'\t,\t\t\t\t// only sites owned by these users, comma-delimited\n\t\t\t\t'exclude_user_id'\t,\t\t\t\t// don't include sites owned by these users, comma-delimited\n\t\t\t\t'include_spam'\t\t=> false,\t\t// Include sites marked as \"spam\"\n\t\t\t\t'include_deleted'\t=> false,\t\t// Include deleted sites\n\t\t\t\t'include_archived'\t=> false,\t\t// Include archived sites\n\t\t\t\t'include_mature'\t=> false,\t\t// Included blogs marked as mature\n\t\t\t\t'public_only'\t\t=> true,\t\t// Include only blogs marked as public\n\t\t\t\t'sort_column'\t\t=> 'registered',// or registered, last_updated, blogname, site_id\n\t\t\t\t'order'\t\t\t\t=> 'asc',\t\t// or desc\n\t\t\t\t'limit_results'\t\t,\t\t\t\t// return this many results\n\t\t\t\t'start'\t\t\t\t,\t\t\t\t// return results starting with this item\n\t\t);\n\t\tfunction make_email_list_by_user_id($user_ids){\n\t\t\t$the_users = explode(',',$user_ids);\n\t\t\t$the_emails = array();\n\t\t\tforeach( (array) $the_users as $user_id){\n\t\t\t\t$the_user = get_userdata($user_id);\n\t\t\t\t$the_emails[] = $the_user->user_email;\n\t\t\t}\n\t\t\treturn $the_emails;\n\t\t}\n\t\n\t\n\t\t// array_merge\n\t\t$r = wp_parse_args( $args, $defaults );\n\t\textract( $r, EXTR_SKIP );\n\t\n\t\t//$query = \"SELECT * FROM {$wpdb->blogs}, {$wpdb->registration_log} WHERE site_id = '{$wpdb->siteid}' AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id \";\n\t\t$query = \"SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' \";\n\t\tif ( isset($include_id) ) {\n\t\t\t$list = implode(\"','\", explode(',', $include_id));\n\t\t\t$query .= \" AND {$wpdb->blogs}.blog_id IN ('{$list}') \";\n\t\t}\n\t\tif ( isset($exclude_id) ) {\n\t\t\t$list = implode(\"','\", explode(',', $exclude_id));\n\t\t\t$query .= \" AND {$wpdb->blogs}.blog_id NOT IN ('{$list}') \";\n\t\t}\n\t\tif ( isset($blogname_like) ) {\n\t\t\t$query .= \" AND ( {$wpdb->blogs}.domain LIKE '%\".$blogname_like.\"%' OR {$wpdb->blogs}.path LIKE '%\".$blogname_like.\"%' ) \";\n\t\t}\n\t\t/*if ( isset($ip_like) ) {\n\t\t\t$query .= \" AND {$wpdb->registration_log}.IP LIKE '%\".$ip_like.\"%' \";\n\t\t}\n\t\tif( isset($reg_date_since) ){\n\t\t$query .= \" AND unix_timestamp({$wpdb->registration_log}.date_registered) > '\".strtotime($reg_date_since).\"' \";\n\t\t}\n\t\tif( isset($reg_date_before) ){\n\t\t$query .= \" AND unix_timestamp({$wpdb->registration_log}.date_registered) < '\".strtotime($reg_date_before).\"' \";\n\t\t}\n\t\tif ( isset($include_user_id) ) {\n\t\t$the_emails = make_email_list_by_user_id($include_user_id);\n\t\t$list = implode(\"','\", $the_emails);\n\t\t$query .= \" AND {$wpdb->registration_log}.email IN ('{$list}') \";\n\t\t}\n\t\tif ( isset($exclude_user_id) ) {\n\t\t$the_emails = make_email_list_by_user_id($include_user_id);\n\t\t$list = implode(\"','\", $the_emails);\n\t\t$query .= \" AND {$wpdb->registration_log}.email NOT IN ('{$list}') \";\n\t\t}\n\t\tif ( isset($ip_like) ) {\n\t\t$query .= \" AND {$wpdb->registration_log}.IP LIKE ('%\".$ip_like.\"%') \";\n\t\t}*/\n\t\n\t\tif( $public_only ) {\n\t\t\t$query .= \" AND {$wpdb->blogs}.public = '1'\";\n\t\t}\n\t\n\t\t$query .= \" AND {$wpdb->blogs}.archived = \". (($include_archived) ? \"'1'\" : \"'0'\");\n\t\t$query .= \" AND {$wpdb->blogs}.mature = \". (($include_mature) ? \"'1'\" : \"'0'\");\n\t\t$query .= \" AND {$wpdb->blogs}.spam = \". (($include_spam) ? \"'1'\" : \"'0'\");\n\t\t$query .= \" AND {$wpdb->blogs}.deleted = \". (($include_deleted) ? \"'1'\" : \"'0'\");\n\t\n\t\tif ( $sort_column == 'site_id' ) {\n\t\t\t$query .= ' ORDER BY {$wpdb->blogs}.blog_id ';\n\t\t} elseif ( $sort_column == 'lastupdated' ) {\n\t\t\t$query .= ' ORDER BY last_updated ';\n\t\t} elseif ( $sort_column == 'blogname' ) {\n\t\t\t$query .= ' ORDER BY domain ';\n\t\t} else {\n\t\t\t$sort_column = 'registered';\n\t\t\t$query .= \" ORDER BY {$wpdb->blogs}.registered \";\n\t\t}\n\t\n\t\t$order = ( 'desc' == $order ) ? \"DESC\" : \"ASC\";\n\t\t$query .= $order;\n\t\n\t\t$limit = '';\n\t\tif( isset($limit_results) ){\n\t\t\tif( isset($start) ){\n\t\t\t\t$limit = $start.\" , \";\n\t\t\t}\n\t\t\t$query .= \"LIMIT \".$limit.$limit_results;\n\t\t}\n\t\n\t\t$results = $wpdb->get_results( $query , ARRAY_A );\n\t\n\t\treturn $results;\n\t}", "public function getSite($email, $domain)\n {\n return $this->apiRequest(\n 'customer/site/listBySite',\n ['email' => $email, 'siteName' => $domain],\n 'GET'\n );\n }", "public function getUserByEmail($email);", "public function SearchUserByEmail($email)\n {\n $email = mysqli_real_escape_string($this->connection, $email);\n $sql = \"SELECT userID, firstName, lastName, email, password, isAdmin FROM users WHERE email like '$email'\";\n\n $users = [];\n $result = mysqli_query($this->connection, $sql);\n if (mysqli_num_rows($result) > 0) {\n while ($row = mysqli_fetch_assoc($result)) {\n $id = $row[\"userID\"];\n $firstName = $row['firstName'];\n $lastName = $row['lastName'];\n $email = $row[\"email\"];\n $password = $row['password'];\n $isAdmin = $row['isAdmin'];\n $user = new User($id, $firstName, $lastName, $email, $password, $isAdmin);\n $users[] = $user;\n }\n return $users;\n }\n }", "function vsite_get_user_vsites($uid = NULL) {\n\n //Retrieve all group memberships for the user\n $groups = og_get_entity_groups('user', $uid);\n\n if (empty($groups['node'])) {\n return array();\n }\n\n $vsites = array();\n foreach($groups['node'] as $mid => $gid) {\n $vsites[] = spaces_load('og', $gid);\n }\n\n // Filter out any spaces that were not loaded.\n return array_filter($vsites);\n}", "public function searchByEmail($email = '')\n {\n if (strlen($email) >= 3){\n $users = $this->query()->where('email', 'LIKE', $email.'%')->get();\n }\n return $users;\n }", "function findAllByEmail($data){\n\t $email = isset($data[$this->alias]['email']) ? $data[$this->alias]['email'] : '%'; \n\t return $this->find('all', array(\n\t 'conditions' => array(\n\t \"{$this->alias}.email LIKE\" => $email\n\t ),\n\t 'contain' => array(),\n\t 'order' => \"{$this->alias}.email ASC\"\n\t ));\n\t}", "public function findUsersByEmail($email)\r\n\t{\r\n\t\t$usernames \t= [];\r\n\t\t\r\n\t\t# Make sure that we scan only the first 11 files even if there are some thousand users.\r\n\t\tif ($dh = opendir($this->userDir))\r\n\t\t{\r\n\t\t\t$count \t\t= 1;\r\n\t\t\t$exclude\t= array('..', '.', '.logins', 'tmuserindex-mail.txt', 'tmuserindex-role.txt');\r\n\r\n\t\t while ( ($userfile = readdir($dh)) !== false && $count <= 11 ) \r\n\t\t {\r\n\t\t \tif(in_array($userfile, $exclude)){ continue; }\r\n\r\n\t\t\t\t$usernames[] = str_replace('.yaml', '', $userfile);\r\n\t\t \t$count++;\r\n\t\t }\r\n\r\n\t\t closedir($dh);\r\n\t\t}\r\n\r\n\t\t$countusers = count($usernames);\r\n\r\n\t\tif($countusers == 0)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t# use a simple dirty search if there are less than 10 users (only in use for new user registrations)\r\n\t\tif($countusers <= 10)\r\n\t\t{\r\n\t\t\tforeach($usernames as $username)\r\n\t\t\t{\r\n\t\t\t\t$userdata = $this->getSecureUser($username);\r\n\r\n\t\t\t\tif($userdata['email'] == $email)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn $userdata;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t# if there are more than 10 users, search with an index\r\n\t\t$usermails = $this->getUserMailIndex();\r\n\r\n\t\t# search with starting asterix, ending asterix or without asterix\r\n\t\tif($email[0] == '*')\r\n\t\t{\r\n\t\t\t$userdata = [];\r\n\t\t\t$search = substr($email, 1);\r\n\t\t\t$length = strlen($search);\r\n\r\n\t\t\tforeach($usermails as $usermail => $username)\r\n\t\t\t{\r\n\t\t\t\tif(substr($usermail, -$length) == $search)\r\n\t\t\t\t{\r\n\t\t\t\t\t$userdata[] = $username;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$userdata = empty($userdata) ? false : $userdata;\r\n\r\n\t\t\treturn $userdata;\r\n\t\t}\r\n\t\telseif(substr($email, -1) == '*')\r\n\t\t{\r\n\t\t\t$userdata = [];\r\n\t\t\t$search = substr($email, 0, -1);\r\n\t\t\t$length = strlen($search);\r\n\r\n\t\t\tforeach($usermails as $usermail => $username)\r\n\t\t\t{\r\n\t\t\t\tif(substr($usermail, 0, $length) == $search)\r\n\t\t\t\t{\r\n\t\t\t\t\t$userdata[] = $username;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$userdata = empty($userdata) ? false : $userdata;\r\n\r\n\t\t\treturn $userdata;\r\n\t\t}\r\n\t\telseif(isset($usermails[$email]))\r\n\t\t{\r\n\t\t\t$userdata[] = $usermails[$email];\r\n\t\t\treturn $userdata;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public static function TraerUsuariosPorEmail($email){ \n\t \n\t\t$sql = \"SELECT * FROM `usuarios` WHERE email=:email\";\n\t\t$consulta = AccesoDatos::ObtenerObjetoAccesoDatos()->ObtenerConsulta($sql);\n\t\t$consulta->bindValue(':email', $email, PDO::PARAM_STR);\t\t\t\n\t $consulta->execute();\t\t\t\n\t\t\n\t\treturn $consulta->fetchAll();\t\n\t}", "function vsite_get_vsite_by_owner($uid = NULL) {\n if (!$uid) {\n global $user;\n $uid = $user->uid;\n }\n\n if (empty($uid)) {\n \treturn array();\n }\n\n $group_bundles = og_get_all_group_bundle();\n if (empty($group_bundles['node'])){\n //can't determine group content types\n return array();\n }\n $bundles = array_keys($group_bundles['node']);\n\n $query = new EntityFieldQuery();\n $result = $query->entityCondition('entity_type', 'node')\n ->propertyCondition('uid', $uid)\n ->entityCondition('bundle', $bundles, 'IN')\n ->execute();\n\n if (empty($result['node'])) {\n return array();\n }\n\n foreach(array_keys($result['node']) as $id) {\n $vsites[] = spaces_load('og', $id);\n }\n\n // Filter out any spaces that were not loaded.\n return array_filter($vsites);\n}", "public function who($email=null)\r\n\t{\r\n\t\t// else return whole list of email addresses\r\n\t\t// todo: implement email param\r\n\r\n\t\t$url = \"https://%host%/mailman/roster/%listname%_%domain%/?roster-pw=%pw%\";\r\n\r\n\t\treturn $this->do_curl_return_result($url);\r\n\t}", "public function emails()\n {\n return $this->getClient()->setApiVersion('2.0')->get('/user/emails');\n }", "function activeSubscriptionsByEmail( $email )\n {\n return array( 'result' => eZSubscription::fetchListByEmail( $email ) );\n }", "public function get_user_invites() {\n\t\t\treturn $this->build_request( 'user/invites' )->fetch();\n\t\t}", "public static function listAllFundRaisingPagesByEmail($email) {\n if (!$email) {\n return false; // throw an exception here\n } else {\n\n $url = sfConfig::get(\"app_fundraising_list_all_sand\");\n // add the search term\n $url .= \"?email=\" . $email;\n\n $resp = self::makeCurlRequest($url, $payload = \"\", $auth = true, $http_method = \"GET\");\n return $resp;\n }\n }", "private function getUserEmails(){\r\n\r\n // then\r\n\r\n // return $the array with the email adress of the subscribers\r\n\r\n $repository = $this->getDoctrine()->getRepository('ExpresDemoBundle:Newsletter');\r\n\r\n $query = $repository->createQueryBuilder('p')\r\n ->select('p.email')\r\n ->getQuery();\r\n\r\n $entity = $query ->getResult();\r\n\r\n return $entity;\r\n }", "function group_tools_get_invited_groups_by_email($email) {\r\n\t\r\n\tif (empty($email)) {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t$options = [\r\n\t\t'type' => 'group',\r\n\t\t'limit' => false,\r\n\t\t'annotation_name_value_pairs' => [\r\n\t\t\t[\r\n\t\t\t\t'name' => 'email_invitation',\r\n\t\t\t\t'value' => \"%|{$email}\",\r\n\t\t\t\t'operand' => 'LIKE',\r\n\t\t\t\t'type' => ELGG_VALUE_STRING,\r\n\t\t\t],\r\n\t\t],\r\n\t];\r\n\t\r\n\t// make sure we can see all groups\r\n\treturn elgg_call(ELGG_IGNORE_ACCESS, function () use ($options) {\r\n\t\treturn elgg_get_entities($options);\r\n\t});\r\n}", "public function getSites($options = array()) {\n\t\t$options['relationship'] = 'member_of_site';\n\t\t$options['relationship_guid'] = $this->guid;\n\t\t$options['inverse_relationship'] = false;\n\t\tif (!isset($options['site_guid']) || !isset($options['site_guids'])) {\n\t\t\t$options['site_guids'] = ELGG_ENTITIES_ANY_VALUE;\n\t\t}\n\n\t\treturn elgg_get_entities_from_relationship($options);\n\t}", "public function getEmails()\n {\n $search = request('q');\n $userList = User::all();\n $userList = User::select('*')\n ->where('email', 'like', '%'.$search.'%')\n ->get();\n $count = 0;\n // $emails[$count]['id'] = 1;\n // $emails[$count++]['text'] = $search;\n if(count($userList))\n {\n foreach ($userList as $user)\n {\n $emails[$count]['id'] = $user->id;\n $emails[$count++]['text'] = $user->email;\n }\n }\n else\n {\n $emails[$count]['id'] = '-1';\n $emails[$count++]['text'] = 'no result';\n }\n return ($emails);\n }", "function get_user_access_collections($owner_guid, $site_guid = 0) {\n\tglobal $CONFIG;\n\t$owner_guid = (int) $owner_guid;\n\t$site_guid = (int) $site_guid;\n\n\tif (($site_guid == 0) && (isset($CONFIG->site_guid))) {\n\t\t$site_guid = $CONFIG->site_guid;\n\t}\n\n\t$query = \"SELECT * FROM {$CONFIG->dbprefix}access_collections\n\t\t\tWHERE owner_guid = {$owner_guid}\n\t\t\tAND site_guid = {$site_guid}\";\n\n\t$collections = get_data($query);\n\n\treturn $collections;\n}", "public function getStoreWebsites();" ]
[ "0.72736907", "0.7064785", "0.6601885", "0.6446355", "0.63642246", "0.60709727", "0.6041106", "0.6000236", "0.5984534", "0.59704816", "0.5959282", "0.59351003", "0.58758867", "0.5813116", "0.5783808", "0.5778781", "0.5765861", "0.5761114", "0.57187486", "0.5695142", "0.56540996", "0.5650622", "0.5619078", "0.56081384", "0.55887026", "0.5587237", "0.55838054", "0.5571539", "0.5569906", "0.5567083" ]
0.7097189
1