function init() { $noteid = getNoteID(); if (!$noteid) { return false; } $note = getNote($noteid); if (!$note) { return false; } return $note; }
.Get id .Get action Set : Get : GetLast : GetAll : .Get note .Get matiere nil nil .Get date .Get matiere */ include 'co_Bdd.php'; try { if (checkArgument() && checkUser($_GET['name'], $_GET['id'], $bdd)) { switch ($_GET['action']) { case 'set': $disp = setNote($bdd); break; case 'get': $disp = getNote($bdd); break; case 'getLast': $disp = getLast($bdd); break; case 'getAll': $disp = getAll($bdd); break; default: throw new Exception('ActionNotFound', 04); break; } echo json_encode($disp, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); } } catch (Exception $e) { $disp = array("Status" => "Error", "Message" => $e->getMessage(), "Code" => $e->getCode());
<?php require "../settings.php"; if (isset($_REQUEST["key"])) { switch ($_REQUEST["key"]) { case "display": $OUTPUT = display(); break; case "get": $OUTPUT = getNote(); break; } } $OUTPUT = display(); require "../template.php"; function display() { extract($_REQUEST); $fields = array(); $fields["from_year"] = date("Y"); $fields["from_month"] = date("m"); $fields["from_day"] = "01"; $fields["to_year"] = date("Y"); $fields["to_month"] = date("m"); $fields["to_day"] = date("d"); $fields["search"] = "~:BLANK:~"; $fields["filter"] = ""; $fields["rsearch"] = ""; extract($fields, EXTR_SKIP); $from_date = dateFmt($from_year, $from_month, $from_day); $to_date = dateFmt($to_year, $to_month, $to_day);
?> " disabled="disabled" /></span> </div> </div> <form action="<?php echo Router::url("note", "edit", $notation['IDNOTATION']); ?> " method="post" name="editNote" > <div class="page"> <table class="dataTable" id="eleveTable"> <thead><th>Matricule</th><th>Noms & Prénoms</th><th>Note</th><th>Non noté</th><th>Observations</th></thead> <tbody> <?php foreach ($eleves as $el) { $ideleve = $el['IDELEVE']; $note = getNote($ideleve, $notes); if (is_null($note)) { $idnote = ""; $sanote = ""; $estabsent = 0; $observation = ""; } else { $idnote = $note['IDNOTE']; $sanote = $note['NOTE']; $estabsent = $note['ABSENT']; $observation = $note['OBSERVATION']; } if ($estabsent === 1) { $sanote = ""; } echo "<tr><td>" . $el['MATRICULE'] . "<input type='hidden' name='id_" . $ideleve . "' value='" . $idnote . "' /></td>";
function PickBest($text, $wordsArrays, $verbosity) { if ($verbosity) { echo "<u>Réponse analysée : </u><br><i>{$text}</i></br>"; } $min = -INF; $output = array(); $notes = array(); foreach ($wordsArrays as $wordsArray) { if ($verbosity) { $keys = implode(' ; ', $wordsArray); echo "<u>Mots clefs proposés : </u><br><i>{$keys}</i></br>"; } echo "<u>Analyse</u>"; $note = getNote($text, $wordsArray, $verbosity); if ($note > $min) { $min = $note; $output = $wordsArray; } } return array($min, $output); }
if (isset($_POST["update"])) { $enotes = $_POST["edata"]; $title = $_POST["title"]; updateNote($title, $enotes); } else { if (!isset($_GET["target"])) { if (isset($_POST["title"])) { $_SESSION["title"] = $title; } if (!isset($_GET["title"])) { $title = $_SESSION["title"]; } else { $title = $_GET["title"]; } } $enotes = getNote($title); } ?> <html> <head> <title>Simple Evernote - evernote for dummies</title> </head> <body> <div style="width: 100%; height: 95%"> <form style = "display: inline" method='post' action="evernote.php?title=<?php echo $title; ?> &username=<?php echo $username; ?> ">
function MakePublicTag(&$thisObj,&$tagObj,&$partObj,&$typeLink,$envTypeid=0,$envArcid=0,$envChannelid=0) { //解析模板 //------------------------- if( is_array($tagObj->CTags) ) { foreach($tagObj->CTags as $tagid=>$ctag) { $tagname = $ctag->GetName(); //字段 if($tagname=="field"){ if(isset($thisObj->Fields[$ctag->GetAtt('name')])) $tagObj->Assign($tagid,$thisObj->Fields[$ctag->GetAtt('name')]); else $tagObj->Assign($tagid,""); } //单个栏目 else if($tagname=="onetype"||$tagname=="type"){ $typeid = $ctag->GetAtt('typeid'); if($typeid=="") $typeid = 0; if($typeid=="") $typeid = $envTypeid; $tagObj->Assign($tagid,$partObj->GetOneType($typeid,$ctag->GetInnerText())); } //下级频道列表 else if($tagname=="channel"){ $typeid = trim($ctag->GetAtt('typeid')); if( empty($typeid) && $envTypeid > 0 ){ $typeid = $envTypeid; $reid = $typeLink->TypeInfos['reID']; }else{ $reid=0; } $tagObj->Assign($tagid, $typeLink->GetChannelList( $typeid,$reid,$ctag->GetAtt("row"), $ctag->GetAtt("type"),$ctag->GetInnerText(), $ctag->GetAtt("col"),$ctag->GetAtt("tablewidth"), $ctag->GetAtt("currentstyle") ) ); } //热门关键字 else if($tagname=="hotwords"){ $tagObj->Assign($tagid, GetHotKeywords($thisObj->dsql,$ctag->GetAtt('num'),$ctag->GetAtt('subday'),$ctag->GetAtt('maxlength'))); } //自定义标记 else if($tagname=="mytag"){ $tagObj->Assign($tagid, $partObj->GetMyTag($envTypeid,$ctag->GetAtt("name"),$ctag->GetAtt("ismake")) ); } //广告代码 else if($tagname=="myad"){ $tagObj->Assign($tagid, $partObj->GetMyAd($envTypeid,$ctag->GetAtt("name")) ); } //频道下级栏目文档列表 else if($tagname=="channelartlist"){ //类别ID if(trim($ctag->GetAtt('typeid'))=="" && $envTypeid!=0){ $typeid = $envTypeid; } else{ $typeid = trim( $ctag->GetAtt('typeid') ); } $tagObj->Assign($tagid, $partObj->GetChannelList($typeid,$ctag->GetAtt('col'),$ctag->GetAtt('tablewidth'),$ctag->GetInnerText()) ); } //投票 else if($tagname=="vote"){ $tagObj->Assign($tagid, $partObj->GetVote( $ctag->GetAtt("id"),$ctag->GetAtt("lineheight"), $ctag->GetAtt("tablewidth"),$ctag->GetAtt("titlebgcolor"), $ctag->GetAtt("titlebackground"),$ctag->GetAtt("tablebgcolor") ) ); } //友情链接 //------------------ else if($tagname=="friendlink"||$tagname=="flink") { $tagObj->Assign($tagid, $partObj->GetFriendLink( $ctag->GetAtt("type"),$ctag->GetAtt("row"),$ctag->GetAtt("col"), $ctag->GetAtt("titlelen"),$ctag->GetAtt("tablestyle"),$ctag->GetAtt("linktyle"),$ctag->GetInnerText() ) ); } //站点新闻 //--------------------- else if($tagname=="mynews") { $tagObj->Assign($tagid, $partObj->GetMyNews($ctag->GetAtt("row"),$ctag->GetAtt("titlelen"),$ctag->GetInnerText()) ); } //调用论坛主题 //---------------- else if($tagname=="loop") { $tagObj->Assign($tagid, $partObj->GetTable( $ctag->GetAtt("table"), $ctag->GetAtt("row"), $ctag->GetAtt("sort"), $ctag->GetAtt("if"), $ctag->GetInnerText() ) ); } //数据表操作 else if($tagname=="sql"){ $tagObj->Assign($tagid, $partObj->GetSql($ctag->GetAtt("sql"),$ctag->GetInnerText()) ); } else if($tagname=="tag"){ if($ctag->GetAtt('type') == 'current'){ $arcid = $thisObj->ArcID; $tagObj->Assign($tagid, GetCurrentTags($thisObj->dsql,$arcid, $ctag->GetInnerText()) ); }else{ //数据表操作 $tagObj->Assign($tagid, $partObj->GetTags($ctag->GetAtt("row"),$ctag->GetAtt("sort"),$ctag->GetInnerText()) ); } } else if($tagname=="toparea"){ //数据表操作 $tagObj->Assign($tagid, $partObj->gettoparea($ctag->GetInnerText()) ); } //特定条件的文档调用 else if($tagname=="arclist"||$tagname=="artlist"||$tagname=="hotart" ||$tagname=="imglist"||$tagname=="imginfolist"||$tagname=="coolart") { $channelid = $ctag->GetAtt("channelid"); if($tagname=="imglist"||$tagname=="imginfolist"){ $listtype = "image"; } else if($tagname=="coolart"){ $listtype = "commend"; } else{ $listtype = $ctag->GetAtt('type'); } //对相应的标记使用不同的默认innertext if(trim($ctag->GetInnerText())!="") $innertext = $ctag->GetInnerText(); else if($tagname=="imglist") $innertext = GetSysTemplets("part_imglist.htm"); else if($tagname=="imginfolist") $innertext = GetSysTemplets("part_imginfolist.htm"); else $innertext = GetSysTemplets("part_arclist.htm"); if($tagname=="hotart") $orderby = "click"; else $orderby = $ctag->GetAtt('orderby'); $typeid = trim($ctag->GetAtt("typeid")); if(empty($typeid)) $typeid = $envTypeid; if(!empty($thisObj->TempletsFile)) $tmpfile = $thisObj->TempletsFile; else $tmpfile = ''; if(!empty($thisObj->maintable)) $maintable = '#@__archives'; else $maintable = ''; if(!isset($titlelen)) $titlelen = 0; if(!isset($infolen)) $infolen = 0; $idlist = ''; if($tagname=="likeart"){ if(!empty($thisObj->Fields['likeid'])) $idlist = $thisObj->Fields['likeid']; }else{ $idlist = $ctag->GetAtt("idlist"); } if($idlist!=''){ $typeid = '0'; $channelid = '0';} $tagObj->Assign($tagid, $partObj->GetArcList( $tmpfile, $typeid, $ctag->GetAtt("row"), $ctag->GetAtt("col"), $ctag->GetAtt("titlelen"), $ctag->GetAtt("infolen"), $ctag->GetAtt("imgwidth"), $ctag->GetAtt("imgheight"), $listtype, $orderby, $ctag->GetAtt("keyword"), $innertext, $ctag->GetAtt("tablewidth"), 0,$idlist,$channelid, $ctag->GetAtt("limit"), $ctag->GetAtt("att"), $ctag->GetAtt("orderway"), $ctag->GetAtt("subday"), -1, $ctag->GetAtt("ismember"), $maintable ) ); } else if($tagname=="groupthread") { //圈子主题 $tagObj->Assign($tagid, $partObj->GetThreads($ctag->GetAtt("gid"),$ctag->GetAtt("row"), $ctag->GetAtt("orderby"),$ctag->GetAtt("orderway"),$ctag->GetInnerText()) ); } else if($tagname=="group") { //圈子 $tagObj->Assign($tagid, $partObj->GetGroups($ctag->GetAtt("row"),$ctag->GetAtt("orderby"),$ctag->GetInnerText()) ); } else if($tagname=="ask") { //问答 $tagObj->Assign($tagid, $partObj->GetAsk($ctag->GetAtt("row"),$ctag->GetAtt("qtype"),$ctag->GetInnerText()),$ctag->GetAtt("typeid") ); } else if($tagname=="spnote") { $noteid = $ctag->GetAtt('noteid'); //专题节点 $tagObj->Assign($tagid, getNote($noteid, $thisObj) ); } //特定条件的文档调用 else if($tagname=="arcfulllist"||$tagname=="fulllist"||$tagname=="likeart"||$tagname=="specart") { $channelid = $ctag->GetAtt("channelid"); if($tagname=="specart"){ $channelid = -1; } $typeid = trim($ctag->GetAtt("typeid")); if(empty($typeid)) $typeid = $envTypeid; $idlist = ''; if($tagname=="likeart"){ if(!empty($thisObj->Fields['likeid'])) $idlist = $thisObj->Fields['likeid']; }else{ $idlist = $ctag->GetAtt("idlist"); } if($idlist!=''){ $typeid = '0'; $channelid = '0';} $tagObj->Assign($tagid, $partObj->GetFullList( $typeid,$channelid,$ctag->GetAtt("row"),$ctag->GetAtt("titlelen"),$ctag->GetAtt("infolen"), $ctag->GetAtt("keyword"),$ctag->GetInnerText(),$idlist,$ctag->GetAtt("limitv"),$ctag->GetAtt("ismember"), $ctag->GetAtt("orderby"),$ctag->GetAtt("imgwidth"),$ctag->GetAtt("imgheight") ) ); } }//结束模板循环 } }
function getPreamble($id, $emailText) { getUserInfo($from_email, $from_name); $link_url = ewiki_script("view", "{$id}"); $link = "https://www.burgiss.com/liveweb/{$link_url}"; $note = getNote($emailText); $preamble = "<p>The following e-mail is a stripped down snapshot of the \"{$id}\" page from Burgiss LiveWeb. "; $preamble .= "If you have an account with us, click <a href=\"{$link}\">here</a> to view it. "; $preamble .= "This was sent from {$from_name} with an e-mail address registered as {$from_email}</p>"; $preamble .= "{$note}<hr><font face=\"Arial\" size=\"-1\">"; return $preamble; }
<?php /** * Created by PhpStorm. * User: joriregter * Date: 29/11/15 * Time: 15:51 */ require '../vendor/autoload.php'; $base = "http://docent.cmi.hro.nl/bootb/restdemo/notes/"; $client = new GuzzleHttp\Client(); switch ($_SERVER["REQUEST_METHOD"]) { case "GET": if (isset($_GET["id"]) && !empty($_GET["id"])) { getNote($client, $base, $_GET["id"]); exit; } getNotes($client, $base); exit; case "POST": if (isset($_POST["note"]) && !empty($_POST["note"])) { $body = $_POST["note"]; createNote($client, $base, $body); exit; } exit; case "PUT": if (isset($_POST["id"]) && !empty($_POST["id"] && isset($_POST["body"]) && !empty($_POST["body"]))) { $id = $_GET["id"]; $body = $_POST["body"]; editNote($client, $base, $id, $body);
$infopost = getInfoPost($post); $nblikes = getNbLikes($post); $nbdislikes = getNbDislikes($post); $pages = getPostPages($post); //Si on a des commentaires sur le post, on les récupère if ($pages > 0) { if (isset($_GET['page'])) { $comments = getComments($post, $_GET['page']); } else { $comments = getComments($post); } $comments = $comments->comments; } $voted = voted($user, $post); if ($voted !== 404) { $note = getNote($user, $post); } else { $note = 0; } } else { setFlash("Cette page n'existe pas.", "danger"); redirect("accueil.php"); } $infopost = $infopost->post; $author = getUser($infopost->user_id); getHeader(); ?> <article> <!-- Contenu de la page -->
require_once 'Servicios/getNotes.php'; $app = new \Slim\Slim(); require_once 'Servicios/Auth.php'; $log = new IOManager(); $log->logAll($app->request->headers); $deviceId = $app->request->headers->get('deviceID'); $hash = $app->request->headers->get('hash'); $respuesta = auth($deviceId, $hash); if ($respuesta != "Auth_OK") { echo $respuesta; return; } //Obtiene los parametros del header http $idNote = $app->request->headers->get('idNote'); //LLama el método que lee de la base de datos y obtiene la respuesta $respuesta = getNote($idNote); //Muestra la respuesta al cliente echo $respuesta; }); //-------------------------------------------------------------------------------------------------- $app->put('/addNote', function () { //Importa el archivo que contiene el método require_once 'Servicios/editNote.php'; $app = new \Slim\Slim(); require_once 'Servicios/Auth.php'; $log = new IOManager(); $log->logAll($app->request->headers); $deviceId = $app->request->headers->get('deviceID'); $hash = $app->request->headers->get('hash'); $respuesta = auth($deviceId, $hash); if ($respuesta != "Auth_OK") {