public function get($column) { $res = $this->getFileInArray(); if (Functions::isArray($res)) { $lines = array(); foreach ($res as $line) { if (isset($line[$column])) { $lines[] = $line[$column]; } } return $lines; } return false; }
protected function setVariable($rA) { $this->cmpt = $i = 0; if (Functions::isArray($rA)) { foreach ($rA as $r) { foreach ($this->columns as $column) { if (strcmp($column["type"], "date") == 0) { $this->data[$column["label"]][$i] = date(Config::$DATE_FORMAT, strtotime($r[$column["label"]])); } elseif (strcmp($column["type"], "fulldate") == 0) { $this->data[$column["label"]][$i] = date(Config::$DATE_FORMAT_FULL, strtotime($r[$column["label"]])); } elseif (strcmp($column["type"], "datetime") == 0) { $this->data[$column["label"]][$i] = date(Config::$DATE_FORMAT_TIME, strtotime($r[$column["label"]])); } elseif (strcmp($column["type"], "int") == 0) { $this->data[$column["label"]][$i] = intval($r[$column["label"]]); } elseif (strcmp($column["type"], "password") != 0) { $this->data[$column["label"]][$i] = $r[$column["label"]]; } } $i++; } } }
private function secureValues($array = array()) { $temp = array(); foreach ($array as $key => $value) { if (Functions::isArray($value)) { $temp[$this->secureText($key)] = $this->secureValues($value); } else { $temp[$this->secureText($key)] = $this->secureText($value); } } return $temp; }
<?php //require Functions::getTemplateDir()."plugins/recaptcha-1.11/recaptchalib.php"; if (strcmp("fr", Config::$CURRENT_LANGUAGE) == 0) { $current = "-page"; } else { $current = ""; } $this->html->setCommonArray(array("%%INDEXCLASS%%" => "", "%%PORTFOLIO%%" => "", "%%BLOG%%" => "", "%%SERVICES%%" => "", "%%ABOUT%%" => "", "%%CONTACT%%" => "current" . $current)); echo $this->html->getFilteredText(Functions::getPublicFile("includes/head.html")); echo $this->html->getFilteredText(Functions::getPublicFile("includes/header.html")); $result = init($this, $request); $publickey = "6LfMk_YSAAAAACZWDgHHzwswD4iVmIjbirsrBv2T"; $values = array("%%ERROR%%" => Functions::isArray($result) ? "<span style='font-weight:bold'>Les erreurs suivant sont identifiés:</span><div style='margin-left:15px;color:#f00'>" . implode($result, "<br />") . "</div>" : (strcmp($result, "no") == 0 ? "<span style='color:#0f0;font-weight:bold'>Le message été envoyé avec succés</span>" : $result), "%%NAME_INPUT%%" => isset($_POST["name"]) && !empty($_POST["name"]) ? $_POST["name"] : "", "%%EMAIL_INPUT%%" => isset($_POST["email"]) && !empty($_POST["email"]) ? $_POST["email"] : "", "%%SUBJECT_INPUT%%" => isset($_POST["subject"]) && !empty($_POST["subject"]) ? $_POST["subject"] : "", "%%MESSAGE_INPUT%%" => isset($_POST["message"]) && !empty($_POST["message"]) ? $_POST["message"] : "", "%%MD5%%" => md5(uniqid())); $this->html->setCommonArray($values); echo $this->html->getFilteredText(Functions::getPublicFile("pages/contact.html")); echo $this->html->getFilteredText(Functions::getPublicFile("includes/footer.html")); function init($servlet, $request = array()) { if (isset($_POST["action"]) && strcmp("send", strtolower($_POST["action"])) == 0) { //$privatekey = "6LfMk_YSAAAAAMIox5-yFggxrvwUmNH-gsiqROQO"; //$resp_captcha = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$_POST["recaptcha_response_field"]); //if(!$resp_captcha->is_valid)$error[]="Le code CAPTCHA ne correspond pas au code affiché sur l'image"; $input = "name"; if (!isset($_POST[$input]) || isset($_POST[$input]) && empty($_POST[$input])) { $error[] = "(*) Nom doit être remplir"; } $input = "email"; if (!isset($_POST[$input]) || isset($_POST[$input]) && empty($_POST[$input])) { $error[] = "(*) Email doit être remplir"; } elseif (isset($_POST[$input]) && !Functions::isEmail($_POST[$input])) {
protected function existMultipleValues($values) { $res = $this->table->search($values); if (Functions::isArray($res)) { return true; } return false; }
private function executeModelFetch($object, $blockWithObject, $reportLine, $replaceElements) { if ($object->getcount() > 0) { do { $blockWithObject .= $reportLine["blockText"]; if (function_exists($replaceElements)) { $replaceChars = call_user_func($replaceElements, $object, $reportLine["objectName"]); foreach ($replaceChars as $replacedKey => $replacedKeyBy) { $blockWithObject = str_replace($replacedKey, $replacedKeyBy, $blockWithObject); } } elseif (Functions::isArray($replaceElements)) { foreach ($replaceElements[$reportLine["objectName"]] as $replacedKey => $replacedKeyBy) { $blockWithObject = str_replace($replacedKey, $replacedKeyBy, $blockWithObject); } } } while ($object->isMore()); return array("objectName" => strtoupper($reportLine["objectName"]), "blockText" => $blockWithObject); } return array("objectName" => strtoupper($reportLine["objectName"]), "blockText" => $blockWithObject); }