function commandRouter($action) { switch ($action) { case 'login': loginUser(); break; case 'createUser': createUser(); break; case 'getUser': getUser(); break; case 'deleteUser': deleteUser(); break; case 'updateUser': updateUser(); break; case 'addTab': addTab(); break; case 'delTab': delTab(); break; case 'editTab': editTab(); break; case 'getTabs': getTabs(); break; case 'addNote': addNote(); break; case 'delNote': delNote(); break; case 'editNote': editNote(); break; case 'getNotes': getNotes(); break; default: break; } }
if (isset($_POST['hoursRequested']) && $_POST['hoursRequested'] != '' || isset($_POST['hoursRegistered']) && $_POST['hoursRegistered'] != '' || isset($_POST['note']) && $_POST['note'] != '') { function setNotes($employee, $semester, $requested, $registered, $notes) { global $db; try { $insertQuery = $db->prepare("INSERT INTO scheduleNotes (netID, semester, requestedHours, registeredHours, notes, guid) VALUES (:employee,:semester,:requested,:registered,:notes,:guid) ON DUPLICATE KEY UPDATE requestedHours=:requested1,registeredHours=:registered1,notes=:notes1"); $success = $insertQuery->execute(array(':employee' => $employee, ':semester' => $semester, ':requested' => $requested, ':registered' => $registered, ':notes' => addSlashes($notes), ':guid' => newGuid(), ':requested1' => $requested, ':registered1' => $registered, ':notes1' => addSlashes($notes))); } catch (PDOException $e) { exit("error in query"); } echo $success; } setNotes($_POST['employee'], $_POST['period'], $_POST['hoursRequested'], $_POST['hoursRegistered'], $_POST['note']); return; } else { if (isset($_POST['employee']) && $_POST['employee'] != '' || isset($_POST['period']) && $_POST['period'] != '') { function getNotes($employee, $semester) { global $db; try { $hoursQuery = $db->prepare("SELECT requestedHours, registeredHours, notes FROM scheduleNotes WHERE netID = :employee AND semester = :semester"); $hoursQuery->execute(array(':employee' => $employee, ':semester' => $semester)); } catch (PDOException $e) { exit("error in query"); } echo json_encode($hoursQuery->fetch(PDO::FETCH_ASSOC)); } getNotes($_POST['employee'], $_POST['period']); return; } }
function getAllMyStaffNotes($userID, $branchID, $userlevel) { $conn = getConnection(); $list = array(); $obj = getBranch($branchID); if ($userlevel != 1) { $query = "SELECT * FROM notes WHERE activeflag<>0 AND type=3 AND batchID =" . $userID . " ORDER BY lastupdated DESC"; } else { $query = "SELECT * FROM notes WHERE activeflag<>0 AND type=3 ORDER BY lastupdated DESC"; } //echo $query; $result = mysql_query($query); while ($member = mysql_fetch_array($result)) { $temp = getNotes($member['ID']); array_push($list, $temp); } /* $batchlist=getAllActiveBatchesByBranch($obj); for($i=0;$i<count($batchlist);$i++) { $query = "SELECT * FROM notes WHERE activeflag<>0 AND batchID='".$batchlist[$i]->getID()."' AND type=2 ORDER BY lastupdated DESC"; //echo $query; $result = mysql_query($query); while($member = mysql_fetch_array($result)) { $temp = getNotes($member['ID']); array_push($list,$temp); } } */ if (count($list) != 0) { return $list; } return NULL; }
file_put_contents("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), $gallery[0]->getSliderImage()); $pdf->Image("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), 20, 30); } } } foreach ($notes as $note) { if ($note->getNote() === "Nota del Índice General de la Construcción (PRIVADO)") { $pdf->SetY(80); $pdf->MultiCell(0, 5, $note->getNoteText()); } } $pdf->Output(); break; case '5': $sliders = getSliders(); $notes = getNotes(); $pdf = new FPDF('L'); $pdf->AddPage(); $pdf->SetFont('Helvetica', '', 8); $gallery = getSliderGallery($sliders[1]->getIdSlider()); if ($gallery) { $filename = generateRandomString(); file_put_contents("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), $gallery[0]->getSliderImage()); $pdf->Image("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), 25, 40); } $gallery = getSliderGallery($sliders[2]->getIdSlider()); if ($gallery) { $filename = generateRandomString(); file_put_contents("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), $gallery[0]->getSliderImage()); $pdf->Image("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), 170, 40); }
$y = $pdf->ezText("\n", 14); # Get the report data $notes = $enc_obj->getEncounterNotes($recnr); while (list($x, $v) = each($types)) { extract($v); if (!stristr($filter, $nr)) { #Get the report title if (isset(${$LD_var}) && !empty(${$LD_var})) { $title = ${$LD_var}; } else { $title = $name; } $data = NULL; $data[] = array($title); $pdf->ezTable($data, '', '', array('xPos' => 'left', 'xOrientation' => 'right', 'showLines' => 0, 'fontSize' => $report_titlesize, 'showHeadings' => 0, 'shaded' => 2, 'shadeCol2' => array(0.9, 0.9, 0.9), 'width' => 555)); if ($notes =& getNotes($nr)) { # get the report while ($report = $result->FetchRow()) { $y = $pdf->ezText("\n", 6); $data = NULL; # create the tag infos inside a table $data[] = array(" {$LDDate}: " . formatDate2Local($report['date'], $date_format) . " {$LDTime}: " . $report['time'] . " {$LDBy}: " . $report['personell_name']); $pdf->ezTable($data, '', '', array('xPos' => 'left', 'xOrientation' => 'right', 'showLines' => 1, 'fontSize' => $report_authorsize, 'showHeadings' => 0, 'shaded' => 0, 'width' => 555)); //$y=$pdf->ezText("\n",$report_authorsize); $y = $pdf->ezText("\n" . $report['notes'] . "\n", $report_textsize); if (!empty($report['short_notes'])) { $y = $pdf->ezText("{$LDShortNotes}\n", $report_auxtitlesize); $y = $pdf->ezText($report['short_notes'], $report_textsize); } if (!empty($report['aux_notes'])) { $y = $pdf->ezText($LDShortNotes . "\n", $report_auxtitlesize);
<?php require 'session.php'; if (!isset($_SESSION['stud'])) { header('Location: ' . SERVER . ''); } $notes = getNotes($_GET['id1']); ?> <!DOCTYPE html> <html lang="en"> <head> <?php require_once 'head.php'; ?> </head> <body> <div id="wrap"> <main> <div class="container"> <header> <div class="row"> <div class="col-md-12"> <?php require_once 'header.php'; ?> </div> </div> </header> <hr/> <section> <div class="col-md-12">
function changeNotes($uid, $pid, $notes) { if (!canViewPuzzle($uid, $pid)) { utilsError("You do not have permission to modify this puzzle."); } $purifier = new HTMLPurifier(); mysql_query('START TRANSACTION'); $oldNotes = getNotes($pid); $cleanNotes = $purifier->purify($notes); $cleanNotes = htmlspecialchars($cleanNotes); updateNotes($uid, $pid, $oldNotes, $cleanNotes); mysql_query('COMMIT'); }
<?php require "../require/connectDB.php"; include "../include/default_lib.inc.php"; include "../base/dbnotes.php"; ?> <div class="InFrmDiv"> <form action="../include/savNotes.php" method="post" class="mainForm"> <div class="noteDivTextarea"> <textarea class="noteTextarea"><?php getNotes("1"); ?> </textarea> </div> <div class="noteDivSave"> <input type="submit" class="noteSave" value="<?php print libSAVE; ?> "> </div> </form> </div>
function getMyNotes() { $conn = getConnection(); $list = array(); $query = "SELECT * FROM notes WHERE batchID='" . $this->BatchID . "' AND activeflag=1 ORDER BY subjectID DESC,datecreated DESC"; $result = mysql_query($query); while ($member = mysql_fetch_array($result)) { $tempmark = getNotes($member['ID']); array_push($list, $tempmark); } if (count($list) != 0) { return $list; } return NULL; }
protected function setInfoShopp() { include_once PLUGIN_PATH_SHIPWORKSWORDPRESS . 'functions/shopp/functionsShopp.php'; $this->id_order = $this->row['id']; $this->createdDate = gmdate("Y-m-d\\TH:i:s\\Z", strtotime($this->row['created'])); $this->modifiedDate = gmdate("Y-m-d\\TH:i:s\\Z", strtotime($this->row['modified'])); $this->shipoption = $this->row['shipoption']; $this->status = $this->row['status']; $this->firstname = $this->row['firstname']; $this->middlename = ''; $this->lastname = $this->row['lastname']; $this->company = $this->row['company']; $this->address = $this->row['address']; $this->xaddress = $this->row['xaddress']; $this->street2 = $this->row['xaddress']; // add to correct no address line 2 shipping on shopp $this->street3 = ''; $this->city = $this->row['city']; $this->state = $this->row['state']; $this->postcode = $this->row['postcode']; $this->country = $this->row['country']; if ('' != $this->company) { $this->residential = 'false'; } $this->phone = $this->row['phone']; $this->email = $this->row['email']; $this->fax = ''; $this->website = ''; //if ( empty( $this->row['shipxaddress'] ) ) { $parts = explode(" ", $this->row['shipname']); $lastname = array_pop($parts); $firstname = implode(" ", $parts); $this->shipfirstname = $firstname; $this->shiplastname = $lastname; $this->shipaddress = $this->row['shipaddress']; $this->shipxaddress = $this->row['shipxaddress']; $this->shipstreet2 = $this->row['shipxaddress']; // add to correct no address line 2 billing on shopp $this->shipcity = $this->row['shipcity']; $this->shipstate = $this->row['shipstate']; $this->shippostcode = $this->row['shippostcode']; $this->shipcountry = $this->row['shipcountry']; $this->cardtype = $this->row['cardtype']; $this->freight = $this->row['freight']; // Shipping Fee $this->tax = $this->row['tax']; //Tax Fee $this->discount = $this->row['discount']; // Discount $this->fees = $this->row['fees']; // Add Fee global $wpdb; $time = strtotime($this->date . ' UTC'); $dateInLocal = date("Y-m-d H:i:s", $time); /*$rows = $wpdb->get_results( "SELECT * FROM ". $wpdb->prefix ."shopp_purchase AS p LEFT JOIN ". $wpdb->prefix ."shopp_purchased AS ped ON ped.purchase = p.id WHERE p.modified > '" . $dateInLocal . "' and p.id='" . $this->id_order . "' and (p.txnstatus = 'authed' or p.txnstatus = 'captured') order by p.id" , ARRAY_A);*/ $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "shopp_purchase AS p LEFT JOIN " . $wpdb->prefix . "shopp_purchased AS ped ON ped.purchase = p.id WHERE p.modified > '" . $dateInLocal . "' and p.id='" . $this->id_order . "' order by p.id", ARRAY_A); for ($k = 0; $k < count($rows); $k++) { // On ne veut pas prendre en compte les item downloadable if (!($rows[$k]["type"] == "Download")) { array_push($this->items, new Item($this->software, $this->date, $rows[$k])); if ($rows[$k]['addons'] == 'yes') { // On ajoute les Addons global $wpdb; $table = $wpdb->prefix . "shopp_meta"; $addons = $wpdb->get_results("SELECT * FROM " . $table . " WHERE parent = " . $rows[$k]['id'] . " and type = 'addon'", ARRAY_A); foreach ($addons as $addon) { $addon['product'] = $rows[$k]['product']; $addon['quantity'] = $rows[$k]['quantity']; array_push($this->items, new Item($this->software, $this->date, $addon)); } } } } // Ajout des coupons if ($this->row['promos'] != null) { $coupons = getCoupons($this->row); foreach ($coupons as $coupon) { /*var_dump( $coupon );*/ array_push($this->coupons, 'Coupon : ' . $coupon); } } // Ajout des notes if (getNotes($this->row['id']) != null) { $notes = getNotes($this->row['id']); foreach ($notes as $note) { $content = unserialize($note['value']); array_push($this->privateNotes, $content->message); } } }
<?php require '../includes/includeMeBlank.php'; if (isset($_POST['employee']) && $_POST['employee'] != '' && (isset($_POST['weekStart']) && $_POST['weekStart'] != '')) { function getNotes($employee, $weekStart) { global $area, $db; try { $notesQuery = $db->prepare("SELECT requestedHours, registeredHours, notes FROM scheduleNotes WHERE netID = :netId AND semester = (SELECT `ID` FROM `scheduleSemesters` WHERE `area` = :area AND :start >= `startDate` AND :end <= `endDate`)"); $notesQuery->execute(array(':netId' => $employee, ':area' => $area, ':start' => $weekStart, ':end' => $weekStart)); } catch (PDOException $e) { exit("error in query"); } echo json_encode($notesQuery->fetch(PDO::FETCH_ASSOC)); } getNotes($_POST['employee'], $_POST['weekStart']); return; }
function translateCommonlabel($template) { global $pagesize, $articleid; $template = str_replace("【#sitename】", getSitename(), $template); $template = str_replace("【#htmltitle】", getHtmltitle(), $template); $template = str_replace("【#copyright】", getCopyright(), $template); $template = str_replace("【#path】", getPath(), $template); $template = str_replace("【#logo】", getLogo(), $template); $template = str_replace("【#chanels】", getChanels(), $template); $template = str_replace("【#childcolumnlist】", getChildcolumnlist(), $template); //网站,栏目,文章关键字 $template = str_replace("【#sitekeywords】", getSitekeywords(), $template); $template = str_replace("【#columnkeywords】", getColumnkeywords(), $template); $template = str_replace("【#articlekeywords】", getArticlekeywords(), $template); $template = str_replace("【#columnname】", getColumnname(), $template); $template = str_replace("【#articleid】", $articleid, $template); $template = str_replace("【#articletitle】", getArticletitle(), $template); $template = str_replace("【#articlecontent】", getArticlecontent(), $template); $template = str_replace("【#date】", getAdddate(), $template); $template = str_replace("【#hits】", getHits(), $template); $template = str_replace("【#author】", getAuthor(), $template); $template = str_replace("【#source】", getSource(), $template); $template = str_replace("【#picurl】", getPicurl(), $template); $template = str_replace("【#pre】", getPre(), $template); $template = str_replace("【#next】", getNext(), $template); $template = str_replace("【#notes】", getNotes(), $template); $template = str_replace("【#commentform】", getCommentform(), $template); //替换自定义字段标签 $template = translateSdefFeildlabel($template); $template = str_replace("【#showpage】", getPage($pagesize), $template); return $template; }
/** * 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); } exit;
function displayNotes($uid, $pid) { $notes = getNotes($pid); ?> <table class="statusInfo"> <tr> <td class='statusInfo'> <strong>Status Notes: </strong> <?php echo $notes; ?> </td> <td class='statusInfo'> <a href="#" class="changeLink">[Change]</a> </td> </tr> <tr> <td colspan='2'> <form method="post" action="form-submit.php"> <input type="hidden" name="uid" value="<?php echo $uid; ?> " /> <input type="hidden" name="pid" value="<?php echo $pid; ?> " /> <input type="text" name="notes" maxlength="255" class="longin" value="<?php echo $notes; ?> "/> <input type="submit" name="changeNotes" value="Change" /> </form> </td> </tr> </table> <?php }
//Importa el archivo que contiene el método require_once 'Servicios/getNotes.php'; $app = new \Slim\Slim(); require_once 'Servicios/Auth.php'; $deviceId = $app->request->headers->get('deviceID'); $hash = $app->request->headers->get('hash'); $respuesta = auth($deviceId, $hash); if ($respuesta != "Auth_OK") { echo $respuesta; return; } $currentUser = $app->request->headers->get('currentUser'); $log = new IOManager(); $log->logAll($app->request->headers); //LLama el método que lee de la base de datos y obtiene la respuesta $respuesta = getNotes($currentUser); //Muestra la respuesta al cliente echo $respuesta; }); //-------------------------------------------------------------------------------------------------- $app->get('/getNote', function () { //Importa el archivo que contiene el método 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") {
function displayAnswers($uid) { $rounds = getRounds(); if (!$rounds) { ?> <span class="emptylist">No rounds to list</span> <?php } foreach ($rounds as $round) { $answers = getAnswersForRound($round['rid']); ?> <table class="boxed"> <tr><th colspan="6"><b><?php echo "{$round['name']}: {$round['answer']}"; ?> </b></th></tr> <tr> <td><b>Answer</b></td> <td><b>ID</b></td> <td><b>Title</b></td> <td><b>Status</b></td> <td><b>Editor Notes</b></td> <td><b>Status Notes</b></td> </tr> <?php if (!$answers) { ?> <tr><td colspan="6"><span class="emptylist">No answers added yet</span></td></tr> <?php } foreach ($answers as $answer) { $pid = $answer['pid']; ?> <tr><td><?php echo $answer['answer']; ?> </td> <td><?php echo $pid ? "<a href=\"puzzle.php?pid={$pid}\">" . $pid . "</a>" : "unassigned"; ?> </td> <td><?php echo $pid ? getTitle($pid) : ""; ?> </td> <td><?php echo $pid ? getStatusNameForPuzzle($pid) : ""; ?> </td> <td><?php echo $pid ? getEditorNotes($pid) : ""; ?> </td> <td><?php echo $pid ? getNotes($pid) : ""; ?> </td> </tr> <?php } ?> <tr> <form method="post" action="answers.php" /> <td><input type="text" name="newAnswer" /> <input type="hidden" name="round" value='<?php echo $round['rid']; ?> '/></td> <td colspan="5"><input type="submit" value='Add Answer For Round <?php echo $round['rid']; ?> ' /></td></form> </tr> </table> <br /> <?php } ?> <table class="boxed"> <tr><th colspan="3"><b>New Round</b></th></tr> <tr> <td>Round Name</td><td>Meta Answer Word</td><td></td> </tr> <tr> <form method="post" action="answers.php" /> <td><input type="text" name="newRound" /></td> <td><input type="text" name="roundAnswer" /></td> <td><input type="submit" value="Add New Round" /></td></form> </tr> </table> <?php }