function new_note() { $result = add_note(); if ($result) { echo json_encode(array("err" => 0, "id" => $result)); } else { echo json_encode(array("err" => 1, "msg" => "Unable to add new note!")); } }
function handle_put($conversation) { // Note: You can only "consume" the entity once, so if we want it // as text, and want to refer to it more than once, we should keep // a reference to that text. $text = $conversation->entity->getText(); $note = json_decode($text, true); $connection = get_connection(); try { add_note($note, $connection); update_board_timestamp($note, $connection); } catch (Exception $x) { $connection->close(); throw $x; } $connection->close(); return handle_get($conversation); }
<?php session_start(); require_once '../file-includes.php'; $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $info = array(); $info[] = fix_string($request->title); $info[] = fix_string($request->content); $info[] = (string) date('d-m-Y'); $info[] = '-'; $userID = get_userID_session(); add_note($info, $userID);
<?php require_once './common.inc'; $userid = (int) $_REQUEST['userid']; $source = $_REQUEST['source']; $contents = $_REQUEST['contents']; add_note($userid, $admin_id, $source, $contents); redirect('view.php?id=' . $userid);
Util::response_bad_request($error); } //Validate Form token $token = POST('token'); $tk_key = 'tk_' . $action; if (Token::verify($tk_key, $token) == FALSE) { $error = Token::create_error_message(); Util::response_bad_request($error); } $db = new ossim_db(); $conn = $db->connect(); try { $response = array(); switch ($action) { case 'add_note': $response = add_note($conn, $type); break; case 'edit_note': $response = edit_note($conn); break; case 'delete_note': $response = delete_note($conn); break; default: Av_exception::throw_error(Av_exception::USER_ERROR, _('Invalid Action.')); } } catch (Exception $e) { $db->close(); Util::response_bad_request($e->getMessage()); } $db->close();
<?php $note_text = htmlspecialchars($_GET["note_text"]); $tag = htmlspecialchars($_GET["tag"]); $person_id = htmlspecialchars($_GET["person_id"]); function add_note($note_text, $tag, $person_id) { include 'dbconnect.php'; $query = "INSERT INTO Notiz (id, date, note_text, tag, person_id ) VALUES (NULL, NULL, '" . $note_text . "', '" . $tag . "', '" . $person_id . "')"; $result = mysqli_query($connection, $query); if ($result) { echo "ok"; } else { echo "nicht ok"; } } add_note($note_text, $tag, $person_id);
protected function setInfoJigoshop() { include_once PLUGIN_PATH_SHIPWORKSWORDPRESS . 'functions/jigoshop/functionsJigoshop.php'; $time = strtotime($this->date . ' UTC'); $this->date = date("y-m-d", $time); global $wpdb; $table = $wpdb->prefix . "posts"; $tracking_number = $this->tracking; //checking the identify shipping company $usps_pattern = $this->usps_pattern; $ups_pattern = $this->ups_pattern; $fedex_pattern = $this->fedex_pattern; /*if ( preg_match( $usps_pattern, $tracking_number ) ) { //test USPS $tracking_name = 'usps'; } elseif( preg_match( $fedex_pattern, $tracking_number ) ) { //test Fedex $tracking_name = 'fedex'; } elseif( preg_match( $ups_pattern, $tracking_number ) ) { //test Ups $tracking_name = 'ups'; }*/ $tracking_name = strtolower($this->carrier); // On ne veut plus utiliser les filtres, on va directement récupérer le nom du carier depuis la requete // Cheking if the order is in the database $row = $wpdb->get_row("SELECT * FROM " . $table . " WHERE id = " . $this->order, ARRAY_A); if (!$row) { $this->result = false; $this->code = 'ERR004'; $this->description = 'The order is not in the Database'; } else { if (false) { $this->result = false; $this->code = 'ERR005'; $this->description = "Carrier Company didn't find"; } else { $note = "Your order was shipped on " . $this->date . " via " . $this->carrier . ". Tracking number is " . $this->tracking . "."; $this->result = add_note($note, $this->order); if ($this->result === false) { $this->code = 'ERR010'; $this->description = "The tracking number coudn't be insert in the database."; } } } }
<?php $title = 'Важни Бележки'; include '/php/phplogin.php'; include '/includes/headerin.php'; imp_notes($con); if (isset($_GET['add_note'])) { add_note($con); } ?> <!DOCTYPE html> <!-- Header Outside the account. --> <div class='maincontent'> <form method='POST' action="/php/phplogin.php"> <div class="fffbackg"> <div class="inheading"> <h2>Важни Бележки</h2><img class="imglogoin" src="/test/<?php echo $uni['pic_logo']; ?> " title="" alt=""/> <h1><?php echo $uni['uniname']; ?> </h1> </div> <div class="menuonpage">
function addnote() { $this->load->helper('note'); $userId = $this->input->post('userid'); $source = $this->input->post('source'); $contents = $this->input->post('contents'); $admin_id = $this->admin->id(); add_note($userId, $admin_id, $source, $contents); redirect("admin/volunteers/show/{$userId}"); }
<?php // +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: rapport_ajax.inc.php,v 1.5 2010-02-23 16:27:22 kantin Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } switch ($quoifaire) { case 'add_note': add_note($idnote); break; case 'up_order': update_order(); break; case 'show_addcom': show_addcom($id); break; case 'update_com': update_contenu($id); break; case 'del_item': del_item($id_item); break; } /* * Ajout d'une note au rapport */ function add_note($idnote = 0) {
<?php include 'mysql.php'; session_start(); if (!isset($_POST['note']) || !isset($_SESSION['user_id'])) { die; } else { if (add_note($_POST['note'], $_SESSION['user_id'])) { echo 'Successfully created the note.'; } else { echo 'There was a problem creating the note.'; } if ($SERVER['HTTP_REFERER']) { header('LOCATION: ' . $SERVER['HTTP_REFERER']); } else { header('LOCATION: /'); } }
// $Id: ajax_demandes.inc.php,v 1.6 2012-02-13 13:17:49 dgoron Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } require_once $base_path . "/classes/demandes_action.class.php"; require_once $base_path . "/includes/templates/demandes.tpl.php"; require_once $base_path . "/includes/mail.inc.php"; switch ($quoifaire) { case 'show_form': show_form($id, $type); break; case 'save_ask': save_ask($id, $type); break; case 'add_note': add_note(); break; case 'save_note': save_note($id_action, $id_note, $id_demande); break; } /* * Affiche le formulaire d'ajout d'un action */ function show_form($id, $type) { global $dbh, $msg; if ($type == 'ask') { $title = $msg['demandes_question_form']; $btn = $msg['demandes_save_question']; } elseif ($type == 'info') {